Skip to content

Conversation

@melanie-taprogge
Copy link
Contributor

No description provided.

Copy link
Member

@fblanqui fblanqui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Melanie! That's nice! Just a few things to change.

rem x s == the subsequence of s, where the first occurrence
of x has been removed (compare filter (predC1 x) s
where ALL occurrences of x are removed).
rem_idx i s == the sequence s where the element at index i has been
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to rename it into rem_nth for consistency.

assert ⊢ subseq eqn (42 ⸬ 4 ⸬ 51 ⸬ 3 ⸬ □) (42 ⸬ 4 ⸬ 51 ⸬ 3 ⸬ 4 ⸬ □) ≡ false;
assert ⊢ subseq eqn (42 ⸬ 4 ⸬ 51 ⸬ 3 ⸬ □) (42 ⸬ 4 ⸬ 51 ⸬ 3 ⸬ □) ≡ true;

// ⊆
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a more informative comment like "list inclusion"?

with _ □ _ ↪ true;

opaque symbol subset_cons_r [a] (beq : τ a → τ a → 𝔹) (x : τ a) (l m : 𝕃 a) :
π (istrue (⊆ beq l m)) → π (istrue (⊆ beq l (x ⸬ m))) ≔
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since istrue is declared as a coercion from 𝔹 to Prop in Bool.lp, we do normally do not need to write it explicitly.

// rem_idx

symbol rem_idx [a : Set]: 𝕃 a → ℕ → 𝕃 a;
rule rem_idx $l $n ↪ (take $n $l) ++ (drop ($n +1) $l);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many parentheses.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we have something more efficient by going through the list only once?

rem_nth _ [] --> []
rem_nth 0 (x :: l) --> l
rem_nth (n +1) (x :: l) --> x :: rem_nth n l

** Delete:
The theorem is instantiated with three lists:
1. A list of natural numbers representing the indices of literals in the original list.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the original clause

end;


// disj
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n-ary disjunction

// ⊆

symbol ⊆ₙ ≔ ⊆ eqn;
notation ⊆ₙ infix right 30.000000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already defined on line 81 with a different priority !

isn't creating an error or a warning ?

// preserves_contents

symbol preserves_contents: 𝕃 nat → 𝕃 o → 𝔹;
rule preserves_contents $f $l ↪ (indexes $l) ⊆ₙ $f;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many parentheses ?


// ∨ᵢₙ
opaque symbol ∨ᵢₙ (c0 : 𝕃 o) (c1 : 𝕃 o) (c2 : 𝕃 o) :
π (disj c0) → π (disj (c0 ++ c1 ++ c2))≔
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why having two lists c1 and c2? Why not having only one? Then, there are two cases: append on the left or on the right. Third case: append in the middle (replace [disj c0] by [disj c1]).

### Added

- MetaTheorems: theorems for structural operations on the level of clauses and literals
- List: ⊆, em_idx, and related theorems
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List: add ... em_idx -> rem_nth

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