static CatTypeVector RenameVars(CatTypeVector vec, CatTypeVarList vars) { CatTypeVector ret = new CatTypeVector(); foreach (CatKind k in vec.GetKinds()) { if (k.IsKindVar() && vars.ContainsKey(k.ToString())) { ret.Add(vars[k.ToString()]); } else if (k is CatFxnType) { ret.Add(RenameVars(ret, vars)); } else if (k is CatTypeVector) { throw new Exception("unexpected type vector in function during renaming"); } else { ret.Add(k); } } return(ret); }
public CatTypeVector Clone() { CatTypeVector ret = new CatTypeVector(); foreach (CatKind k in GetKinds()) { ret.Add(k); } return(ret); }
public CatTypeVector Rename(CatTypeVector s) { CatTypeVector ret = new CatTypeVector(); foreach (CatKind k in s.GetKinds()) { ret.Add(Rename(k)); } return(ret); }
private CatTypeVector AddImplicitRhoVariables(CatTypeVector v) { CatTypeVector ret = new CatTypeVector(); foreach (CatKind k in v.GetKinds()) { if (k is CatFxnType) { ret.Add((k as CatFxnType).AddImplicitRhoVariables()); } else if (k is CatTypeVector) { ret.Add(AddImplicitRhoVariables(k as CatTypeVector)); } else { ret.Add(k); } } return(ret); }