Commit 700646bc authored by Robbert Krebbers's avatar Robbert Krebbers

Add bitwise negation on integers.

parent c57f36f0
......@@ -317,6 +317,7 @@ Definition subst' (mx : binder) (es : expr) : expr → expr :=
Definition un_op_eval (op : un_op) (v : val) : option val :=
match op, v with
| 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)
| _, _ => None
end.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment