Skip to content

Commit acc9463

Browse files
emarzionttuegel
andauthored
Display location of rejected function equations (#2408)
* adding source location info for ignoreDefinition assertion * switch branches * Add error message for non-function-like definitions Co-authored-by: Thomas Tuegel <thomas.tuegel@runtimeverification.com>
1 parent db9e6a4 commit acc9463

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

kore/src/Kore/Equation/Registry.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import Kore.Syntax.Sentence
5151
( SentenceAxiom (..)
5252
)
5353
import qualified Kore.Verified as Verified
54+
import qualified Pretty
5455

5556
{- | Create a mapping from symbol identifiers to their defining axioms.
5657
@@ -154,8 +155,13 @@ ignoreEquation Equation { attributes }
154155
{- | Should we ignore the 'EqualityRule' for evaluating function definitions?
155156
-}
156157
ignoreDefinition :: Equation VariableName -> Bool
157-
ignoreDefinition Equation { left } =
158-
assert isLeftFunctionLike False
158+
ignoreDefinition Equation { attributes, left }
159+
| isLeftFunctionLike = False
160+
| otherwise = (error . show . Pretty.vsep)
161+
[ "left-hand side of equation was not function-like at:"
162+
, Pretty.indent 4 $ Pretty.pretty sourceLocation
163+
]
159164
where
165+
Attribute.Axiom { sourceLocation } = attributes
160166
isLeftFunctionLike =
161167
(Pattern.isFunction . Pattern.function) (extractAttributes left)

0 commit comments

Comments
 (0)