Fix unsound symbolic to_fp-from-Real encoding causing false unsat in Float32 FP/Real round-trip constraints#9966
Fix unsound symbolic to_fp-from-Real encoding causing false unsat in Float32 FP/Real round-trip constraints#9966Copilot wants to merge 4 commits into
to_fp-from-Real encoding causing false unsat in Float32 FP/Real round-trip constraints#9966Conversation
fp.eq simplification causing false unsat in Float32 FP/Real round-trip constraints
|
@copilot - doesn't this fix shadow an underlying bug? |
I investigated this further and added a regression that avoids the direct numeral shortcut path by introducing Float32 aliases before Addressed in commit |
|
Looks fishy to me. Additional simplification rules won't fix the incorrectness of an existing one. I had a look the other day and I'm fairly sure that there is a bug in |
|
@copilot heed the verdict of the authority, Christoph Wintersteiger. Where is the real bug? |
The underlying bug is in That encodes |
|
@copilot what is a fix to this root cause? |
The fix is to stop encoding non-numeral For the non-numeral-real path in In short: replace the exact round-trip equality with rm-aware rounding-neighborhood constraints. |
|
@copilot update pr with proper fix |
fp.eq simplification causing false unsat in Float32 FP/Real round-trip constraintsto_fp-from-Real encoding causing false unsat in Float32 FP/Real round-trip constraints
This change addresses a refutational soundness bug where a satisfiable Float32 constraint was reported
unsatwhen mixingfp.eq,fp.add,fp.to_real, and(_ to_fp 8 24).The root cause was in
fpa2bv_converter::mk_to_fp_real(non-numeral real input path), where conversion was constrained using exact round-trip equality (fp.to_real(result) = x) instead of IEEE-754 rounding semantics.Root-cause fix (
src/ast/fpa/fpa2bv_converter.cpp)mk_to_fp_realfor symbolic real inputs, replaced exact equality encoding with rounding-mode-aware neighborhood constraints around adjacent representable floating-point values.Rewriter correction (
src/ast/rewriter/fpa_rewriter.cpp)fp.eq x c -> (= x c)shortcut for nonzero non-NaN numerals, since it masked the underlying converter bug instead of fixing it.Targeted regression coverage (
src/test/fpa.cpp)sat.