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

SBV->C: Semantics of fpMin/fpMax around +/-0 is not the same as SMTLib #161

Closed
LeventErkok opened this issue May 5, 2015 · 1 comment
Closed
Assignees

Comments

@LeventErkok
Copy link
Owner

Not sure if this is really worth "fixing." But we're currently translating SMTLib's fpMin/fpMax to C's fmin/fmax functions; which semantically disagree when given +/-0.

In case of SMTLib2; the result is +0. In case of the C-function (following x86 hardware), the result is the second argument.

Note that both behaviors are IEEE754 compliant; but just another nuisance to watch out for; if it ever comes up.

@LeventErkok LeventErkok self-assigned this May 5, 2015
@LeventErkok
Copy link
Owner Author

The real issue here is that which semantics should we go with? If we take the C-semantics, then we need to wrap-around in our SMT-Lib generator to generate different code; otherwise, we need to wrap-around the C-translator to match the Z3/SMTLib semantics. Neither choice is satisfactory. Note that this only is an issue with the explicit calls to fpMin/fpMax; as those directly translate to Z3/C "equivalents." Regular use of min/max just goes through regular comparison, which does "whatever it does," but does it the same in both backends.

There's really no good solution here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant