@@ -604,12 +604,13 @@ 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 Nothing
607
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing Nothing
608
608
, nextStates =
609
- Just $
610
- map
611
- (\ (_, muid, p', mrulePred) -> toExecState p' originalSubstitution unsupported (Just muid) mrulePred) $
612
- toList nexts
609
+ Just
610
+ $ map
611
+ ( \ (_, muid, p', mrulePred, ruleSubst) -> toExecState p' originalSubstitution unsupported (Just muid) mrulePred (Just ruleSubst)
612
+ )
613
+ $ toList nexts
613
614
, rule = Nothing
614
615
, unknownPredicate = Nothing
615
616
}
@@ -620,7 +621,7 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
620
621
{ reason = RpcTypes. Stuck
621
622
, depth
622
623
, logs
623
- , state = toExecState p originalSubstitution unsupported Nothing Nothing
624
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing Nothing
624
625
, nextStates = Nothing
625
626
, rule = Nothing
626
627
, unknownPredicate = Nothing
@@ -632,7 +633,7 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
632
633
{ reason = RpcTypes. Vacuous
633
634
, depth
634
635
, logs
635
- , state = toExecState p originalSubstitution unsupported Nothing Nothing
636
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing Nothing
636
637
, nextStates = Nothing
637
638
, rule = Nothing
638
639
, unknownPredicate = Nothing
@@ -644,8 +645,8 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
644
645
{ reason = RpcTypes. CutPointRule
645
646
, depth
646
647
, logs
647
- , state = toExecState p originalSubstitution unsupported Nothing Nothing
648
- , nextStates = Just [toExecState next originalSubstitution unsupported Nothing Nothing ]
648
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing Nothing
649
+ , nextStates = Just [toExecState next originalSubstitution unsupported Nothing Nothing Nothing ]
649
650
, rule = Just lbl
650
651
, unknownPredicate = Nothing
651
652
}
@@ -656,7 +657,7 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
656
657
{ reason = RpcTypes. TerminalRule
657
658
, depth
658
659
, logs
659
- , state = toExecState p originalSubstitution unsupported Nothing Nothing
660
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing Nothing
660
661
, nextStates = Nothing
661
662
, rule = Just lbl
662
663
, unknownPredicate = Nothing
@@ -668,7 +669,7 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
668
669
{ reason = RpcTypes. DepthBound
669
670
, depth
670
671
, logs
671
- , state = toExecState p originalSubstitution unsupported Nothing Nothing
672
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing Nothing
672
673
, nextStates = Nothing
673
674
, rule = Nothing
674
675
, unknownPredicate = Nothing
@@ -685,7 +686,7 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
685
686
(logSuccessfulRewrites, logFailedRewrites)
686
687
(RewriteStepFailed failure)
687
688
in logs <|> abortRewriteLog
688
- , state = toExecState p originalSubstitution unsupported Nothing Nothing
689
+ , state = toExecState p originalSubstitution unsupported Nothing Nothing Nothing
689
690
, nextStates = Nothing
690
691
, rule = Nothing
691
692
, unknownPredicate = Nothing
@@ -716,20 +717,27 @@ toExecState ::
716
717
[Syntax. KorePattern ] ->
717
718
Maybe UniqueId ->
718
719
Maybe Predicate ->
720
+ Maybe (Map Variable Term ) ->
719
721
RpcTypes. ExecuteState
720
- toExecState pat sub unsupported muid mrulePredicate =
722
+ toExecState pat sub unsupported muid mrulePredicate mruleSubst =
721
723
RpcTypes. ExecuteState
722
724
{ term = addHeader t
723
725
, predicate = addHeader <$> addUnsupported p
724
726
, substitution = addHeader <$> s
725
- , ruleSubstitution = Nothing
727
+ , ruleSubstitution = addHeader <$> mruleSubstExt
726
728
, rulePredicate = addHeader <$> mrulePredExt
727
729
, ruleId = getUniqueId <$> muid
728
730
}
729
731
where
730
- mrulePredExt = externalisePredicate (externaliseSort Pattern. SortBool ) <$> mrulePredicate
732
+ mrulePredExt = externalisePredicate predicateSort <$> mrulePredicate
733
+ mruleSubstExt =
734
+ Syntax. KJAnd predicateSort
735
+ . map (uncurry $ externaliseSubstitution predicateSort)
736
+ . Map. toList
737
+ <$> mruleSubst
731
738
(t, p, s) = externalisePattern pat sub
732
739
termSort = externaliseSort $ sortOfPattern pat
740
+ predicateSort = externaliseSort Pattern. SortBool
733
741
allUnsupported = Syntax. KJAnd termSort unsupported
734
742
addUnsupported
735
743
| null unsupported = id
0 commit comments