blob: 0b4d52708f020cb2436b5a388c13fc30997270dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
(* v * Copyright INRIA, CNRS and contributors *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
module type ZArith = sig
type t
val zero : t
val one : t
val two : t
val add : t -> t -> t
val sub : t -> t -> t
val mul : t -> t -> t
val div : t -> t -> t
val neg : t -> t
val sign : t -> int
val equal : t -> t -> bool
val compare : t -> t -> int
val power_int : t -> int -> t
val quomod : t -> t -> t * t
val ppcm : t -> t -> t
(** [gcd x y] Greatest Common Divisor. Must always return a
positive number *)
val gcd : t -> t -> t
(** [lcm x y] Least Common Multiplier. Must always return a
positive number *)
val lcm : t -> t -> t
val to_string : t -> string
end
module type QArith = sig
module Z : ZArith
type t
val of_int : int -> t
val zero : t
val one : t
val two : t
val ten : t
(** -1 constant *)
val minus_one : t
module Notations : sig
val ( // ) : t -> t -> t
val ( +/ ) : t -> t -> t
val ( -/ ) : t -> t -> t
val ( */ ) : t -> t -> t
val ( =/ ) : t -> t -> bool
val ( <>/ ) : t -> t -> bool
val ( >/ ) : t -> t -> bool
val ( >=/ ) : t -> t -> bool
val ( </ ) : t -> t -> bool
val ( <=/ ) : t -> t -> bool
end
val compare : t -> t -> int
val make : Z.t -> Z.t -> t
val den : t -> Z.t
val num : t -> Z.t
val of_bigint : Z.t -> t
val to_bigint : t -> Z.t
val neg : t -> t
(* val inv : t -> t *)
val max : t -> t -> t
val min : t -> t -> t
val sign : t -> int
val abs : t -> t
val mod_ : t -> t -> t
val floor : t -> t
val ceiling : t -> t
val round : t -> t
val pow2 : int -> t
val pow10 : int -> t
val power : int -> t -> t
val to_string : t -> string
val of_string : string -> t
val to_float : t -> float
end
module Z : ZArith
module Q : QArith with module Z = Z
|