A proof-value is in the dynamics of ATS.
prfun/prfn/prval are used to form bindings between names and proof values.
The main difference between a proof-value and a program-value (that is,
non-proof-value)
is that the former can never have any influence the construction of the
latter. So therefore,
proof values are all erased after type-checking.
What’s exactly the result of a proof function? Most seems to return void,
but some returns a result. Is this a static value? Are proof functions
simply static functions?
The result of a proof function is a proof value. Proof functions are not
static functions; they are dynamic.
What happens when the result of a proof function is bound to a prval
or
especially matched with ()
? Does it makes ATS (the checker, not the
language) store some confirmed hypotheses internally? If yes, then is there
a way to “dump” these hypotheses?
Say we have
prfun lemma_fib{n:nat}{r:int}(FIB(n, r)): [n <= r+1] void // fib(n)+1 >= n
Suppose that pf is a proof-value of the prop FIB(N, R) for some N and R
The the following declaration adds (N <= R+1) to the internal store of
currently available assumptions:
prval () = lemma_fib(pf)
If yes, then is there a way to “dump” these hypotheses?
Yes. But not in a form that is readable.
How does a proof “returned” by a proof function differs from a proof
returned along with a result from a dynamic function?
There is no difference.On Monday, February 9, 2015 at 7:41:06 PM UTC-5, Yannick Duchêne wrote:
Basic questions, but I really have to ask… I’m not sure to really
understand what prfun
/prfn
and prval
do.
What’s exactly the result of a proof function? Most seems to return void,
but some returns a result. Is this a static value? Are proof functions
simply static functions?
What happens when the result of a proof function is bound to a prval
or
especially matched with ()
? Does it makes ATS (the checker, not the
language) store some confirmed hypotheses internally? If yes, then is there
a way to “dump” these hypotheses?
How does a proof “returned” by a proof function differs from a proof
returned along with a result from a dynamic function?