Skip to content

Conversation

@redianthus
Copy link
Member

No description provided.

@redianthus redianthus changed the title Boolintf clean intf Dec 12, 2025
@redianthus redianthus merged commit e45984c into OCamlPro:main Dec 13, 2025
5 of 6 checks passed

let eq e1 e2 =
if phys_equal e1 e2 then Symbolic_boolean.true_ else relop Ty_bool Eq e1 e2
(* TODO: why do we use `Ty_bool` in the first two cases and `ty` in the others? What is the righe choice? *)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @filipeom, I can't make sense of this, could you explain how it works to me?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitvectors use the default equality operator in SMTLIB (i.e., =). Since we pattern match on the theory to dispatch the operator we can just use Ty_bool for bitvectors to get the default boolean equality operator. But probably using ty would also work. Internally it defaults to the same operator used for Ty_bool.

relop Ty_bool Eq e (of_concrete c) |> Symbolic_boolean.of_expr

let eq e1 e2 =
if phys_equal e1 e2 then Symbolic_boolean.true_ else relop Ty_bool Eq e1 e2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @filipeom, I removed the phys_equal shortcut as it did not seem used that often to me and I also thinks it would make more sense to have it in smtml, WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged 😄

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants