Commit 9676c8c2 authored by Philipp Meyer's avatar Philipp Meyer

Remove stable inequality; simplify refinement argument passing

parent 430f9c2e
......@@ -92,44 +92,42 @@ printInvariant inv = do
checkStrongConsensus :: PopulationProtocol -> OptIO PropResult
checkStrongConsensus pp = do
r <- checkStrongConsensus' pp [] [] []
r <- checkStrongConsensus' pp [] []
case r of
(Nothing, _, _, _) -> return Satisfied
(Just _, _, _, _) -> return Unknown
checkStrongConsensus' :: PopulationProtocol ->
[Trap] -> [Siphon] -> [StableInequality] ->
OptIO (Maybe StrongConsensusCounterExample, [Trap], [Siphon], [StableInequality])
checkStrongConsensus' pp utraps usiphons inequalities = do
r <- checkSat $ checkStrongConsensusSat pp utraps usiphons inequalities
(Nothing, _, _) -> return Satisfied
(Just _, _, _) -> return Unknown
checkStrongConsensus' :: PopulationProtocol -> [Trap] -> [Siphon] ->
OptIO (Maybe StrongConsensusCounterExample, [Trap], [Siphon])
checkStrongConsensus' pp utraps usiphons = do
r <- checkSat $ checkStrongConsensusSat pp utraps usiphons
case r of
Nothing -> return (Nothing, utraps, usiphons, inequalities)
Nothing -> return (Nothing, utraps, usiphons)
Just c -> do
refine <- opt optRefinementType
if isJust refine then
refineStrongConsensus pp utraps usiphons inequalities c
refineStrongConsensus pp utraps usiphons c
else
return (Just c, utraps, usiphons, inequalities)
return (Just c, utraps, usiphons)
refineStrongConsensus :: PopulationProtocol ->
[Trap] -> [Siphon] -> [StableInequality] -> StrongConsensusCounterExample ->
OptIO (Maybe StrongConsensusCounterExample, [Trap], [Siphon], [StableInequality])
refineStrongConsensus pp utraps usiphons inequalities c@(m0, m1, m2, x1, x2) = do
r1 <- checkSatMin $ Solver.StrongConsensus.findTrapConstraintsSat pp m0 m1 m2 x1 x2
refineStrongConsensus :: PopulationProtocol -> [Trap] -> [Siphon] -> StrongConsensusCounterExample ->
OptIO (Maybe StrongConsensusCounterExample, [Trap], [Siphon])
refineStrongConsensus pp utraps usiphons c = do
r1 <- checkSatMin $ Solver.StrongConsensus.findTrapConstraintsSat pp c
case r1 of
Nothing -> do
r2 <- checkSatMin $ Solver.StrongConsensus.findUSiphonConstraintsSat pp m0 m1 m2 x1 x2
r2 <- checkSatMin $ Solver.StrongConsensus.findUSiphonConstraintsSat pp c
case r2 of
Nothing -> do
r3 <- checkSatMin $ Solver.StrongConsensus.findUTrapConstraintsSat pp m0 m1 m2 x1 x2
r3 <- checkSatMin $ Solver.StrongConsensus.findUTrapConstraintsSat pp c
case r3 of
Nothing -> return (Just c, utraps, usiphons, inequalities)
Nothing -> return (Just c, utraps, usiphons)
Just utrap ->
checkStrongConsensus' pp (utrap:utraps) usiphons inequalities
checkStrongConsensus' pp (utrap:utraps) usiphons
Just usiphon ->
checkStrongConsensus' pp utraps (usiphon:usiphons) inequalities
checkStrongConsensus' pp utraps (usiphon:usiphons)
Just trap ->
checkStrongConsensus' pp (trap:utraps) usiphons inequalities
checkStrongConsensus' pp (trap:utraps) usiphons
checkLayeredTermination :: PopulationProtocol -> OptIO PropResult
checkLayeredTermination pp = do
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment