1- msolve L :- std.forall L (open tc).
1+ msolve L :-
2+ compile_all [{{eqdec}}] Cl,
3+ Cl => std.forall L (open tc).
24
3- pred open i:(list prop -> term -> term -> prop), i:sealed-goal.
5+ pred open i:(term -> term -> prop), i:sealed-goal.
46open P (nabla F) :- pi x\ open P (F x).
57open P (seal (goal Ctx Ty Wit)) :-
68 print "TC PROBLEM:\n" Ctx "|-\n" Wit ":" Ty "\n",
7- Ctx => P Ctx Ty Wit,
9+ Ctx => P Ty Wit,
810 print "TC INSTANCE:\n" Ctx "|-\n" Wit ":" Ty "\n".
911
1012:index(_ 4)
11- pred tc i:list prop, i:term, o:term.
12- tc _ {{ eqdec bool }} {{ bool_eqdec }}.
13- tc _ {{ eqdec nat }} {{ nat_eqdec }}.
14- tc C {{ eqdec (pair $A $B) }} {{ pair_eqdec $A $B $FA $FB }} :-
15- tc C (appl {{eqdec}} A) FA,
16- tc C (appl {{eqdec}} B) FB.
13+ pred tc o:term, o:term.
1714
18- /* brainstorm
15+ pred is_typeclass o:term.
16+ is_typeclass {{eqdec}}.
1917
20- compile_rule_lambdapi R (pi c\ tc c (app {{eqdec}} {{bool}})) .
21- compile_rule_coq R (pi c\ tc c (app {{eqdec}} {{bool}})) .
18+ pred instances o:term o:list term .
19+ instances {{eqdec}} [{{bool_eqdec}}, {{nat_eqdec}}, {{pair_eqdec}}] .
2220
23- abstract G GA,
24- interp [R1,R2] GA PA,
25- instantiate PA P,
26- of P G
21+ pred compile i:term, i:list prop, i:term, o:prop.
22+ compile (prod (appl T U) F) TODO H (pi x\ C x) :-
23+ is_typeclass T,
24+ !,
25+ pi x\
26+ compile (F x) [tc (appl T U) x |TODO] (appl H x) (C x).
2727
28- */
28+ compile (prod _ F) TODO H (pi x\ C x) :-
29+ !,
30+ pi x\
31+ compile (F x) TODO (appl H x) (C x).
32+
33+ compile End TODO HD (tc End HD :- TODO).
34+
35+ pred compile_all i:list term, o:list prop.
36+ compile_all Refs Props :-
37+ std.map Refs instances LList,
38+ std.flatten LList Candidates,
39+ std.map Candidates
40+ (cand\claus\ sigma T\ sigma N\
41+ cand = (symb N),
42+ lp.sig N T,
43+ compile T [] cand claus)
44+ Props.
0 commit comments