Morphologic for knowledge dynamics: revision, fusion, abduction

02/14/2018 ∙ by Isabelle Bloch, et al. ∙ University of the Andes Télécom ParisTech Universidad Industrial de Santander Université Paris-Dauphine 0

Several tasks in artificial intelligence require to be able to find models about knowledge dynamics. They include belief revision, fusion and belief merging, and abduction. In this paper we exploit the algebraic framework of mathematical morphology in the context of propositional logic, and define operations such as dilation or erosion of a set of formulas. We derive concrete operators, based on a semantic approach, that have an intuitive interpretation and that are formally well behaved, to perform revision, fusion and abduction. Computation and tractability are addressed, and simple examples illustrate the typical results that can be obtained.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 5

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Several tasks in artificial intelligence require to be able to find models about knowledge dynamics. In particular, how do beliefs change in the light of a new observation, how can we extract a coherent source of information of many sources of information (eventually contradictory), or how can a given observation be explained? All these questions fall more precisely under the following topics: belief revision, belief merging or fusion, and abduction, respectively.

Such tasks have been formalized and axiomatized in various logics. It is out of the scope of this paper to review the huge amount of work done in this direction, and we will rely on existing postulates, now rather widely accepted, such as AGM postulates for revision KatsunoMendelzon91 , integrity constraints postulates for merging and fusion KONI-98 ; KONI-02 ; KP11 , rationality postulates for abduction and explanatory relations PINO-99 ; PU03 .

Here the propositional logic is considered, and propositional formulas are used to encode either pieces of knowledge (which may be generic, for instance integrity constraints, or factual such as observations) or “preference items” (such as beliefs, opinions, desires or goals). Such formulas are then used for complex reasoning or decision making tasks.

In this paper, we propose to build tools for modeling knowledge dynamics based on mathematical morphology operators applied to propositional formulas. Mathematical morphology is originally based on set theory. It has been introduced in 1964 by Matheron MATH-67 ; MATH-75

, in order to study porous media. But this theory evolved rapidly to a general theory of shape and its transformations, and was applied in particular in image processing and pattern recognition

SERR-82 . Additionally to its set theoretical foundations, it also relies on topology on sets, on random sets, on topological algebra, on integral geometry, on lattice theory. In particular, the general algebraic framework of lattices allows developing mathematical morphology in various domains of information processing, beyond sets and functions, such as fuzzy sets, logics, graphs, hypergraphs, formal concept analysis, etc. IB:INS-11 ; IB:CVIU-13 ; IB:LOS-07 ; TCIS-02 ; Rons90 .

The aim of this paper is to develop mathematical morphology in propositional logics, called morphologic, and to propose concrete morphological operators to perform revision, fusion and abduction, which are tractable and have an intuitive meaning. In particular we will make use of two important operations, dilations and erosions. Intuitively, when applied to a set, the effect of dilation is to expand the set while the effect of erosion is to shrink the set.

The following ideas explain intuitively why morphologic is an adequate tool for knowledge dynamics:

  • Belief revision: let and be two propositional formulas. The models of the revision of by are the models of which are closest (with respect to a given proximity notion) to a model of . Intuitively, using the language of morphologic, it means that has to be dilated enough to become consistent with .

  • Belief merging: finding the best compromise between a finite set of formulas , … amounts to selecting the models which minimize the aggregation (using some given operator) of the distances to each of the . This amounts intuitively to dilate simultaneously all the until they constitute a consistent set.

  • Abductive reasoning: preferred explanations of a formula are defined based on a set of axioms, several of which being closed to properties of morphological operators, in particular erosion.

An important noticeable aspect is that the framework of morphologic gives us not only natural and general notions to deal with many tasks of knowledge dynamics, but this approach is also well behaved. Actually, the operators and relations obtained via the morphological tools enjoy good rationality properties. Moreover, last but not least, under certain assumptions there are interesting ways of computing some of our proposed operators.

The main contribution of this work is to propose such models in the framework of morphologic, based on a semantic approach. One interesting aspect is that the proposed operators include some of existing ones, and also new ones. For each of them, the properties will be analyzed and discussed. Finally, the outcome is a toolbox of operational methods, among which a user can choose according to the required properties.

This paper is organized as follows: Section 2 is devoted to the presentation of concepts in mathematical morphology and to introduce logical morphology (morphologic). Section 3 shows the general techniques of computation of the operators when the metric over the space of valuations is given by the Hamming distance. Section 4 is devoted to show how well-known revision operators can be interpreted in the framework of morphologic. Section 5 proposes a similar analysis in the framework of fusion. It shows how belief merging operators can be interpreted in the framework of morphologic. Section 6 is devoted to abduction (explanatory relations) built on morphological operations aiming to capture the notion of the most central part. Based on a common notion of pre-order relation on models, derived from morphological operators, Section 6.4 presents a unified framework for revision and abduction. In Section 7 we finish with some concluding remarks and perspectives for future work.

2 From mathematical morphology to logical morphology

In this section we recall the main concepts and tools used in mathematical morphology and their interpretation in mathematical logic. This interpretation is possible via the identification between a logical formula and a set of interpretations (its models) in the framework of finite propositional logic.

2.1 Algebraic framework: complete lattices

Mathematical morphology relies on concepts and tools from various branches of mathematics: algebra (lattice theory), topology, discrete geometry, integral geometry, geometrical probability, partial differential equations, etc. 

MATH-75 ; SERR-82 ; in fact any mathematical theory that deals with shapes, their combinations or their evolution, can be brought to contribute to morphological theory. When adopting a logics point of view, the algebraic framework is particularly relevant, and we will concentrate on it in the sequel.

The basic structure in this framework is a complete lattice 111Although mathematical morphology has also been extended to complete semi-lattices and general posets keshet2000 , based on the notion of adjunction, in this paper we only consider the case of complete lattices.. We denote the supremum by , the infimum by , the smallest element by and the greatest element by . We have and . The framework of complete lattices is fundamental in mathematical morphology, as explained in HEIJ-90 ; RonsHeij:91 ; Rons90 .

All the following definitions and results are detailed in textbooks on mathematical morphology, such as Heijmans94 ; NajTal10 ; SERR-88 . We restrict the presentation to operators from into itself.

An algebraic dilation is defined as an operator on that commutes with the supremum, and an algebraic erosion as an operator that commutes with the infimum, i.e. for every family of elements of (finite or not), where is an index set, we have:

(1)
(2)

These are the two main operators, from which a lot of others can be built.

Among the numerous examples of complete lattices, one will be particularly interesting for the extension to logics: , the set of subsets of a set , endowed with the set theoretical inclusion. It is a Boolean lattice (i.e. complemented and distributive). The smallest and greatest elements are and , respectively.

Algebraic dilations and erosions in satisfy the following properties:

  • and ,

  • and are increasing with respect to the partial ordering on ,

  • in , .

Another important concept is the one of adjunction. A pair of operators defines an adjunction on if:

(3)

If a pair of operators defines an adjunction, the following important properties hold:

  • and ,

  • is a dilation and is an erosion (in the algebraic sense expressed by Equations 1 and 2);

  • , where denotes the identity mapping on (i.e. is anti-extensive);

  • (i.e. is extensive);

  • and , i.e. the composition of a dilation and an erosion are idempotent operators ( is called a morphological opening and a morphological closing).

The following representation theorem holds: an increasing operator is an algebraic dilation iff there is an operator such that is an adjunction; the operator is then an algebraic erosion and . Similarly, an increasing operator is an algebraic erosion iff there is an operator such that is an adjunction; the operator is then an algebraic dilation and .

Finally, let and be two increasing operators such that is anti-extensive and is extensive. Then is an adjunction.

Further properties and derived operators can be found in seminal works such as Heijmans94 ; SERR-82 ; SERR-88 , or in more recent ones IB:LOS-07 ; NajTal10 .

