(* Delphin test file. Functions related to Mini-ML Author: Carsten Schuermann *) add :: world (base) all {N:exp} all {M:exp} exists {K:exp} true fun add (A.z) M = > | add ((A.s) N) M = let val > = add N M in <(A.s) K, <>> end count :: world (param base) all^ {e:exp} all^ {t:tp} all {P : of e t} exists {N : exp} true fun count (B.of_z) = > | count ((A:param T).u) = choose (B:base) in <(B.s) (B.z), <>> end | count ((B.of_fn) T1 T2 E P) = new (a: param T1) in count (P (a.x) (a.u)) end | count ((B.of_fix) T E D) = new (a: param T) in count (D (a.x) (a.u)) end | count ((B.of_s) E P) = count P | count ((B.of_app) E1 E2 T1 T2 D1 D2) = let val > = count D1 val > = count D2 in add N1 N2 end new (b:base) val > = count ((b.of_s) (b.z) (b.of_z)) (* val > = count ((b.of_fix) (b.nat) ([x] x) ([x][u] u)) *)