Skip to content

Commit c354862

Browse files
committed
add some doc to predicates
1 parent ca35b85 commit c354862

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

apps/tc/elpi/compile_instance.elpi

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,12 @@ namespace tc {
110110
get-range-arity _ Ty _ (r-ar z N) :- tc.get-TC-of-inst-type Ty _, !, count-prod Ty N.
111111
get-range-arity B _ T N :- !, get-range-arity-aux B T N.
112112

113-
pred precompile-aux i:positivity, i:term, i:nat, o:term, o:nat.
113+
pred precompile-aux
114+
i:positivity, % Positive or negaive position of the term being pre-compiled
115+
i:term, % Term being explored
116+
i:nat, % Number of pi to quantified accumulated
117+
o:term, % Precompiled term: problematic sub-terms are tagged with custom constructors
118+
o:nat. % Final number of pi to quantify
114119
precompile-aux _ X A Y A :- name X, !, X = Y, !. % avoid loading "precompile-aux x A x A" at binders
115120
precompile-aux _ (global _ as C) A C A :- !.
116121
precompile-aux _ (pglobal _ _ as C) A C A :- !.
@@ -376,16 +381,16 @@ namespace tc {
376381
deterministic-prem _ P P.
377382

378383
pred compile-premise
379-
i:list term,
380-
o:list term,
381-
i:term,
382-
i:term,
383-
i:term,
384-
i:bool,
385-
i:term,
386-
i:list term,
387-
i:list prop,
388-
o:prop.
384+
i:list term, % List of pi-quantified vars to consume
385+
o:list term, % List of remaining pi-quantified variables
386+
i:term, % (Local) Name of the proof of the premise
387+
i:term, % Type of the local premise being consumed by compile-ty
388+
i:term, % Name of the instance being compiled (global {{:gref InstName}})
389+
i:bool, % Positive or negative position of the term
390+
i:term, % Type of InstName to compile
391+
i:list term, % List of the name of all local proofs
392+
i:list prop, % List of premises to add to the fianal clause
393+
o:prop. % The final clause
389394
compile-premise L L2 P PTy ProofHd IsPositive ITy ProofArgsR PremR Clause :-
390395
((pi a b c\ tc.get-TC-of-inst-type (tc.prod-range a c) b :- tc.get-TC-of-inst-type a b) =>
391396
tc.get-TC-of-inst-type PTy TC), !,
@@ -396,14 +401,14 @@ namespace tc {
396401
compile-ty L L1 ProofHd IsPositive ITy ProofArgsR PremR Clause.
397402

398403
pred compile-ty
399-
i:list term,
400-
i:list term,
401-
i:term,
402-
i:bool,
403-
i:term,
404-
i:list term,
405-
i:list prop,
406-
o:prop.
404+
i:list term, % List of pi-quantified vars to consume
405+
o:list term, % List of remaining pi-quantified variables
406+
i:term, % Name of the instance being compiled (global {{:gref InstName}})
407+
i:bool, % Positive or negative position of the term
408+
i:term, % Type of InstName to compile
409+
i:list term, % List of the name of all local proofs
410+
i:list prop, % List of premises to add to the fianal clause
411+
o:prop. % The final clause
407412
compile-ty L L1 ProofHd IsPositive (tc.prod-range (prod N Ty Bo) Arity) ProofArgsR PremR Clause :- !,
408413
std.do![
409414
if (IsPositive = tt)

0 commit comments

Comments
 (0)