summaryrefslogtreecommitdiff
path: root/proofs
diff options
context:
space:
mode:
authorPaulMeng <baolmeng@gmail.com>2016-08-24 11:24:57 -0400
committerPaulMeng <baolmeng@gmail.com>2016-08-24 11:24:57 -0400
commitdc3f45d6e41bdd4e52e39b0c6fecae3148a2944c (patch)
tree7516d3d5d43f0dadb943bb186615e0903cbd9f7f /proofs
parent74bf9ff63f5566fbe1b5db9124f9dc1fde65cb82 (diff)
parent6b355496aaf27d46d6a33402814753589b755842 (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'proofs')
-rw-r--r--proofs/lfsc_checker/expr.cpp17
-rwxr-xr-xproofs/signatures/th_arrays.plf4
2 files changed, 18 insertions, 3 deletions
diff --git a/proofs/lfsc_checker/expr.cpp b/proofs/lfsc_checker/expr.cpp
index 5cb774fbf..784a0ad2f 100644
--- a/proofs/lfsc_checker/expr.cpp
+++ b/proofs/lfsc_checker/expr.cpp
@@ -577,8 +577,21 @@ bool Expr::defeq(Expr *e) {
{
int counter = 0;
while( e1->kids[counter] ){
- if( !e2->kids[counter] || !e1->kids[counter]->defeq( e2->kids[counter] ) )
- return false;
+ if( e1->kids[counter]!=e2->kids[counter] ){
+ if( !e2->kids[counter] || !e1->kids[counter]->defeq( e2->kids[counter] ) )
+ return false;
+ //--- optimization : replace child with equivalent pointer if was defeq
+ if( e1->kids[counter]<e2->kids[counter] ){
+ e1->kids[counter]->dec();
+ e2->kids[counter]->inc();
+ e1->kids[counter] = e2->kids[counter];
+ }else{
+ e2->kids[counter]->dec();
+ e1->kids[counter]->inc();
+ e2->kids[counter] = e1->kids[counter];
+ }
+ }
+ //---
counter++;
}
return e2->kids[counter]==NULL;
diff --git a/proofs/signatures/th_arrays.plf b/proofs/signatures/th_arrays.plf
index b54a4ed5b..acfbd2f3b 100755
--- a/proofs/signatures/th_arrays.plf
+++ b/proofs/signatures/th_arrays.plf
@@ -32,6 +32,7 @@
(th_holds (= _
(apply _ _ (apply _ _ (read s1 s2) (apply _ _ (apply _ _ (apply _ _ (write s1 s2) t1) t2) t3)) t2) t3))))))))
+; read( a[i] = b, j ) == read( a, j ) if i != j
(declare row (! s1 sort
(! s2 sort
(! t2 (term s1)
@@ -42,6 +43,7 @@
(th_holds (= _ (apply _ _ (apply _ _ (read s1 s2) (apply _ _ (apply _ _ (apply _ _ (write s1 s2) t1) t2) t4)) t3)
(apply _ _ (apply _ _ (read s1 s2) t1) t3)))))))))))
+; i == j if read( a, j ) != read( a[i] = b, j )
(declare negativerow (! s1 sort
(! s2 sort
(! t2 (term s1)
@@ -60,4 +62,4 @@
(! u1 (! k (term s1)
(! u2 (th_holds (or (= _ t1 t2) (not (= _ (apply _ _ (apply _ _ (read s1 s2) t1) k) (apply _ _ (apply _ _ (read s1 s2) t2) k)))))
(holds cln)))
- (holds cln))))))) \ No newline at end of file
+ (holds cln)))))))
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback