aboutsummaryrefslogtreecommitdiff
path: root/kernel/cPrimitives.mli
diff options
context:
space:
mode:
authorMaxime Dénès2018-02-16 01:02:17 +0100
committerVincent Laporte2019-02-04 13:12:40 +0000
commite43b1768d0f8399f426b92f4dfe31955daceb1a4 (patch)
treed46d10f8893205750e7238e69512736243315ef6 /kernel/cPrimitives.mli
parenta1b7f53a68c9ccae637f2c357fbe50a09e211a4a (diff)
Primitive integers
This work makes it possible to take advantage of a compact representation for integers in the entire system, as opposed to only in some reduction machines. It is useful for heavily computational applications, where even constructing terms is not possible without such a representation. Concretely, it replaces part of the retroknowledge machinery with a primitive construction for integers in terms, and introduces a kind of FFI which maps constants to operators (on integers). Properties of these operators are expressed as explicit axioms, whereas they were hidden in the retroknowledge-based approach. This has been presented at the Coq workshop and some Coq Working Groups, and has been used by various groups for STM trace checking, computational analysis, etc. Contributions by Guillaume Bertholon and Pierre Roux <Pierre.Roux@onera.fr> Co-authored-by: Benjamin Grégoire <Benjamin.Gregoire@inria.fr> Co-authored-by: Vincent Laporte <Vincent.Laporte@fondation-inria.fr>
Diffstat (limited to 'kernel/cPrimitives.mli')
-rw-r--r--kernel/cPrimitives.mli81
1 files changed, 55 insertions, 26 deletions
diff --git a/kernel/cPrimitives.mli b/kernel/cPrimitives.mli
index 1e99a69d2f..3f8174bd7b 100644
--- a/kernel/cPrimitives.mli
+++ b/kernel/cPrimitives.mli
@@ -9,33 +9,62 @@
(************************************************************************)
type t =
- | Int31head0
- | Int31tail0
- | Int31add
- | Int31sub
- | Int31mul
- | Int31div
- | Int31mod
-(*
- | Int31lsr
- | Int31lsl
- *)
- | Int31land
- | Int31lor
- | Int31lxor
- | Int31addc
- | Int31subc
- | Int31addcarryc
- | Int31subcarryc
- | Int31mulc
- | Int31diveucl
- | Int31div21
- | Int31addmuldiv
- | Int31eq
- | Int31lt
- | Int31le
- | Int31compare
+ | Int63head0
+ | Int63tail0
+ | Int63add
+ | Int63sub
+ | Int63mul
+ | Int63div
+ | Int63mod
+ | Int63lsr
+ | Int63lsl
+ | Int63land
+ | Int63lor
+ | Int63lxor
+ | Int63addc
+ | Int63subc
+ | Int63addCarryC
+ | Int63subCarryC
+ | Int63mulc
+ | Int63diveucl
+ | Int63div21
+ | Int63addMulDiv
+ | Int63eq
+ | Int63lt
+ | Int63le
+ | Int63compare
+
+val equal : t -> t -> bool
+
+type arg_kind =
+ | Kparam (* not needed for the elavuation of the primitive*)
+ | Kwhnf (* need to be reduced in whnf before reducing the primitive *)
+ | Karg (* no need to be reduced in whnf *)
+
+type args_red = arg_kind list
val hash : t -> int
val to_string : t -> string
+
+val arity : t -> int
+
+val kind : t -> args_red
+
+(** Special Entries for Register **)
+
+type prim_ind =
+ | PIT_bool
+ | PIT_carry
+ | PIT_pair
+ | PIT_cmp
+
+type prim_type =
+ | PT_int63
+
+type op_or_type =
+ | OT_op of t
+ | OT_type of prim_type
+
+val prim_ind_to_string : prim_ind -> string
+val op_or_type_to_string : op_or_type -> string