Skip to content

Commit 832e8de

Browse files
committed
Fix bug in proof extraction of consecutive Delta rules.
The bug occurred when several Delta rules were applied in the same prover round, and caused generated function names to not be fresh beginning with the second Delta rule of the round. The remainder of the proof was unaffected, starting with the first Ext rule after the Alpha-Delta phase. The bug was due to the fact that the fresh name generated by each Delta rule was not carried forward internally in the round, but only "re-discovered" after the end of the phase. The bug did not affect the prover algorithm, only the generation of proof certificates. Verification of proof certificates for formulas affected by the bug would fail despite the prover finding a proof, since the proof certificate would not contain a valid proof.
1 parent 9d7aacf commit 832e8de

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

haskell/lib/ProofExtractor.hs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,27 @@ second (_ : xs) = first xs
5353
-- Expansion of the alpha, delta, and double negation elimination rules
5454
expandAlphaDelta :: Tree (([Tm], [Fm]), Rule) -> Int -> Tree ([Fm], SeCaVRule)
5555
expandAlphaDelta (Node ((terms, f : fs), rule) (Abs_fset (Set [current]))) n =
56-
let (srule, applied) = case (rule, f) of
57-
(AlphaDis, Dis p q) -> (RAlphaDis, [p, q])
58-
(AlphaCon, Neg (Con p q)) -> (RAlphaCon, [Neg p, Neg q])
59-
(AlphaImp, Imp p q) -> (RAlphaImp, [Neg p, q])
60-
(NegNeg, Neg (Neg p)) -> (RNeg, [p])
61-
(DeltaUni, Uni p) -> (RDeltaUni, [SeCaV.sub Arith.zero_nat (SeCaV.Fun (generateNew terms) []) p])
62-
(DeltaExi, Neg (Exi p)) -> (RDeltaExi, [Neg (SeCaV.sub Arith.zero_nat (SeCaV.Fun (generateNew terms) []) p)])
63-
(AlphaDis, x) -> (RAlphaDis, [x])
64-
(AlphaCon, x) -> (RAlphaCon, [x])
65-
(AlphaImp, x) -> (RAlphaImp, [x])
66-
(DeltaUni, x) -> (RDeltaUni, [x])
67-
(DeltaExi, x) -> (RDeltaExi, [x])
68-
(NegNeg, x) -> (RNeg, [x])
56+
let (srule, applied, newTerms) = case (rule, f) of
57+
(AlphaDis, Dis p q) -> (RAlphaDis, [p, q], [])
58+
(AlphaCon, Neg (Con p q)) -> (RAlphaCon, [Neg p, Neg q], [])
59+
(AlphaImp, Imp p q) -> (RAlphaImp, [Neg p, q], [])
60+
(NegNeg, Neg (Neg p)) -> (RNeg, [p], [])
61+
(DeltaUni, Uni p) ->
62+
let newFun = SeCaV.Fun (generateNew terms) [] in
63+
(RDeltaUni, [SeCaV.sub Arith.zero_nat newFun p], [newFun])
64+
(DeltaExi, Neg (Exi p)) ->
65+
let newFun = SeCaV.Fun (generateNew terms) [] in
66+
(RDeltaExi, [Neg (SeCaV.sub Arith.zero_nat newFun p)], [newFun])
67+
(AlphaDis, x) -> (RAlphaDis, [x], [])
68+
(AlphaCon, x) -> (RAlphaCon, [x], [])
69+
(AlphaImp, x) -> (RAlphaImp, [x], [])
70+
(DeltaUni, x) -> (RDeltaUni, [x], [])
71+
(DeltaExi, x) -> (RDeltaExi, [x], [])
72+
(NegNeg, x) -> (RNeg, [x], [])
6973
_ -> error "expandAlphaDelta must only be called on Alpha, Neg or Delta rules." in
7074
let extRule = if n == 1
7175
then Node (applied ++ fs, RExt) (Abs_fset (Set [expandMultiRules current]))
72-
else Node (applied ++ fs, RExt) (Abs_fset (Set [expandAlphaDelta (Node ((terms, fs ++ applied), rule) (Abs_fset (Set [current]))) (n - 1)])) in
76+
else Node (applied ++ fs, RExt) (Abs_fset (Set [expandAlphaDelta (Node ((terms ++ newTerms, fs ++ applied), rule) (Abs_fset (Set [current]))) (n - 1)])) in
7377
Node (f : fs, srule) (Abs_fset (Set [extRule]))
7478
expandAlphaDelta (Node ((_, []), _) _) _ = error "The sequent must never be empty."
7579
expandAlphaDelta (Node ((_, _), _) (Abs_fset (Coset _))) _ = error "The proof tree must not include cosets."

0 commit comments

Comments
 (0)