In this paper, the fact that dilations and erosions are increasing operators that commute with the supremum and the infimum, respectively, will play an important role.

2.2 Structuring element and morphological dilations and erosions

Let us now consider the lattice of the subsets of . We have . If is a vectorial or metric space (e.g. ), and if and are additionally supposed to be invariant under translation, then it can be proved that there exists a subset , called structuring element, such that

(4)

and

(5)

where denotes the translation of at point (i.e. ), and is the symmetrical of with respect to the origin. The operators are then called morphological dilations and erosions. Details on these definitions and their properties can be found e.g. in IB:LOS-07 ; Heijmans94 ; NajTal10 ; SERR-82 .

The structuring element

defines a neighborhood that is considered at each point. This is typically the case in image processing and computer vision, where the underlying lattice is built on sets or functions of the spatial domain. It is a subset of

with fixed shape and size, directly influencing the extent of the morphological operations. It is generally assumed to be compact, so as to guarantee good properties. In the discrete case (that will be considered all through this paper), we assume that it is connected, according to a discrete connectivity defined on .

The general principle underlying morphological operators consists in translating the structuring element at every position in space and checking if this translated structuring element satisfies some relation with the original set (intersection for dilation, Equation 4, inclusion for erosion, Equation 5SERR-82 .

An example on a binary image is displayed in Figure 1.

(a) (b) (c) (d)
Figure 1: (a) Structuring element (ball of the Euclidean distance). (b) Subset in the Euclidean plane (in white). (c) Its dilation . (d) Its erosion .

The structuring element can also be seen as a binary relation between points IB:LOS-07 , i.e. iff where denotes a relation on . Dilation and erosion are then expressed as follows:

These formulas apply for any binary relation . If is reflexive (i.e. for all ), then is extensive () and is anti-extensive (). These properties hold in the case illustrated in Figure 1. The objects in the original image are then expanded by dilation, to an extent that depends on the shape and the size of the structuring element, and reduced by erosion. Similar interpretations hold for any relation , and these properties will also be important in the remainder of this paper.

2.3 Lattice of formulas and morpho-logic

The idea of using mathematical morphology in a logical framework has been first introduced in IPMU-00b ; TCIS-02 . Let be a finite set of propositional symbols, with . The set of formulas (generated by and the usual connectives) is denoted by . Well-formed formulas are denoted by Greek letters , … The set of all interpretations for is denoted by , interpretations are denoted by , …, and is the set of all models of (i.e. all interpretations for which is true).

The underlying idea for constructing morphological operations on logical formulas is to consider formulas and interpretations from a set theoretical perspective. Since is isomorphic to up to the syntactic equivalence, i.e., knowing a formula defines completely the set of its models (and conversely, any set of models corresponds to a subset of built of syntactic equivalent formulas), we can identify with the set of its models , and then apply set-theoretic morphological operations. We recall that , , iff , and is consistent iff . Considering the inclusion relation on , is a Boolean complete lattice. Similarly a lattice (which is isomorphic to ) is defined on , where denotes the quotient space of by the equivalence relation between formulas (with the equivalence defined as iff ). In the following, this is implicitly assumed, and we simply use the notation . Any subset of has a supremum , and an infimum (corresponding respectively to union and intersection in ). The greatest element is and the smallest one is (corresponding respectively to and ).

Based on this lattice structure, it is straightforward to define a dilation as an operation that commutes with the supremum and an erosion as an operation that commutes with the infimum, as in Equations 1 and 2. They naturally inherit all general properties of the algebraic framework.

2.4 Morphological dilation and erosion of logical formulas

Using the previous equivalences, we propose to define morphological dilation and erosion of a formula with a structuring element as follows, according to the preliminary work in IPMU-00b ; TCIS-02 . The underlying lattice is , or equivalently . Since these two lattices are isomorphic, we will use the same notations for morphological operations on each of them.

Definition 1

A morphological dilation of a formula with a structuring element () is defined through its models as:

(6)

Similarly, a morphological erosion is defined as:

(7)

In these equations, the structuring element represents a relationship between worlds, i.e. iff satisfies some relationship with . The condition in Equation 6 expresses that the set of worlds in relation to should be consistent with . The condition in Equation 7 is stronger and expresses that all worlds in relation to should be models of . Note that in this paper we only consider symmetrical structuring elements.

There are several possible ways to define structuring elements in the context of formulas. We suggest here a few ones. The relationship can be any relationship between worlds and defines a “neighborhood” of worlds. If it is symmetrical, it leads to symmetrical structuring elements. If it is reflexive, it leads to structuring elements such that , which leads to interesting properties, as will be seen later. For instance, this relationship can be an accessibility relation as in normal modal logics HughesCreswell68 (see JANCL-02 for its use to define modalities as morphological operators).

An interesting way to choose the relationship is to base it on distances between worlds. This allows defining sequences of increasing structuring elements defined as the balls of a distance. From any distance between worlds (), a distance from a world to a formula is derived as a distance from a point to a set: . The most commonly used distance between worlds in knowledge representation (especially in belief revision DALA-88 , belief update KatsunoMendelzon91 , merging KONI-98 or preference representation LAFA-00b ) is the Hamming distance where is the number of propositional symbols that are instantiated differently in both worlds. By default, we take to be , and this is the distance we will use in most of the examples developed in this paper. In this case, the distance takes values in . The extension of what follows to distances taking values in is straightforward. Note that all what follows applies for general dilations, not necessarily derived from .

Then dilation and erosion of size are defined from Equations 6 and 7 by using the distance balls of radius as structuring elements (i.e. ):

(8)
(9)

Note that we have . By convention, when there is no ambiguity, we will set and . More generally, whatever the operator , we define and for .

From operations with the unit ball we define the external (respectively internal) boundary of as (respectively ), corresponding to the worlds that are exactly at distance 1 of (respectively of ).

As an illustrative example, let us consider the case where we have three propositional symbols , and . The set of worlds has then 8 elements, which can be represented as the vertices of a cube. In this example, we consider the unit cube of (for propositional symbols, this generalizes to the hypercube of ). For the sake of simplicity, we assimilate a formula formed by a simple conjunction of symbols with its corresponding model. For instance is assimilated to the corresponding world in , represented by the point in the unit cube. The edges link two worlds differing by one instantiation of a propositional symbol (i.e. at a Hamming distance of 1). For instance vertices representing and are linked by an edge (we have ). This is a convenient representation for graphically illustrating the morphological operations, as shown in Figures 2 and 3. The balls of the Hamming distance are used as structuring elements. In Figure 2, we consider a formula . Its dilation (of size 1, i.e. by a ball of radius 1) is then . The dilation of size one just amounts to add to the vertices representing the vertices linked by an edge to them. In Figure 3, an example of erosion is illustrated, for . The erosion of size 1 is then . It amounts to keep in the result only the vertices having all their neighbors (according to the graph defined by the cube) in .

Figure 2: Example of a dilation of size 1: and . Note that in all figures, the models of the formulas are represented.

Figure 3: Example of an erosion of size 1: and .

The main properties of dilation and erosion, which are satisfied in mathematical morphology on sets, hold also in the logical setting proposed here. They are summarized below. The proofs are not given here, but they are straightforward based on set/logic equivalences.

The dilations and erosions defined in Equations 6, 7, 8, and 9 have the following properties:

Adjunction relation: is an adjunction, i.e. iff , for any structuring element . This shows that the proposed definitions are a particular case of general algebraic dilations and erosions.

Commutativity with union or intersection: Dilation commutes with union or disjunction (this is a fundamental property of dilation as mentioned in the general algebraic framework, and is derived from the adjunction property): for any family of formulas, we have: . Erosion on the other hand commutes with intersection or conjunction. Note that this property is taken as definition in case of a general algebraic dilation or erosion.

In general, dilation (respectively erosion) does not commute with intersection (respectively union), and only an inclusion relation holds: .

Monotonicity: Both operators are increasing with respect to , i.e. if , then and , for any structuring element . Dilation is increasing with respect to the structuring element, while erosion is decreasing, i.e. if , then and .

Extensivity and anti-extensivity: Dilation is extensive () if and only if is derived from a reflexive relation (as is the case for distance based dilation, since if , then ), and erosion is anti-extensive () under the same conditions. We will always assume extensive dilations and anti-extensive erosions in the following.

Iteration: Dilation and erosion satisfy an iteration property:

For instance for distance based operations, for a distance satisfying the betweeness property222Let be a discrete metric on a set . We say that has the betweenness property if for all and all there exists such that and . The Hamming distance has this property., this property can be expressed as:

This means that the effect of these operations increases with the size of the structuring element, and that the computation can be done either by successive applications of “small” structuring elements or directly by the sum of the structuring elements.

Duality: Dilation and erosion are dual operators with respect to the negation: which allows deducing properties of an operator from those of its dual operator.

Relations to distances: Equation 8 shows how to derive a dilation from a distance. Conversely, from Equation 8 we have: , and similarly, we have .

Distances between formulas can also be derived from dilation, as minimum distance and Hausdorff distance333Note that, in constrast to the Hausdorff distance, the minimum distance is improperly called distance since it does not satisfy all the properties of a true metric.. For instance the minimum distance is expressed as: . This means that the minimum distance is attained for the minimum size of dilation of both formulas such that they become consistent. The Hausdorff distance is defined as: . It can be computed from dilation by .

These properties will be used intensively in the applications of these operators for knowledge representation and reasoning.

2.5 Some derived operators

Conditional dilation and erosion and reconstruction

In a number of problems and applications, we may want to restrict the result of an operation to stay within some domain, or to satisfy a particular formula. This is typically the case for instance if a result has to satisfy a theory, or a set of integrity constraints. This idea calls for geodesic distances, from which structuring elements are derived, as the balls of this distance. Using these structuring elements in the definitions of dilation and erosion (Equations 6 and 7) leads to the notion of geodesic, or conditional, operators. In the discrete case, that we consider here, the expression of these operators is very simple:

(10)

where denotes the conditioning formula, is the size of the structuring element, denotes the dilation using a ball of radius 1 (not geodesic) and the superscript means that the succession of dilation of size 1 and conjunction has to be performed times. This equation is a short writing for the following sequence of operations: begin ; For ; end for Return

Similarly the geodesic erosion of conditionally to can be computed as:

(11)

If the conditional dilations are iterated until convergence, then the result is called reconstruction, and is denoted by :

(12)

Note that in practice this sequence converges in a finite number of steps, when we consider a finite discrete space, as is the case in this paper. An example is illustrated in Figure 4, with the same type of representation as in the previous figures. The reconstruction results in the only connected component of “marked” by .

Figure 4: Reconstruction: only the connected component of which is “marked” by is reconstructed.
Searching for the most central models satisfying a formula

In some problems, it might be interesting to find the most relevant worlds that are models of a formula. This problem is solved in LAFA-00b by taking the absolute maximum of the internal distance function (i.e. the function that associates to each world its distance to ). Mathematical morphology offers other tools that could also be interesting:

Ultimate erosion

is one of them. It consists in eroding iteratively and, at each step , keeping the connected components of that disappear in . It corresponds exactly to the regional maxima of the internal distance (i.e. the function that assigns to each model of the distance to its closest model of ). This approach may provide several components, which represent all parts of , belonging to different connected components, or connected by narrow sets of worlds. This notion can be formalized using the reconstruction operator (Definition 2).

Last-non empty erosion

only keeps track of the largest component. Erosions are iterated and the last result before the erosion becomes empty is the final result. The result is then more restrictive than with ultimate erosion, and some component of may not be represented. Definition 3 formalizes this idea.

Morphological skeleton

is another approach to represent a formula in a compact and “central” way. It is defined as the union of the centers of maximal balls included in the initial formula (see SERR-82 for definitions on sets and corresponding properties). This approach will not be further investigated in this paper.

Definition 2

The ultimate erosion is expressed using the reconstruction operator as:

(13)

Again in the finite discrete case, the iterative erosion process stops in a finite number of steps.

Definition 3

The last erosion of a formula , denoted by , is the erosion of of the largest possible size such that the set of worlds where is satisfied is not empty or the smallest size of erosion leading to a fixed point:

(14)

with the smallest value for which this holds, and .

In the example of Figure 3, the first erosion is also the last non-empty erosion.

It is interesting to note that the idea of successive erosions is related to the notions of supermodels Ginsberg98 and of preferred explanations PINO-99 . For instance, it is easy to prove that iff is a -supermodel of . The application to preferred explanations will be further investigated in Section 6.

Opening and closing

Two other important operators are opening and closing. An algebraic opening is an operator that is increasing, idempotent and anti-extensive, and an algebraic closing is an operator that is increasing, idempotent and extensive. Typical examples are and where is an adjunction, as seen in the general algebraic framework. An important property if that any disjunction of openings is an opening, and any conjunction of closings is a closing. Opening and closing of a formula by a structuring element are defined respectively as: , and .

These two basic morphological filters can be seen as approximation operators, since they “simplify” formulas by either suppressing some irregularities for opening, or adding some parts of for closing. Families of filters can be built from these two ones. For instance, granulometry SERR-82 consists in applying successively openings with structuring elements of increasing size, such decomposing a formula in parts of different characteristic sizes. Another example is alternate sequential filters SERR-88 , which consist in building sequences of opening/closing (or closing/opening), with structuring elements of increasing size. Such transformations are increasing and idempotent, and allow filtering progressively parts of and .

Note that is an anti-extensive and idempotent operator, but it is not increasing (and hence not an opening). The same applies for ultimate erosion.

2.6 Morphological ordering

Given a formula, a natural ordering can be derived from the sequence of its successive erosions and dilations, for a given elementary structuring element (of size 1). This idea is illustrated on sets in Figure 5. This will be particularly interesting in the following, when considering a theory, and for defining a partial order on the models satisfying this theory (by identifying a theory with an equivalent formula). We call it morphological ordering.

Figure 5: Illustration of a natural partial ordering derived from successive erosions (in blue) and dilations (in red) of . We have in this example.
Definition 4

Let be a theory (represented by a formula) or a formula. Let be the maximal size of dilation and the size of the last non-empty erosion, i.e.:

where is defined in a similar way as the last erosion (and can be either or a fixed point). Then we define the fundamental sequence of subsets of associated with , from to , as follows:

The morphological total pre-order associated to is then defined by:

(15)

The fact that this defines a pre-order is easy to check. Note that this ordering depends on the choice of the elementary structuring element.

As an example, let us consider again three propositional symbols, with the same representation as in Figures 2 and 3, and (represented by the same formula as in the example of Figure 3). The models of are . We have , , and , as illustrated in Figure 6.

Figure 6: Illustration of the morphological ordering (here ).

This provides a stratification of the elements of , as given in Table 1.

0
1
2
Table 1: Stratification of the elements of according to the morphological ordering associated with .

Note that in case the last dilation yields a fixed point different from , the rank of the models in is set to by convention. This amounts to ordering only .

Proposition 1

The following properties hold:

  • The subsets of are nested, i.e. for the considered dilations and erosions (with structuring elements such that ).

  • The relation is reflexive and transitive, i.e. a pre-order, which is moreover total.

  • Let be the relation defined on by iff . This relation is an equivalence relation and the ordering induced by on the quotient space is a total ordering.

Let us briefly comment on the choice of the structuring element used in the morphological operations. When it is taken as a ball of the Hamming distance, as in all examples in this section so far, then the neighborhood it defines is isotropic and all variables are taken into account in the same way. However, different structuring elements could be used, and their choice is a way to impose preferences, for instance on some variables over other ones. As an example, let us consider the following structuring element, defining the neighborhood of any world :

where denotes the ball of radius 1 of the Hamming distance, and means that is instantiated in the same way in and in . With this structuring element, is not handled in the same way as variables and . Note that when performing successive erosions (respectively dilations) with such a structuring element, we may not end up with (respectively ), but we may converge towards a fixed point (a subset of ). Figure 7 illustrates the effect of this structuring element on the same example as in Figure 6. The derived morphological ordering and the corresponding stratification of is now given in Table 2.

Figure 7: Illustration of the morphological ordering (here ), using as structuring element.
0
1
2
3
Table 2: Stratification of the elements of according to the morphological ordering associated with , using as structuring element.

As another way to handle variables differently, let us note that does not need to be “isotropic”, i.e. the cube in our illustrations could be a parallelepiped, with different lengths of the edges, representing the elementary distances between worlds. A distance between two worlds can then be defined as the length of a shortest path in this weighted graph. Structuring elements can be defined as balls of this distance. However, in general this distance does not satisfy the betweenness property, which makes is less interesting for our purpose.

It is important to note that the ordering of the elements of depends on both and the definition of erosion and dilation, in particular the choice of the structuring element.

This morphological ordering will be used to unify several reasoning tasks, in particular abduction and revision, in Section 6.

3 Computational issues

Unless stated otherwise, for all the operators considered here we assume that the structuring element is the ball of radius 1 for the Hamming distance.

3.1 Dilation

The commutativity of dilation with disjunction, along with the iteration property, allows us to recover results of LAFA-00b . In particular, the following result holds.

Proposition 2

Let be a consistent conjunction of literals, i.e. , then

Similarly, if is a disjunction of literals, i.e. , then the erosion is expressed as:

In these equations (respectively ) denotes the dilation (erosion) using as structuring element a ball of radius 1 of the Hamming distance.

This property, together with the commutation of dilation with disjunction, gives the following result LAFA-00b : if is a fixed integer, then the dilation of size of a DNF formula can be computed in time – thus in polynomial time. In a similar way, erosion commutes with intersection and can be computed in polynomial time from a CNF formula.

When is not under DNF, computing directly from (without rewriting under DNF first) is a difficult problem.

However, we can prove a slightly general result:

Proposition 3

If are such that for all , and do not share variables, then .

Proof: For every interpretation let be the projection of on the language of (). We have if and only if
(1) there exists such that and .
Now, (since the have no variable in common). Therefore, if and only if there exists a , , such that: (a) , and (b) for every , . From this we get that (1) is equivalent to:
(2) there exists a , , such that and for every , .
Now, is equivalent to a formula on the language , therefore iff , Moreover, iff . Therefore, if and only if there exists a , , such that , from which the result follows.

In particular:

  • if , then ;

  • if are literals whose associated variables are all different, then we recover the identity .

Now, how hard is it to compute dilations (respectively erosions) when is not under DNF (respectively CNF)? First of all we have the following complexity results.

Proposition 4
  1. Given an interpretation and a formula , deciding whether is NP-complete.

  2. Given an interpretation and a formula , deciding whether is coNP-complete.

Proof: In both cases membership is straightforward. For hardness for point 1 we consider the following reduction from sat: we map every formula to where with , and being any interpretation satisfying . Using Proposition 3 we have , which is equivalent to . Now, if is satisfiable, then so is . Therefore, . If is unsatisfiable, then so are and . Therefore . The reduction from unsat for point 2 is similar.

This shows that, a fortiori, computing erosion or dilation in the general case is hard. Moreover, the size of and is not polysize, except if . It is not sure that there is a way of computing erosion (dilation) being more efficient than first rewriting under CNF (DNF).

Note that inference from the dilation of a formula is (theoretically) not harder than inference from the formula itself. Namely, given any two formulas and and any integer , determining whether is coNP-complete. Obviously, a similar result holds for inference from erosion.

However, interesting results can be obtained for erosion by decomposing a formula into its connected components. Based on the graph interpretation used all through this paper, a connected component is classically defined as a connected component in the graph: we say that is a connected component of if is a connected component of the graph associated with (whose set of vertices is ) and whose set of edges is defined by whenever ).

Proposition 5

If , for being the minimum distance between formulas, then .

Proof: Assume . We already know that , so it remains to be proven that . Let . This implies if the erosion is anti-extensive (which is the case in this paper). Without loss of generality, assume . Because , we have . Now, assume that , i.e., ; this means that there exists a such that and ( is impossible because and ). Now, we must have ; otherwise we would have , hence , which contradicts . Therefore, , which contradicts the assumption that .

Proposition 6

Let be the connected components of . Then we have:

Proof: For any two distinct connected components , of we have , therefore, ; the fact that enables us to conclude that .

Now, we have to find a way of (a) computing the connected components of and (b) computing . The first step is easy when is under DNF. We first note the following fact:

Proposition 7

Let be a DNF formula. For any , is equal to the number of disagreeing literals between and .

For instance, we have , , and .

Proposition 8

Let be a DNF formula. Let be the undirected graph defined by its set of vertices , which can be grouped into subsets where , and containing an edge iff . Then the connected components of correspond to the connected components of , and is a connected component of iff is a connected component of .

Example 1

Let us consider (Figure 8). The graph has 8 vertices, grouped into 4 subsets , and its edges are , , , plus the reflexive edges , , , . has two connected components: and (the valuation of is not represented here), therefore has two connected components: and , from which we have .

