Can λ-prolog do it? The proof is a little bit
tricky, since line 1 is used twice in
line 2 and in line 4. So its not a proof
tree, rather a proof mesh (*).
On 19/11/2024 12:25, Mild Shock wrote:
Can λ-prolog do it? The proof is a little bit
tricky, since line 1 is used twice in
line 2 and in line 4. So its not a proof
tree, rather a proof mesh (*).
My reduction rules actually take a goal and, if it can be reduced,
return proof steps and residual goals. But indeed, my experiment has started with "how far can I get without lambda Prolog", aka "why lambda Prolog?"
Now, thanks also to your help, I have fixed my rule for `->E` and now my little solver in plain Prolog does it:
```plain
?- solve_test.
solve_test::pos:
- absorp: [(p->q)]=>p->p/\q --> true
- andcom: [p/\q]=>q/\p --> true
- export: [(p/\q->r)]=>p->q->r --> true
- import: [(p->q->r)]=>p/\q->r --> true
- frege_: [(p->q->r)]=>(p->q)->p->r --> true
- hsyll_: [(p->q),(q->r)]=>p->r --> true
solve_test::pos: tot.=6, FAIL=0 --> true.
solve_test::neg:
- pierce: []=>((p->q)->p)->p --> true
solve_test::neg: tot.=1, FAIL=0 --> true.
true.
```
```plain
?- solve(([]=>(p->q->r)->p/\q->r), Qs).
Qs = [
impi((p->q->r)),
impi(p/\q),
impe(1:(q->r)),
impe(1:p),
impe(2:r),
impe(2:q),
equi(2:r),
ande(1:(p,q)),
equi(2:q),
ande(1:(p,q)),
equi(1:p)
].
```
In fact, it's still in its infancy and the output is still a flat mess
with wrong hypothesis numbering, but I will keep working on it with the
idea of going well past just propositional: will start sharing as soon
as I manage to implement negation, and a proper proof tree...
-Julio
Julio Di Egidio schrieb:
On 19/11/2024 12:25, Mild Shock wrote:
Can λ-prolog do it? The proof is a little bit
tricky, since line 1 is used twice in
line 2 and in line 4. So its not a proof
tree, rather a proof mesh (*).
My reduction rules actually take a goal and, if it can be reduced,
return proof steps and residual goals. But indeed, my experiment has
started with "how far can I get without lambda Prolog", aka "why
lambda Prolog?"
I don't know exactly what your full source
code in plain Prolog is.
On 19/11/2024 14:55, Mild Shock wrote:
Julio Di Egidio schrieb:
On 19/11/2024 12:25, Mild Shock wrote:
Can λ-prolog do it? The proof is a little bit
tricky, since line 1 is used twice in
line 2 and in line 4. So its not a proof
tree, rather a proof mesh (*).
My reduction rules actually take a goal and, if it can be reduced,
return proof steps and residual goals. But indeed, my experiment has
started with "how far can I get without lambda Prolog", aka "why
lambda Prolog?"
I don't know exactly what your full source
code in plain Prolog is.
It's here for your preview, up to disjunction and with a beginning of a
proof tree (still with the messed up numbering):
<https://gist.github.com/jp-diegidio/b6a7a071f9f81a469c493c4afcc5cb11>
And it fails one test:
```
?- solve_t.
pos:begin:
- absorpt : [(p->q)]=>p->p/\q : ok
- andcomm : [p/\q]=>q/\p : ok
- codilem : [(p->q),(r->s),p\/r]=>q\/s : FAIL!
- distand : []=>p/\(q\/r)<->p/\q\/p/\r : ok
- distor : []=>p\/q/\r<->(p\/q)/\(p\/r) : ok
- export : [(p/\q->r)]=>p->q->r : ok
- import : [(p->q->r)]=>p/\q->r : ok
- frege : [(p->q->r)]=>(p->q)->p->r : ok
- hsyllo : [(p->q),(q->r)]=>p->r : ok
- idempand : []=>p/\p<->p : ok
- idempor : []=>p\/p<->p : ok
pos:end: tot.=11, failed=1 : FAIL!
neg:begin:
- pierce : []=>((p->q)->p)->p : ok
neg:end: tot.=1, failed=0 : ok
false.
```
And I have already spent a day trying to find the bug, the trace is a
little bit overwhelming:
```
?- solve_trace([p->q,r->s,p\/r]=>q\/s, Qs).
```
On 11/22/2024 09:30 AM, Julio Di Egidio wrote:
On 22/11/2024 18:23, Julio Di Egidio wrote:
On 19/11/2024 14:55, Mild Shock wrote:
```
?- solve_trace([p->q,r->s,p\/r]=>q\/s, Qs).
```
Never mind, I have fixed it: just needed to get rid of those `once`!
Will update the Gist shortly.
If you have any feedback already, it's very welcome: anyway, will keep
you guys posted.
Good afternoon, what is this about briefly?
On 11/27/2024 04:06 AM, Julio Di Egidio wrote:
Hi Ross, it's a little linear propositional solver at this stage, but
with ambitions...
Of course a variety of what are "non-standard", results, according
to the standard, are standard again, establishing the very ideals
and "goals" of inference, intuitionistic in the sense of a
"fuller dialectic".
On 19/11/2024 14:55, Mild Shock wrote:
Julio Di Egidio schrieb:
On 19/11/2024 12:25, Mild Shock wrote:
Can λ-prolog do it? The proof is a little bit
tricky, since line 1 is used twice in
line 2 and in line 4. So its not a proof
tree, rather a proof mesh (*).
My reduction rules actually take a goal and, if it can be reduced,
return proof steps and residual goals. But indeed, my experiment has
started with "how far can I get without lambda Prolog", aka "why
lambda Prolog?"
I don't know exactly what your full source
code in plain Prolog is.
It's here for your preview, up to disjunction and with a beginning of a
proof tree (still with the messed up numbering):
<https://gist.github.com/jp-diegidio/b6a7a071f9f81a469c493c4afcc5cb11>
And it fails one test:
```
?- solve_t.
pos:begin:
- absorpt : [(p->q)]=>p->p/\q : ok
- andcomm : [p/\q]=>q/\p : ok
- codilem : [(p->q),(r->s),p\/r]=>q\/s : FAIL!
- distand : []=>p/\(q\/r)<->p/\q\/p/\r : ok
- distor : []=>p\/q/\r<->(p\/q)/\(p\/r) : ok
- export : [(p/\q->r)]=>p->q->r : ok
- import : [(p->q->r)]=>p/\q->r : ok
- frege : [(p->q->r)]=>(p->q)->p->r : ok
- hsyllo : [(p->q),(q->r)]=>p->r : ok
- idempand : []=>p/\p<->p : ok
- idempor : []=>p\/p<->p : ok
pos:end: tot.=11, failed=1 : FAIL!
neg:begin:
- pierce : []=>((p->q)->p)->p : ok
neg:end: tot.=1, failed=0 : ok
false.
```
And I have already spent a day trying to find the bug, the trace is a
little bit overwhelming:
```
?- solve_trace([p->q,r->s,p\/r]=>q\/s, Qs).
```
-Julio
(~(~X))
This is Peirce law:
((p->q)->p)->p
Peirce law is not provable in minimal logic.
But I guess this is not Glivenko:
notation(dnt(X), ~X->(~(~X)))
https://en.wikipedia.org/wiki/Double-negation_translation#Propositional_logic
Glivenko would be simply:
notation(gliv(X), (~(~X)))
Julio Di Egidio schrieb:
On 19/11/2024 14:55, Mild Shock wrote:
Julio Di Egidio schrieb:
On 19/11/2024 12:25, Mild Shock wrote:
Can λ-prolog do it? The proof is a little bit
tricky, since line 1 is used twice in
line 2 and in line 4. So its not a proof
tree, rather a proof mesh (*).
My reduction rules actually take a goal and, if it can be reduced,
return proof steps and residual goals. But indeed, my experiment
has started with "how far can I get without lambda Prolog", aka "why
lambda Prolog?"
I don't know exactly what your full source
code in plain Prolog is.
It's here for your preview, up to disjunction and with a beginning of
a proof tree (still with the messed up numbering):
<https://gist.github.com/jp-diegidio/b6a7a071f9f81a469c493c4afcc5cb11>
And it fails one test:
```
?- solve_t.
pos:begin:
- absorpt : [(p->q)]=>p->p/\q : ok
- andcomm : [p/\q]=>q/\p : ok
- codilem : [(p->q),(r->s),p\/r]=>q\/s : FAIL!
- distand : []=>p/\(q\/r)<->p/\q\/p/\r : ok
- distor : []=>p\/q/\r<->(p\/q)/\(p\/r) : ok
- export : [(p/\q->r)]=>p->q->r : ok
- import : [(p->q->r)]=>p/\q->r : ok
- frege : [(p->q->r)]=>(p->q)->p->r : ok
- hsyllo : [(p->q),(q->r)]=>p->r : ok
- idempand : []=>p/\p<->p : ok
- idempor : []=>p\/p<->p : ok
pos:end: tot.=11, failed=1 : FAIL!
neg:begin:
- pierce : []=>((p->q)->p)->p : ok
neg:end: tot.=1, failed=0 : ok
false.
```
And I have already spent a day trying to find the bug, the trace is a
little bit overwhelming:
```
?- solve_trace([p->q,r->s,p\/r]=>q\/s, Qs).
```
-Julio
But you will not immediately see the
difference. Since for tautologies, by
weakening if this here is provable:
(~(~X))
Then this here is also provbale.
(~(~X))
And also vice versa, which a simple
classical transformation shows. So you
might only notice a speed difference,
speed in finding a proof.
P.S.: To get even more speed you
might apply some cuts here and then,
based on Gentzens inversion lemmas.
You see which cuts are allowed in Jens Ottens prover:
https://www.leancop.de/ileansep/index.html#Source
Mild Shock schrieb:
This is Peirce law:
((p->q)->p)->p
Peirce law is not provable in minimal logic.
But I guess this is not Glivenko:
notation(dnt(X), ~X->(~(~X)))
https://en.wikipedia.org/wiki/Double-negation_translation#Propositional_logic
Glivenko would be simply:
notation(gliv(X), (~(~X)))
Julio Di Egidio schrieb:
On 19/11/2024 14:55, Mild Shock wrote:
Julio Di Egidio schrieb:
On 19/11/2024 12:25, Mild Shock wrote:
Can λ-prolog do it? The proof is a little bit
tricky, since line 1 is used twice in
line 2 and in line 4. So its not a proof
tree, rather a proof mesh (*).
My reduction rules actually take a goal and, if it can be reduced,
return proof steps and residual goals. But indeed, my experiment
has started with "how far can I get without lambda Prolog", aka
"why lambda Prolog?"
I don't know exactly what your full source
code in plain Prolog is.
It's here for your preview, up to disjunction and with a beginning of
a proof tree (still with the messed up numbering):
<https://gist.github.com/jp-diegidio/b6a7a071f9f81a469c493c4afcc5cb11>
And it fails one test:
```
?- solve_t.
pos:begin:
- absorpt : [(p->q)]=>p->p/\q : ok
- andcomm : [p/\q]=>q/\p : ok
- codilem : [(p->q),(r->s),p\/r]=>q\/s : FAIL!
- distand : []=>p/\(q\/r)<->p/\q\/p/\r : ok
- distor : []=>p\/q/\r<->(p\/q)/\(p\/r) : ok
- export : [(p/\q->r)]=>p->q->r : ok
- import : [(p->q->r)]=>p/\q->r : ok
- frege : [(p->q->r)]=>(p->q)->p->r : ok
- hsyllo : [(p->q),(q->r)]=>p->r : ok
- idempand : []=>p/\p<->p : ok
- idempor : []=>p\/p<->p : ok
pos:end: tot.=11, failed=1 : FAIL!
neg:begin:
- pierce : []=>((p->q)->p)->p : ok
neg:end: tot.=1, failed=0 : ok
false.
```
And I have already spent a day trying to find the bug, the trace is a
little bit overwhelming:
```
?- solve_trace([p->q,r->s,p\/r]=>q\/s, Qs).
```
-Julio
This is Peirce law:
((p->q)->p)->p
Peirce law is not provable in minimal logic.
But I guess this is not Glivenko:
notation(dnt(X), ~X->(~(~X)))
https://en.wikipedia.org/wiki/Double-negation_translation#Propositional_logic
Glivenko would be simply:
notation(gliv(X), (~(~X)))
On 28/11/2024 00:55, Mild Shock wrote:
This is Peirce law:
((p->q)->p)->p
Peirce law is not provable in minimal logic.
But I guess this is not Glivenko:
notation(dnt(X), ~X->(~(~X)))
https://en.wikipedia.org/wiki/Double-negation_translation#Propositional_logic
Glivenko would be simply:
notation(gliv(X), (~(~X)))
Indeed Glivenko's is to embed classical into intuitionistic, not into
linear (or affine).
OTOH, you can try the code yourself: with that 'dnt' the solver solves
all the classical theorems I have been able to think about, Pierce's law included, otherwise it fails: because of linearity essentially, i.e. not enough hypotheses... <https://gist.github.com/jp-diegidio/b6a7a071f9f81a469c493c4afcc5cb11>
That said, that 'dnt' is almost surely not really correct, indeed maybe
it only works for me because my reduction rules are linear (affine
actually), yet my operators for now are only the intuitionistic ones, I
do not have the whole set of linear operators.
Here are lecture notes that maybe have a complete answer/recipe, see
from page 5, but I still cannot fully parse what they write: <https://www.cs.cmu.edu/%7Efp/courses/15816-f16/lectures/27-classical.pdf>
Meanwhile, you might have seen it, I have also asked on SE: <https://proofassistants.stackexchange.com/questions/4455/negative-translation-for-linear-propositional-logic>
In affine logic you can possibly do something like iterative
deepening, only its iterative contraction.
Define A^n o- B as:
A o- A o- .. A o- B
\-- n times --/
The running the prover with this notation:
A -> B := A^n o- B
repeatedly with increasing n .
On 28/11/2024 00:55, Mild Shock wrote:
This is Peirce law:
((p->q)->p)->p
Peirce law is not provable in minimal logic.
But I guess this is not Glivenko:
notation(dnt(X), ~X->(~(~X)))
https://en.wikipedia.org/wiki/Double-negation_translation#Propositional_logic
Glivenko would be simply:
notation(gliv(X), (~(~X)))
Indeed Glivenko's is to embed classical into intuitionistic, not into
linear (or affine).
OTOH, you can try the code yourself: with that 'dnt' the solver solves
all the classical theorems I have been able to think about, Pierce's law included, otherwise it fails: because of linearity essentially, i.e. not enough hypotheses... <https://gist.github.com/jp-diegidio/b6a7a071f9f81a469c493c4afcc5cb11>
That said, that 'dnt' is almost surely not really correct, indeed maybe
it only works for me because my reduction rules are linear (affine
actually), yet my operators for now are only the intuitionistic ones, I
do not have the whole set of linear operators.
Here are lecture notes that maybe have a complete answer/recipe, see
from page 5, but I still cannot fully parse what they write: <https://www.cs.cmu.edu/%7Efp/courses/15816-f16/lectures/27-classical.pdf>
Meanwhile, you might have seen it, I have also asked on SE: <https://proofassistants.stackexchange.com/questions/4455/negative-translation-for-linear-propositional-logic>
-Julio
But in a linear logic you can do
intuitionistic logic by using this notation:
A -> B := !A o- B
BTW: There are alternative approaches to
directly find a notation for classical implication
in linear logic, without the need for Glivenkos theorem.
Just put an eye here:
https://en.wikipedia.org/wiki/Linear_logic#Encoding_classical/intuitionistic_logic_in_linear_logic
Julio Di Egidio schrieb:
On 28/11/2024 00:55, Mild Shock wrote:
This is Peirce law:
((p->q)->p)->p
Peirce law is not provable in minimal logic.
But I guess this is not Glivenko:
notation(dnt(X), ~X->(~(~X)))
https://en.wikipedia.org/wiki/Double-negation_translation#Propositional_logic
Glivenko would be simply:
notation(gliv(X), (~(~X)))
Indeed Glivenko's is to embed classical into intuitionistic, not into
linear (or affine).
OTOH, you can try the code yourself: with that 'dnt' the solver solves
all the classical theorems I have been able to think about, Pierce's
law included, otherwise it fails: because of linearity essentially,
i.e. not enough hypotheses...
<https://gist.github.com/jp-diegidio/b6a7a071f9f81a469c493c4afcc5cb11>
That said, that 'dnt' is almost surely not really correct, indeed
maybe it only works for me because my reduction rules are linear
(affine actually), yet my operators for now are only the
intuitionistic ones, I do not have the whole set of linear operators.
Here are lecture notes that maybe have a complete answer/recipe, see
from page 5, but I still cannot fully parse what they write:
<https://www.cs.cmu.edu/%7Efp/courses/15816-f16/lectures/27-classical.pdf> >>
Meanwhile, you might have seen it, I have also asked on SE:
<https://proofassistants.stackexchange.com/questions/4455/negative-translation-for-linear-propositional-logic>
-Julio
On 28/11/2024 02:38, Mild Shock wrote:
In affine logic you can possibly do something like iterative
deepening, only its iterative contraction.
Define A^n o- B as:
A o- A o- .. A o- B
\-- n times --/
The running the prover with this notation:
A -> B := A^n o- B
repeatedly with increasing n .
Yeah, something like that, but I am pretty sure we can do better than
just trial and error.
-Julio
A o- A o- .. A o- B
\-- n times --/
Well I don't know an online affine logic prover.
But you can play with linear logic here:
P -o P * P is not provable https://click-and-collect.linear-logic.org/?s=P+-o+P+*+P
!P -o P * P is provable https://click-and-collect.linear-logic.org/?s=%21P+-o+P+*+P
Julio Di Egidio schrieb:
On 28/11/2024 02:38, Mild Shock wrote:
In affine logic you can possibly do something like iterative
deepening, only its iterative contraction.
Define A^n o- B as:
A o- A o- .. A o- B
\-- n times --/
The running the prover with this notation:
A -> B := A^n o- B
repeatedly with increasing n .
Yeah, something like that, but I am pretty sure we can do better than
just trial and error.
-Julio
Affin and linear logic share the use once of a
hypothesis for implication, the unprovability of
P -o P * P being an example of this similarity.
On 28/11/2024 09:04, Mild Shock wrote:
Affin and linear logic share the use once of a
hypothesis for implication, the unprovability of
P -o P * P being an example of this similarity.
Should have been yesterday, but it's still the next frontier:
<https://girard.perso.math.cnrs.fr/0.pdf>
Of course more than half of it is under a pay wall, but we'll do what we can...
-Julio
This is Peirce law:
((p->q)->p)->p
Peirce law is not provable in minimal logic.
But I guess this is not Glivenko:
notation(dnt(X), ~X->(~(~X)))
https://en.wikipedia.org/wiki/Double-negation_translation#Propositional_logic
Glivenko would be simply:
notation(gliv(X), (~(~X)))
"Type system" can be another word for "logic with
proof terms", if you look at: https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspondence
On 28/11/2024 00:55, Mild Shock wrote:
This is Peirce law:
((p->q)->p)->p
Peirce law is not provable in minimal logic.
But I guess this is not Glivenko:
notation(dnt(X), ~X->(~(~X)))
https://en.wikipedia.org/wiki/Double-negation_translation#Propositional_logic
Glivenko would be simply:
notation(gliv(X), (~(~X)))
We have gone over that already. Either you have memory problems or you
are purposely flooding the channel at this point.
-Julio
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 17:05:36 |
| Calls: | 12,103 |
| Calls today: | 3 |
| Files: | 15,004 |
| Messages: | 6,518,068 |