Closed RyanGlScott closed 3 months ago
Currently, the Cryptol reference evaluator can evaluate a Float value when using its FLiteral instance:
Float
FLiteral
Float> :m Float Loading module Cryptol Loading module Float Float> :eval 1.0 : Float64 0x1.0
But if you use Float's Literal instance, then the reference evaluator crashes:
Literal
Float> :eval 1 : Float64 cryptol: You have encountered a bug in Cryptol's implementation. *** Please create an issue at https://github.com/GaloisInc/cryptol/issues %< --------------------------------------------------- Revision: 65397a491bddc3b4e8f41053106ce8859387d662 Branch: release-3.1.0 (uncommited files present) Location: [Reference Evaluator]literal Message: TCon (TC TCFloat) [TCon (TC (TCNum 11)) [],TCon (TC (TCNum 53)) []] cannot represent literals CallStack (from HasCallStack): panic, called at src/Cryptol/Utils/Panic.hs:21:9 in cryptol-3.1.0-inplace:Cryptol.Utils.Panic panic, called at src/Cryptol/Eval/Reference.lhs:1804:19 in cryptol-3.1.0-inplace:Cryptol.Eval.Reference %< ---------------------------------------------------
Fixing this should be a simple matter of adding another case to the literal function.
literal
Currently, the Cryptol reference evaluator can evaluate a
Float
value when using itsFLiteral
instance:But if you use
Float
'sLiteral
instance, then the reference evaluator crashes:Fixing this should be a simple matter of adding another case to the
literal
function.