stacst True: prop // Makes sense, OK?
stacst False: prop // Does not make sens, isn't it?
absprop F(int) // int -> prop
stadef g: prop = F 0 // Check it's indeed int -> prop
absprop F(int) // int -> prop
// typedef t = [i: int; F i] int(i) **ILLEGAL**
stadef h: prop -> bool = (lam p => true) // Assume a prop is a proof
typedef t = [i: int; h(F i)] int(i) // Does it mean what I think it means?
val a: t = 0
Maybe you just need to be more creative in creating an inconsistent
set of axioms. :)
A disproof can be done with ‘case ... =/=>’ so I am not sure a ‘false
proposition’ can’t exist. I’ve used it for reductio ad absurdum.
stadef h: prop -> bool = (lam p => true)
Here is an encoding of propositional logic in ATS:
http://www.cs.bu.edu/~hwxi/academic/courses/CS520/Fall15/code/lecture-09-21/prop-logic.dats
You can see clearly that 'False' is indeed encoded.
Maybe you just need to be more creative in creating an inconsistent
set of axioms. :)
A disproof can be done with ‘case ... =/=>’ so I am not sure a ‘false
proposition’ can’t exist. I’ve used it for reductio ad absurdum.
Hope this can shed a bit light.
Let me use an example to explain the relation and difference
between **the impredicative sort 'prop' and the predicative sort
'bool'**.
dataprop
FACT(int, int) =
| FACTbas(0, 1)
| {n:pos}{r1:int}
FACTind(n, n*r1) of FACT(n-1, r1)
The above dataprop essentially introduces the following constants:
######
FACT: (int, int) -> prop
FACTbas: () -> FACT(0, 1)
FACTind:
{n:pos}{r1:int} FACT(n-1, r1) -> FACT(n, n*r1)
######
There exists a constant 'fact' corresponding to 'FACT':
fact: (int, int) -> bool
and the following first-order formulas are true:
######
(1)
fact(0, 1) = true
(2)
{n:pos}{r1:int}
fact(n-1, r1)=true implies fact(n, n*r1)=true
######
If there exists a closed value of the prop FACT(n, r), then
fact(n, r)=true holds. Another way to put it, if FACT(n, r) is
provable, then fact(n, r) is true.
Note that the existence of 'fact' is implied by the so-called
fixed-pointed theorem. Usually, 'fact' is taken to be the least
relation satisfying (1) and (2). So we know 'fact(0, 0)=false'
holds. However, the statement that there is no closed value of
the prop FACT(0, 0) is not provable inside ATS (Godel's incompleteness
result).
dataprop SUM(int, int) =
| SUMBase(0, 0)
| {x, y:int} SUMInd(x + 1, y + x + 1) of SUM(x, y)
fun sum {x:int; x >= 0} (a: int x): [y:int] (SUM(x, y) | int y) =
if a = 0 then (SUMBase | 0)
else let
val (pf1 | s) = sum(a - 1)
prval pf2 = SUMInd pf1
in (pf2 | s + a)
end
dataprop SUM(int, int) =
| SUMBase(0, 0)
| {x, y:int} SUMInd(x + 1, y + x + 1) of SUM(x, y)
fun sum {x:int; x >= 0} (a: int x): [y:int] (SUM(x, y) | int y) =
if a = 0 then (SUMBase:SUM(0, 0) | 0)
else let
val [y:int] (pf1:SUM(x - 1, y) | s:int y) = sum(a - 1)
prval pf2:SUM(x, y + x) = SUMInd pf1
in (pf2 | s + a)
end
Yes, the dataprop definition for FACT only tells you what can be
proven; it does not say anything about what cannot be proven. On the
other hand, the relation 'fact' corresponding to 'FACT' is a set, and we
know that either (0, 0) is in 'fact' or it is not in 'fact'.
dataprop P(int) =
| Q(0) of () // Asserts Q(0) from ()
| Q(0) // Asserts Q(0) from nothing (same as above)
| R(1) of P(0) // Asserts R(1), that is P(1) from P(0)
| {i:int; i == 1} R(i) of P(0) // Same, with explicit constraint
| {i:int; i == 1} R(i) of [j: int; j == 0] P(j) // Even more.
Q: () -> P(0) // this is very different from writing: unit -> prop
propdef p:prop = P(0) // OK and in the static.
prval q:P(0) = Q // OK and in the dynamic, however erased by the compiler.
[…] the argument of R is often called a proof.
That makes sense, if P is not a prop constructor, not a prop.
--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/e038b307-4288-4cd6-ab5a-fa4e5d2f9d2d%40googlegroups.com.
there is no proof construction at run-time.which is dynamic but erased by the compiler. So while proofs are dynamic,A prop is like a type; a value classified by a prop is often called a proof,
prval q:P(0) = Q
val q:P(0) = Q
val a:int = 0
prval a:int = 0
--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/37f08799-c612-4dc6-a6e3-92c444e565f8%40googlegroups.com.
there is no proof construction at run-time.which is dynamic but erased by the compiler. So while proofs are dynamic,A prop is like a type; a value classified by a prop is often called a proof,Yes, I think you have got it!Just in case others read these messages, I would like to say this:
[…]
--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/9568a1dd-a7c3-4da5-ae9a-2c3219c2a697%40googlegroups.com.
Currently, we have the following subsort relation:prop < t@ype < typeview < view@type < viewtypeview < propviewt@ype < t@ypeviewtype < type
Currently, we have the following subsort relation:prop < t@ype < typeview < view@type < viewtypeview < propviewt@ype < t@ypeviewtype < type
I’m confused again. I would rather read it the other way it is written. Ex. type < t@ype instead of type < t@ype, that is, a boxed type is a special case of boxed type.
Le samedi 30 juin 2018 13:37:03 UTC+2, gmhwxi a écrit :
Currently, we have the following subsort relation:prop < t@ype < type
[…][…]
In fewer word, boxed types are more general than flat types (except that there is no algebraic flat type).Or am I wrong ?
[…]
--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/a6654183-1402-412f-b71e-b52c6596102c%40googlegroups.com.