Skip to content

Make Conditional's term a strict field #2442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kore/src/Kore/Internal/Conditional.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ quadratic complexity.
-}
data Conditional variable child =
Conditional
{ term :: child
{ term :: !child
, predicate :: !(Predicate variable)
, substitution :: !(Substitution variable)
}
Expand Down
2 changes: 2 additions & 0 deletions kore/src/Kore/Reachability/Claim.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import Control.Lens
( Lens'
)
import qualified Control.Lens as Lens
import qualified Control.Monad as Monad
import Control.Monad.Catch
( Exception (..)
, SomeException (..)
Expand Down Expand Up @@ -604,6 +605,7 @@ simplify' lensClaimPattern claim = do

simplifyLeftHandSide =
Lens.traverseOf (lensClaimPattern . field @"left") $ \config -> do
Monad.guard (not . isBottom . Conditional.term $ config)
let definedConfig =
Pattern.andCondition (mkDefined <$> config)
$ from $ makeCeilPredicate (Conditional.term config)
Expand Down
15 changes: 15 additions & 0 deletions kore/test/Test/Kore/Reachability/Prove.hs
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,21 @@ test_proveClaims =
[ mkTest "OnePath" simpleOnePathClaim
, mkTest "AllPath" simpleAllPathClaim
]
, testGroup "LHS is undefined" $
let mkTest name mkSimpleClaim =
testCase name $ do
let claims = [mkSimpleClaim mkBottom_ Mock.a]
actual <- proveClaims_
Unlimited
Unlimited
[]
claims
[]
assertEqual "Result is \\top" MultiAnd.top actual
in
[ mkTest "OnePath" simpleOnePathClaim
, mkTest "AllPath" simpleAllPathClaim
]
]

simpleAxiom
Expand Down