20
Korean J. Com. & Appl. Math. Vol. 3(1996), No. 2, pp. 129 - 148 LINEAR POLYNOMIAL CONSTRAINTS INFERENCING ALGORITHM Sung-Do Chi This paper propose the inference mechanism for handling linear polynomial constraints called consistency checking algorithm based on the feasibility checking algorithm borrowed from linear pro- gramming. In contrast with other approaches, proposed algorithm can efficiently and coherented by linear polynomial forms. The developed algorithm is successfully applied to the symbolic simulation that offers a convenient means to conduct multiple, simultaneous exploration of model behaviors. Mathematical Subject Classification : 65Yxx 1. Introduction Much of the knowledge in many AI reasoning systems can be ex- pressed as mathematical relations on times and durations; spatial rea- soning involves relations on lengths and angles; physical reasoning in- volves relations on masses, temperatures, energies, etc. Frequently, the maintenance of these relationships and the performing of inferences on them can be separated into a distinct component called a quantity knowledge base. A quantity knowledge base interacts with the rest of the system’s inference mechanism in two ways. The system provides the quantity knowledge base with mathematical relations, either per- ceived or derived from non-mathematical inferences; and the quantity knowledge base uses these to infer new relations which it can report to the rest of the system. Received April 8, 1996. c 1996 Korean SIGCOAM, Korea Information Processing Society 129

Linear polynomial constraints inferencing algorithm

Embed Size (px)

Citation preview

Page 1: Linear polynomial constraints inferencing algorithm

Korean J. Com. & Appl. Math. Vol. 3(1996), No. 2, pp. 129 - 148

LINEAR POLYNOMIAL CONSTRAINTS

INFERENCING ALGORITHM

Sung-Do Chi

Abstract. This paper propose the inference mechanism for handling

linear polynomial constraints called consistency checking algorithm

based on the feasibility checking algorithm borrowed from linear pro-gramming. In contrast with other approaches, proposed algorithm can

efficiently and coherented by linear polynomial forms. The developed

algorithm is successfully applied to the symbolic simulation that offersa convenient means to conduct multiple, simultaneous exploration of

model behaviors.

Mathematical Subject Classification : 65Yxx

1. Introduction

Much of the knowledge in many AI reasoning systems can be ex-pressed as mathematical relations on times and durations; spatial rea-soning involves relations on lengths and angles; physical reasoning in-volves relations on masses, temperatures, energies, etc. Frequently,the maintenance of these relationships and the performing of inferenceson them can be separated into a distinct component called a quantityknowledge base. A quantity knowledge base interacts with the rest ofthe system’s inference mechanism in two ways. The system providesthe quantity knowledge base with mathematical relations, either per-ceived or derived from non-mathematical inferences; and the quantityknowledge base uses these to infer new relations which it can report tothe rest of the system.

Received April 8, 1996.c© 1996 Korean SIGCOAM, Korea Information Processing Society

129

Page 2: Linear polynomial constraints inferencing algorithm

130 Sung-Do Chi

Inequalities are useful in dealing with quantity spaces in which therelative values of two quantities may be well known though their ab-solute quantities are much more uncertain. This happens particularlyin that Michaelangelo was an older contemporary of Raphael, and thatthe end of the Thirty Years War occurred about thirty years after itsbeginning, while having only the vaguest notion of either the dates ofthese events, or the relation of the first pair to the second pair. Suchknowledge can be represented in inequalities like the following [1]:

0 ≤ date(birth(Raphael)) − date(birth(Michaelangelo)) ≤ 3025 ≤ date(end(30 years war)) − date(start(30 years war)) ≤ 35−100 ≤ date(birth(Raphael)) − date(start(30 years war)) ≤ 2001400 ≤ date(birth(Michaelangelo)) ≤ 1600

In measure spaces with scalar multiplication, a bound on the quotientof two quantities is often more useful than a bound on their difference.For example, you might know that both your kitchen table and yourhouse were roughly 2 to 1 rectangles without knowing at all preciselythe ratio of their sizes. You might then express your knowledge in theinequalities[1]:

1.8 ≤ length of(table) / width of(table) ≤ 2.21.5 ≤ length of(house) / width of(house) ≤ 2.510.0 ≤ length of(house) / length of(table) ≤ 50.0

Many problems in AI can be viewed as problems of constraint satisfac-tion in which the goal is to discover some problem state that satisfies agiven set of constraints. Many design tasks can also be viewed as con-straint satisfaction problems in which a design must be created withinfixed limits on time, cost, and materials. The quantity knowledge basecomponent shown in Figure 1 should accept equalities and inequali-ties and maintain an irredundant, consistent knowledge base. It shouldoutput the best solution that is possible with the available data. Thus,as illustrated in Figure 2, it should have a capability to reason aboutconsistency with new data in the form of constraints:

• if the new data item is consistent and not redundant, add a newconstraint and delete any redundant constraint.

• if the new data item is inconsistent or redundant, the constraintset is not changed. If the new data item is inconsistent, this fact isreported to the user.

Page 3: Linear polynomial constraints inferencing algorithm

Linear Polynomial Constraints Inferencing Algorithm 131

Queries should be entered in the form of new data items. If a queryis consistent and redundant, then it can be derived from the currentknowledge base and the answer is ”yes.” If it is consistent but notredundant, then the answer is ”possible.” If it is inconsistent, the answeris ”no.” For example, we can ask our system ”Was Raphael born before1000 ?”, ”Did the Thirty Year War end after 1500 ?”, or ”Is the ratio ofthe width of the house to the width of the table between 2.5 and 3.5 ?”.We can also update the knowledge base with new facts such as ”Thestarting date of the Thirty Year War was between 1500 and 1700”, or”The length of the house is 5 [m]”. [1] All the above constraints canbe represented as linear polynomials by introducing slack variables asfollows:

Q1:date birth Raphael + slack0 = 1000Q2 : end date 30 year war − slack1 = 1500Q3 : 2.5 * width of table + slack2 = width of house

width of house + slack3 = 3.5 * width of tableC1 : start date 30 year war − slack4 = 1500

start date 30 year war + slack5 = 1700C2 : length house = 5

We have developed a consistency checking algorithm for linear poly-nomial constraints based on a feasibility checking algorithm borrowedfrom linear programming [2].

Figure 1. Knowledge Base System Concept

Page 4: Linear polynomial constraints inferencing algorithm

132 Sung-Do Chi

.

Figure 2. Knowledge Base System Structure

2. Consistency Checking Algorithm

Through an analysis of a few examples that are simple enough tosee ”what is going on,” it will be possible to bring out certain generalfeatures of consistency problems. As illustrated in Figure 3, consider aconsistent set of constraint {C1, C2, C3, C4} such that:

C1 :x1 ≥ 10

C2 :x2 ≥ 5

Page 5: Linear polynomial constraints inferencing algorithm

Linear Polynomial Constraints Inferencing Algorithm 133

C3 :x1 + x2 ≤ 20

C4 :−x1 + 4x2 ≤ 20

where x1, x2 ≥ 0.

Figure 3. An Example

The dotted area in Figure 3 represents the feasible solution region. Now,let’s add new constraints, a, a′, b, and c, respectively, such that;

a : x2 ≥ 10

a′ : x2 ≤ 10

b : x2 ≤ 7.5

c : x2 ≤ 7

Depending on the constraint to be added, there exist four differentcases;

• Case 1 inconsistent (example: constraint a) – knowledge baseunchanged, error reported.

• Case 2 redundant (example: constraint a′ ) – knowledge baseunchanged.

Page 6: Linear polynomial constraints inferencing algorithm

134 Sung-Do Chi

• Case 3 consistent (example: constraint b) – new constraint isadded to the knowledge base.

• Case 4 consistent (example: constraint c) – new constraint isadded to the knowledge base, but simultaneously, the now redundantprevious constraint, C4, is removed from the knowledge base.

Inconsistency can be checked easily; if the new constraint is infeasi-ble, then it is inconsistent, otherwise one of the cases 2, 3, or 4 applies.

Redundancy can be detected by considering the negation of the con-straint. If the new constraint is not redundant but consistent, thenthe negated constraint is also not redundant but consistent (see Figure4a). However, if the new constraint is redundant, then the negated con-straint is inconsistent (see Figure 4b). It can therefore be discriminatedusing the previously discussed method.

Once a new constraint has been shown to be consistent yet not redun-dant, we should remove all constraints from the knowledge base thathave meanwhile become redundant. As shown in Figure 5, supposethe new constraint, c (x2 ≤ 7), is added to the knowledge base, thenC4 should be eliminated from the knowledge base since it has becomeredundant. Thus, we have to test each existing constraint by lookingat its negation. In Figure 5, the C1, C2, and C3 constraints are irre-dundant since ¬C1, ¬C2, and ¬C3 are consistent, but C4 has becomeredundant since ¬C4 is inconsistent. Figure 6 illustrates the overall al-gorithm for constraint checking, so that only feasibility checking is leftto be discussed.

Page 7: Linear polynomial constraints inferencing algorithm

Linear Polynomial Constraints Inferencing Algorithm 135

.

(a) Irredundant Case

(b) Redundant CaseFigure 4. Redundancy Checking

Page 8: Linear polynomial constraints inferencing algorithm

136 Sung-Do Chi

.

(a) Constraint c is added

(b) Iterating Redundant Constraint CheckingFigure 5. Redundant Constraint Elimination

Page 9: Linear polynomial constraints inferencing algorithm

Linear Polynomial Constraints Inferencing Algorithm 137

.

Figure 6. Consistency Checking Algorithm

Page 10: Linear polynomial constraints inferencing algorithm

138 Sung-Do Chi

3. Feasibility Checking Algorithm

A pivotal algebra algorithm introduced by Orden efficiently replacesPhase I of the simplex method without reference to artificial variablesor an artificial objective function [2]. Most linear programming meth-ods deal with closed boundary relations only such as ≤, =, and ≥,not with open boundary relations such as < and > in that most tech-niques are based on boundary checking (minimax problem). However,we must be able to handle open boundary relations due to our desireto evaluate negated constraints. For example, the negation of the con-straint x ≤ a is x > a. By introducing a new slack variable ε, theopen boundary relation can be replaced by a closed boundary relationpreserving mathematical equivalence. For example, if ”statement A istrue for all x < a”, we can equivalently say that ”statement A is truefor all x ≤ a − ε where ε > 0”.

Brief description of pivotal algebra algorithm :

The general linear equality/inequality system can be stated as follows:

Find a vector [x1, · · · , xn] that satisfies

Σj aijxj = bi i = 1, · · · , m

xj ≥ 0, j = 1, · · · , n

Note that inequalities can always be converted to equalities using slackvariables. The right hand side (bi) can easily be made non-negative bymultiplying both sides of the equality by −1.

The following definitions will be used:

∗ ”reduced” : The i-th row of matrix A is called ”reduced,” if it con-tains at least one 1 element, e.g. in column j, and if all other elementsof the j-th column of matrix A are zero, i.e., if the j-th column ofmatrix A consists of the i-th unit vector, or if the i-th row containsonly 0 elements.

∗ [ A b ] : is called the augmented matrix of the linear system A x = b.∗ ”homogeneous” : The i-th row of the augmented matrix [ A b ] is

called ”homogeneous,” if the bi element is 0.∗ ”semi − reduced”: The augmented matrix [ A b ] is called ”semi-

reduced” if every row is either reduced or homogeneous.

Page 11: Linear polynomial constraints inferencing algorithm

Linear Polynomial Constraints Inferencing Algorithm 139

If a system can be made semi-reduced, then it has a feasible solution,otherwise it has an infeasible solution.

Pivot procedure :

As shown in Figure 7, choose a non-reduced row, iD. If aiDj ≤ 0,j = 1, · · · , n, the system is infeasible. Otherwise, find the column androw:

jp = j|Max aiDj j = 1, · · · , n where jP is the index of the pivotcolumn.

iP = i|Min bi/aijP aijP > 0where iP is the index of the pivot row.

Then pivot at (iP , jP ).

There are four cases to consider.

• Case1. (iP = iD) : the driving row is the pivot row. In this case,it becomes a reduced row.

• Case2. ( iP 6= iD, and at least one a′iDj > 0 ) : The driving row

cannot be reduced. In this case, repeat the pivot procedure with thedriving row unch anged, until it becomes a reduced row (Case 1), oruntil either Case 3 or Case 4 applies.

• Case3. ( iP 6= iD, all a′iDj ≤ 0, and b′iD = 0 ) : proceed to another

driving row.• Case4. ( iP 6= iD, all a′

iDj ≤ 0, and b′iD > 0 ) : The system isinfeasible.

Orden [2] proved the convergence of the algorithm. Its complexity isof order O(nm2) since at most m rows must be semi-reduced, each re-quiring at most n positions to pivot, each pivot requiring at most moperations. This deterministic polynomial complexity contrasts withthe non-deterministic polynomial complexity required for testing satis-fiability of first order logic [3].

Page 12: Linear polynomial constraints inferencing algorithm

140 Sung-Do Chi

.

Figure 7. Feasibility Checking Algorithm

Page 13: Linear polynomial constraints inferencing algorithm

Linear Polynomial Constraints Inferencing Algorithm 141

4. Relation to ”Commonsense” Arithmetic Reasoning

Simmons has developed the so-called Quantity Lattice to performa wide range of ”common sense” arithmetic inference operations [4,5].The Quantity Lattice integrates qualitative and quantitative reasoningand combines inequality reasoning with reasoning about simple arith-metic expressions. It uses five reasoning techniques of i) graph search,ii) numeric constraint propagation, iii) interval arithmetic, iv) relationalarithmetic and v) constant elimination arithmetic. Simmons also out-lined the advantages of the Quantity Lattice by comparing it with otherapproaches such as the temporal reasoning approach of Allen [6], andthe DEVISER planning system by Vere [7].

In contrast with Simmons’ work, our algorithm for linear polynomialconstraint management using linear programming techniques has beendeveloped for the purpose of symbolic simulation in which the simu-lation time and the branching constraints due to non-determinism arerepresented by linear polynomials. The proposed algorithm can effi-ciently and coherently integrate various reasoning approaches of Sim-mons for constraints represented by linear polynomial constraints with>, <, =, ≥, and ≤ relationships.

In the following, we shall briefly describe the five arithmetic reasoningtechniques and corresponding examples introduced by Simmons, andshow how they can be handled using the linear polynomial representa-tion technique employed in our algorithm.

i) Graph Search : Graph search is a qualitative technique to determinethe relationship between two quantities. This technique searches thegraph of quantities using a simple breadth-first search algorithm tofind a path between the investigated quantities.Example : if A = C, C < E then A < E ?Linear Polynomial Representation:

if A − C = 0, C − E + slack1 = 0, then A − E + slack2 = 0 ?

ii) Numeric Constraint Propagation : This is a quantitative techniqueto determine the relationship between two quantities. The orderingbetween two quantities can be determined if the intervals associatedwith the quantities do not overlap, except possibly at their endpoints,since the value of a quantity is constrained to lie within the interval.Example : if A < 1, B > 2, then A < B ?

Page 14: Linear polynomial constraints inferencing algorithm

142 Sung-Do Chi

Linear Polynomial Representation :if A + slack1 = 1, B - slack2 = 2, then A − B + slack3 = 0 ?

iii) Interval Arithmetic : This technique computes the value of an arith-metic expression by applying the arithmetic operator of the formula tothe endpoints of intervals of its arguments.Example : if 3 < A < 4, 1 < B < 4, then 4 < A + B < 8 ?Linear Polynomial Representation :

