Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8a26f02
Keep sideCondition and change andCondition
andreiburdusa May 6, 2020
a4c006b
addressed coments more carefully
andreiburdusa May 6, 2020
672ab1f
clean up
andreiburdusa May 6, 2020
1389480
Merge remote-tracking branch 'upstream/master' into remove-Kore.Inter…
andreiburdusa May 6, 2020
4682190
Update kore/src/Kore/Internal/SideCondition.hs
andreiburdusa May 6, 2020
92731f6
pedantic
andreiburdusa May 7, 2020
804b230
Merge remote-tracking branch 'upstream/master' into remove-Kore.Inter…
andreiburdusa May 7, 2020
888bf60
Merge remote-tracking branch 'upstream/master' into remove-Kore.Inter…
andreiburdusa May 8, 2020
feb799a
Merge remote-tracking branch 'upstream/master' into remove-Kore.Inter…
andreiburdusa May 11, 2020
3ceb88b
applyInitialConditions: No SideCondition argument
ttuegel May 12, 2020
0e65e25
applyInitialConditions: Initial Condition is not optional
ttuegel May 12, 2020
7237c21
applyInitialConditions: Inline simplifyPredicate
ttuegel May 12, 2020
593675b
applyInitialConditions: Use initial condition to simplify unification…
ttuegel May 12, 2020
2a851c7
applyRemainder: No SideCondition argument
ttuegel May 12, 2020
9973418
applyRemainder: Inline simplifyPredicate
ttuegel May 12, 2020
b85996b
applyRemainder: Use initial condition to simplify remainders
ttuegel May 12, 2020
d86613d
unifyRule: No SideCondition argument
ttuegel May 12, 2020
1c7d816
unifyRules: No SideCondition argument
ttuegel May 12, 2020
cf227cb
applyInitialConditions: Inputs are simplified
ttuegel May 12, 2020
1d9750c
applyRemainder: Inputs are simplified
ttuegel May 12, 2020
9fdf8bd
finalizeAppliedRule: Inline simplifyPredicate
ttuegel May 12, 2020
0191924
unifyRule: Inline simplifyPredicate
ttuegel May 12, 2020
571a23a
Remove Kore.Step.Step.simplifyPredicate
ttuegel May 12, 2020
15b1f36
Revert "applyRemainder: Inputs are simplified"
ttuegel May 12, 2020
f0fc4f4
Merge branch 'master' into feature--rewrite-SideCondition
ttuegel May 13, 2020
78ecde4
Merge branch 'master' into feature--rewrite-SideCondition
ttuegel May 13, 2020
0a92a83
Dockerfile: Update Z3
ttuegel May 13, 2020
af6f821
Revert "Dockerfile: Update Z3"
ttuegel May 14, 2020
0a2476a
Merge remote-tracking branch 'tom/feature--rewrite-SideCondition' int…
andreiburdusa May 18, 2020
42583c5
Line length
andreiburdusa May 18, 2020
eca584c
Merge remote-tracking branch 'upstream/master' into remove-Kore.Inter…
andreiburdusa May 18, 2020
e5c8dbb
test_onePathStrategy: removeDestination simplifies stuck configuration
ttuegel May 18, 2020
14033c1
Merge branch 'master' into remove-Kore.Internal.SideCondition.andCond…
ttuegel May 19, 2020
2e6ebf6
rebuild
andreiburdusa May 19, 2020
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
5 changes: 3 additions & 2 deletions kore/src/Kore/Internal/SideCondition.hs
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,12 @@ andCondition
-> Condition variable
-> SideCondition variable
andCondition SideCondition {assumedTrue} newCondition =
SideCondition
assert (isNormalized result) result
where
result = SideCondition
{ representation = toRepresentationCondition merged
, assumedTrue = merged
}
where
merged = assumedTrue `Condition.andCondition` newCondition

assumeTrueCondition
Expand Down
9 changes: 8 additions & 1 deletion kore/src/Kore/Step/Simplification/Pattern.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import qualified Kore.Internal.SideCondition as SideCondition
( andCondition
, topTODO
)
import Kore.Internal.Substitution
( toMap
)
import Kore.Internal.TermLike
( pattern Exists_
)
Expand All @@ -36,6 +39,9 @@ import Kore.Step.Simplification.Simplify
, simplifyCondition
, simplifyConditionalTermToOr
)
import Kore.Substitute
( substitute
)

