Skip to content

Commit cd3ed71

Browse files
authored
fix-negbLR (EasyCrypt#737)
1 parent 30cb08a commit cd3ed71

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

examples/PIR.ec

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ proof.
289289
by rewrite restrS 1:/# Hjx Hof /= fset0U.
290290
smt (is_restrS is_restr_addS oflist_cons).
291291
+ conseq H => />.
292-
+ move=> &hr ?? His Hof Hb.
293-
rewrite restrS 1:/# (@negbRL _ _ Hb);case: (j0 = i{hr}) => /= [<<- | ?].
292+
+ move=> &hr ?? His Hof /negbDR->.
293+
rewrite restrS 1:/#;case: (j0 = i{hr}) => /= [<<- | ?].
294294
+ rewrite xorC xor_true /=.
295295
case (j0 \in x) => /= Hj0x /=.
296296
+ by rewrite (@eq_sym (oflist s0)) (@is_restr_diff j0 (restr x j0) _ His).

examples/vonNeumann.eca

+4-4
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ while true (b2i (b = b')) 1 (2%r * p * (1%r - p))=> />.
100100
+ seq 1: (b' = !x) (mu1 dbiased (!x)) 1%r (mu1 dbiased x) (mu dvn (pred1 x \o fst)) (b = x)=> //.
101101
+ by auto.
102102
+ by rnd (pred1 (!x)); auto.
103-
+ by conseq ih=> />; rewrite negbLR.
103+
+ by conseq ih=> />; rewrite -negbDR.
104104
+ by rnd (pred1 x); auto=> /#.
105-
by conseq ih=> /> &0 /negbRL /=.
105+
by conseq ih=> /> &0 /negbDR /=.
106106
+ by rnd (pred1 (!x)); auto=> /#.
107107
+ seq 1: (b' = x) _ 0%r (mu1 dbiased (!x)) (mu dvn (pred1 x \o fst)) (b <> x)=> //.
108108
+ by auto.
109-
+ by conseq ih=> /> &0 /negbRL ->; rewrite negbLR.
109+
+ by conseq ih=> /> &0 ->.
110110
+ by rnd (pred1 (!x)); auto=> /#.
111-
by conseq ih=> /> &0 /negbRL -> /negbRL ->.
111+
by conseq ih=> /> &0 /negbDR -> /negbDR ->.
112112
move=> {ih} _ -> /=; rewrite !vnE /svn /(\o)/ pred1 /= /b2i /=.
113113
by move: x=> [] /=; rewrite !dbiased1E /#.
114114
+ by auto=> />; rewrite dbiased_ll.

theories/prelude/Logic.ec

+4-2
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,10 @@ lemma negbK : involutive [!] by [].
340340
lemma negbNE b : !!b => b by [].
341341

342342
lemma negb_inj : injective [!] by smt().
343-
lemma negbLR b c : b = !c => !b = c by smt().
344-
lemma negbRL b c : !b = c => b = !c by smt().
343+
lemma negbLR b c : b = !c => (!b) = c by smt().
344+
lemma negbRL b c : (!b) = c => b = !c by smt().
345+
lemma negbDL b c : !(b = c) <=> (!b) = c by smt().
346+
lemma negbDR b c : !(b = c) <=> b = !c by smt().
345347

346348
lemma contra c b : (c => b) => !b => !c by smt().
347349
lemma contraL c b : (c => !b) => b => !c by smt().

0 commit comments

Comments
 (0)