···2020 let ghost = ""
2121 let substDeBruijn = (name, _, ~from as _) => name
2222 let unifiesWithAnything = _ => false
2323+ let upshift = (t, _, ~from as _=?) => t
2324}
24252526include SExpFunc.Make(ConstSymbol)
+2-1
src/SExpFunc.res
···55 let prettyPrint: (t, ~scope: array<string>) => string
66 let parse: (string, ~scope: array<string>, ~gen: ref<int>=?) => result<(t, string), string>
77 let substitute: (t, subst) => t
88+ let upshift: (t, int, ~from: int=?) => t
89 // used for when trying to substitute a variable of the wrong type
910 let lowerVar: int => t
1011 let lowerSchematic: (int, array<int>) => t
···194195 }
195196 let rec upshift = (term: t, amount: int, ~from: int=0) =>
196197 switch term {
197197- | Symbol(_) => term
198198+ | Symbol(s) => Symbol(s->Symbol.upshift(amount, ~from))
198199 | Compound({subexps}) => Compound({subexps: Array.map(subexps, x => upshift(x, amount, ~from))})
199200 | Var({idx}) =>
200201 Var({