Skip to content

Commit ed517d0

Browse files
authored
Some cleaning (Deducteam#20)
- remove FIXME comments - declare istrue as injective
1 parent 7f8c051 commit ed517d0

File tree

4 files changed

+17
-34
lines changed

4 files changed

+17
-34
lines changed

Bool.lp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ end;
2727

2828
// non confusion of constructors
2929

30-
symbol istrue : 𝔹 → Prop;
30+
injective symbol istrue : 𝔹 → Prop;
3131

3232
rule istrue true ↪ ⊤
3333
with istrue false ↪ ⊥;
@@ -136,8 +136,7 @@ end;
136136

137137
opaque symbol andᵢ [p q] : π(istrue p) → π(istrue q) → π(istrue (p and q)) ≔
138138
begin
139-
assume p q h i; //FIXME: apply istrue_and fails
140-
apply @istrue_and p q; apply ∧ᵢ h i;
139+
assume p q h i; apply @istrue_and p q; apply ∧ᵢ h i;
141140
end;
142141

143142
opaque symbol andₑ₁ [p q] : π (istrue (p and q)) → π (istrue p) ≔

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33
The format is based on [Keep a Changelog](https://keepachangelog.com/),
44
and this project adheres to [Semantic Versioning](https://semver.org/).
55

6+
## Unreleased
7+
8+
- Declare istrue as injective
9+
610
## 1.1.0 (2024-06-21)
711

812
- Add classical logic

List.lp

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ end;
225225

226226
opaque symbol □≠⸬ [a] [xa] [l] : π (□ ≠ xl) ≔
227227
begin
228-
assume a x l h; /*FIXME:apply ⸬≠□ fails*/ refine @⸬≠□ a x l _;
229-
symmetry; apply h
228+
assume a x l h; refine @⸬≠□ a x l _; symmetry; apply h
230229
end;
231230

232231
// head
@@ -270,12 +269,9 @@ begin
270269
{ assume x l h; induction
271270
{ simplify; assume c; refine ⊥ₑ c; }
272271
{ simplify; assume y m i c;
273-
//FIXME: apply feq2 (⸬) fails
274-
refine feq2 (⸬) _ _
275-
{ apply beq_correct; //FIXME: apply andₑ₁ c fails
276-
apply @andₑ₁ (beq x y) (eql beq l m) c}
277-
{ apply h; //FIXME: apply andₑ₂ c fails
278-
refine @andₑ₂ (beq x y) (eql beq l m) c
272+
apply feq2 (⸬) _ _
273+
{ apply beq_correct; apply @andₑ₁ _ (eql beq l m) c}
274+
{ apply h; refine @andₑ₂ (beq x y) _ c
279275
}
280276
}
281277
}
@@ -284,17 +280,15 @@ end;
284280
opaque symbol eql_complete a beq: π(`∀ xa, `∀ y, x = yistrue(beq x y)) →
285281
π(`∀ l, `∀ m, l = mistrue(eql beq l m)) ≔
286282
begin
287-
simplify; //FIXME: remove
288283
assume a beq beq_complete; induction
289284
{ assume m i; rewrite left i; apply ⊤ᵢ; }
290-
{ simplify /*FIXME*/; assume x l h; induction
285+
{ assume x l h; induction
291286
{ assume j; apply ⸬≠□ j; }
292287
{ assume y m i j; simplify;
293288
have j': π(x = yl = m) { apply ⸬_inj j };
294-
apply @istrue_and (beq x y) (eql beq l m) /*FIXME*/; apply ∧ᵢ
289+
apply @istrue_and (beq x y) (eql beq l m); apply ∧ᵢ
295290
{ apply beq_complete x y; apply ∧ₑ₁ j' }
296-
{ //FIXME: apply h fails
297-
refine h m _; apply ∧ₑ₂ j' }
291+
{ apply h m; apply ∧ₑ₂ j' }
298292
}
299293
}
300294
end;
@@ -457,15 +451,9 @@ opaque symbol rev_idem [a] (l :𝕃 a) : π(rev (rev l) = l) ≔
457451
begin
458452
assume a; induction
459453
{ reflexivity }
460-
{ assume x l h;
461-
/*FIXME: if no rule rev_concat, rewrite rev_concat fails:
462-
Uncaught [File "src/handle/rewrite.ml", line 166
463-
rewrite @rev_concat a;*/
464-
simplify; rewrite h; reflexivity }
454+
{ assume x l h; simplify; rewrite h; reflexivity }
465455
end;
466456

467-
//rule rev (rev $l) ↪ $l; creates confluence problems
468-
469457
opaque symbol size_rev [a] (l : 𝕃 a) : π(size (rev l) = size l) ≔
470458
begin
471459
assume a;
@@ -476,8 +464,6 @@ begin
476464
{ assume x l h; simplify; rewrite h; reflexivity; }
477465
end;
478466

479-
//rule size (rev $l) ↪ size $l; // confluence modulo C
480-
481467
// rcons
482468

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

759-
//rule drop (size $l) $l ↪ □;
760-
761745
opaque symbol drop_cons [a] (ea) l n : π (drop (n +1) (el) = drop n l) ≔
762746
begin
763747
assume a e l n; reflexivity;
@@ -992,10 +976,7 @@ end;
992976

993977
opaque symbol rot_size [a] (l:𝕃 a) : π (rot (size l) l = l) ≔
994978
begin
995-
assume a l; simplify; rewrite take_size l;
996-
/*FIXME: Uncaught [File "src/core/infer.ml", line 101
997-
rewrite @drop_size;*/
998-
rewrite @drop_size a; reflexivity;
979+
assume a l; simplify; rewrite take_size l; rewrite @drop_size a; reflexivity;
999980
end;
1000981

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

10361017
opaque symbol rotr0 [a] (l:𝕃 a) : π (rotr 0 l = l) ≔
10371018
begin
1038-
assume a l; simplify; rewrite take_size l; rewrite @drop_size a; //FIXME
1039-
reflexivity;
1019+
assume a l; simplify; rewrite take_size l; rewrite @drop_size a; reflexivity;
10401020
end;
10411021

10421022
opaque symbol rotK [a] n (l:𝕃 a) : π (rot n (rotr n l) = l) ≔

Nat.lp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ opaque symbol ltn_trans x y z : π (istrue (x < y)) → π (istrue (y < z)) →
772772
begin
773773
assume x y z h i;
774774
have v:π (istrue (x +1y +1)) { apply leqW (x +1) y h; };
775-
apply @leq_trans (x +1) (y +1) z v i; //FIXME
775+
apply @leq_trans (x +1) (y +1) z v i;
776776
end;
777777

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

0 commit comments

Comments
 (0)