Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z3 and floating points: check useFpForReals when translating gt and lt expressions #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/main/gov/nasa/jpf/symbc/numeric/solvers/ProblemZ3.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,11 @@ public Object lt(Object exp, long value){

public Object lt(Object exp1, Object exp2){
try{
return ctx.mkLt((ArithExpr)exp1,(ArithExpr)exp2);
if (useFpForReals) {
return ctx.mkFPLt((FPExpr)exp1,(FPExpr)exp2);
} else {
return ctx.mkLt((ArithExpr)exp1,(ArithExpr)exp2);
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("## Error Z3: Exception caught in Z3 JNI: \n" + e);
Expand Down Expand Up @@ -405,7 +409,11 @@ public Object gt(Object exp, long value){

public Object gt(Object exp1, Object exp2){
try{
return ctx.mkGt((ArithExpr)exp1,(ArithExpr)exp2);
if (useFpForReals) {
return ctx.mkFPGt((FPExpr)exp1,(FPExpr)exp2);
} else {
return ctx.mkGt((ArithExpr)exp1,(ArithExpr)exp2);
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("## Error Z3: Exception caught in Z3 JNI: \n" + e);
Expand Down