mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 11:15:43 -05:00
Aliased def of negated in Expr_intf
This commit is contained in:
parent
b56e4e3355
commit
eba84fba42
2 changed files with 9 additions and 5 deletions
|
|
@ -4,6 +4,10 @@ Copyright 2014 Guillaume Bury
|
||||||
Copyright 2014 Simon Cruanes
|
Copyright 2014 Simon Cruanes
|
||||||
*)
|
*)
|
||||||
|
|
||||||
|
type negated = Formula_intf.negated =
|
||||||
|
| Negated (* changed sign *)
|
||||||
|
| Same_sign (* kept sign *)
|
||||||
|
|
||||||
module type S = sig
|
module type S = sig
|
||||||
(** Signature of formulas that parametrises the Mcsat Solver Module. *)
|
(** Signature of formulas that parametrises the Mcsat Solver Module. *)
|
||||||
|
|
||||||
|
|
@ -37,7 +41,7 @@ module type S = sig
|
||||||
val neg : Formula.t -> Formula.t
|
val neg : Formula.t -> Formula.t
|
||||||
(** Formula negation *)
|
(** Formula negation *)
|
||||||
|
|
||||||
val norm : Formula.t -> Formula.t * Formula_intf.negated
|
val norm : Formula.t -> Formula.t * negated
|
||||||
(** Returns a 'normalized' form of the formula, possibly negated
|
(** Returns a 'normalized' form of the formula, possibly negated
|
||||||
(in which case return [Negated]).
|
(in which case return [Negated]).
|
||||||
[norm] must be so that [a] and [neg a] normalise to the same formula,
|
[norm] must be so that [a] and [neg a] normalise to the same formula,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ Copyright 2014 Guillaume Bury
|
||||||
Copyright 2014 Simon Cruanes
|
Copyright 2014 Simon Cruanes
|
||||||
*)
|
*)
|
||||||
|
|
||||||
module FI = Formula_intf
|
module I = Formula_intf
|
||||||
|
|
||||||
exception Invalid_var
|
exception Invalid_var
|
||||||
|
|
||||||
|
|
@ -40,9 +40,9 @@ let neg = function
|
||||||
| Distinct (a, b) -> Equal (a, b)
|
| Distinct (a, b) -> Equal (a, b)
|
||||||
|
|
||||||
let norm = function
|
let norm = function
|
||||||
| Prop i -> Prop (abs i), if i < 0 then FI.Negated else FI.Same_sign
|
| Prop i -> Prop (abs i), if i < 0 then I.Negated else I.Same_sign
|
||||||
| Equal (a, b) -> Equal (a, b), FI.Same_sign
|
| Equal (a, b) -> Equal (a, b), I.Same_sign
|
||||||
| Distinct (a, b) -> Equal (a, b), FI.Negated
|
| Distinct (a, b) -> Equal (a, b), I.Negated
|
||||||
|
|
||||||
(* Only used after normalisation, so usual functions should work *)
|
(* Only used after normalisation, so usual functions should work *)
|
||||||
let hash = Hashtbl.hash
|
let hash = Hashtbl.hash
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue