(* Substititution into canonical/atomic forms *) (* Author: Adam Poswolsky, Carsten Schuermann *) nf> nf) -> nf> nf -> at> (* subat' is just temporarily here. Once mutual recursion is completely implemented, remove it and rename all occurrences of subst' by subat *) subnf : nf> -> -> = <[x:at] l [y:at] N x y> |--> |--> {y:at} case subnf <[x:at] N x y> of ( |--> pop ) | <[x:at] atnf (P x)> |--> |--> @ (subat <[x:at] P x> ) and subat : at> -> -> = <[x:at] c> |--> |--> | <[x:at] a (P x) (N x)> |--> |--> @ (subat <[x:at] P x> ) @ (subnf <[x:at] N x> ) | {{y:at}} <[x:at] y> |--> |--> | <[x:at] x> |--> |--> ; (* Add some examples *) result1 = subnf <[x] atnf x> ; result2 = subnf <[x] l ([y] atnf (a x (atnf y)))> ;