Closed c-cube closed 8 years ago
polarity:
definition | + | - | ± |
---|---|---|---|
wf-pred | rec | rec | rec |
pred | unroll | rec | guard |
copred | rec | co-unroll | guard |
where:
k
argument, then same as rec
unroll
but the 0 case is true
, not false
p
into a positive version p⁺
and a negative version p⁻
, defined with rec and (co)-unroll respectively (see above), and everywhere p t1...tn
is used we use, say, p⁺ t1...tn
with a guard p⁺ t1...tn = p⁻ t1...tn
.
keyword: pred/copred (?)
Each rhs should start with the defined predicate and contain no other occurrence of the predicates being defined.
Flag
well-founded
(or variantwf-pred
/wf-copred
) as an option/attribute. For well-founded predicates, encoding straightforward (turn into arec
definition, then encoding of rec functions).not well-founded: add an argument (of type
nat
) that decreases at each call:becomes, with an approximation of depth
k
:and then we can reverse the definition and turn it into a recursive function.