Module Purity


module Purity: sig .. end
Pure literal elimination.

The pure rule consists in eliminating a literal when its opposite does not occur in the schema/block. ex. P_n is pure in /\i=1..n ~P_i-1 \/ P_i as ~P_n does not occur in the schema. This is not the case of P_n-1 as ~P_n-1 occurs in it.

We have to detect such literals (though this is usually an optimisation, it is here mandatory for looping to occur). This is achieved through the following module.


Author(s): Vincent Aravantinos


type t 
The type of purities. The information to detect pure literals is collected independantly of the detection itself. Hence the need to store it in some way, and so the need for a dedicated type.
type range = Variable.t * Indexes.t * Indexes.t 
The interval of values possibly taken by a variable e.g. (i,1,n) for /\i=1..n S.
val empty : t
The empty purity.
val add : ?range:range option -> lit:Literal.t -> t -> t
Adds a literal, possibly within a given range, to a purity meaning that the returned purity considers this literal as occurring (thus its negation is not pure).
val merge : t -> t -> t
Merges two purities.
val is_pure : cstr:Constraint.t -> pur:t -> Literal.t -> bool
From a constraint and an already computed purity, says if a literal is pure. Notice that the constraint is needed because P_1 is pure in ~P_n /\ ... if n <> 1, but is not if n may equal 1.
module type Purable = sig .. end
The interface of a data structure that can be inspected for pure literals.