Figure 8: Decomposition of into two connected components and , and its erosion (only , and are considered in this representation).

3.2 About last erosion and ultimate erosion

Let us consider the last erosion (Definition 3). Denote by the number of iterations to reach the last non-empty erosion of .

Proposition 9

If and then , where is the number of propositional symbols in the language.

Proof: Let . We have if for all we have . Therefore, , because it can never be the case that .

Actually, we can find a better bound for :

Proposition 10

If and then is less than the length of the shortest prime implicate of (the set of prime implicates being denoted by ).

Proof: The result follows easily from , from the fact that erosion commutes with conjunction, and from the following expression of the erosion of a disjunction of literals:

this result being obtained by duality from Proposition 2 (or directly by induction on ).

For instance let us consider . We have , i.e., every prime implicate of is of length 2; , therefore . This example shows that can be strictly lower than the bound expressed in Proposition 10.

Proposition 9 enables us to say that deciding whether is in in the Boolean hierarchy of NP sets.

Let us now consider ultimate erosion (Definition 2). The following result directly follows from Proposition 6.

Proposition 11

Let be the connected components of . Then we have: .

Using Proposition 11, the following algorithm computes the ultimate erosion of .

:
begin
decompose into its connected components ;
if
then if
then return
else return
endif
else return
endif

3.3 About opening and skeleton

A morphological opening is the composition of an erosion followed by a dilation: . Computing is not an easy task. If is in CNF, then is computable in polynomial time, and expressible as a polysize CNF, but then is not (and can be exponentially long). If is in DNF, then is not polynomially computable (and can be exponentially long). Proposition 5 gives a hint on how to compute , when is under DNF.

Proposition 12

Let the connected components of . Then we have: .

This results directly follows from Proposition 6.

Let us now consider the skeleton . It is defined as the centers of maximal balls of the Hamming distance included in . In the finite discrete case, it can be computed by the following algorithm:

begin
;
While do
;
end while
Return

We note that the number of iterations performed by this algorithm is equal to and therefore is no larger than .

Example 2

Let us consider again , as in Figure 8. We have:

  • and which is the center of a maximal ball of radius 0;

  • , , and , which is the center of a maximal ball of radius 1;

  • the next erosion provides , so we stop here and return