Skip to content

Commit 1e2720c

Browse files
committed
Special-case unary minus in a different way
1 parent 8304ec1 commit 1e2720c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kore/src/Kore/Rewrite/SMT/Translate.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,11 @@ backTranslateWith
533533
backTranslate (List xs)
534534
| null xs =
535535
throwError "backtranslate: empty list"
536+
-- special case for the unary minus, back-translating 'List ["-", "X"]' as '0 - X'
537+
| [fct@(Atom "-"), arg] <- xs
538+
, Just koreSym <- Map.lookup fct reverseMetadata = do
539+
arg' <- backTranslate arg
540+
pure $ TermLike.mkApplySymbol koreSym [mkInternalInt (InternalInt (simpleSort "SortInt") 0), arg']
536541
-- everything is translated back using symbol declarations,
537542
-- not ML connectives (translating terms not predicates)
538543
| (fct@Atom{} : rest) <- xs

0 commit comments

Comments
 (0)