Skip to content
Snippets Groups Projects
Commit 700646bc authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Add bitwise negation on integers.

parent c57f36f0
No related branches found
No related tags found
No related merge requests found
...@@ -317,6 +317,7 @@ Definition subst' (mx : binder) (es : expr) : expr → expr := ...@@ -317,6 +317,7 @@ Definition subst' (mx : binder) (es : expr) : expr → expr :=
Definition un_op_eval (op : un_op) (v : val) : option val := Definition un_op_eval (op : un_op) (v : val) : option val :=
match op, v with match op, v with
| NegOp, LitV (LitBool b) => Some $ LitV $ LitBool (negb b) | NegOp, LitV (LitBool b) => Some $ LitV $ LitBool (negb b)
| NegOp, LitV (LitInt n) => Some $ LitV $ LitInt (Z.lnot n)
| MinusUnOp, LitV (LitInt n) => Some $ LitV $ LitInt (- n) | MinusUnOp, LitV (LitInt n) => Some $ LitV $ LitInt (- n)
| _, _ => None | _, _ => None
end. end.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment