Skip to content

Unexpected exception thrown #654

Description

@amenahh
let y = Smtml.Typed.Float32.symbol (Smtml.Symbol.make (Smtml.Ty.Ty_fp 32) "y")

let expr =
  Smtml.Typed.Float32.neg
    (Smtml.Typed.Float32.add (Smtml.Typed.Float32.of_float 42.) y)

let expr = Smtml.Typed.Bitv32.reinterpret_f32 expr

let expr = Smtml.Typed.Bitv32.lt expr Smtml.Typed.Bitv32.one

module CVC5 = Smtml.Solver.Batch (Smtml.Cvc5_mappings)

let solver = CVC5.create ()

let () =
  match CVC5.check solver [ Smtml.Typed.Unsafe.unwrap expr ] with
  | `Sat -> Format.printf "SAT@\n"
  | `Unsat -> Format.printf "UNSAT@\n"
  | `Unknown -> Format.printf "UNKNOWN@\n"

For the following example an exception is thrown.
Z3 and Colibri2 return SAT

Here's the stack trace

Fatal error: exception Invalid_argument("expecting a bit-vector term")
Raised by primitive operation at Cvc5.Term.mk_term in file "cvc5.ml", line 98, characters 4-50
Called from Smtml__Mappings.Make.Make_.Encoder.encode_expr in file "src/smtml/mappings.ml", line 754, characters 16-33
Called from Smtml__Mappings.Make.Make_.Encoder.encode_exprs.(fun) in file "src/smtml/mappings.ml", line 791, characters 27-44
Called from Stdlib__List.fold_left in file "list.ml", line 125, characters 24-34
Called from Smtml__Mappings.Make.Make_.Encoder.encode_exprs in file "src/smtml/mappings.ml", lines 789-793, characters 10-24
Called from Smtml__Mappings.Make.Make_.Solver.check in file "src/smtml/mappings.ml", line 953, characters 40-76
Called from Smtml__Utils.run_and_time_call in file "src/smtml/utils.ml", line 7, characters 15-19
Called from Dune__exe__Bug8 in file "bug/bug8.ml", line 40, characters 8-60

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions