[sledge] Reorder Arithmetic interface

Summary: No functional change, just to make the interface easier to read

Reviewed By: jvillard

Differential Revision: D26250513

fbshipit-source-id: f3b07bccc
master
Josh Berdine 4 years ago committed by Facebook GitHub Bot
parent 5704b160bf
commit ae5ef09d9e

@ -5,34 +5,6 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*) *)
(** Arithmetic terms *)
(** An embedding of arithmetic terms [t] into indeterminates [trm]. *)
module type EMBEDDING = sig
type t
type trm
val to_trm : t -> trm
(** Embedding from [t] to [trm]: [to_trm a] is arithmetic term [a]
embedded into an indeterminate term. *)
val get_arith : trm -> t option
(** Partial projection from [trm] to [t]: [get_arith x] is [Some a] iff
[x = to_trm a]. *)
end
(** Indeterminate terms, treated as atomic / variables except when they can
be flattened using {!EMBEDDING.get_arith}. *)
module type TRM = sig
include Comparer.S
val pp : t pp
type var
val vars : t -> var iter
end
(** Arithmetic terms, e.g. polynomials [t] over indeterminate terms [trm] *) (** Arithmetic terms, e.g. polynomials [t] over indeterminate terms [trm] *)
module type S0 = sig module type S0 = sig
type trm type trm
@ -94,6 +66,32 @@ module type S0 = sig
[j]. *) [j]. *)
end end
(** An embedding of arithmetic terms [t] into indeterminates [trm]. *)
module type EMBEDDING = sig
type t
type trm
val to_trm : t -> trm
(** Embedding from [t] to [trm]: [to_trm a] is arithmetic term [a]
embedded into an indeterminate term. *)
val get_arith : trm -> t option
(** Partial projection from [trm] to [t]: [get_arith x] is [Some a] iff
[x = to_trm a]. *)
end
(** Indeterminate terms, treated as atomic / variables except when they can
be flattened using {!EMBEDDING.get_arith}. *)
module type TRM = sig
include Comparer.S
val pp : t pp
type var
val vars : t -> var iter
end
(** Arithmetic terms, where an embedding {!EMBEDDING.get_arith} into (** Arithmetic terms, where an embedding {!EMBEDDING.get_arith} into
indeterminate terms is used to implicitly flatten arithmetic terms that indeterminate terms is used to implicitly flatten arithmetic terms that
are embedded into general terms to the underlying arithmetic term. *) are embedded into general terms to the underlying arithmetic term. *)

Loading…
Cancel
Save