Skip to content

Commit

Permalink
fix bug #55, raise an error for ill-formed clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
pruemmer committed Jul 16, 2024
1 parent 3384e46 commit a93c194
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions regression-tests/horn-smt-lib/Answers
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,7 @@ Warning: ignoring exit
unsat

0: FALSE

illformed.smt2
Warning: ignoring get-model
(error "Uninterpreted functions or constants in clauses are not supported")
9 changes: 9 additions & 0 deletions regression-tests/horn-smt-lib/illformed.smt2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; Input that should be rejected, no Horn clauses

(set-logic UFLIA)
(declare-fun n () Int)

(assert (and (> n 1) (not (= (- n 1) 1))))

(check-sat)
(get-model)
3 changes: 2 additions & 1 deletion regression-tests/horn-smt-lib/runtests
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ TESTS="mccarthy91.nts.smt2 \
clause-shortener-bug.smt2 \
extract.smt2 \
solution-verifier-bug.smt2 \
groebner-bug.smt2"
groebner-bug.smt2 \
illformed.smt2"

for name in $TESTS; do
echo
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/lazabs/horn/parser/HornReader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,11 @@ class SMTHornReader protected[parser] (

if (ContainsSymbol(clause, (x:IExpression) => x match {
case IFunApp(f, _) => !(TheoryRegistry lookupSymbol f).isDefined
case IConstant(_) => true
case _ => false
}))
throw new Exception ("Uninterpreted functions are not supported")
throw new Exception (
"Uninterpreted functions or constants in clauses are not supported")

clause =
if (elimArrays) {
Expand Down

0 comments on commit a93c194

Please sign in to comment.