Frama-C API - Nat
Encoding of the Peano arithmetic in OCaml type system. A value of type n nat
contains n
at the value and the type level, allowing to express properties on objects sizes and accesses for example. It is used by the module Linear
to represent vectors and matrices dimensions.
val to_int : 'n nat -> int
The call to_int n
returns an integer equal to n. This function complexity is O(1).
val of_int : int -> positive_or_null option
Returns a positive or null natural. If the given parameter is stricly negative then None
is returned. This function complexity is O(1).
val of_strictly_positive_int : int -> strictly_positive option
Returns a strictly positive natural. If the given parameter is less or equal than zero, then None
is returned. This function complexity is O(1).