···1717 let substitute = (name, _) => name
1818 let lowerVar = _ => None
1919 let lowerSchematic = (_, _) => None
2020- let ghost = ""
2120 let substDeBruijn = (name, _, ~from as _=?, ~to as _) => name
2221 let concrete = _ => false
2322 let upshift = (t, _, ~from as _=?) => t
-7
src/SExpFunc.res
···99 // used for when trying to substitute a variable of the wrong type
1010 let lowerVar: int => option<t>
1111 let lowerSchematic: (int, array<int>) => option<t>
1212- let ghost: t
1312 let substDeBruijn: (t, Map.t<int, t>, ~from: int=?, ~to: int) => t
1413 let concrete: t => bool
1514}
···2524 | Compound({subexps: array<t>})
2625 | Var({idx: int})
2726 | Schematic({schematic: int, allowed: array<int>})
2828- | Ghost
29273028 include Signatures.TERM
3129 with type t := t
···3937 | Compound({subexps: array<t>})
4038 | Var({idx: int})
4139 | Schematic({schematic: int, allowed: array<int>})
4242- | Ghost
4340 module Atom = Atom
4441 type meta = string
4542 type schematic = int
···194191 }
195192 ),
196193 })
197197- | Ghost => Ghost
198194 }
199195 let rec upshift = (term: t, amount: int, ~from: int=0) =>
200196 switch term {
···219215 }
220216 ),
221217 })
222222- | Ghost => Ghost
223218 }
224219 let place = (x: int, ~scope: array<string>) => Schematic({
225220 schematic: x,
···261256 "("
262257 ->String.concat(Array.join(subexps->Array.map(e => prettyPrint(e, ~scope)), " "))
263258 ->String.concat(")")
264264- | Ghost => "§SExp.Ghost"
265259 }
266260267261 let prettyPrintSubst = (sub, ~scope) =>
···430424 }
431425 }
432426433433- let ghostTerm = Ghost
434427 let rec concrete = t =>
435428 switch t {
436429 | Schematic(_) => true
···2424 let parseMeta: string => result<(meta, string), string>
2525 let prettyPrint: (t, ~scope: array<meta>) => string
2626 let prettyPrintMeta: meta => string
2727- let ghostTerm: t
2827 let concrete: t => bool
2928}
3029···4140 let mapTerms: (t, Term.t => Term.t) => t
4241 let parse: (string, ~scope: array<Term.meta>, ~gen: Term.gen=?) => result<(t, string), string>
4342 let prettyPrint: (t, ~scope: array<Term.meta>) => string
4444- let ghostTerm: t
4543 // will unifying t with a term give meaningful substitutions?
4644 let concrete: t => bool
4745}
···5050 let b = parse(`"b"`)
5151 let x = parse(`"?1()"`)
5252 let y = parse(`"?2()"`)
5353- t->block("ghost", t => {
5454- t->UnifyUtil.testUnifyFail(a, StringAtom.ghost)
5555- t->UnifyUtil.testUnify(x, StringAtom.ghost)
5656- t->UnifyUtil.testUnify([x, y, x]->Array.flat, StringAtom.ghost)
5757- })
5853 t->block("schematics on at most one side", t => {
5954 t->UnifyUtil.testUnify(a, a, ~expect=[Map.make()])
6055 t->UnifyUtil.testUnify(x, a, ~expect=[Map.fromArray([(1, a)])])