Skip to content

Commit 97494af

Browse files
committed
Revert "Issue 2100 follow up (#2574)"
This reverts commit 9733608.
1 parent 314b81b commit 97494af

File tree

3 files changed

+26
-51
lines changed

3 files changed

+26
-51
lines changed

kore/src/Kore/ASTVerifier/SentenceVerifier.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import Kore.ASTVerifier.PatternVerifier as PatternVerifier
4848
import Kore.ASTVerifier.SortVerifier
4949
import Kore.ASTVerifier.Verifier
5050
import qualified Kore.Attribute.Axiom as Attribute (
51-
Axiom,
51+
Axiom (..),
5252
parseAxiomAttributes,
5353
)
5454
import qualified Kore.Attribute.Hook as Attribute

kore/src/Kore/Equation/Sentence.hs

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -65,38 +65,14 @@ data MatchEquationError variable
6565
deriving anyclass (Debug)
6666

6767
instance InternalVariable variable => Pretty (MatchEquationError variable) where
68-
pretty (NotEquation term) =
69-
Pretty.vsep
70-
[ "The given term is not an equation:"
71-
, unparse term
72-
]
73-
pretty (RequiresError notPred) =
74-
Pretty.vsep
75-
[ "The equation's requires clause is not a predicate:"
76-
, pretty notPred
77-
, "This is a frontend bug. Please report this error at https://github.com/kframework/k/issues."
78-
]
79-
pretty (ArgumentError notPred) =
80-
Pretty.vsep
81-
[ "The equation's argument clause is not a predicate:"
82-
, pretty notPred
83-
, "This is a frontend bug. Please report this error at https://github.com/kframework/k/issues."
84-
]
85-
pretty (AntiLeftError notPred) =
86-
Pretty.vsep
87-
[ "The equation's anti-left clause is not a predicate:"
88-
, pretty notPred
89-
, "This is a frontend bug. Please report this error at https://github.com/kframework/k/issues."
90-
]
91-
pretty (EnsuresError notPred) =
92-
Pretty.vsep
93-
[ "The equation's ensures clause is not a predicate:"
94-
, pretty notPred
95-
, "This is a frontend bug. Please report this error at https://github.com/kframework/k/issues."
96-
]
97-
pretty FunctionalAxiom = "The term is a functional axiom."
98-
pretty ConstructorAxiom = "The term is a constructor axiom."
99-
pretty SubsortAxiom = "The term is a subsort axiom."
68+
pretty (NotEquation term) = "The given term is not an equation:\n" <> unparse term
69+
pretty (RequiresError notPred) = "The equation's requires clause is not a predicate:\n" <> pretty notPred
70+
pretty (ArgumentError notPred) = "The equation's argument clause is not a predicate:\n" <> pretty notPred
71+
pretty (AntiLeftError notPred) = "The equation's anti-left clause is not a predicate:\n" <> pretty notPred
72+
pretty (EnsuresError notPred) = "The equation's ensures clause is not a predicate:\n" <> pretty notPred
73+
pretty FunctionalAxiom = "The term is a functional axiom"
74+
pretty ConstructorAxiom = "The term is a constructor axiom"
75+
pretty SubsortAxiom = "The term is a subsort axiom"
10076

10177
matchEquation ::
10278
forall variable.

kore/src/Kore/Equation/Validate.hs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ validateAxiom attrs verified =
113113
pack $
114114
show $
115115
Pretty.vsep
116-
[ "Expected function symbol, but found constructor symbol:"
116+
[ "Head of LHS of Not Simplification axiom is not a non-constructor function symbol. This is the LHS symbol:"
117117
, unparse sym
118118
]
119119

120120
checkVarFunctionArguments =
121121
failOnJust
122122
eq
123-
"Expected variable, but found:"
123+
"LHS of NotSimplification axiom contains non-variable:"
124124
$ asum $ getNotVar <$> termLikeF
125125

126126
getNotVar (TermLike.Var_ _) = Nothing
@@ -129,7 +129,7 @@ validateAxiom attrs verified =
129129
checkArg _ Nothing = return ()
130130
checkArg eq (Just arg) =
131131
traverse_
132-
( failOnJust eq "Found invalid subterm in argument of function equation:"
132+
( failOnJust eq "Found invalid subterm of Axiom equation argument:"
133133
. checkArgIn
134134
)
135135
$ Predicate.getMultiAndPredicate arg
@@ -144,7 +144,20 @@ validateAxiom attrs verified =
144144
_
145145
| TermLike.isConstructorLike term -> descend
146146
TermLike.App_ sym _
147-
| isGoodSymbol sym -> descend
147+
| or
148+
[ Symbol.isConstructorLike sym
149+
, Symbol.isAnywhere sym && Symbol.isInjective sym
150+
, Map.isSymbolConcat sym
151+
, Map.isSymbolElement sym
152+
, Map.isSymbolUnit sym
153+
, Set.isSymbolConcat sym
154+
, Set.isSymbolElement sym
155+
, Set.isSymbolUnit sym
156+
, List.isSymbolConcat sym
157+
, List.isSymbolElement sym
158+
, List.isSymbolUnit sym
159+
] ->
160+
descend
148161
| otherwise -> Just term
149162
TermLike.InternalBytes_ _ _ -> Nothing
150163
TermLike.InternalBool_ _ -> Nothing
@@ -157,20 +170,6 @@ validateAxiom attrs verified =
157170
_ -> Just term
158171
where
159172
_ :< termF = Recursive.project term
160-
isGoodSymbol sym =
161-
or
162-
[ Symbol.isConstructorLike sym
163-
, Symbol.isAnywhere sym && Symbol.isInjective sym
164-
, Map.isSymbolConcat sym
165-
, Map.isSymbolElement sym
166-
, Map.isSymbolUnit sym
167-
, Set.isSymbolConcat sym
168-
, Set.isSymbolElement sym
169-
, Set.isSymbolUnit sym
170-
, List.isSymbolConcat sym
171-
, List.isSymbolElement sym
172-
, List.isSymbolUnit sym
173-
]
174173
descend = asum $ findBadArgSubterm <$> termF
175174

176175
failOnJust _ _ Nothing = return ()

0 commit comments

Comments
 (0)