Skip to content

Commit

Permalink
a formula should be an instance of itself (cvc5#1668)
Browse files Browse the repository at this point in the history
Proof checking failed when applying the instantiation rule so that the original formula and the instantiated formula are the same. Fixed using the new "ifequal" construct in lfsc.
  • Loading branch information
yoni206 authored Apr 2, 2018
1 parent 75d15b2 commit 065adbb
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions proofs/signatures/th_quant.plf
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
(! f formula
formula))))

(program eqterm ((n1 term) (n2 term)) bool
(do (markvar n1)
(let s (ifmarked n2 tt ff)
(do (markvar n1) s))))
;This program recursively checks the instantiation.
;Composite terms (such as "apply _ _ ...") are handled recursively.
;Then, if ti and t are equal, we return true. Otherwise, we first verify that t is the variable for which ti is substitued (ifmarked). if this is the case, ti should be equal to k.

(program is_inst_t ((ti term) (t term) (k term)) bool
(match t
((apply s1 s2 t1 t2)
(match ti
((apply si1 si2 ti1 ti2) (match (is_inst_t ti1 t1 k) (tt (is_inst_t ti2 t2 k)) (ff ff)))
(default ff)))
(default (eqterm ti (ifmarked t k t)))))
(match t
((apply s1 s2 t1 t2)
(match ti
((apply si1 si2 ti1 ti2)
(match (is_inst_t ti1 t1 k) (tt (is_inst_t ti2 t2 k)) (ff ff)))
(default ff)))
(default (ifequal ti t tt (ifmarked t (ifequal ti k tt ff) ff)))))


(program is_inst_f ((fi formula) (f formula) (k term)) bool
(match f
Expand Down

0 comments on commit 065adbb

Please sign in to comment.