Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
16ef91d
Add module and datatype ClaimPattern
ana-pantilie Jul 24, 2020
19c1a8b
ClaimPattern: onePathRuleToTerm
ana-pantilie Jul 24, 2020
0d9cf80
ClaimPattern: allPathRuleToTerm
ana-pantilie Jul 24, 2020
6cf54fe
ClaimPattern: add missing instances
ana-pantilie Jul 24, 2020
6bfe65d
ClaimPattern: ReachabilityRule
ana-pantilie Jul 24, 2020
3fac67a
ClaimPattern: FreeVariables
ana-pantilie Jul 27, 2020
9be3816
Merge remote-tracking branch 'upstream/master' into change-representa…
ana-pantilie Jul 27, 2020
5faacd3
Rule.Expand: update to ClaimPattern
ana-pantilie Jul 27, 2020
256c30f
Rule.Simplify: add functionality for ClaimPattern
ana-pantilie Jul 27, 2020
058f1ab
Step.Rule: parse reachability claims to ClaimPattern
ana-pantilie Jul 27, 2020
12b61ca
Integrate old claim representation back
ana-pantilie Jul 27, 2020
6f9880d
Step.Rule.Expand: refactor instance for ClaimPattern
ana-pantilie Jul 28, 2020
52d5380
Step.Rule.Simplify: refactor instance for ClaimPattern
ana-pantilie Jul 28, 2020
be962b3
ClaimPattern: functions to construct ClaimPatterns
ana-pantilie Jul 28, 2020
cd886e3
Test.Step.Rule.Expand: add tests for ClaimPattern
ana-pantilie Jul 28, 2020
17c94ec
Test.Step.Rule: add Common.hs + add tests for ClaimPattern in Simplif…
ana-pantilie Jul 28, 2020
81cd449
Test.Step.Rule: fix sort issues
ana-pantilie Jul 28, 2020
f25410b
Test.Step.Rule: remove class specific to old OnePathRule
ana-pantilie Jul 28, 2020
4e27c08
Test.Step.Rule.Simplify: hlint workaround
ana-pantilie Jul 28, 2020
c263eee
Test.Step.Rule.Simplify: hlint workaround
ana-pantilie Jul 28, 2020
cdfd7ee
Test.Step.Rule.Simplify: fix unit test
ana-pantilie Jul 28, 2020
49d435c
HLint
ana-pantilie Jul 28, 2020
82c6c6c
Clean-up
ana-pantilie Jul 28, 2020
854f338
Merge branch 'master' into change-representation-of-claims
ana-pantilie Jul 29, 2020
89d4a32
Fix ClaimPattern right hand side free variables bug
ana-pantilie Jul 29, 2020
6eaf5c1
Fix ClaimPattern unparsing bug
ana-pantilie Jul 29, 2020
0342cc6
SentenceVerifier: case for ClaimPatterns
ana-pantilie Jul 29, 2020
deb9abd
Kore.Step.Rule.Expand: Remove redundant State field
ttuegel Jul 29, 2020
5f866d4
Test.Kore.Step.Rule.Expand: Separate old and new tests
ttuegel Jul 29, 2020
03f9f85
Address review comments
ana-pantilie Jul 30, 2020
5fc5741
Merge branch 'change-representation-of-claims' into change-representa…
ana-pantilie Jul 30, 2020
994e8e9
Global clean-up and WIP transition to ClaimPattern
ana-pantilie Jul 30, 2020
6f3631d
WIP fill in strategy steps + move RewritingVariable transformations
ana-pantilie Jul 31, 2020
d06b5a7
Kore.Repl: use ClaimPattern
ana-pantilie Aug 1, 2020
75140a2
ClaimPattern: refreshClaim
ana-pantilie Aug 3, 2020
978171a
UnifyingRule: variable type determined rule type
ana-pantilie Aug 4, 2020
726e294
Step.RewriteStep: implementation for ClaimPattern
ana-pantilie Aug 5, 2020
06a2d9d
Strategies.Goal: deriveSeqClaim + WIP deriveResultsClaim
ana-pantilie Aug 5, 2020
19ad066
Strategies.Goal: transitioning should save sum type of applied rule t…
ana-pantilie Aug 5, 2020
bc3eba1
Strategies.Goal: AppliedRule
ana-pantilie Aug 5, 2020
91e2898
Strategies.Goal: applyClaims
ana-pantilie Aug 5, 2020
c7a1237
Strategies.Goal: checkImplication implementation draft
ana-pantilie Aug 7, 2020
c61a755
Add missing implementations
ana-pantilie Aug 7, 2020
36cd8c9
ClaimPattern: fix unparsing bug
ana-pantilie Aug 10, 2020
3b6319a
Strategy fixes
ana-pantilie Aug 10, 2020
927a40f
Fix unparsing bug
ana-pantilie Aug 10, 2020
6f37c71
Test.Step.RewriteStep: revert changes
ana-pantilie Aug 11, 2020
b0fa63b
Repl.Interpreter: fix tests
ana-pantilie Aug 11, 2020
eb527b0
Repl: make goal when beginning to prove claim
ana-pantilie Aug 11, 2020
e148412
Kore.Exec: simplify claims only with ML rules
ana-pantilie Aug 11, 2020
6aae817
save-proofs: config variable wrapper
ana-pantilie Aug 11, 2020
a24817f
ClaimPattern: fix right hand side parsing bug
ana-pantilie Aug 11, 2020
14f0a9e
Fix bugs
ana-pantilie Aug 12, 2020
d9b12b6
Fix unparsing bugs
ana-pantilie Aug 13, 2020
18678d2
Fix unparsing bug
ana-pantilie Aug 13, 2020
abe74f1
Clean-up: RewritingVariable
ana-pantilie Aug 13, 2020
fcec97b
Remove trace
ana-pantilie Aug 13, 2020
b5b268f
Clean-up: lens ClaimPattern
ana-pantilie Aug 13, 2020
0f6e115
Clean-up: general
ana-pantilie Aug 13, 2020
55456ae
Revert golden change
ana-pantilie Aug 13, 2020
3dcbd15
Integration tests: questionable changes
ana-pantilie Aug 13, 2020
a6b54a7
Strategies.Goal: refactor checkImplication and clean-up
ana-pantilie Aug 13, 2020
7a96150
Strategies.Goal: checkImplication clarity + possible fix
ana-pantilie Aug 13, 2020
63c01fa
Step.RewriteStep: WIP reduce duplication
ana-pantilie Aug 13, 2020
42d8187
Step.RewriteStep: finish major refactoring
ana-pantilie Aug 14, 2020
c4430b4
Step.RewriteStep: clarity
ana-pantilie Aug 14, 2020
c91082d
Merge remote-tracking branch 'upstream/master' into change-representa…
ana-pantilie Aug 14, 2020
70d4edd
General clean-up
ana-pantilie Aug 14, 2020
29f310d
Clean-up
ana-pantilie Aug 14, 2020
9a0de4a
General clean-up
ana-pantilie Aug 14, 2020
840a504
Step.RulePattern: remove ToRulePattern and FromRulePattern
ana-pantilie Aug 14, 2020
33532a6
Unparsing change
ana-pantilie Aug 14, 2020
5f0b696
Revert integration test change: probably was from start-up claim simp…
ana-pantilie Aug 14, 2020
e9d36a9
Revert integration test change
ana-pantilie Aug 14, 2020
6fa510c
Add tests for refreshRule ClaimPattern
ana-pantilie Aug 14, 2020
8531b9b
Test.RewriteStep: duplicate renameRuleVariables
ana-pantilie Aug 17, 2020
f29c8c8
Test.RewriteStep: duplicate unifyRule
ana-pantilie Aug 17, 2020
63db91c
Test.RewriteStep: duplicate unifyRule
ana-pantilie Aug 17, 2020
7763685
Test.RewriteStep: WIP duplicate applyRewriteRule_
ana-pantilie Aug 17, 2020
36ab29b
Test.RewriteStep: duplicate applyRewriteRule_
ana-pantilie Aug 17, 2020
1829f3d
Test.RewriteStep: finish duplicating tests
ana-pantilie Aug 17, 2020
399b334
Test.Rule: add simple parsing test for claims + fix parsing bug
ana-pantilie Aug 17, 2020
fa6ab64
Test.Rule: add parsing test for claims with conditions + fix parsing bug
ana-pantilie Aug 17, 2020
101781f
Test.Rule: add parsing test for claims with conditions and existentials
ana-pantilie Aug 17, 2020
54051c3
Test.Rule: add parsing test for claims with conditions and existentia…
ana-pantilie Aug 17, 2020
e4d702b
Revert changes to integration tests
ana-pantilie Aug 17, 2020
9817a1e
Fix ClaimPattern RHS parsing bug
ana-pantilie Aug 17, 2020
b9c382c
General clean-up
ana-pantilie Aug 17, 2020
8f86040
Integration test failures?: add #Or in RHS of claims
ana-pantilie Aug 17, 2020
88f51b1
Remove redundant import
ana-pantilie Aug 17, 2020
227f918
Strategies.Goal: add suggested fixes + add exit case in checkImplication
ana-pantilie Aug 18, 2020
05bbd85
Revert changes to a couple of one/all-path tests
ana-pantilie Aug 18, 2020
d5197be
WIP: Add simplify-rhs integration test
ana-pantilie Aug 18, 2020
c36cc19
Add simplify-rhs integration test
ana-pantilie Aug 18, 2020
a71b3be
Update kore/test/Test/Kore/Strategies/AllPath/Verification.hs
ana-pantilie Aug 19, 2020
dc52f41
Update kore/src/Kore/Step/RewriteStep.hs
ana-pantilie Aug 19, 2020
a1d7242
Update kore/src/Kore/Step/ClaimPattern.hs
ana-pantilie Aug 19, 2020
2d7b560
Update kore/src/Kore/Internal/Pattern.hs
ana-pantilie Aug 19, 2020
e92a59a
Address review comments: parse claim RHS
ana-pantilie Aug 19, 2020
135a08d
Address review comments: separate predicate and substitution
ana-pantilie Aug 19, 2020
1fa7961
Merge branch 'change-representation-of-claims-part2' into simplify-rh…
ana-pantilie Aug 19, 2020
f9e62ff
RED: expect evaluated RHS
ana-pantilie Aug 19, 2020
48628e2
GRN: simplify RHS during Simplify strategy step
ana-pantilie Aug 19, 2020
ea5e101
Strategy.Goal: fix bugs in checkImplication
ana-pantilie Aug 19, 2020
3711f3e
MOVE THIS! Strategies.Goal: checkImplicationWorker to global scope fo…
ana-pantilie Aug 20, 2020
ede2f09
MOVE THIS! Test.Strategies.Goal: WIP add tests for checkImplicationWo…
ana-pantilie Aug 20, 2020
f0ac742
Remove test from simplify-rhs branch
ana-pantilie Aug 20, 2020
73a2d29
Remove simplify rhs
ana-pantilie Aug 20, 2020
10c2002
Test.Strategies.Goal: add RHS branching tests
ana-pantilie Aug 20, 2020
37f5f91
Refactor checkImplication. Tests still failing
ana-pantilie Aug 21, 2020
b773602
git add src/Kore/Step/Simplification/AndPredicates.hs! Step.Simplific…
ana-pantilie Aug 21, 2020
00235cf
Fix check implication
ana-pantilie Aug 21, 2020
93bf22f
Revert "Remove test from simplify-rhs branch"
ana-pantilie Aug 21, 2020
a949ac9
Revert "Remove simplify rhs"
ana-pantilie Aug 21, 2020
d22bf11
Strategies.Goal.simplify': do not traverse over MultiOr
ana-pantilie Aug 21, 2020
cdbcddc
Update Exec.hs
ana-pantilie Aug 21, 2020
ae3fcc0
Extract assertFunctionLikeConfiguration
ttuegel Aug 21, 2020
d8aeabc
checkImplication: Allow branching
ttuegel Aug 21, 2020
03b989b
Merge branch 'master' into change-representation-of-claims-part2
ttuegel Aug 21, 2020
a7fd9db
Refactor checkImplicationWorker
ttuegel Aug 21, 2020
faed75d
stack.yaml: Update hashes
ttuegel Aug 21, 2020
bb590d9
test_checkImplication: does not unify, with left condition
ttuegel Aug 22, 2020
cf7d9e2
test_checkImplication: does not unify, with right condition
ttuegel Aug 22, 2020
5103706
Prelude.Kore: Export Data.Tuple
ttuegel Aug 22, 2020
983fd14
checkImplicationWorker: Report NotImplied if unification unsuccessful
ttuegel Aug 22, 2020
820a26e
test/all-path: Do not unify with initial configuration
ttuegel Aug 22, 2020
0fedd8b
hlint
ana-pantilie Aug 24, 2020
190e06f
Merge branch 'change-representation-of-claims-part2' into simplify-rh…
ana-pantilie Aug 24, 2020
8a7823b
Strategies.Goal: simplify with correct side condition
ana-pantilie Aug 24, 2020
75d1655
checkImplicationWorker: Do not call topExistsToImplicitForall
ttuegel Aug 22, 2020
a3d3413
checkImplicationWorker: getNegatedConjuncts
ttuegel Aug 22, 2020
f8faedb
Remove topExistsToImplicitForall
ttuegel Aug 23, 2020
b06a6c0
checkImplicationWorker: Documentation
ttuegel Aug 23, 2020
9ea62dd
checkImplicationWorker: Use leftCondition as sideCondition
ttuegel Aug 23, 2020
dbeadd7
Kore.Internal.SideCondition.assertNormalized
ttuegel Aug 24, 2020
2a5e0ba
Revert "checkImplicationWorker: Use leftCondition as sideCondition"
ttuegel Aug 24, 2020
6bc7a11
TODO: checkImplicationWorker: SideCondition and subtitution
ttuegel Aug 24, 2020
2c8bb8c
finalizeAppliedClaim: Do not drop substitution from right-hand side
ttuegel Aug 24, 2020
7726522
finalizeAppliedRule: Do not drop substitution from right-hand side
ttuegel Aug 24, 2020
a470b1c
Merge remote-tracking branch 'origin/change-representation-of-claims-…
ana-pantilie Aug 24, 2020
e08dd85
Address review comments
ana-pantilie Aug 24, 2020
7c2ffa8
Merge remote-tracking branch 'upstream/master' into simplify-rhs-of-c…
ana-pantilie Aug 25, 2020
410131a
Remove binary files
ana-pantilie Aug 25, 2020
cfa1ff8
Remove old code
ana-pantilie Aug 25, 2020
735bd10
Update kore/src/Kore/Strategies/Goal.hs
ana-pantilie Aug 25, 2020
937bc4c
Remove todo's in integration tests
ana-pantilie Aug 25, 2020
67c6cec
Merge branch 'simplify-rhs-of-claims' of github.com:ana-pantilie/kore…
ana-pantilie Aug 25, 2020
29e143d
Address review comments and refactor
ana-pantilie Aug 25, 2020
8edd4f9
Merge branch 'master' into simplify-rhs-of-claims
ttuegel Aug 25, 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
37 changes: 27 additions & 10 deletions kore/src/Kore/Strategies/Goal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -846,16 +846,33 @@ simplify'
=> Lens' goal ClaimPattern
-> goal
-> Strategy.TransitionT (AppliedRule goal) m goal
simplify' lensClaimPattern =
Lens.traverseOf (lensClaimPattern . field @"left") $ \config -> do
let definedConfig =
Pattern.andCondition (mkDefined <$> config)
$ from $ makeCeilPredicate_ (Conditional.term config)
configs <-
simplifyTopConfiguration definedConfig
>>= SMT.Evaluator.filterMultiOr
& lift
Foldable.asum (pure <$> configs)
simplify' lensClaimPattern goal = do
goal' <- simplifyLeftHandSide goal
let sideCondition = extractSideCondition goal'
simplifyRightHandSide sideCondition goal'
where
extractSideCondition =
SideCondition.assumeTrueCondition
. Pattern.withoutTerm
. Lens.view (lensClaimPattern . field @"left")

simplifyLeftHandSide =
Lens.traverseOf (lensClaimPattern . field @"left") $ \config -> do
let definedConfig =
Pattern.andCondition (mkDefined <$> config)
$ from $ makeCeilPredicate_ (Conditional.term config)
configs <-
simplifyTopConfiguration definedConfig
>>= SMT.Evaluator.filterMultiOr
& lift
Foldable.asum (pure <$> configs)

simplifyRightHandSide sideCondition =
Lens.traverseOf (lensClaimPattern . field @"right") $ \dest ->
OrPattern.observeAllT
$ Logic.scatter dest
>>= Pattern.simplify sideCondition
>>= Logic.scatter

isTriviallyValid' :: Lens' goal ClaimPattern -> goal -> Bool
isTriviallyValid' lensClaimPattern =
Expand Down
1 change: 0 additions & 1 deletion test/all-path/00-basic/01-one-rule/all-path-b-or-c-spec.k
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module ALL-PATH-B-OR-C-SPEC
import PATH

// This should be provable as transiting to b suffices
// TODO (#1278): ... => ?X ensures ?X ==K b orBool ?X ==K c
rule <k> a => b #Or c </k> [all-path]

endmodule
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module ALL-PATH-B-OR-C-SPEC
imports VERIFICATION
imports PATH

// TODO (#1278): ... => ?X ensures ?X ==K b orBool ?X ==K c
rule <k> select => b #Or c </k>
<state> SetItem(b) SetItem(c) </state>
[all-path]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module ONE-PATH-B-OR-C-SPEC
imports VERIFICATION
imports PATH

// TODO (#1278): ... => ?X ensures ?X ==K b orBool ?X ==K c
rule <k> select => b #Or c </k>
<state> SetItem(b) SetItem(c) </state>
[one-path]
Expand Down
2 changes: 2 additions & 0 deletions test/simplify-rhs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DEF = test
include $(CURDIR)/../include.mk
11 changes: 11 additions & 0 deletions test/simplify-rhs/test-1-repl-script-spec.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module VERIFICATION
imports TEST

endmodule

module TEST-1-REPL-SCRIPT-SPEC
imports VERIFICATION

rule a => f(c)

endmodule
10 changes: 10 additions & 0 deletions test/simplify-rhs/test-1-repl-script-spec.k.out.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Kore (0)> ProveSteps 1
#Top
#And
<k>
evaluated ~> _DotVar1 ~> .
</k>
#Implies
#wAF ( <k>
evaluated ~> _DotVar1 ~> .
</k> )
1 change: 1 addition & 0 deletions test/simplify-rhs/test-1-repl-script-spec.k.repl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
step
10 changes: 10 additions & 0 deletions test/simplify-rhs/test.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module TEST

syntax S ::= "a" | "b" | "c" | "evaluated"
| f(S) [function]

rule f(_:S) => evaluated

rule a => f(b)

endmodule