{-| Simplifies the pattern without a side-condition (i.e. it's top)
and removes the exists quantifiers at the top.
Expand Down Expand Up @@ -68,9 +74,10 @@ simplify sideCondition pattern' =
withSimplifiedCondition <- simplifyCondition sideCondition pattern'
let (term, simplifiedCondition) =
Conditional.splitTerm withSimplifiedCondition
term' = substitute (toMap $ substitution simplifiedCondition) term
termSideCondition =
sideCondition `SideCondition.andCondition` simplifiedCondition
orSimplifiedTerms <- simplifyConditionalTermToOr termSideCondition term
orSimplifiedTerms <- simplifyConditionalTermToOr termSideCondition term'
simplifiedTerm <- Branch.scatter orSimplifiedTerms
simplifyCondition
sideCondition
Expand Down
7 changes: 2 additions & 5 deletions kore/src/Kore/Step/Simplification/SubstitutionSimplifier.hs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ import Kore.Internal.SideCondition
( SideCondition
)
import qualified Kore.Internal.SideCondition as SideCondition
( andCondition
, toRepresentation
( toRepresentation
, topTODO
)
import Kore.Internal.Substitution
Expand Down Expand Up @@ -195,9 +194,7 @@ simplifyAnds MakeAnd { makeAnd } (NonEmpty.sort -> patterns) =
AndF And { andFirst, andSecond } ->
foldM simplifyAnds' intermediate [andFirst, andSecond]
_ -> do
let sideCondition =
SideCondition.topTODO
`SideCondition.andCondition` intermediateCondition
let sideCondition = SideCondition.topTODO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now, but let's make a follow-up pull request to add a SideCondition argument to simplifyAnds and remove this topTODO.

simplified <-
makeAnd
intermediateTerm
Expand Down
7 changes: 1 addition & 6 deletions kore/src/Kore/Unification/Procedure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ import qualified Kore.Internal.Pattern as Conditional
import Kore.Internal.SideCondition
( SideCondition
)
import qualified Kore.Internal.SideCondition as SideCondition
( andCondition
)
import Kore.Internal.TermLike
import Kore.Log.InfoAttemptUnification
( infoAttemptUnification
Expand Down Expand Up @@ -75,9 +72,7 @@ unificationProcedureWorker sideCondition p1 p2
pat <- termUnification Not.notSimplifier p1 p2
TopBottom.guardAgainstBottom pat
let (term, conditions) = Conditional.splitTerm pat
mergedSideCondition =
sideCondition `SideCondition.andCondition` conditions
orCeil <- Ceil.makeEvaluateTerm mergedSideCondition term
orCeil <- Ceil.makeEvaluateTerm sideCondition term
ceil' <- Monad.Unify.scatter orCeil
BranchT.alternate . simplifyCondition sideCondition
$ Conditional.andCondition ceil' conditions
Expand Down
52 changes: 30 additions & 22 deletions kore/test/Test/Kore/Strategies/OnePath/Step.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ import Kore.Syntax.Module
import Kore.Syntax.Variable
( Variable (..)
)
import Kore.Variables.UnifiedVariable

import qualified Test.Kore.Step.MockSymbols as Mock
import Test.Kore.Step.Simplification
Expand Down Expand Up @@ -749,34 +750,37 @@ test_onePathStrategy =
-- Coinductive axiom: -
-- Normal axiom: -
-- Expected: stuck, since the terms unify but the conditions do not
let goal =
makeOnePathRuleFromPatterns
( Conditional
{ term = TermLike.mkElemVar Mock.x
, predicate =
makeEqualsPredicate Mock.testSort
(TermLike.mkElemVar Mock.x)
Mock.a
, substitution = mempty
}
let left =
Pattern.withCondition
(TermLike.mkElemVar Mock.x)
(Condition.fromPredicate
(makeEqualsPredicate Mock.testSort
(TermLike.mkElemVar Mock.x)
Mock.a
)
)
( Conditional
{ term = TermLike.mkElemVar Mock.x
, predicate =
makeNotPredicate
$ makeEqualsPredicate Mock.testSort
(TermLike.mkElemVar Mock.x)
Mock.a
, substitution = mempty
}
left' =
Pattern.withCondition
Mock.a
(Condition.assign (ElemVar Mock.x) Mock.a)
right =
Pattern.withCondition
(TermLike.mkElemVar Mock.x)
(Condition.fromPredicate $ makeNotPredicate
(makeEqualsPredicate Mock.testSort
(TermLike.mkElemVar Mock.x)
Mock.a
)
)
original = makeOnePathRuleFromPatterns left right
expect = makeOnePathRuleFromPatterns left' right
[ _actual ] <- runOnePathSteps
Unlimited
(Limit 1)
goal
original
[]
[]
assertEqual "" (ProofState.GoalStuck goal) _actual
assertEqual "" (ProofState.GoalStuck expect) _actual
]

simpleRewrite
Expand Down Expand Up @@ -847,7 +851,11 @@ runSteps breadthLimit graphFilter picker configuration strategy' =
give metadataTools
$ declareSMTLemmas
$ indexedModuleWithDefaultImports (ModuleName "TestModule") Nothing
runStrategy breadthLimit transitionRule strategy' (ProofState.Goal configuration)
runStrategy
breadthLimit
transitionRule
strategy'
(ProofState.Goal configuration)
where
mockEnv = Mock.env
Env {metadataTools} = mockEnv
Expand Down