if A−slack1 = 3, A+ slack2 = 4, B− slack3 = 1, B+ slack4 = 4,then A + B− slack5= 4, A + B+ slack6= 8 ?

iv) Relational Arithmetic : This arithmetic maintains constraints on thequalitative relationship of an arithmetic expression to its arguments.The relationship depends on the relationship of the expression or itsarguments to the identity value for the arithmetic operator of the ex-pression.Example : if X = Y + 5, then X > Y ?Linear Polynomial Representation :

if X − Y = 5, then X − Y − slack1 = 0 ?

v) Constraint Elimination Arithmetic : If the same amount is addedto two expressions then the results are related in the same way as theoriginal expressions are.

Example : if A = B + X, C = D + X, B > D, then A > C ?Linear Polynomial Representation : if A−B−X = 0, C−D−X = 0,B − D− slack1 = 0,

then A − C− slack2 = 0 ?

5. Application: Symbolic DEVS Simulation

The time base of discrete event models has been assumed to be nu-merical. To enhance the capability of discrete event models, we canextend the Discrete Event System Specification (DEVS) formalism [8,9]to be defined on a symbolic time base. In ordinary DEVS, and indeed,in most system formalisms, the time base and its operations and rela-tions are performed over the field of real numbers. In symbolic DEVS,this field will be extended to the linear polynomials over the reals. Forexample, the expression ”5+2 ∗ travel− time + delay− time” is a legaltime value and might represent the time taken to make a round tripjourney. When travel − time and delay − time are assigned numerical

Page 15: Linear polynomial constraints inferencing algorithm

Linear Polynomial Constraints Inferencing Algorithm 143

values, this expression evaluates to a real number. This precise knowl-edge of any event time can be readily incorporated by setting its symbolto a real value. Therefore symbolic DEVS will truely be an extension ofordinary DEVS and reduces to the latter when all times are real valued.This contrasts with qualitative representations of differential equationmodels that move to a coarser grained formalism in which exact timingcannot be covered with acquisition of more information.We note that a coupled model of symbolic DEVS components will benondeterministic since the minimum of a set of next-event times is notunique as in an ordinary DEVS multicomponent model. Thus trajec-tories split into tree-like structures. Each minimal element in a setnext-event times represents a possible state transition; in making thechoice of such an element, we will generate a constraint asserting thatit is less than all other minimal elements. This constraint applies tothe trajectory branch just initiated. Likewise constraints will be accu-mulated and inferenced to constrain minimal next-event times in sub-sequent branchings. For example, asserting ”t1 < t2” at one branch,and ”t2 < t3” at a subordinate one, will require also that ”t1 < t3”in the latter’s subtree. Since symbolic times are linear expressions, wecan easily use the constraint inferencing algorithm to efficiently manageand inference the constraint sets.By allowing the times to be expressed symbolically, we can generatea family of trajectories that represent the possible sequences of eventsresulting in a particular goal. The symbolic extension of discrete eventsimulation allows for both the situations where timings are unknown,or are known, but can vary. The symbolic DEVS applied to do thecausal propagation required for model-based diagnosis are described in[10].

Example : Symbolic Simulation of Baseball 11111As an example of symbolic simulation, consider some timing relationsbetween pitcher and batter in baseball. The ball departs from thepitcher and approaches the home plate providing an opportunity forthe batter to swing. If not hit, it reaches the catcher. On the otherhand, the batter waits for the ball to reach a good position and thenswings to hit the ball. Figure 8a) shows a coupled model, and Figure 8b)shows the symbolic DEVS state transition graphs of its PITCHER andBATTER as components. When the PITCHER component receives

Page 16: Linear polynomial constraints inferencing algorithm

144 Sung-Do Chi

