@@ -150,8 +150,7 @@ import Kore.Step.Transition
150
150
)
151
151
import qualified Kore.Step.Transition as Transition
152
152
import Kore.Strategies.ProofState hiding
153
- ( Prim
154
- , proofState
153
+ ( proofState
155
154
)
156
155
import qualified Kore.Strategies.ProofState as ProofState
157
156
import Kore.Strategies.Rule
@@ -190,8 +189,6 @@ proven
190
189
-> Bool
191
190
proven = Foldable. null . unprovenNodes
192
191
193
- type Prim goal = ProofState. Prim (Rule goal )
194
-
195
192
class Goal goal where
196
193
goalToRule :: goal -> Rule goal
197
194
default goalToRule
@@ -203,7 +200,7 @@ class Goal goal where
203
200
:: goal
204
201
-> [goal ]
205
202
-> [Rule goal ]
206
- -> Stream (Strategy ( Prim goal ) )
203
+ -> Stream (Strategy Prim )
207
204
208
205
isTriviallyValid :: goal -> Bool
209
206
@@ -468,18 +465,16 @@ instance Goal ReachabilityRule where
468
465
:: ReachabilityRule
469
466
-> [ReachabilityRule ]
470
467
-> [Rule ReachabilityRule ]
471
- -> Stream (Strategy ( Prim ReachabilityRule ) )
468
+ -> Stream (Strategy Prim )
472
469
strategy goal claims axioms =
473
470
case goal of
474
471
OnePath rule ->
475
- reachabilityOnePathStrategy
476
- $ strategy
472
+ strategy
477
473
rule
478
474
(mapMaybe maybeOnePath claims)
479
475
(fmap ruleReachabilityToRuleOnePath axioms)
480
476
AllPath rule ->
481
- reachabilityAllPathStrategy
482
- $ strategy
477
+ strategy
483
478
rule
484
479
(mapMaybe maybeAllPath claims)
485
480
(fmap ruleReachabilityToRuleAllPath axioms)
@@ -511,24 +506,6 @@ maybeAllPath :: ReachabilityRule -> Maybe AllPathRule
511
506
maybeAllPath (AllPath rule) = Just rule
512
507
maybeAllPath _ = Nothing
513
508
514
- reachabilityOnePathStrategy
515
- :: Functor t
516
- => t (Strategy (Prim OnePathRule ))
517
- -> t (Strategy (Prim ReachabilityRule ))
518
- reachabilityOnePathStrategy strategy' =
519
- (fmap . fmap . fmap )
520
- ruleOnePathToRuleReachability
521
- strategy'
522
-
523
- reachabilityAllPathStrategy
524
- :: Functor t
525
- => t (Strategy (Prim AllPathRule ))
526
- -> t (Strategy (Prim ReachabilityRule ))
527
- reachabilityAllPathStrategy strategy' =
528
- (fmap . fmap . fmap )
529
- ruleAllPathToRuleReachability
530
- strategy'
531
-
532
509
-- The functions below are easier to read coercions between
533
510
-- the newtypes over 'RewriteRule VariableName' defined in the
534
511
-- instances of 'Goal' as 'Rule's.
@@ -553,7 +530,7 @@ ruleOnePathToRuleReachability
553
530
ruleOnePathToRuleReachability = coerce
554
531
555
532
type TransitionRule m goal =
556
- Prim goal
533
+ Prim
557
534
-> ProofState goal
558
535
-> Strategy. TransitionT (Rule goal ) m (ProofState goal )
559
536
@@ -567,7 +544,7 @@ transitionRule
567
544
transitionRule claims axiomGroups = transitionRuleWorker
568
545
where
569
546
transitionRuleWorker
570
- :: Prim goal
547
+ :: Prim
571
548
-> ProofState goal
572
549
-> Strategy. TransitionT (Rule goal ) m (ProofState goal )
573
550
transitionRuleWorker CheckProven Proven = empty
@@ -614,6 +591,17 @@ transitionRule claims axiomGroups = transitionRuleWorker
614
591
| isTriviallyValid goal =
615
592
return Proven
616
593
594
+ -- TODO (virgil): Wrap the results in GoalRemainder/GoalRewritten here.
595
+ --
596
+ -- thomas.tuegel: "Here" is in ApplyClaims and ApplyAxioms.
597
+ --
598
+ -- Note that in most transitions it is obvious what is being transformed
599
+ -- into what, e.g. that a `ResetGoal` transition transforms
600
+ -- `GoalRewritten` into `Goal`. However, here we're taking a `Goal`
601
+ -- and transforming it into `GoalRewritten` and `GoalRemainder` in an
602
+ -- opaque way. I think that there's no good reason for wrapping the
603
+ -- results in `derivePar` as opposed to here.
604
+
617
605
transitionRuleWorker ApplyClaims (Goal goal) =
618
606
Profile. timeStrategy " applyClaims"
619
607
$ applyClaims claims goal
@@ -630,37 +618,9 @@ transitionRule claims axiomGroups = transitionRuleWorker
630
618
Profile. timeStrategy " applyAxioms"
631
619
$ applyAxioms axiomGroups goal
632
620
633
- transitionRuleWorker (DerivePar rules) (Goal goal) =
634
- -- TODO (virgil): Wrap the results in GoalRemainder/GoalRewritten here.
635
- --
636
- -- Note that in most transitions it is obvious what is being transformed
637
- -- into what, e.g. that a `ResetGoal` transition transforms
638
- -- `GoalRewritten` into `Goal`. However, here we're taking a `Goal`
639
- -- and transforming it into `GoalRewritten` and `GoalRemainder` in an
640
- -- opaque way. I think that there's no good reason for wrapping the
641
- -- results in `derivePar` as opposed to here.
642
- Profile. timeStrategy " Goal.DerivePar"
643
- $ derivePar rules goal
644
- transitionRuleWorker (DerivePar rules) (GoalRemainder goal) =
645
- -- TODO (virgil): Wrap the results in GoalRemainder/GoalRewritten here.
646
- -- See above for an explanation.
647
- Profile. timeStrategy " Goal.DeriveParRemainder"
648
- $ derivePar rules goal
649
-
650
- transitionRuleWorker (DeriveSeq rules) (Goal goal) =
651
- -- TODO (virgil): Wrap the results in GoalRemainder/GoalRewritten here.
652
- -- See above for an explanation.
653
- Profile. timeStrategy " Goal.DeriveSeq"
654
- $ deriveSeq rules goal
655
- transitionRuleWorker (DeriveSeq rules) (GoalRemainder goal) =
656
- -- TODO (virgil): Wrap the results in GoalRemainder/GoalRewritten here.
657
- -- See above for an explanation.
658
- Profile. timeStrategy " Goal.DeriveSeqRemainder"
659
- $ deriveSeq rules goal
660
-
661
621
transitionRuleWorker _ state = return state
662
622
663
- onePathFirstStep :: Strategy ( Prim goal )
623
+ onePathFirstStep :: Strategy Prim
664
624
onePathFirstStep =
665
625
(Strategy. sequence . map Strategy. apply)
666
626
[ CheckProven
@@ -675,7 +635,7 @@ onePathFirstStep =
675
635
, TriviallyValid
676
636
]
677
637
678
- onePathFollowupStep :: Strategy ( Prim goal )
638
+ onePathFollowupStep :: Strategy Prim
679
639
onePathFollowupStep =
680
640
(Strategy. sequence . map Strategy. apply)
681
641
[ CheckProven
@@ -691,7 +651,7 @@ onePathFollowupStep =
691
651
, TriviallyValid
692
652
]
693
653
694
- allPathFirstStep :: Strategy ( Prim AllPathRule )
654
+ allPathFirstStep :: Strategy Prim
695
655
allPathFirstStep =
696
656
(Strategy. sequence . map Strategy. apply)
697
657
[ CheckProven
@@ -706,7 +666,7 @@ allPathFirstStep =
706
666
, TriviallyValid
707
667
]
708
668
709
- allPathFollowupStep :: Strategy ( Prim AllPathRule )
669
+ allPathFollowupStep :: Strategy Prim
710
670
allPathFollowupStep =
711
671
(Strategy. sequence . map Strategy. apply)
712
672
[ CheckProven
0 commit comments