Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Bool.lp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ end;

// non confusion of constructors

symbol istrue : 𝔹 → Prop;
injective symbol istrue : 𝔹 → Prop;

rule istrue true ↪ ⊤
with istrue false ↪ ⊥;
Expand Down Expand Up @@ -136,8 +136,7 @@ end;

opaque symbol andᵢ [p q] : π(istrue p) → π(istrue q) → π(istrue (p and q)) ≔
begin
assume p q h i; //FIXME: apply istrue_and fails
apply @istrue_and p q; apply ∧ᵢ h i;
assume p q h i; apply @istrue_and p q; apply ∧ᵢ h i;
end;

opaque symbol andₑ₁ [p q] : π (istrue (p and q)) → π (istrue p) ≔
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/),
and this project adheres to [Semantic Versioning](https://semver.org/).

## Unreleased

- Declare istrue as injective

## 1.1.0 (2024-06-21)

- Add classical logic
Expand Down
40 changes: 10 additions & 30 deletions List.lp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ end;

opaque symbol □≠⸬ [a] [x:τ a] [l] : π (□ ≠ x ⸬ l) ≔
begin
assume a x l h; /*FIXME:apply ⸬≠□ fails*/ refine @⸬≠□ a x l _;
symmetry; apply h
assume a x l h; refine @⸬≠□ a x l _; symmetry; apply h
end;

// head
Expand Down Expand Up @@ -270,12 +269,9 @@ begin
{ assume x l h; induction
{ simplify; assume c; refine ⊥ₑ c; }
{ simplify; assume y m i c;
//FIXME: apply feq2 (⸬) fails
refine feq2 (⸬) _ _
{ apply beq_correct; //FIXME: apply andₑ₁ c fails
apply @andₑ₁ (beq x y) (eql beq l m) c}
{ apply h; //FIXME: apply andₑ₂ c fails
refine @andₑ₂ (beq x y) (eql beq l m) c
apply feq2 (⸬) _ _
{ apply beq_correct; apply @andₑ₁ _ (eql beq l m) c}
{ apply h; refine @andₑ₂ (beq x y) _ c
}
}
}
Expand All @@ -284,17 +280,15 @@ end;
opaque symbol eql_complete a beq: π(`∀ x:τ a, `∀ y, x = y ⇒ istrue(beq x y)) →
π(`∀ l, `∀ m, l = m ⇒ istrue(eql beq l m)) ≔
begin
simplify; //FIXME: remove
assume a beq beq_complete; induction
{ assume m i; rewrite left i; apply ⊤ᵢ; }
{ simplify /*FIXME*/; assume x l h; induction
{ assume x l h; induction
{ assume j; apply ⸬≠□ j; }
{ assume y m i j; simplify;
have j': π(x = y ∧ l = m) { apply ⸬_inj j };
apply @istrue_and (beq x y) (eql beq l m) /*FIXME*/; apply ∧ᵢ
apply @istrue_and (beq x y) (eql beq l m); apply ∧ᵢ
{ apply beq_complete x y; apply ∧ₑ₁ j' }
{ //FIXME: apply h fails
refine h m _; apply ∧ₑ₂ j' }
{ apply h m; apply ∧ₑ₂ j' }
}
}
end;
Expand Down Expand Up @@ -457,15 +451,9 @@ opaque symbol rev_idem [a] (l :𝕃 a) : π(rev (rev l) = l) ≔
begin
assume a; induction
{ reflexivity }
{ assume x l h;
/*FIXME: if no rule rev_concat, rewrite rev_concat fails:
Uncaught [File "src/handle/rewrite.ml", line 166
rewrite @rev_concat a;*/
simplify; rewrite h; reflexivity }
{ assume x l h; simplify; rewrite h; reflexivity }
end;

//rule rev (rev $l) ↪ $l; creates confluence problems

opaque symbol size_rev [a] (l : 𝕃 a) : π(size (rev l) = size l) ≔
begin
assume a;
Expand All @@ -476,8 +464,6 @@ begin
{ assume x l h; simplify; rewrite h; reflexivity; }
end;

//rule size (rev $l) ↪ size $l; // confluence modulo C

// rcons

symbol rcons [a] : 𝕃 a → τ a → 𝕃 a;
Expand Down Expand Up @@ -756,8 +742,6 @@ begin
{ assume e l h; simplify; apply h; }
end;

//rule drop (size $l) $l ↪ □;

opaque symbol drop_cons [a] (e:τ a) l n : π (drop (n +1) (e ⸬ l) = drop n l) ≔
begin
assume a e l n; reflexivity;
Expand Down Expand Up @@ -992,10 +976,7 @@ end;

opaque symbol rot_size [a] (l:𝕃 a) : π (rot (size l) l = l) ≔
begin
assume a l; simplify; rewrite take_size l;
/*FIXME: Uncaught [File "src/core/infer.ml", line 101
rewrite @drop_size;*/
rewrite @drop_size a; reflexivity;
assume a l; simplify; rewrite take_size l; rewrite @drop_size a; reflexivity;
end;

opaque symbol rot_size_cat [a] (l1 l2:𝕃 a) :
Expand Down Expand Up @@ -1035,8 +1016,7 @@ end;

opaque symbol rotr0 [a] (l:𝕃 a) : π (rotr 0 l = l) ≔
begin
assume a l; simplify; rewrite take_size l; rewrite @drop_size a; //FIXME
reflexivity;
assume a l; simplify; rewrite take_size l; rewrite @drop_size a; reflexivity;
end;

opaque symbol rotK [a] n (l:𝕃 a) : π (rot n (rotr n l) = l) ≔
Expand Down
2 changes: 1 addition & 1 deletion Nat.lp
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ opaque symbol ltn_trans x y z : π (istrue (x < y)) → π (istrue (y < z)) →
begin
assume x y z h i;
have v:π (istrue (x +1 ≤ y +1)) { apply leqW (x +1) y h; };
apply @leq_trans (x +1) (y +1) z v i; //FIXME
apply @leq_trans (x +1) (y +1) z v i;
end;

opaque symbol <_asym x y : π (istrue (x < y)) → π (¬ (istrue (y < x))) ≔
Expand Down