the start command, it changes the state from passive to approaching.After ′approaching − time has elapsed, it outputs approached to theUMPIRE and changes its state to chance during ′chance time. Thenit goes to the passive state after sending arrived to the UMPIRE. TheBATTER has basically the same state transition, but different statesand times. Symbolic simulation automatically generates the tree oftrajectories in Figure 8c), which are illustrated in Figure 8d). The boxattached to each node in Figure 8c) shows constraints of the node. Forexample, node N1 is generated with constraint, w < a, by taking was its minimum time from two symbolic time, w (waiting-time) and a(approaching-time). The constraints set of node N8 is initially consistsof three constraints, w < a, a < w + s, (from the node N4) and a +c < w + s (new constraint), but the constraint checking algorithmautomatically eliminates the redundant constraint, a < w + s (withrespect to a + c < w + s) so that the resultant constraints are w < aand a + c < w + s. Note that the leaves of Figure 8c) represent allfeasible outcomes of the model together with the timing relationshipsnecessary to generate them.

(a) Model Structure of Baseball

Page 17: Linear polynomial constraints inferencing algorithm

Linear Polynomial Constraints Inferencing Algorithm 145

.

(b) State Transition Graphs

Page 18: Linear polynomial constraints inferencing algorithm

146 Sung-Do Chi

.

(c) Generated Tree of Trajectories

Page 19: Linear polynomial constraints inferencing algorithm

Linear Polynomial Constraints Inferencing Algorithm 147

.

(d) Timing Relations

Figure 8. Symbolic Simulation Example: Baseball

6. Conclusions

The developed quantity knowledge base system coherently maintainsthe mathematical relations in the form of linear polynomial constraintson quantity variables such as times and duration, etc. and performsinferences on them. The inference mechanism for handling linear equal-ity/inequality constraints called consistency checking algorithm basedon the feasibility checking algorithm borrowed from linear programminghas been successfully developed and tested. In contrast with other ap-proaches such as the quantity lattice approach due to Simmons, our

Page 20: Linear polynomial constraints inferencing algorithm

148 Sung-Do Chi

algorithm can efficiently and coherently integrate various reasoning ap-proaches represented by linear polynomial forms with >, <, =, ≥, and≤ relationships. Our developed algorithm is successfully applied to ex-tend discrete event modelling formalisms to facilitate greater symbolicmanipulation capabilities, which is important to further their use inintelligent control and design of high autonomy systems.

References

1. Davis, E., Constraint Propagation with Interval Labels, Artificial Intelligence32 (1987), 281 – 331.

2. Orden, A., On the Solution of Linear Equation/inequality Systems, Mathemat-

ical Programming 1 (1971), 137 – 152.3. Genersereth M.R., Nilsson, N.J., Logical Foundations of Articifial Intelligence,

Morgan Kaufmann Pub, Los Altos, CA, 1987.4. Simmons, R., Integrating Multiple Representations for Incremental Causal Sim-

ulation, Proc. on AI, Simulation and Planning in High Autonomy Systems

(1991), 88 – 95.5. Simmons, R., Commonsense Arithmetic Reasoning, Proc. AAAI-86 (1986), 118

– 124.

6. Allen, J.F., Toward a General Theory of Action and Time, Artificial Intelligent23 (1984), 123 – 134.

7. Vere, S.A., Planning in Time: Windows and Durations for Activities and Goals,IEEE Trans. on Pattern Analysis and Machine Intelligence PAMI-5 3 (1983),

246 – 267.

8. Zeigler, B.P., Multifaceted Modelling and discrete Event simulation, Academicpress, 1984.

9. Zeigler, B.P., Object-Oriented simulation with Hierarchical, Modular Models:

Intelligent Agents and Endomorphic systems, Academic Press, 1990.10. Chi, S.D., B.P. Zeigler, Model-based Hierarchical Diagnosis for High Autonomy

Systems, J. of Intelligent and Robotic Systems 9 (1994), 193 – 207.

Department of Computer EngineeringHangkong UniversityHwacheon-Dong 200-1, Kyungki-Do, Korea