Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add classic logic operators #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NotBad4U
Copy link
Member

@NotBad4U NotBad4U commented Feb 1, 2024

Hi!

This PR adds the classic logic operators and some basic lemma.

However, I have a little problem with this lemma:

opaque symbol ∀ᶜᵢ p : (Π x, πᶜ (p x)) → πᶜ (∀ᶜ p) ≔
begin
  assume p Hnnpx Hnnnpx;
  apply Hnnnpx;
  assume x Hnnp;
  apply Hnnpx x;
  assume Hnp;
  apply Hnnp;
  apply Hnp
end;

I got the warning below when I ran make preventing creating the Classic.lpo

Writing "/Users/alessiocoltellacci/Projects/Inria/lambdapi-stdlib/Classic.lpo" ...
Uncaught [File "src/core/sign.ml", line 182, characters 16-22: Assertion failed].

@fblanqui
Copy link
Member

Because of the use of the opaque command, this PR can only work with the next release of lambdapi. This should be reflect in the opam file.

Classic.lp Outdated Show resolved Hide resolved
@fblanqui
Copy link
Member

fblanqui commented Mar 1, 2024

I am wondering: why not having 2 files:

  1. one file stating the axiom of excluded middle and the properties of connectors in this context (De Morgan laws), so not using the exponent.
  2. one file showing that classical logic can be encoded in intuitionistic logic using double negation?

@NotBad4U
Copy link
Member Author

NotBad4U commented Apr 3, 2024

I am wondering: why not having 2 files:

  1. one file stating the axiom of excluded middle and the properties of connectors in this context (De Morgan laws), so not using the exponent.
  2. one file showing that classical logic can be encoded in intuitionistic logic using double negation?

The file 1 will be the one used by the user ? Will this file contain only axiom symbols?
The problem that I discovered with my approach is that I can not use the rewriting rule on _ᶜ operator because they have a definition.
For example, a rule like rule πᶜ ($p ⇒ᶜ $q) ↪ πᶜ $p → πᶜ $q; could not be defined because ⇒ᶜ and πᶜ are defined symbols. So it makes proof in classical logic more verbose than the intuitionistic one with tactic because we need to use a combination of apply ⇒ᶜᵢ; assume h; where assume h; is enough for the intuitionistic (similar problem with ∃ₑ that can act like an exists tactic 😄 ).

@fblanqui
Copy link
Member

fblanqui commented Apr 3, 2024

The file 1 will be the one used by the user ? Will this file contain only axiom symbols?

Yes.

Classic.lp:

require open Stdlib.Prop;
require open Stdlib.FOL;
require open Stdlib.Set;
symbol classic [p] : π (p ∨ ¬ p);
opaque symbol nnpp [p] : π (¬ ¬ p) → π p ≔ begin ... end;
opaque symbol pierce [p] : π ((p ⇒ ⊥) ⇒ p) → π p ≔ begin ... end;
opaque symbol imply_to_or [p q] : π (p ⇒ q) → π (¬ p ∨ q) ≔ begin ... end;
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants