···329329 (P 0)
330330 [k. (P k) |- (P (S (S k)))]
331331 --------------------------- E-ind
332332- (P n) </hol-comp>
332332+ (P n)
333333+334334+ a.
335335+ ---- refl
336336+ (= a a)
337337+338338+ a. b. f.
339339+ (= a b) (f a)
340340+ -------- eq-ap
341341+ (f b)
342342+ </hol-comp>
333343 <hol-config id="index.html/myconfig">Gentzen</hol-config>
334344 <hol-proof id="index.html/prooftest" deps="index.html/myconfig index.html/baz index.html/nat">
335345 a.
336346 (Nat a)
337347 -------
338348 (Nat (S (S a)))
349349+350350+ a. asm |- ?
351351+ </hol-proof>
352352+353353+ <hol-proof id="index.html/prooftest2" deps="index.html/myconfig index.html/baz index.html/nat">
354354+ a. b. f.
355355+ (= a b)
356356+ -------
357357+ (= (f a) (f b))
339358340340- a. asm |- ?
359359+ a. b. f. asm |- ?
360360+ </hol-proof>
361361+362362+ <hol-proof id="index.html/eq-trans" deps="index.html/myconfig index.html/baz index.html/nat">
363363+ a. b. c.
364364+ (= a b)
365365+ (= b c)
366366+ ------- eq-trans
367367+ (= a c)
368368+369369+ a. b. c. ab bc |- ?
341370 </hol-proof>
342371 <h1>String</h1>
343372 <h2>Basic</h2>
···4444 let upshift: (t, int, ~from: int=?) => t
4545 let upshiftSubstCodom: (substCodom, int, ~from: int=?) => substCodom
4646 let placeSubstCodom: (schematic, ~scope: array<meta>) => substCodom
4747+ // Map a function over all terms in the judgment
4848+ let mapTerms: (t, Term.t => Term.t) => t
4749 let parse: (string, ~scope: array<Term.meta>, ~gen: Term.gen=?) => result<(t, string), string>
4850 let parseSubstCodom: (
4951 string,
+7
src/StringTermJudgment.res
···7676 | SExpV(j) => SExpV(SExp.upshift(j, amount, ~from))
7777 }
78787979+let mapTerms = ((t, j): t, f: StringTerm.t => StringTerm.t): t => {
8080+ // Apply the function to both the string term and the sexp (converted to/from string term)
8181+ let newT = f(t)
8282+ let newJ = j->StringTerm.fromSExp->f->StringTerm.toSExp
8383+ (newT, newJ)
8484+}
8585+7986let parse = (str: string, ~scope: array<StringTerm.meta>, ~gen=?) => {
8087 StringTerm.parse(str, ~scope, ~gen?)->Result.flatMap(((t, str)) =>
8188 SExp.parse(str, ~scope)->Result.map(((j, str)) => ((t, j), str))
+1
src/TermAsJudgment.res
···88 let placeSubstCodom = Term.place
99 let upshiftSubstCodom = Term.upshift
1010 let substituteSubstCodom = Term.substitute
1111+ let mapTerms = (t: Term.t, f: Term.t => Term.t): Term.t => f(t)
1112}
12131314module SExpJ = Make(SExp)
+2-2
tests/HOTermTest.res
···313313 t->testUnify(c, b, ~subst=emptySubst->substAdd(6, t->Util.parse("(x. S \\0)")))
314314 })
315315 t->block("tests from induction examples", t => {
316316- let r = ("((?0 \\0) (?1 \\0))")
317317- let g = ("(f \\0)")
316316+ let r = "((?0 \\0) (?1 \\0))"
317317+ let g = "(f \\0)"
318318 // what it's currently doing:
319319 // 0 := (x. y. f x)
320320 // 1 := doesn't matter