prfun f {i:int; i >= 1} .. (pf:R(i)): int =
case+ pf of
| R1() => 1
| RN(pf’:R(i-1)) => f(pf’) + 1
However, given this:
dataprop R =
| R1
| RN of R
One can’t have this:
prfun f .<>. (pf:R): int =
case+ pf of
| R1() => 1
| RN(pf’) => f(pf’) + 1
Is there a way to have a termination metric for this?
I feel to guess the answer is likely “no”, and I feel to know why:
Isabelle/HOL, has something looking like dataprop which is checked to be
inductive (based on a well founded recursion). ATS does not check it (it
has general recursive definitions, not checked to be inductive
definitions), so that may be the reason why it can’t handle such a case
without an explicit index.
While I feel to guess the answer, I prefer to ask, in case of I just missed
something. If the answer is “yes”, then that would be nice as more natural.
ATS is not a formal theorem-proving system; its focus is on using
theorem-proving
to locate/fix bugs in programs. Theorem-proving in ATS is informal; it is
a bit like how
people construct mathematical proofs using pencil/paper.
Learning what can be expressed and what can’t be (or can be not the
expected way) , is a big part or learning ATS.
May be I’m expecting too much from dataprop. I will later start to look at
absprop and praxi more closely, and better see when use one or the other.Le mardi 22 décembre 2015 22:40:30 UTC+1, gmhwxi a écrit :
NON_SENSE is actually inductive. The following is a non-inductive
example:
In ATS, a dataprop needs to be defined inductively, but this requirement
is not
formally enforced. Still, for your example, explicit indexes are needed in
order to
establish termination in ATS.
So something like:
dataprop NON_SENSE =
| NON_SENSE_CONS of NON_SENSE
should never be written in ATS? (although it won’t complain)
ATS is not a formal theorem-proving system; its focus is on using
theorem-proving
to locate/fix bugs in programs. Theorem-proving in ATS is informal; it is
a bit like how
people construct mathematical proofs using pencil/paper.
NON_SENSE is actually inductive. The following is a non-inductive example:
dataprop D = D of (D → D)On Tue, Dec 22, 2015 at 4:38 PM, ‘Yannick Duchêne’ via ats-lang-users < ats-lan...@googlegroups.com> wrote:
Le mardi 22 décembre 2015 22:14:34 UTC+1, gmhwxi a écrit :
In ATS, a dataprop needs to be defined inductively, but this requirement
is not
formally enforced. Still, for your example, explicit indexes are needed
in order to
establish termination in ATS.
So something like:
dataprop NON_SENSE =
| NON_SENSE_CONS of NON_SENSE
should never be written in ATS? (although it won’t complain)
ATS is not a formal theorem-proving system; its focus is on using
theorem-proving
to locate/fix bugs in programs. Theorem-proving in ATS is informal; it is
a bit like how
people construct mathematical proofs using pencil/paper.
In ATS, a dataprop needs to be defined inductively, but this requirement is
not
formally enforced. Still, for your example, explicit indexes are needed in
order to
establish termination in ATS.
ATS is not a formal theorem-proving system; its focus is on using
theorem-proving
to locate/fix bugs in programs. Theorem-proving in ATS is informal; it is a
bit like how
people construct mathematical proofs using pencil/paper.On Tuesday, December 22, 2015 at 3:55:57 PM UTC-5, Yannick Duchêne wrote:
prfun f {i:int; i >= 1} .. (pf:R(i)): int =
case+ pf of
| R1() => 1
| RN(pf’:R(i-1)) => f(pf’) + 1
However, given this:
dataprop R =
| R1
| RN of R
One can’t have this:
prfun f .<>. (pf:R): int =
case+ pf of
| R1() => 1
| RN(pf’) => f(pf’) + 1
Is there a way to have a termination metric for this?
I feel to guess the answer is likely “no”, and I feel to know why:
Isabelle/HOL, has something looking like dataprop which is checked to be
inductive (based on a well founded recursion). ATS does not check it (it
has general recursive definitions, not checked to be inductive
definitions), so that may be the reason why it can’t handle such a case
without an explicit index.
While I feel to guess the answer, I prefer to ask, in case of I just
missed something. If the answer is “yes”, then that would be nice as more
natural.