diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 940a8526357922f6eaa729f40abbeceffeaef6c6..819758750f952654d1f360245140869117ccc80c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -62,7 +62,7 @@ variables: # /!\ CI_REGISTRY is overriden to use a private Docker registry mirror in AWS ECR # in GitLab namespaces `nomadic-labs` and `tezos` ## This value MUST be the same as `opam_repository_tag` in `scripts/version.sh` - build_deps_image_version: b9a9313e3610545ac5c26e6f6d9cde9f63e32987 + build_deps_image_version: 216c0f260dd672aef71ac769d1435c4f2785db97 build_deps_image_name: "${CI_REGISTRY}/tezos/opam-repository" # This image is not automatically mirrored to AWS ECR and should be # fetch from the GitLab registry, so do not use CI_REGISTRY here. diff --git a/dune-workspace b/dune-workspace index c974bd8fff5985f4ab5b3a1746f996e2c0bbab67..f91d3cf6b85c8af7a961f7026c1628b33ab0b1eb 100644 --- a/dune-workspace +++ b/dune-workspace @@ -2,7 +2,7 @@ (env (dev - (flags (:standard -w @1..72-4-40..42-44-45-48-58-60-67-69-70)) + (flags (:standard -w @1..72-4-40..42-44-45-48-60-67-69-70)) (js_of_ocaml (runtest_alias runtest_js))) (release (js_of_ocaml (runtest_alias runtest_js)) diff --git a/manifest/main.ml b/manifest/main.ml index f86a6f47a58942c76e69ca7581595a3e802a7b64..59c876508ad9c19f0cfb63c8da691558a8fcbb45 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -27,8 +27,7 @@ open Manifest -let warnings_disabled_by_default = - [4; 40; 41; 42; 44; 45; 48; 58; 60; 67; 69; 70] +let warnings_disabled_by_default = [4; 40; 41; 42; 44; 45; 48; 60; 67; 69; 70] (* 4 [fragile-match] 40 [name-out-of-scope] @@ -37,7 +36,6 @@ let warnings_disabled_by_default = 44 [open-shadow-identifier] 45 [open-shadow-label-constructor] 48 [eliminated-optional-arguments] - 58 [no-cmx-file] (flambda specific, necessary as long as Zarith_version.cmx is not installed) 60 [unused-module] 67 [unused-functor-parameter] 69 [unused-field] @@ -363,9 +361,11 @@ let zarith = external_lib ~js_compatible:true "zarith" - V.(at_least "1.12" && less_than "1.13") + V.(at_least "1.13" && less_than "1.14") -let zarith_stubs_js = external_lib ~js_compatible:true "zarith_stubs_js" V.True +(* The 0.16.1 release matches of the stubs matches the 1.13 release of zarith *) +let zarith_stubs_js = + external_lib ~js_compatible:true "zarith_stubs_js" V.(at_least "0.16.1") let ledgerwallet_tezos = external_lib "ledgerwallet-tezos" V.(at_least "0.4.0") diff --git a/opam/bls12-381.opam b/opam/bls12-381.opam index 768bcee44f947563338875cdf271bf963ad15159..b9ba2a39467931daee84d649ccdc15de3d389810 100644 --- a/opam/bls12-381.opam +++ b/opam/bls12-381.opam @@ -12,8 +12,8 @@ depends: [ "ocaml" { >= "4.14" } "integers" "integers_stubs_js" - "zarith" { >= "1.12" & < "1.13" } - "zarith_stubs_js" + "zarith" { >= "1.13" & < "1.14" } + "zarith_stubs_js" { >= "0.16.1" } "hex" { >= "1.3.0" } "tezt" { with-test & >= "4.0.0" & < "5.0.0" } "octez-alcotezt" {with-test} diff --git a/opam/octez-l2-libs.opam b/opam/octez-l2-libs.opam index 812d073045c0ed65bbb9b4f52d4fa4cc4f421db5..2eed0cc4e30a55c809ffd28e9eb82ceefedbc731 100644 --- a/opam/octez-l2-libs.opam +++ b/opam/octez-l2-libs.opam @@ -12,7 +12,7 @@ depends: [ "ocaml" { >= "4.14" } "ppx_deriving" "octez-libs" - "zarith" { >= "1.12" & < "1.13" } + "zarith" { >= "1.13" & < "1.14" } "lwt" { >= "5.7.0" } "ctypes" { >= "0.18.0" } "ctypes-foreign" { >= "0.18.0" } diff --git a/opam/octez-libs.opam b/opam/octez-libs.opam index eb8702c1e7b51b0399483f56a1e9ccf0fab53781..07329097ce8282d90b41872bec33bfb7e6a8c362 100644 --- a/opam/octez-libs.opam +++ b/opam/octez-libs.opam @@ -19,8 +19,8 @@ depends: [ "data-encoding" { >= "0.7.1" & < "1.0.0" } "ppx_expect" "hex" { >= "1.3.0" } - "zarith" { >= "1.12" & < "1.13" } - "zarith_stubs_js" + "zarith" { >= "1.13" & < "1.14" } + "zarith_stubs_js" { >= "0.16.1" } "aches" { >= "1.0.0" } "seqes" { >= "0.2" } "lwt-canceler" { >= "0.3" & < "0.4" } diff --git a/opam/octez-proto-libs.opam b/opam/octez-proto-libs.opam index dcdd3a77549d97de25bdef23fdd04d3091267705..51f9878ae3ee6c28ddfedd2151ca6a2399f42609 100644 --- a/opam/octez-proto-libs.opam +++ b/opam/octez-proto-libs.opam @@ -14,8 +14,8 @@ depends: [ "octez-l2-libs" "data-encoding" { >= "0.7.1" & < "1.0.0" } "bls12-381" - "zarith" { >= "1.12" & < "1.13" } - "zarith_stubs_js" + "zarith" { >= "1.13" & < "1.14" } + "zarith_stubs_js" { >= "0.16.1" } "class_group_vdf" { >= "0.0.4" } "aches" { >= "1.0.0" } "aches-lwt" { >= "1.0.0" } diff --git a/opam/tezos-micheline-rewriting.opam b/opam/tezos-micheline-rewriting.opam index 8add99b5a33b7675c41d125b00f953ff4ca4b23f..d0b421e2206a2f5670e78fdb90467963c248e9a7 100644 --- a/opam/tezos-micheline-rewriting.opam +++ b/opam/tezos-micheline-rewriting.opam @@ -10,8 +10,8 @@ license: "MIT" depends: [ "dune" { >= "3.11.1" } "ocaml" { >= "4.14" } - "zarith" { >= "1.12" & < "1.13" } - "zarith_stubs_js" + "zarith" { >= "1.13" & < "1.14" } + "zarith_stubs_js" { >= "0.16.1" } "octez-libs" "tezt" { with-test & >= "4.0.0" & < "5.0.0" } "tezos-protocol-alpha" {with-test} diff --git a/opam/virtual/octez-deps.opam b/opam/virtual/octez-deps.opam index d484fd4e56c6e9d680ef0d6803fa91673e1d52d3..b085e0de263a602efa535437f6f7383e3ac2a862 100644 --- a/opam/virtual/octez-deps.opam +++ b/opam/virtual/octez-deps.opam @@ -107,8 +107,8 @@ depends: [ "uri" { >= "3.1.0" } "uutf" "yaml" { >= "3.1.0" } - "zarith" { >= "1.12" & < "1.13" } - "zarith_stubs_js" + "zarith" { >= "1.13" & < "1.14" } + "zarith_stubs_js" { >= "0.16.1" } ] conflicts: [ "checkseum" { = "0.5.0" } diff --git a/scripts/version.sh b/scripts/version.sh index 4e130e6145a997b761d36f739a17eb7d578534cf..770d6b27a8cfce335e7f348f53c5c760208383a1 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -31,7 +31,7 @@ export full_opam_repository_tag=2314da5646931ec7f643bdc9aaa39177971ac857 ## opam_repository is an additional, tezos-specific opam repository. ## This value MUST be the same as `build_deps_image_version` in `.gitlab-ci.yml` export opam_repository_url=https://gitlab.com/tezos/opam-repository -export opam_repository_tag="${OPAM_REPOSITORY_TAG:-b9a9313e3610545ac5c26e6f6d9cde9f63e32987}" +export opam_repository_tag="${OPAM_REPOSITORY_TAG:-216c0f260dd672aef71ac769d1435c4f2785db97}" export opam_repository_git="$opam_repository_url.git" export opam_repository="$opam_repository_git"\#"$opam_repository_tag" diff --git a/src/lib_protocol_compiler/dune b/src/lib_protocol_compiler/dune index 9e4300a4f68ff819c50e3bf528d834395325b3d1..24d95fdc0a25a611712940b1e375b625f472f66b 100644 --- a/src/lib_protocol_compiler/dune +++ b/src/lib_protocol_compiler/dune @@ -67,7 +67,7 @@ (action (write-file %{targets} - "let warnings = \"+a-4-40..42-44-45-48-58-60-67-69-70\""))) + "let warnings = \"+a-4-40..42-44-45-48-60-67-69-70\""))) (library (name octez_protocol_compiler_native) diff --git a/src/lib_protocol_environment/sigs/v1.ml b/src/lib_protocol_environment/sigs/v1.ml index 3d13f7ee82f26d74d6d6586a4b5f19f209d75886..823a15c132ddd0dcfe0463c0849f848d818ded97 100644 --- a/src/lib_protocol_environment/sigs/v1.ml +++ b/src/lib_protocol_environment/sigs/v1.ml @@ -2945,21 +2945,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v1/z.mli b/src/lib_protocol_environment/sigs/v1/z.mli index b31519b726287c4c114c4ca52d125002afde0535..5361baec1fa4ace744cef331cab6512993acb7bd 100644 --- a/src/lib_protocol_environment/sigs/v1/z.mli +++ b/src/lib_protocol_environment/sigs/v1/z.mli @@ -435,21 +435,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v10.ml b/src/lib_protocol_environment/sigs/v10.ml index 4462553c534598c161fabb7d11055f84854895a1..e44d0ac90ce951d6ef01adf8fbbf56c84dc9d74e 100644 --- a/src/lib_protocol_environment/sigs/v10.ml +++ b/src/lib_protocol_environment/sigs/v10.ml @@ -2857,21 +2857,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v10/z.mli b/src/lib_protocol_environment/sigs/v10/z.mli index bc93f0cdcd0a4018f15dd4a6c783617c1acb11c8..adbc20dbe8124960b127848d225e1a0972babec6 100644 --- a/src/lib_protocol_environment/sigs/v10/z.mli +++ b/src/lib_protocol_environment/sigs/v10/z.mli @@ -435,21 +435,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v11.ml b/src/lib_protocol_environment/sigs/v11.ml index ae6b446a897a3fdcfad6384431ff1b29d0bf0fd6..76285713d1fe724c1f861f3ba7bef26e5e962eb4 100644 --- a/src/lib_protocol_environment/sigs/v11.ml +++ b/src/lib_protocol_environment/sigs/v11.ml @@ -2491,10 +2491,10 @@ external of_int: int -> t = "%identity" (** Converts from a base integer. *) external of_int32: int32 -> t = "ml_z_of_int32" -(** Converts from a 32-bit integer. *) +(** Converts from a 32-bit (signed) integer. *) external of_int64: int64 -> t = "ml_z_of_int64" -(** Converts from a 64-bit integer. *) +(** Converts from a 64-bit (signed) integer. *) val of_string: string -> t (** Converts a string to an integer. @@ -2512,7 +2512,8 @@ val of_string: string -> t val of_substring : string -> pos:int -> len:int -> t (** [of_substring s ~pos ~len] is the same as [of_string (String.sub s pos len)] - *) + @since 1.4 +*) val of_string_base: int -> string -> t (** Parses a number represented as a string in the specified base, @@ -2525,6 +2526,7 @@ external of_substring_base = "ml_z_of_substring_base" (** [of_substring_base base s ~pos ~len] is the same as [of_string_base base (String.sub s pos len)] + @since 1.4 *) @@ -2609,12 +2611,14 @@ external divisible: t -> t -> bool = "ml_z_divisible" (** [divisible a b] returns [true] if [a] is exactly divisible by [b]. Unlike the other division functions, [b = 0] is accepted (only 0 is considered divisible by 0). + @since 1.10 *) external congruent: t -> t -> t -> bool = "ml_z_congruent" (** [congruent a b c] returns [true] if [a] is congruent to [b] modulo [c]. Unlike the other division functions, [c = 0] is accepted (only equal numbers are considered equal congruent 0). + @since 1.10 *) @@ -2665,7 +2669,9 @@ external numbits: t -> int = "ml_z_numbits" [@@noalloc] If [x] is zero, [numbits x] returns 0. Otherwise, [numbits x] returns a positive integer [n] such that [2^{n-1} <= |x| < 2^n]. Note that [numbits] is defined - for negative arguments, and that [numbits (-x) = numbits x]. *) + for negative arguments, and that [numbits (-x) = numbits x]. + @since 1.4 +*) external trailing_zeros: t -> int = "ml_z_trailing_zeros" [@@noalloc] (** Returns the number of trailing 0 bits in the given number. @@ -2673,13 +2679,17 @@ external trailing_zeros: t -> int = "ml_z_trailing_zeros" [@@noalloc] Otherwise, [trailing_zeros x] returns a nonnegative integer [n] which is the largest [n] such that [2^n] divides [x] evenly. Note that [trailing_zeros] is defined for negative arguments, - and that [trailing_zeros (-x) = trailing_zeros x]. *) + and that [trailing_zeros (-x) = trailing_zeros x]. + @since 1.4 +*) val testbit: t -> int -> bool (** [testbit x n] return the value of bit number [n] in [x]: [true] if the bit is 1, [false] if the bit is 0. Bits are numbered from 0. Raise [Invalid_argument] if [n] - is negative. *) + is negative. + @since 1.4 +*) external popcount: t -> int = "ml_z_popcount" (** Counts the number of bits set. @@ -2700,13 +2710,16 @@ external hamdist: t -> t -> int = "ml_z_hamdist" *) val to_int: t -> int -(** Converts to a base integer. May raise an [Overflow]. *) +(** Converts to a signed OCaml [int]. + Raises an [Overflow] if the value does not fit in a signed OCaml [int]. *) external to_int32: t -> int32 = "ml_z_to_int32" -(** Converts to a 32-bit integer. May raise [Overflow]. *) +(** Converts to a signed 32-bit integer [int32]. + Raises an [Overflow] if the value does not fit in a signed [int32]. *) external to_int64: t -> int64 = "ml_z_to_int64" -(** Converts to a 64-bit integer. May raise [Overflow]. *) +(** Converts to a signed 64-bit integer [int64]. + Raises an [Overflow] if the value does not fit in a signed [int64]. *) val to_string: t -> string (** Gives a human-readable, decimal string representation of the argument. *) @@ -2740,13 +2753,13 @@ external format: string -> t -> string = "ml_z_format" *) external fits_int: t -> bool = "ml_z_fits_int" [@@noalloc] -(** Whether the argument fits in a regular [int]. *) +(** Whether the argument fits in an OCaml signed [int]. *) external fits_int32: t -> bool = "ml_z_fits_int32" [@@noalloc] -(** Whether the argument fits in an [int32]. *) +(** Whether the argument fits in a signed [int32]. *) external fits_int64: t -> bool = "ml_z_fits_int64" [@@noalloc] -(** Whether the argument fits in an [int64]. *) +(** Whether the argument fits in a signed [int64]. *) (** {1 Printing} *) @@ -2795,10 +2808,14 @@ val max: t -> t -> t (** Returns the maximum of its arguments. *) val is_even: t -> bool -(** Returns true if the argument is even (divisible by 2), false if odd. *) +(** Returns true if the argument is even (divisible by 2), false if odd. + @since 1.4 +*) val is_odd: t -> bool -(** Returns true if the argument is odd, false if even. *) +(** Returns true if the argument is odd, false if even. + @since 1.4 +*) (** {1 Powers} *) @@ -2832,7 +2849,7 @@ external rootrem: t -> int -> t * t = "ml_z_rootrem" [x-root**n]. [n] must be positive and, if [n] is even, then [x] must be nonnegative. Otherwise, an [Invalid_argument] is raised. - *) + @since 1.10 *) external perfect_power: t -> bool = "ml_z_perfect_power" (** True if the argument has the form [a^b], with [b>1] *) @@ -2844,13 +2861,17 @@ val log2: t -> int (** Returns the base-2 logarithm of its argument, rounded down to an integer. If [x] is positive, [log2 x] returns the largest [n] such that [2^n <= x]. If [x] is negative or zero, [log2 x] raise - the [Invalid_argument] exception. *) + the [Invalid_argument] exception. + @since 1.4 +*) val log2up: t -> int (** Returns the base-2 logarithm of its argument, rounded up to an integer. If [x] is positive, [log2up x] returns the smallest [n] such that [x <= 2^n]. If [x] is negative or zero, [log2up x] raise - the [Invalid_argument] exception. *) + the [Invalid_argument] exception. + @since 1.4 +*) (** {1 Representation} *) diff --git a/src/lib_protocol_environment/sigs/v11/z.mli b/src/lib_protocol_environment/sigs/v11/z.mli index 9653bf7c0097524a59030957337bedf1fd36b487..d05230601af04ec878b68262940779be08b9d64f 100644 --- a/src/lib_protocol_environment/sigs/v11/z.mli +++ b/src/lib_protocol_environment/sigs/v11/z.mli @@ -69,10 +69,10 @@ external of_int: int -> t = "%identity" (** Converts from a base integer. *) external of_int32: int32 -> t = "ml_z_of_int32" -(** Converts from a 32-bit integer. *) +(** Converts from a 32-bit (signed) integer. *) external of_int64: int64 -> t = "ml_z_of_int64" -(** Converts from a 64-bit integer. *) +(** Converts from a 64-bit (signed) integer. *) val of_string: string -> t (** Converts a string to an integer. @@ -90,7 +90,8 @@ val of_string: string -> t val of_substring : string -> pos:int -> len:int -> t (** [of_substring s ~pos ~len] is the same as [of_string (String.sub s pos len)] - *) + @since 1.4 +*) val of_string_base: int -> string -> t (** Parses a number represented as a string in the specified base, @@ -103,6 +104,7 @@ external of_substring_base = "ml_z_of_substring_base" (** [of_substring_base base s ~pos ~len] is the same as [of_string_base base (String.sub s pos len)] + @since 1.4 *) @@ -187,12 +189,14 @@ external divisible: t -> t -> bool = "ml_z_divisible" (** [divisible a b] returns [true] if [a] is exactly divisible by [b]. Unlike the other division functions, [b = 0] is accepted (only 0 is considered divisible by 0). + @since 1.10 *) external congruent: t -> t -> t -> bool = "ml_z_congruent" (** [congruent a b c] returns [true] if [a] is congruent to [b] modulo [c]. Unlike the other division functions, [c = 0] is accepted (only equal numbers are considered equal congruent 0). + @since 1.10 *) @@ -243,7 +247,9 @@ external numbits: t -> int = "ml_z_numbits" [@@noalloc] If [x] is zero, [numbits x] returns 0. Otherwise, [numbits x] returns a positive integer [n] such that [2^{n-1} <= |x| < 2^n]. Note that [numbits] is defined - for negative arguments, and that [numbits (-x) = numbits x]. *) + for negative arguments, and that [numbits (-x) = numbits x]. + @since 1.4 +*) external trailing_zeros: t -> int = "ml_z_trailing_zeros" [@@noalloc] (** Returns the number of trailing 0 bits in the given number. @@ -251,13 +257,17 @@ external trailing_zeros: t -> int = "ml_z_trailing_zeros" [@@noalloc] Otherwise, [trailing_zeros x] returns a nonnegative integer [n] which is the largest [n] such that [2^n] divides [x] evenly. Note that [trailing_zeros] is defined for negative arguments, - and that [trailing_zeros (-x) = trailing_zeros x]. *) + and that [trailing_zeros (-x) = trailing_zeros x]. + @since 1.4 +*) val testbit: t -> int -> bool (** [testbit x n] return the value of bit number [n] in [x]: [true] if the bit is 1, [false] if the bit is 0. Bits are numbered from 0. Raise [Invalid_argument] if [n] - is negative. *) + is negative. + @since 1.4 +*) external popcount: t -> int = "ml_z_popcount" (** Counts the number of bits set. @@ -278,13 +288,16 @@ external hamdist: t -> t -> int = "ml_z_hamdist" *) val to_int: t -> int -(** Converts to a base integer. May raise an [Overflow]. *) +(** Converts to a signed OCaml [int]. + Raises an [Overflow] if the value does not fit in a signed OCaml [int]. *) external to_int32: t -> int32 = "ml_z_to_int32" -(** Converts to a 32-bit integer. May raise [Overflow]. *) +(** Converts to a signed 32-bit integer [int32]. + Raises an [Overflow] if the value does not fit in a signed [int32]. *) external to_int64: t -> int64 = "ml_z_to_int64" -(** Converts to a 64-bit integer. May raise [Overflow]. *) +(** Converts to a signed 64-bit integer [int64]. + Raises an [Overflow] if the value does not fit in a signed [int64]. *) val to_string: t -> string (** Gives a human-readable, decimal string representation of the argument. *) @@ -318,13 +331,13 @@ external format: string -> t -> string = "ml_z_format" *) external fits_int: t -> bool = "ml_z_fits_int" [@@noalloc] -(** Whether the argument fits in a regular [int]. *) +(** Whether the argument fits in an OCaml signed [int]. *) external fits_int32: t -> bool = "ml_z_fits_int32" [@@noalloc] -(** Whether the argument fits in an [int32]. *) +(** Whether the argument fits in a signed [int32]. *) external fits_int64: t -> bool = "ml_z_fits_int64" [@@noalloc] -(** Whether the argument fits in an [int64]. *) +(** Whether the argument fits in a signed [int64]. *) (** {1 Printing} *) @@ -373,10 +386,14 @@ val max: t -> t -> t (** Returns the maximum of its arguments. *) val is_even: t -> bool -(** Returns true if the argument is even (divisible by 2), false if odd. *) +(** Returns true if the argument is even (divisible by 2), false if odd. + @since 1.4 +*) val is_odd: t -> bool -(** Returns true if the argument is odd, false if even. *) +(** Returns true if the argument is odd, false if even. + @since 1.4 +*) (** {1 Powers} *) @@ -410,7 +427,7 @@ external rootrem: t -> int -> t * t = "ml_z_rootrem" [x-root**n]. [n] must be positive and, if [n] is even, then [x] must be nonnegative. Otherwise, an [Invalid_argument] is raised. - *) + @since 1.10 *) external perfect_power: t -> bool = "ml_z_perfect_power" (** True if the argument has the form [a^b], with [b>1] *) @@ -422,13 +439,17 @@ val log2: t -> int (** Returns the base-2 logarithm of its argument, rounded down to an integer. If [x] is positive, [log2 x] returns the largest [n] such that [2^n <= x]. If [x] is negative or zero, [log2 x] raise - the [Invalid_argument] exception. *) + the [Invalid_argument] exception. + @since 1.4 +*) val log2up: t -> int (** Returns the base-2 logarithm of its argument, rounded up to an integer. If [x] is positive, [log2up x] returns the smallest [n] such that [x <= 2^n]. If [x] is negative or zero, [log2up x] raise - the [Invalid_argument] exception. *) + the [Invalid_argument] exception. + @since 1.4 +*) (** {1 Representation} *) diff --git a/src/lib_protocol_environment/sigs/v12.ml b/src/lib_protocol_environment/sigs/v12.ml index f26b8cb133f57851fa5ea325fc20150089763a8a..6fde91b06a3812ddea0a2ab8b37fa581ed58cce9 100644 --- a/src/lib_protocol_environment/sigs/v12.ml +++ b/src/lib_protocol_environment/sigs/v12.ml @@ -2491,10 +2491,10 @@ external of_int: int -> t = "%identity" (** Converts from a base integer. *) external of_int32: int32 -> t = "ml_z_of_int32" -(** Converts from a 32-bit integer. *) +(** Converts from a 32-bit (signed) integer. *) external of_int64: int64 -> t = "ml_z_of_int64" -(** Converts from a 64-bit integer. *) +(** Converts from a 64-bit (signed) integer. *) val of_string: string -> t (** Converts a string to an integer. @@ -2512,7 +2512,8 @@ val of_string: string -> t val of_substring : string -> pos:int -> len:int -> t (** [of_substring s ~pos ~len] is the same as [of_string (String.sub s pos len)] - *) + @since 1.4 +*) val of_string_base: int -> string -> t (** Parses a number represented as a string in the specified base, @@ -2525,6 +2526,7 @@ external of_substring_base = "ml_z_of_substring_base" (** [of_substring_base base s ~pos ~len] is the same as [of_string_base base (String.sub s pos len)] + @since 1.4 *) @@ -2609,12 +2611,14 @@ external divisible: t -> t -> bool = "ml_z_divisible" (** [divisible a b] returns [true] if [a] is exactly divisible by [b]. Unlike the other division functions, [b = 0] is accepted (only 0 is considered divisible by 0). + @since 1.10 *) external congruent: t -> t -> t -> bool = "ml_z_congruent" (** [congruent a b c] returns [true] if [a] is congruent to [b] modulo [c]. Unlike the other division functions, [c = 0] is accepted (only equal numbers are considered equal congruent 0). + @since 1.10 *) @@ -2665,7 +2669,9 @@ external numbits: t -> int = "ml_z_numbits" [@@noalloc] If [x] is zero, [numbits x] returns 0. Otherwise, [numbits x] returns a positive integer [n] such that [2^{n-1} <= |x| < 2^n]. Note that [numbits] is defined - for negative arguments, and that [numbits (-x) = numbits x]. *) + for negative arguments, and that [numbits (-x) = numbits x]. + @since 1.4 +*) external trailing_zeros: t -> int = "ml_z_trailing_zeros" [@@noalloc] (** Returns the number of trailing 0 bits in the given number. @@ -2673,13 +2679,17 @@ external trailing_zeros: t -> int = "ml_z_trailing_zeros" [@@noalloc] Otherwise, [trailing_zeros x] returns a nonnegative integer [n] which is the largest [n] such that [2^n] divides [x] evenly. Note that [trailing_zeros] is defined for negative arguments, - and that [trailing_zeros (-x) = trailing_zeros x]. *) + and that [trailing_zeros (-x) = trailing_zeros x]. + @since 1.4 +*) val testbit: t -> int -> bool (** [testbit x n] return the value of bit number [n] in [x]: [true] if the bit is 1, [false] if the bit is 0. Bits are numbered from 0. Raise [Invalid_argument] if [n] - is negative. *) + is negative. + @since 1.4 +*) external popcount: t -> int = "ml_z_popcount" (** Counts the number of bits set. @@ -2700,13 +2710,16 @@ external hamdist: t -> t -> int = "ml_z_hamdist" *) val to_int: t -> int -(** Converts to a base integer. May raise an [Overflow]. *) +(** Converts to a signed OCaml [int]. + Raises an [Overflow] if the value does not fit in a signed OCaml [int]. *) external to_int32: t -> int32 = "ml_z_to_int32" -(** Converts to a 32-bit integer. May raise [Overflow]. *) +(** Converts to a signed 32-bit integer [int32]. + Raises an [Overflow] if the value does not fit in a signed [int32]. *) external to_int64: t -> int64 = "ml_z_to_int64" -(** Converts to a 64-bit integer. May raise [Overflow]. *) +(** Converts to a signed 64-bit integer [int64]. + Raises an [Overflow] if the value does not fit in a signed [int64]. *) val to_string: t -> string (** Gives a human-readable, decimal string representation of the argument. *) @@ -2740,13 +2753,13 @@ external format: string -> t -> string = "ml_z_format" *) external fits_int: t -> bool = "ml_z_fits_int" [@@noalloc] -(** Whether the argument fits in a regular [int]. *) +(** Whether the argument fits in an OCaml signed [int]. *) external fits_int32: t -> bool = "ml_z_fits_int32" [@@noalloc] -(** Whether the argument fits in an [int32]. *) +(** Whether the argument fits in a signed [int32]. *) external fits_int64: t -> bool = "ml_z_fits_int64" [@@noalloc] -(** Whether the argument fits in an [int64]. *) +(** Whether the argument fits in a signed [int64]. *) (** {1 Printing} *) @@ -2795,10 +2808,14 @@ val max: t -> t -> t (** Returns the maximum of its arguments. *) val is_even: t -> bool -(** Returns true if the argument is even (divisible by 2), false if odd. *) +(** Returns true if the argument is even (divisible by 2), false if odd. + @since 1.4 +*) val is_odd: t -> bool -(** Returns true if the argument is odd, false if even. *) +(** Returns true if the argument is odd, false if even. + @since 1.4 +*) (** {1 Powers} *) @@ -2832,7 +2849,7 @@ external rootrem: t -> int -> t * t = "ml_z_rootrem" [x-root**n]. [n] must be positive and, if [n] is even, then [x] must be nonnegative. Otherwise, an [Invalid_argument] is raised. - *) + @since 1.10 *) external perfect_power: t -> bool = "ml_z_perfect_power" (** True if the argument has the form [a^b], with [b>1] *) @@ -2844,13 +2861,17 @@ val log2: t -> int (** Returns the base-2 logarithm of its argument, rounded down to an integer. If [x] is positive, [log2 x] returns the largest [n] such that [2^n <= x]. If [x] is negative or zero, [log2 x] raise - the [Invalid_argument] exception. *) + the [Invalid_argument] exception. + @since 1.4 +*) val log2up: t -> int (** Returns the base-2 logarithm of its argument, rounded up to an integer. If [x] is positive, [log2up x] returns the smallest [n] such that [x <= 2^n]. If [x] is negative or zero, [log2up x] raise - the [Invalid_argument] exception. *) + the [Invalid_argument] exception. + @since 1.4 +*) (** {1 Representation} *) diff --git a/src/lib_protocol_environment/sigs/v12/z.mli b/src/lib_protocol_environment/sigs/v12/z.mli index 9653bf7c0097524a59030957337bedf1fd36b487..d05230601af04ec878b68262940779be08b9d64f 100644 --- a/src/lib_protocol_environment/sigs/v12/z.mli +++ b/src/lib_protocol_environment/sigs/v12/z.mli @@ -69,10 +69,10 @@ external of_int: int -> t = "%identity" (** Converts from a base integer. *) external of_int32: int32 -> t = "ml_z_of_int32" -(** Converts from a 32-bit integer. *) +(** Converts from a 32-bit (signed) integer. *) external of_int64: int64 -> t = "ml_z_of_int64" -(** Converts from a 64-bit integer. *) +(** Converts from a 64-bit (signed) integer. *) val of_string: string -> t (** Converts a string to an integer. @@ -90,7 +90,8 @@ val of_string: string -> t val of_substring : string -> pos:int -> len:int -> t (** [of_substring s ~pos ~len] is the same as [of_string (String.sub s pos len)] - *) + @since 1.4 +*) val of_string_base: int -> string -> t (** Parses a number represented as a string in the specified base, @@ -103,6 +104,7 @@ external of_substring_base = "ml_z_of_substring_base" (** [of_substring_base base s ~pos ~len] is the same as [of_string_base base (String.sub s pos len)] + @since 1.4 *) @@ -187,12 +189,14 @@ external divisible: t -> t -> bool = "ml_z_divisible" (** [divisible a b] returns [true] if [a] is exactly divisible by [b]. Unlike the other division functions, [b = 0] is accepted (only 0 is considered divisible by 0). + @since 1.10 *) external congruent: t -> t -> t -> bool = "ml_z_congruent" (** [congruent a b c] returns [true] if [a] is congruent to [b] modulo [c]. Unlike the other division functions, [c = 0] is accepted (only equal numbers are considered equal congruent 0). + @since 1.10 *) @@ -243,7 +247,9 @@ external numbits: t -> int = "ml_z_numbits" [@@noalloc] If [x] is zero, [numbits x] returns 0. Otherwise, [numbits x] returns a positive integer [n] such that [2^{n-1} <= |x| < 2^n]. Note that [numbits] is defined - for negative arguments, and that [numbits (-x) = numbits x]. *) + for negative arguments, and that [numbits (-x) = numbits x]. + @since 1.4 +*) external trailing_zeros: t -> int = "ml_z_trailing_zeros" [@@noalloc] (** Returns the number of trailing 0 bits in the given number. @@ -251,13 +257,17 @@ external trailing_zeros: t -> int = "ml_z_trailing_zeros" [@@noalloc] Otherwise, [trailing_zeros x] returns a nonnegative integer [n] which is the largest [n] such that [2^n] divides [x] evenly. Note that [trailing_zeros] is defined for negative arguments, - and that [trailing_zeros (-x) = trailing_zeros x]. *) + and that [trailing_zeros (-x) = trailing_zeros x]. + @since 1.4 +*) val testbit: t -> int -> bool (** [testbit x n] return the value of bit number [n] in [x]: [true] if the bit is 1, [false] if the bit is 0. Bits are numbered from 0. Raise [Invalid_argument] if [n] - is negative. *) + is negative. + @since 1.4 +*) external popcount: t -> int = "ml_z_popcount" (** Counts the number of bits set. @@ -278,13 +288,16 @@ external hamdist: t -> t -> int = "ml_z_hamdist" *) val to_int: t -> int -(** Converts to a base integer. May raise an [Overflow]. *) +(** Converts to a signed OCaml [int]. + Raises an [Overflow] if the value does not fit in a signed OCaml [int]. *) external to_int32: t -> int32 = "ml_z_to_int32" -(** Converts to a 32-bit integer. May raise [Overflow]. *) +(** Converts to a signed 32-bit integer [int32]. + Raises an [Overflow] if the value does not fit in a signed [int32]. *) external to_int64: t -> int64 = "ml_z_to_int64" -(** Converts to a 64-bit integer. May raise [Overflow]. *) +(** Converts to a signed 64-bit integer [int64]. + Raises an [Overflow] if the value does not fit in a signed [int64]. *) val to_string: t -> string (** Gives a human-readable, decimal string representation of the argument. *) @@ -318,13 +331,13 @@ external format: string -> t -> string = "ml_z_format" *) external fits_int: t -> bool = "ml_z_fits_int" [@@noalloc] -(** Whether the argument fits in a regular [int]. *) +(** Whether the argument fits in an OCaml signed [int]. *) external fits_int32: t -> bool = "ml_z_fits_int32" [@@noalloc] -(** Whether the argument fits in an [int32]. *) +(** Whether the argument fits in a signed [int32]. *) external fits_int64: t -> bool = "ml_z_fits_int64" [@@noalloc] -(** Whether the argument fits in an [int64]. *) +(** Whether the argument fits in a signed [int64]. *) (** {1 Printing} *) @@ -373,10 +386,14 @@ val max: t -> t -> t (** Returns the maximum of its arguments. *) val is_even: t -> bool -(** Returns true if the argument is even (divisible by 2), false if odd. *) +(** Returns true if the argument is even (divisible by 2), false if odd. + @since 1.4 +*) val is_odd: t -> bool -(** Returns true if the argument is odd, false if even. *) +(** Returns true if the argument is odd, false if even. + @since 1.4 +*) (** {1 Powers} *) @@ -410,7 +427,7 @@ external rootrem: t -> int -> t * t = "ml_z_rootrem" [x-root**n]. [n] must be positive and, if [n] is even, then [x] must be nonnegative. Otherwise, an [Invalid_argument] is raised. - *) + @since 1.10 *) external perfect_power: t -> bool = "ml_z_perfect_power" (** True if the argument has the form [a^b], with [b>1] *) @@ -422,13 +439,17 @@ val log2: t -> int (** Returns the base-2 logarithm of its argument, rounded down to an integer. If [x] is positive, [log2 x] returns the largest [n] such that [2^n <= x]. If [x] is negative or zero, [log2 x] raise - the [Invalid_argument] exception. *) + the [Invalid_argument] exception. + @since 1.4 +*) val log2up: t -> int (** Returns the base-2 logarithm of its argument, rounded up to an integer. If [x] is positive, [log2up x] returns the smallest [n] such that [x <= 2^n]. If [x] is negative or zero, [log2up x] raise - the [Invalid_argument] exception. *) + the [Invalid_argument] exception. + @since 1.4 +*) (** {1 Representation} *) diff --git a/src/lib_protocol_environment/sigs/v2.ml b/src/lib_protocol_environment/sigs/v2.ml index fb8b992a9ba4ac37b38b64f4323389d2142e1d11..3970a734e8cfd93a034778d381bc0ea8c007d8fe 100644 --- a/src/lib_protocol_environment/sigs/v2.ml +++ b/src/lib_protocol_environment/sigs/v2.ml @@ -2979,21 +2979,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v2/z.mli b/src/lib_protocol_environment/sigs/v2/z.mli index b31519b726287c4c114c4ca52d125002afde0535..5361baec1fa4ace744cef331cab6512993acb7bd 100644 --- a/src/lib_protocol_environment/sigs/v2/z.mli +++ b/src/lib_protocol_environment/sigs/v2/z.mli @@ -435,21 +435,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v3.ml b/src/lib_protocol_environment/sigs/v3.ml index 564064b803b4e258ecb862372dc51b2858e89f30..e2f74b3f37fb4a84007c9c963da880afba2fe132 100644 --- a/src/lib_protocol_environment/sigs/v3.ml +++ b/src/lib_protocol_environment/sigs/v3.ml @@ -2699,21 +2699,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v3/z.mli b/src/lib_protocol_environment/sigs/v3/z.mli index b31519b726287c4c114c4ca52d125002afde0535..5361baec1fa4ace744cef331cab6512993acb7bd 100644 --- a/src/lib_protocol_environment/sigs/v3/z.mli +++ b/src/lib_protocol_environment/sigs/v3/z.mli @@ -435,21 +435,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v4.ml b/src/lib_protocol_environment/sigs/v4.ml index 4f2e468ab803726eaa0c1f4d58b292f3f38d6084..af1c48796f5682f3f80831b13f35a0465e07dfd7 100644 --- a/src/lib_protocol_environment/sigs/v4.ml +++ b/src/lib_protocol_environment/sigs/v4.ml @@ -2708,21 +2708,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v4/z.mli b/src/lib_protocol_environment/sigs/v4/z.mli index e04b459a7f0ea4b602d2be2a6f104924483f46cc..201fa62236eda158986bbc914afd98eb4f5ba11b 100644 --- a/src/lib_protocol_environment/sigs/v4/z.mli +++ b/src/lib_protocol_environment/sigs/v4/z.mli @@ -435,21 +435,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v5.ml b/src/lib_protocol_environment/sigs/v5.ml index d43a15ccc721980d0b3599a2dc8e7f4cdbdfdb00..36f057c0322ba4518c385d45111a28035bdbcb71 100644 --- a/src/lib_protocol_environment/sigs/v5.ml +++ b/src/lib_protocol_environment/sigs/v5.ml @@ -2799,21 +2799,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v5/z.mli b/src/lib_protocol_environment/sigs/v5/z.mli index e04b459a7f0ea4b602d2be2a6f104924483f46cc..201fa62236eda158986bbc914afd98eb4f5ba11b 100644 --- a/src/lib_protocol_environment/sigs/v5/z.mli +++ b/src/lib_protocol_environment/sigs/v5/z.mli @@ -435,21 +435,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v6.ml b/src/lib_protocol_environment/sigs/v6.ml index 2056296fd2e015f1e2efcb420b7269d6fd1b199b..9e31c63aa9461aaeb855975f0c09a97de23694d8 100644 --- a/src/lib_protocol_environment/sigs/v6.ml +++ b/src/lib_protocol_environment/sigs/v6.ml @@ -2799,21 +2799,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v6/z.mli b/src/lib_protocol_environment/sigs/v6/z.mli index e04b459a7f0ea4b602d2be2a6f104924483f46cc..201fa62236eda158986bbc914afd98eb4f5ba11b 100644 --- a/src/lib_protocol_environment/sigs/v6/z.mli +++ b/src/lib_protocol_environment/sigs/v6/z.mli @@ -435,21 +435,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v7.ml b/src/lib_protocol_environment/sigs/v7.ml index db54ebbef4e433c58b1e5744056b64e9ebc7f3c4..8324fd1d44ebe124e1bd0c18cb0d5165a883185a 100644 --- a/src/lib_protocol_environment/sigs/v7.ml +++ b/src/lib_protocol_environment/sigs/v7.ml @@ -2799,21 +2799,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v7/z.mli b/src/lib_protocol_environment/sigs/v7/z.mli index bc93f0cdcd0a4018f15dd4a6c783617c1acb11c8..adbc20dbe8124960b127848d225e1a0972babec6 100644 --- a/src/lib_protocol_environment/sigs/v7/z.mli +++ b/src/lib_protocol_environment/sigs/v7/z.mli @@ -435,21 +435,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v8.ml b/src/lib_protocol_environment/sigs/v8.ml index e10325fec77989fc2554d28eb18d29d8f2cf60f9..2a4bc4088fe04314cec43bf850fa6ccff37084d4 100644 --- a/src/lib_protocol_environment/sigs/v8.ml +++ b/src/lib_protocol_environment/sigs/v8.ml @@ -2857,21 +2857,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v8/z.mli b/src/lib_protocol_environment/sigs/v8/z.mli index bc93f0cdcd0a4018f15dd4a6c783617c1acb11c8..adbc20dbe8124960b127848d225e1a0972babec6 100644 --- a/src/lib_protocol_environment/sigs/v8/z.mli +++ b/src/lib_protocol_environment/sigs/v8/z.mli @@ -435,21 +435,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v9.ml b/src/lib_protocol_environment/sigs/v9.ml index 92d867725c6dbb506c75d071f1250a6438f610cd..f4b0af547843a51492df498715b55c88e6161146 100644 --- a/src/lib_protocol_environment/sigs/v9.ml +++ b/src/lib_protocol_environment/sigs/v9.ml @@ -2857,21 +2857,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes, diff --git a/src/lib_protocol_environment/sigs/v9/z.mli b/src/lib_protocol_environment/sigs/v9/z.mli index bc93f0cdcd0a4018f15dd4a6c783617c1acb11c8..adbc20dbe8124960b127848d225e1a0972babec6 100644 --- a/src/lib_protocol_environment/sigs/v9/z.mli +++ b/src/lib_protocol_environment/sigs/v9/z.mli @@ -435,21 +435,6 @@ val log2up: t -> int external size: t -> int = "ml_z_size" [@@noalloc] (** Returns the number of machine words used to represent the number. *) -external extract: t -> int -> int -> t = "ml_z_extract" -(** [extract a off len] returns a nonnegative number corresponding to bits - [off] to [off]+[len]-1 of [b]. - Negative [a] are considered in infinite-length 2's complement - representation. - *) - -val signed_extract: t -> int -> int -> t -(** [signed_extract a off len] extracts bits [off] to [off]+[len]-1 of [b], - as [extract] does, then sign-extends bit [len-1] of the result - (that is, bit [off + len - 1] of [a]). The result is between - [- 2{^[len]-1}] (included) and [2{^[len]-1}] (excluded), - and equal to [extract a off len] modulo [2{^len}]. - *) - external to_bits: t -> string = "ml_z_to_bits" (** Returns a binary representation of the argument. The string result should be interpreted as a sequence of bytes,