• No results found

4.6 Generalised Anytime Symmetry Detection Algorithm

5.5.1 Widening for Space

As stated in the related work survey in §5.4, the ROBDD approximation algorithms of Shiple [Shi96] and Ravi et al [RMSS98] seek to improve the density of an ROBDD defined as the ratio of minterms in the represented function to the number of nodes in the representing ROBDD. Both algorithms identify the non-dense sub-ROBDDs within an ROBDD and substitute them with other sub-ROBDDs which are denser but possess more models. Ultimately this culminates in a dense over-approximation. Although this approach is well-intended, it has the following distinct disadvantages:

• density comparisons and ROBDD restructuring is limited to those sub-ROBDDs that actually arise in the ROBDD. The structure of the ROBDD to be approx- imated is heavily dependant upon the variable ordering employed (§2.2.1) hence differing approximations will be obtained for different variable orderings,

• although density is a natural measure of the efficiency of an ROBDD represen- tation of a Boolean function, an approximation algorithm that endeavours to increase density alone may produce inaccurate approximations. For instance, suppose that a Boolean function over 8 variables has 27 minterms and is rep- resented by 16 nodes, thus its density is 2167 = 8. The trivial approximation true

can be represented as a single node, and therefore has density 218 = 256, yet this over-approximation conveys no information at all. Thus it is not prudent to base widening on density alone.

The observation is that prime implicants are natural variable order independent candi- dates for reasoning about density whilst retaining accuracy. To illustrate this, consider a Boolean function f ∈ BX and the set of implicants S = {p | p |= f} of f. Observe

that any S′ ⊆S is a sound under-approximation off in the sense that ∨S′ |=f where

∨S′ = W

pS′p. However, different S′, even of the same size, can yield better approx- imations. For instance, consider an implicant p ∈ S and a prime implicant p′ strictly contained within it, that is, p |=p′ and p 6=p′. Then |p′|< |p|. Hence pcontributes

2n−|p′|

minterms to f whereas p contributes only 2n−|p|. Thusp is a better candidate for inclusion inS′ thanp. Moreover, sincep′ is shorter thanp, it is likely to contribute a shorter path in an ROBDD that represents∨S′. The following family of widening op-

erators draw together these ideas to compute a sound over-approximation by combining negation with systematic under-approximation.

Definition 5.1. The family of operators ∇k:BX BX where kN∪ {0} are defined

by∇k(f) =V

{¬p|p∈primes(¬f)∧ |p| ≤k}

We now proceed to prove the properties of the widening ∇k. The proposition asserts that ∇k is anti-monotonic in its parameter k and hence ∇k is uniformly more precise than ∇k1. Furthermore, in the limit, ∇k(f) converges onto f from above. We show

that the widening is also monotonic in its argumentf, that is, for f, f′ ∈BX such that

f |=f′ then∇k(f)|=∇k(f′).

Proposition 5.1. Suppose |X|=n. Then

• Given f ∈BX then f =∇n(f)|=∇n1(f)|=. . .|=∇0(f) =true.

• Given f, f′∈BX such that f |=fand0kn then ∇k(f)|=∇k(f).

• Given f, f′∈BX such that f |=fand0ℓ < k n then ∇k(f)|=∇ℓ(f).

Proof.

• It is well-known that f =W

primes(f) [CH09], hence in the limit f =∇n(f). To prove for 0≤k < n. Observe,

{¬p|p∈primes(¬f)∧ |p| ≤k} ⊆ {¬p|p∈primes(¬f)∧ |p| ≤k+ 1}

hence it follows that,

^

{¬p|p∈primes(¬f)∧ |p| ≤k+ 1} |=^{¬p|p∈primes(¬f)∧ |p| ≤k}

and thus ∇k+1(f)|=∇k(f). Finally observe∇0(f) =∧∅=trueas required. • Let 0≤k≤n,p′ primes(¬f) and|p| ≤k. Sincep|=¬fby definition, further

by assumption we havef |=f′then¬f′ |=¬f hencep′|=¬f′ |=¬f. Furthermore, there exists some p ∈ primes(¬f) such that p′ |= p thus |p| ≤ |p′| ≤ k. Since

p′ |=p,¬p|=¬p, hence,

∇k(f) =^{¬p|p∈primes(¬f)∧ |p| ≤k} |=¬p′

Therefore∇k(f)|=∇k(f′) as required.

• Holds trivially by combining the above two cases.

From the above proposition we now proceed to show that the widening ∇k constitutes an upper closure operator on the complete lattice of Boolean formulae, and therefore the widening may be used as the basis for defining a Galois connection [CC79]. This is ironic since widening is often deployed when a Galois connection does not exist.

Definition 5.2 (Upper Closure Operator). An upper closure operator (uco) is a func- tion ρ:L→L on a complete lattice hL,⊑,⊥,⊤,⊓,⊔i such that ρ is,

• monotonic: ifx⊑y then ρ(x)⊑ρ(y) for all x, y∈L and,

• idempotent: ρ(x) =ρ(ρ(x))for all x∈L.

Corollary 5.1. The widening ∇k is an upper closure operator on the complete lattice

hBX,|=,0,1,∨,∧,¬i.

Proof. The first two requirements follow as a consequence of Proposition 5.1. Suppose f′ = ∇k(f) for some f ∈ BX and k N∪ {0}. Furthermore, let f′′ = ∇k(f) then

f |=f′ and f|=f′′ thus¬f′′|=¬f|=¬f. Observe, by De Morgans,

¬f′=∨{p|p∈primes(¬f)∧ |p| ≤k} ¬f′′=∨{p|p∈primes(¬f′)∧ |p| ≤k}

since f′ |= f′′ it is sufficient to show f′′ |= f′, or equivalently, ¬f′ |= ¬f′′. By Blake

canonical form [CH09], this sufficient condition can be reduced to the requirement

primes(¬f′)⊆primes(¬f′′). Letp∈primes(¬f′). Since ¬f′=∨{p|p∈primes(¬f)∧ |p| ≤k} it follows that|p| ≤k. Since ¬f′′=∨{p|pprimes(¬f)∧ |p| ≤k}it follows

that p |= ¬f′′. Suppose for the sake of a contradiction that p 6∈ primes(¬f′′). Thus

there exists some p′ |=¬f′′ such that p|=p′ and p6=p′. Hence |p′| ≤k, and p′ |=¬f′ since¬f′′|=¬f. Thusp6∈primes(¬f) and pprimes(¬f′′) as required.