@@ -766,18 +766,20 @@ internaliseAxiom (Partial partialDefinition) parsedAxiom =
766
766
sortVars
767
767
attribs
768
768
769
- {- | internalises a pattern and turns its contained substitution into
770
- equations (predicates). Errors if any ceil conditions or
771
- unsupported predicates are found.
769
+ {- | Internalises a pattern to be used as a rule left/right-hand side.
770
+
771
+ Turns its contained substitution into predicates.
772
+
773
+ Errors if any ceil conditions or unsupported predicates are found.
772
774
-}
773
- internalisePatternEnsureNoSubstitutionOrCeilOrUnsupported ::
775
+ internaliseRulePattern ::
774
776
KoreDefinition ->
775
777
SourceRef ->
776
778
Maybe [Id ] ->
777
779
(Variable -> Variable ) ->
778
780
Syntax. KorePattern ->
779
781
Except DefinitionError (Def. Term , [Predicate ])
780
- internalisePatternEnsureNoSubstitutionOrCeilOrUnsupported partialDefinition ref maybeVars f t = do
782
+ internaliseRulePattern partialDefinition ref maybeVars f t = do
781
783
(term, preds, ceilConditions, substitution, unsupported) <-
782
784
withExcept (DefinitionPatternError ref) $
783
785
internalisePattern AllowAlias IgnoreSubsorts maybeVars partialDefinition t
@@ -806,7 +808,7 @@ internaliseRewriteRuleNoAlias partialDefinition exs left right axAttributes = do
806
808
-- to avoid name clashes with patterns from the user;
807
809
-- filter out literal `Top` constraints
808
810
(lhs, requires) <-
809
- internalisePatternEnsureNoSubstitutionOrCeilOrUnsupported
811
+ internaliseRulePattern
810
812
partialDefinition
811
813
ref
812
814
Nothing
@@ -817,7 +819,7 @@ internaliseRewriteRuleNoAlias partialDefinition exs left right axAttributes = do
817
819
| v `Set.member` existentials' = Util. modifyVarName Util. markAsExVar v
818
820
| otherwise = Util. modifyVarName Util. markAsRuleVar v
819
821
(rhs, ensures) <-
820
- internalisePatternEnsureNoSubstitutionOrCeilOrUnsupported
822
+ internaliseRulePattern
821
823
partialDefinition
822
824
ref
823
825
Nothing
@@ -873,14 +875,14 @@ internaliseSimpleEquation partialDef precond left right sortVars attrs
873
875
| Syntax. KJApp {} <- left = do
874
876
-- this ensures that `left` is a _term_ (invariant guarded by classifyAxiom)
875
877
(lhs, requires) <-
876
- internalisePatternEnsureNoSubstitutionOrCeilOrUnsupported
878
+ internaliseRulePattern
877
879
partialDef
878
880
(sourceRef attrs)
879
881
(Just sortVars)
880
882
(Util. modifyVarName (" Eq#" <> ))
881
883
$ Syntax. KJAnd left. sort [left, precond]
882
884
(rhs, ensures) <-
883
- internalisePatternEnsureNoSubstitutionOrCeilOrUnsupported
885
+ internaliseRulePattern
884
886
partialDef
885
887
(sourceRef attrs)
886
888
(Just sortVars)
@@ -932,7 +934,7 @@ internaliseCeil ::
932
934
internaliseCeil partialDef left right sortVars attrs = do
933
935
-- this ensures that `left` is a _term_ (invariant guarded by classifyAxiom)
934
936
(lhs, _) <-
935
- internalisePatternEnsureNoSubstitutionOrCeilOrUnsupported
937
+ internaliseRulePattern
936
938
partialDef
937
939
(sourceRef attrs)
938
940
(Just sortVars)
@@ -1020,7 +1022,7 @@ internaliseFunctionEquation partialDef requires args leftTerm right sortVars att
1020
1022
Util. modifyVariablesInT (Util. modifyVarName (" Eq#" <> )) $
1021
1023
Substitution. substituteInTerm (Map. fromList argPairs) left
1022
1024
(rhs, ensures) <-
1023
- internalisePatternEnsureNoSubstitutionOrCeilOrUnsupported
1025
+ internaliseRulePattern
1024
1026
partialDef
1025
1027
(sourceRef attrs)
1026
1028
(Just sortVars)
0 commit comments