@@ -48,7 +48,7 @@ import Booster.Definition.Base qualified as Definition (RewriteRule (..))
48
48
import Booster.LLVM as LLVM (API )
49
49
import Booster.Log
50
50
import Booster.Pattern.ApplyEquations qualified as ApplyEquations
51
- import Booster.Pattern.Base (Pattern (.. ), Sort (SortApp ), Term , Variable )
51
+ import Booster.Pattern.Base (Pattern (.. ), Predicate ( .. ), Sort (SortApp ), Term , Variable )
52
52
import Booster.Pattern.Base qualified as Pattern
53
53
import Booster.Pattern.Bool (pattern TrueBool )
54
54
import Booster.Pattern.Match (FailReason (.. ), MatchResult (.. ), MatchType (.. ), matchTerms )
@@ -604,10 +604,11 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
604
604
{ reason = RpcTypes. Branching
605
605
, depth
606
606
, logs
607
- , state = toExecState p originalSubstitution unsupported Nothing
607
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing
608
608
, nextStates =
609
609
Just $
610
- map (\ (_, muid, p') -> toExecState p' originalSubstitution unsupported (Just muid)) $
610
+ map
611
+ (\ (_, muid, p', mrulePred) -> toExecState p' originalSubstitution unsupported (Just muid) mrulePred) $
611
612
toList nexts
612
613
, rule = Nothing
613
614
, unknownPredicate = Nothing
@@ -619,7 +620,7 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
619
620
{ reason = RpcTypes. Stuck
620
621
, depth
621
622
, logs
622
- , state = toExecState p originalSubstitution unsupported Nothing
623
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing
623
624
, nextStates = Nothing
624
625
, rule = Nothing
625
626
, unknownPredicate = Nothing
@@ -631,7 +632,7 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
631
632
{ reason = RpcTypes. Vacuous
632
633
, depth
633
634
, logs
634
- , state = toExecState p originalSubstitution unsupported Nothing
635
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing
635
636
, nextStates = Nothing
636
637
, rule = Nothing
637
638
, unknownPredicate = Nothing
@@ -643,8 +644,8 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
643
644
{ reason = RpcTypes. CutPointRule
644
645
, depth
645
646
, logs
646
- , state = toExecState p originalSubstitution unsupported Nothing
647
- , nextStates = Just [toExecState next originalSubstitution unsupported Nothing ]
647
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing
648
+ , nextStates = Just [toExecState next originalSubstitution unsupported Nothing Nothing ]
648
649
, rule = Just lbl
649
650
, unknownPredicate = Nothing
650
651
}
@@ -655,7 +656,7 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
655
656
{ reason = RpcTypes. TerminalRule
656
657
, depth
657
658
, logs
658
- , state = toExecState p originalSubstitution unsupported Nothing
659
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing
659
660
, nextStates = Nothing
660
661
, rule = Just lbl
661
662
, unknownPredicate = Nothing
@@ -667,7 +668,7 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
667
668
{ reason = RpcTypes. DepthBound
668
669
, depth
669
670
, logs
670
- , state = toExecState p originalSubstitution unsupported Nothing
671
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing
671
672
, nextStates = Nothing
672
673
, rule = Nothing
673
674
, unknownPredicate = Nothing
@@ -684,7 +685,7 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
684
685
(logSuccessfulRewrites, logFailedRewrites)
685
686
(RewriteStepFailed failure)
686
687
in logs <|> abortRewriteLog
687
- , state = toExecState p originalSubstitution unsupported Nothing
688
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing
688
689
, nextStates = Nothing
689
690
, rule = Nothing
690
691
, unknownPredicate = Nothing
@@ -710,17 +711,23 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
710
711
(Just t, xs) -> Just (t : xs)
711
712
712
713
toExecState ::
713
- Pattern -> Map Variable Term -> [Syntax. KorePattern ] -> Maybe UniqueId -> RpcTypes. ExecuteState
714
- toExecState pat sub unsupported muid =
714
+ Pattern ->
715
+ Map Variable Term ->
716
+ [Syntax. KorePattern ] ->
717
+ Maybe UniqueId ->
718
+ Maybe Predicate ->
719
+ RpcTypes. ExecuteState
720
+ toExecState pat sub unsupported muid mrulePredicate =
715
721
RpcTypes. ExecuteState
716
722
{ term = addHeader t
717
723
, predicate = addHeader <$> addUnsupported p
718
724
, substitution = addHeader <$> s
719
725
, ruleSubstitution = Nothing
720
- , rulePredicate = Nothing
726
+ , rulePredicate = addHeader <$> mrulePredExt
721
727
, ruleId = getUniqueId <$> muid
722
728
}
723
729
where
730
+ mrulePredExt = externalisePredicate (externaliseSort Pattern. SortBool ) <$> mrulePredicate
724
731
(t, p, s) = externalisePattern pat sub
725
732
termSort = externaliseSort $ sortOfPattern pat
726
733
allUnsupported = Syntax. KJAnd termSort unsupported
0 commit comments