Module CopSyntax
Inductive
unary_operation
:
Type
:=
|
Onotbool
:
unary_operation
(* boolean negation (
!
in C) *)
|
Onotint
:
unary_operation
(* integer complement (
~
in C) *)
|
Oneg
:
unary_operation
(* opposite (unary
-
) *)
|
Oabsfloat
:
unary_operation
.
(* floating-point absolute value *)
Inductive
binary_operation
:
Type
:=
|
Oadd
:
binary_operation
(* addition (binary
+
) *)
|
Osub
:
binary_operation
(* subtraction (binary
-
) *)
|
Omul
:
binary_operation
(* multiplication (binary
*
) *)
|
Odiv
:
binary_operation
(* division (
/
) *)
|
Omod
:
binary_operation
(* remainder (
%
) *)
|
Oand
:
binary_operation
(* bitwise and (
&
) *)
|
Oor
:
binary_operation
(* bitwise or (
|
) *)
|
Oxor
:
binary_operation
(* bitwise xor (
^
) *)
|
Oshl
:
binary_operation
(* left shift (
<<
) *)
|
Oshr
:
binary_operation
(* right shift (
>>
) *)
|
Oeq
:
binary_operation
(* comparison (
==
) *)
|
One
:
binary_operation
(* comparison (
!=
) *)
|
Olt
:
binary_operation
(* comparison (
<
) *)
|
Ogt
:
binary_operation
(* comparison (
>
) *)
|
Ole
:
binary_operation
(* comparison (
<=
) *)
|
Oge
:
binary_operation
.
(* comparison (
>=
) *)
Inductive
incr_or_decr
:
Type
:=
Incr
|
Decr
.