fpToRational (0 : Float32) should be equal to (ratio 0 1). Cryptol's native and reference evaluators confirm this:
Cryptol> :m Float
Loading module Cryptol
Loading module Float
Float> fpToRational (0 : Float32) == (ratio 0 1)
True
Float> :eval fpToRational (0 : Float32) == (ratio 0 1)
True
If you ask the :prove command with a What4-based prover, however, it claims that evaluating this query will result in a runtime error:
Float> :set prover=w4-z3
Float> :prove fpToRational (0 : Float32) == (ratio 0 1)
Counterexample
(fpToRational (0 : Float32) == (ratio 0 1)) ~> ERROR
(Total Elapsed Time: 0.018s, using "Z3")
As far as I can tell, this is a bug. Strangely, this issue doesn't arise if you try the following, very similar :sat command:
Float> :sat \x -> fpToRational (0 : Float32) == x
Satisfiable
(\x -> fpToRational (0 : Float32) == x) (ratio 0 1) = True
(Total Elapsed Time: 0.021s, using "Z3")
fpToRational (0 : Float32)should be equal to(ratio 0 1). Cryptol's native and reference evaluators confirm this:If you ask the
:provecommand with a What4-based prover, however, it claims that evaluating this query will result in a runtime error:As far as I can tell, this is a bug. Strangely, this issue doesn't arise if you try the following, very similar
:satcommand: