10
Divide and Conquer : A component-based qualitative simulation algorithm Daniel J . Clancy NASA Ames/Caelum Research Center, MS 269-3 Moffet Field, CA 94035 USA clancy@ptolemy .arc .nasa .go v Abstract Traditionally, qualitative simulation uses a global, state--based representation to describe the behav- ior of an imprecisely defined dynamical system . This representation, however, is inherently lim- ited in its ability to scale to larger systems since it provides a complete temporal ordering of all unrelated events thus resulting in combinatoric branching in the behavioral description . The Dec- SIM qualitative simulation algorithm addresses this problem using a divide and conquer approach . DecSIM combines problem decomposition, a tree- clustering algorithm and ideas similar to directed arc-consistency to exploit structure and causality within a qualitative model resulting in an exponen- tial speed-up in simulation time when compared to existing techniques along with a more focused behavioral description . In this paper, we present the DecSIM algorithm along with both theoreti- cal and empirical results demonstrating the ben- efits provided over traditional techniques . In ad- dition, we formally characterize the problem ad- dressed by qualitative simulation as the composi- tion of state-based and temporal-based constraint satisfaction problems (CSPs) allowing us to dis- cuss how DecSIM can be viewed as a general con- straint satisfaction algorithm and how the results can be extended to other classes of problems . Introduction Traditionally, constraint satisfaction problems (CSPs) are characterized using a finite set of con- straints expressed within a common ; shared con- straint language (Tsang 1993) . When reasoning across time, however, it is possible to express both temporal and state--based constraints represented within multiple constraint languages . A state--based constraint specifies restrictions between variables that must hold at any given point in time while a temporal constraint specifies restrictions that oc- cur across time . Qualitative simulation provides an QR99 Loch Awe, Scotland Benjamin J . Kuipers University of Texas at Austin Austin, Texas 78712 kuipersOcs .utexas .edu instance of this class of composite constraint satis- faction problems . Qualitative simulation (Forbus 1984 ; Kuipers 1994) reasons about. the behavior of a class of dy- namical systems using a branching time description of alternating time-point and time-interval states . The model specifies a finite set of variables and constraints . Each constraint specifies valid com- binations of variable values for any given point in time (i.e . state-based constraints) . Continuity constraints are then used to restrict the valid tran- sitions between states . For example, if in a time- point state Sl the variable X is increasing and has a value X'*, then immediately following Si , X must be greater than X * and increasing . The continu- ity constraints correspond to temporal restrictions . Each qualitative behavior generated during simula- tion corresponds to a solution to the CSP defined by the composition of the state-based CSP with the temporal CSP. Viewing qualitative simulation as a composite CSP is beneficial because it allows us to explore how advances within the CSP literature can be used to improve the techniques applied during simulation . In addition, it describes a new class of constraint satisfaction problems that has not been extensively explored within the CSP literature . The DecSIM qualitative simulation algorithm ) provides a solu- tion to this class of CSPs by building upon and extending existing research within the constraint satisfaction literature . DecSIM provides a sound, but potentially incomplete algorithm' that solves 1 This paper provides a more extensive discussion of the algorithm than what is provided in (Clancy & Kuipers 1998) . 2 As discussed later in the paper, the incompleteness of the algorithm only occurs under certain conditions and, in fact, has not been manifested in any of the 41

Divide and Conquer: Acomponent-based qualitative simulation … · 2003. 8. 29. · Divide and Conquer: Acomponent-based qualitative simulation algorithm Daniel J. Clancy NASAAmes/Caelum

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Divide and Conquer: Acomponent-based qualitative simulation … · 2003. 8. 29. · Divide and Conquer: Acomponent-based qualitative simulation algorithm Daniel J. Clancy NASAAmes/Caelum

Divide and Conquer :A component-based qualitative simulation algorithm

Daniel J. ClancyNASA Ames/Caelum Research Center,

MS 269-3Moffet Field, CA 94035 USA

clancy@ptolemy .arc .nasa .gov

Abstract

Traditionally, qualitative simulation uses a global,state--based representation to describe the behav-ior of an imprecisely defined dynamical system .This representation, however, is inherently lim-ited in its ability to scale to larger systems sinceit provides a complete temporal ordering of allunrelated events thus resulting in combinatoricbranching in the behavioral description . The Dec-SIM qualitative simulation algorithm addressesthis problem using a divide and conquer approach .DecSIM combines problem decomposition, a tree-clustering algorithm and ideas similar to directedarc-consistency to exploit structure and causalitywithin a qualitative model resulting in an exponen-tial speed-up in simulation time when comparedto existing techniques along with a more focusedbehavioral description . In this paper, we presentthe DecSIM algorithm along with both theoreti-cal and empirical results demonstrating the ben-efits provided over traditional techniques . In ad-dition, we formally characterize the problem ad-dressed by qualitative simulation as the composi-tion of state-based and temporal-based constraintsatisfaction problems (CSPs) allowing us to dis-cuss how DecSIM can be viewed as a general con-straint satisfaction algorithm and how the resultscan be extended to other classes of problems .

IntroductionTraditionally, constraint satisfaction problems(CSPs) are characterized using a finite set of con-straints expressed within a common ; shared con-straint language (Tsang 1993) . When reasoningacross time, however, it is possible to express bothtemporal and state--based constraints representedwithin multiple constraint languages . A state--basedconstraint specifies restrictions between variablesthat must hold at any given point in time whilea temporal constraint specifies restrictions that oc-cur across time . Qualitative simulation provides an

QR99 Loch Awe, Scotland

Benjamin J . KuipersUniversity of Texas at Austin

Austin, Texas 78712kuipersOcs .utexas .edu

instance of this class of composite constraint satis-faction problems .

Qualitative simulation (Forbus 1984 ; Kuipers1994) reasons about. the behavior of a class of dy-namical systems using a branching time descriptionof alternating time-point and time-interval states .The model specifies a finite set of variables andconstraints . Each constraint specifies valid com-binations of variable values for any given point intime (i .e . state-based constraints) . Continuityconstraints are then used to restrict the valid tran-sitions between states . For example, if in a time-point state Sl the variable X is increasing and hasa value X'*, then immediately following Si , X mustbe greater than X* and increasing . The continu-ity constraints correspond to temporal restrictions .Each qualitative behavior generated during simula-tion corresponds to a solution to the CSP definedby the composition of the state-based CSP withthe temporal CSP.Viewing qualitative simulation as a composite

CSP is beneficial because it allows us to explore howadvances within the CSP literature can be used toimprove the techniques applied during simulation .In addition, it describes a new class of constraintsatisfaction problems that has not been extensivelyexplored within the CSP literature . The DecSIMqualitative simulation algorithm ) provides a solu-tion to this class of CSPs by building upon andextending existing research within the constraintsatisfaction literature . DecSIM provides a sound,but potentially incomplete algorithm' that solves

1 This paper provides a more extensive discussionof the algorithm than what is provided in (Clancy &Kuipers 1998) .

2 As discussed later in the paper, the incompletenessof the algorithm only occurs under certain conditionsand, in fact, has not been manifested in any of the

41

Page 2: Divide and Conquer: Acomponent-based qualitative simulation … · 2003. 8. 29. · Divide and Conquer: Acomponent-based qualitative simulation algorithm Daniel J. Clancy NASAAmes/Caelum

this class of CSP exponentially faster than the tech-niques currently used within the qualitative reason-ing literature . This speed-up facilitates the applica-tion of qualitative simulation techniques to larger,more realistic problems .DecSIM uses a divide and conquer approach to

reduce the complexity of a simulation by exploit-ing structure within the qualitative model. Qual-itative simulation explicitly computes all possiblesolutions to the CSP. As with any CSP, if two vari-ables are completely unconstrained with respectto each other, then the set of all possible solu-tions will contain the cross-product of the possi-ble values for each variable . For QSINI this resultsin combinatoric branching when the temporal or-dering of a set of events is unconstrained by themodel . An event occurs whenever a variable crossesa qualitatively distinct landmark value or its deriva-tive becomes zero . DecSIM avoids explicitly com-puting this cross-product by breaking the state-based CSP P,%1 into a set of smaller sub-problems{pi, p2, . . . )PO} called components. Each compo-nent contains a subset of the variables in PM whileshared variables represent the constraints betweencomponents.DecSIM explicitly computes all solutions (i.e . all

qualitative behaviors) for each component . Eachsolution to a sub-problem pi provides a partial solu-tion to PNr since it provides an assignment of valuesto a subset of the variables . Solutions for relatedsub-problems (i .e . for components that share vari-ables) are consistent if they assign the same value toall shared variables . Thus, the interaction betweencomponents defines a separate, global CSP. For asolution to a sub-problem to be globally consistent,

it must participate in a solution to this global CSP.DecSI1I addresses two problems when determiningif a solution to a component is globally consistent :

1 . When performing a simulation, a solution to asub--problem is actually a sequence of qualitativestates . To ensure that a solution for sub-problempi is consistent with a solution for a related sub-problem pj, each state within the solution for pimust be matched against a state in the solutionfor pi in a manner that satisfies the compositeCSP (see figure 1 for an example) .

2 . Global consistency must be computed in an in-cremental fashion as each solution to a compo-nent is incrementally extended via simulation .

models tested .

QR99 Loch Awe, Scotland

By decomposing the model into smaller prob-lems, DecSIM is able to exploit structure withinthe model in two ways . First, it avoids explic-itly computing all possible solutions to the orig-inal CSP. Instead, it computes all solutions foreach sub-problem and then for each of these so-lutions it computes a single solution to the globalCSP. Second, DecSIM uses causality along with atree-clustering algorithm to identify an ordering be-tween the sub-problems allowing solutions to thecausally upstream sub-problems to be identified asglobally consistent without finding a solution to theglobal CSP.The primary contribution of this paper is the ap-

plication of the DecSIM algorithm to the problemof qualitative simulation . We present both theoreti-cal and empirical results demonstrating the benefitsprovided by DecSIM when compared to techniquescurrently used to perform a simulation . In addi-tion, however, the characterization of qualitativesimulation as a general class of a composite CSPallows us to explore how the concepts used withinthe DecSIM algorithm can be applied to other sim-ilar problems . In particular, this characterizationhighlights many of the similarities between qualita-tive simulation and planning .

Qualitative Simulation as aComposite CSP

Qualitative simulation uses an imprecise, structuralmodel describing a class of dynamical systems toderive a description of all qualitatively distinct be-haviors consistent with the model .' The followingdescription of qualitative simulation will focus onissues that are relevant to its characterization as aconstraint satisfaction problem . In its basic form,a model, called a qualitative differential equation(QDE), is defined by the tuple <V, Q, I, C> whereV is a set of variables, Q a discrete set of values foreach variable, I is an initial state, and C a set ofstate-based constraints on the variables in V .The constraints are abstractions of mathemati-

cal relationships restricting the valid combinationsof values for the variables in the constraint . Thebehavior of the system is described by a tree of al-ternating time-point and time-interval qualitative

3In this presentation, we focus on the representationused by the QSINI qualitative simulation algorithm .These concepts can also be applied to alternative repre-sentations (Forbus 1984 ; de Kleer & Brown 1985) thathave been proposed within the literature .

4 2

Page 3: Divide and Conquer: Acomponent-based qualitative simulation … · 2003. 8. 29. · Divide and Conquer: Acomponent-based qualitative simulation algorithm Daniel J. Clancy NASAAmes/Caelum

a) Initial Model ,~

b) Components

QR99 Loch Awe, Scotland

(c) Component state mappingDecSIM decomposes a single model (a) containing threevariables, X,Y, and Z, into a pair of components (b) .Constraints between components are represented by asingle shared variable Y .

" DecSIM maintains a mapping between states in corn-portents that share a variable. Each qualitative statemust be mapped to a corresponding state withinthe neighboring component . Two states are mappedtogether if they are equivalent with respect to theshared variables and either their predecessors mapto each other or one of the states maps to the prede-cessor of the other state . This mapping ensures thateach component behavior is globally consistent .

" Figure (c) displays a single behavior from each com-ponent . Filled in circles correspond to time-pointstates and unfilled circles to time-interval states . In-teger valued variables are used for this example .Variable values are displayed beneath each state .States that map to each other are connected by anarc .

" Note that a time-interval state can be mapped tomultiple time-point states as other variables in theneighboring component change value . Thus, state B2is mapped to A2, A3 and A4 .

Figure 1 : Example mapnina between states

states . Each qualitative state provides a value forall of the variables within the model along with avalue for a special variable representing time .A qualitative model defines a traditional, state-

based CSP. During simulation, however, this CSP iscomposed with a temporal CSP in which the "vari-ables" correspond to model variables within succes-sive qualitative states . Since a qualitative behav-ior can conceptually be of infinite length, the com-posite CSP contains an arbitrarily large number ofvariables defined by the set UZ r U?i {`t3 } whereVi j corresponds to the variable ti from the originalmodel in the jth state of a qualitative behavior andrn corresponds to the maximum number of stateswithin a given behavior . Similarly, the compositeCSP is also composed of an arbitrarily large num-ber of constraints .

The DecSIM Algorithm

Most applications of constraint satisfaction are con-cerned with identifying a single solution to the CSP.Qualitative simulation, however, must provide acharacterization of all possible solutions to the CSP.Thus, the complexity of the problem is completelydetermined by the size of the solution space andin fact, can be shown to be at least PSPACE-complete .4 Since larger models tend to be moreloosely constrained, simulation of these models of-ten results in intractable branching and an expo-nential number of solutions . Thus, a state-basedrepresentation is inherently limited in its ability torepresent and reason about the behavior of an im-precisely defined dynamical system .To tractably solve the class of problems ad-

dressed by qualitative simulation, the problemspace must be modified to provide a more corn-pact representation . DecSIM exploits the fact thatlarger systems can often be decomposed into a num-ber of loosely connected subsystems due to inher-ent structure that exists within the model (Simon1969) . By decomposing the model . DecSIM is ableto address one of the primary sources of complexity- combinatoric branching due to the complete tem-poral ordering of the behaviors of unrelated vari-ables .

4Qualitative simulation can be shown to be at leastas hard as a STRIPS style planning problems whichBylander (1994) showed to be PSPACE-complete .

43

Page 4: Divide and Conquer: Acomponent-based qualitative simulation … · 2003. 8. 29. · Divide and Conquer: Acomponent-based qualitative simulation algorithm Daniel J. Clancy NASAAmes/Caelum

Component GenerationGiven a model M with a set of variables V andan initial state I, DecSIM uses a partitioningIVl , V2 . . . . V,} of the variables in the model to gen-erate a component for each partition . Currently,the partitioning of the variables is provided as aninput to the DecSIM algorithm . 5 A separate be-havioral description (i .e . set of solutions) is explic-itly generated for each component . The interactionbetween components is represented via shared vari-ables called boundary variables. For each partitionVi, DecSIM generates a component Ci containingtwo types of variables :

within-partition variables are

the

variablesspecified in Vi, and

boundary variables are variables contained inother partitions that have a direct causal influ-ence on the within-partition variables .

The classification of a variable as a boundary vari-able or a within-partition variable is relative withrespect to an individual component . Thus, a vari-able vi might be a within-partition variable in com-ponent Ci, but a boundary variable in componentC; . Each variable within the original model is clas-sified as a within-partition variable in one and onlyone component .

DecSITNI identifies boundary variables using anextension of Iwasaki's (1988) causal ordering al-gorithm to transform the model into a hybriddirected/undirected hypergraph called the causalgraph (see figure 2 for an example) . A variable vi issaid to have a direct causal influence on a variablevj if there exists either an undirected hyperedge inthe causal graph relating vi and vj or if there existsa directed hyperedge extending from vi and termi-nating in vj .Each component Ci defines a qualitative

model, called a sub-QDE, defined by the tuple< Vi , Q, Cv, Ii > where

" ti,' is the union of the set of within-partition vari-ables and boundary variables for the component,

" Q is a set of quantity spaces, one for each of thevariables,

5Various techniques for automating this process havebeen considered ; however, up to this point, we havefocused on the simulation algorithm since partitioningthe variables is a fairly straight-forward extension ofthe model--building process .

QR99 Loch Awe, Scotland

" Cv; is the set of constraints within M that onlycontain the variables in Vi, and

" Ii is a projection of the initial state onto the setof variables in Vi .

Local and global consistencyThe core QSINI algorithm is used to derive a sep-arate behavioral description, called a componenttree, for each component . The terms componentbehavior and component,state are used to refer toa behavior and a state within a component tree re-spectively.Definition 1 (Local consistency) A componentbehavior for component Ci is locally consistent ifand only if it is a solution to the CSP defined byCi, i .e . consistent with the model defined by thecomponent.

QSIM ensures that each component behavior islocally consistent . In addition, however, each com-ponent behavior must be consistent with respect tothe rest of the model . In fact, the boundary vari-ables are effectively unconstrained within a com-ponent and thus their behavior is only constrainedby the interaction between components.' The con-straints between components are represented byshared boundary variables . These constraints de-fine a separate, global CSP in which the "variables"correspond to components and the "variable val-ues" to component behaviors . A component behav-ior is globally consistent if and only if there exists asolution to this global CSP.The rest of this section provides a more detailed

characterization of the global CSP that must besolved . Readers not interested in a detailed descrip-tion of the algorithm can skip directly to the nextsection . First, we describe how global consistencyis defined with respect to a component behavior .Then this concept is extended to individual states .The constraints within this global CSP are im-

plicitly represented by the shared boundary vari-ables . For a set of components {Cl, C2, . . ., C,, }, acomponent behavior bc, is globally consistent if andonly if there exists a set of component behaviorsB = {bc� be,,..., bc, I containing bc, such thatthe component behaviors in B can be combined to

6The boundary variables within a component arecausally upstream, exogenous variables with respect tothe within-partition variables in the component . Thus,their behavior is not directly constrained by the within-partition variables .

44

Page 5: Divide and Conquer: Acomponent-based qualitative simulation … · 2003. 8. 29. · Divide and Conquer: Acomponent-based qualitative simulation algorithm Daniel J. Clancy NASAAmes/Caelum

form a single composite behavior .' A compositebehavior combines a set of component behaviorsinto a single behavior describing all of the variableswithin each component .Definition 2 (Behavior composition) Given aset of component behaviorsB = Ibc�bc. . . . . . bc~ }, 13 is a composite behaviorfor B if and only if 8 describes all of the variablesin U' l VC; and for i from 1 to n IIv,, (,C3) = biwhere IIv,,, is the projection of a behavior onto thevariables in Vci .a

Note that the composition of a set of component be-haviors may result in a large number of compositebehaviors if the components are weakly connected .

Repeatedly determining if a component behavioris globally consistent each time it is extended by asingle state would be prohibitively expensive . In-stead, DecSIM incrementally determines the globalconsistency of a component behavior by maintain-ing a many-to-many mapping between states incomponents that share variables (see figure 1) . Twostates are mapped together if and only if the com-ponent behaviors leading up to the states are com-patible with respect to each other . This mappingallows DecSIM to translate the global CSP in whichthe variable values correspond to component behav-iors into a CSP in which the variable values cor-respond to component states . This allows globalconsistency to be computed via a local computa-tion with respect to the temporal progression of abehavior .The relationships between components are repre-

sented via shared variables which are used to definethe links within a graph of components called thecomponent graph which in turn is used to formallydefine the global CSP.Definition 3 (Component graph) Given a setof related components {C, , C2, . . . , Cn } the compo-nent graph is a labeled, directed graph with a nodecorresponding to each component. The edges aredefined as follows:

" An edge exists from component Ci to componentCj if and only if there exists a variable v such

7Throughout this paper, subscripts are used to iden-tify the component to which a state, behavior or set ofvariables belong. Thus, be, corresponds to a compo-nent behavior from component Ci .

8Please refer to (Clancy 1997) for a formal definitionof the projection operator as it applies to a qualitativebehavior .

QR99 Loch Awe, Scotland

that v is a within-partition variable in. Ci and aboundary variable in

edge from Ci to Cj is labeled with the setof boundary variables in C; that are classified aswithin-partition variables in Ci .

Thus, the component graph identifies the manner inwhich two components are related with respect toshared variables . The graph is directed because itincorporates information obtained from the causalgraph .

If two components are related within the com-ponent graph, then DecSIM maintains a many-to-many mapping between states within the respectivecomponent trees . Two states are mapped togetherif and only if the component behaviors ending inthese states can be combined to form a compos-ite behavior . If components A and B are relatedwithin the component graph, then state SA mapsto component state SB if and only if SA and SB areequivalent with respect, to shared variables, and ei-ther

" both SA and SB are initial states,

" the predecessor of SA maps to the predecessor ofSB,

" the predecessor of SA maps to SB, or

" SA maps to the predecessor of SB .

This mapping defines a boolean predicate, called acomponent edge predicate, for each edge within thecomponent graph that defines how the behaviorscan be combined together .Definition 4 (Component-edge predicate)For all edges Ci !4 C; within the componentgraph, the mapping between states in compo-nents Ci and Cj defines the predicate M

c; -!~C;(Sc; , SC,)

-->

{T, F} where Sc;

and Scj

corre-spond to states in components Ci and C;, respectively .

MC,~c, (si, sj), called a component edgepredicate, is true if and only if si is mapped to sj .

Ci ~4 Cj corresponds to the directed edge labeled vi.irelating component Ci to component Cj . The labelidentifies the set of shared variables.

DecSIA1 uses the component-edge predicates cou-pled with the component graph to define a con-straint satisfaction problem over component statesthat is used to determine if a component state isglobally consistent .

C;-

An

5

Page 6: Divide and Conquer: Acomponent-based qualitative simulation … · 2003. 8. 29. · Divide and Conquer: Acomponent-based qualitative simulation algorithm Daniel J. Clancy NASAAmes/Caelum

Definition 5 (Component graph CSP) Thecomponent graph CSP is defined as follows :

" a variable is defined for each component,

e the domain for each variable is the set of qualita-tive states defined in the component tree for thecorresponding component,

. the constraints are defined by the set ofcomponent-edge predicates defined for the edgeswithin the component graph .

A solution to the component graph CSP, called asolution to the component graph, corresponds to aset of component states1 8 1, 32 . . . . . . n,} such that

one state comes from each component, and

(2) for all i and j such that i, j < n, if there existsv;

an edge Ci N C; then M

v ;

(si, sy) is true .C; -+ C;

Definition 6 (Global consistency) Acomponent state is globally consistent if and only ifthe state is both locally consistent and participatesin a solution to the component graph CSP.

Defining the global CSP over component statesas opposed to component behaviors significantly re-duces the complexity of incrementally generatingeach component behavior . This translation, how-ever, is also the source of DecSIM's incompleteness .Thus, it is possible for a component state to bemarked globally consistent even though the behav-ior terminating in this state does not participate ina solution to the global CSP. Section 3 describesthis issue in detail and discusses why it has notbeen a significant problem up to this point .

Performing the simulationWhen performing a simulation, DecSIM iteratesthrough the components incrementally simulatingthe leaf states in each component tree . DecSIMuses QSIM to generate the successors of each com-ponent state, thus ensuring that each state is locallyconsistent . In addition, however, DecSIM-I must en-sure that each state is also globally consistent .Determining whether a component state is glob-

ally consistent for a fully simulated set of compo-nent behaviors is a straight-forward constraint sat-isfaction problem given the characterization thathas been provided . DecSIM, however, incremen-tally generates each component behavior . Thus,

QR99 Loch Awe, Scotland

it is possible that as component behaviors are ex-tended, a solution to the component graph is gener-ated containing a state already within a componenttree that had previously not been globally consis-tent . In other words, a state s not being globallyconsistent at a given point during the simulationdoes not imply that s is globally inconsistent . Dec-SIM addresses this issue using two techniques :

1 . successors of a component state s are only com-puted if s is determined to be globally consistent,and

2 . the identification of a state as globally consis-tent must be propagated through the componentgraph CSP by identifying all new solutions to thecomponent graph that contain at least one statewhose status with respect to global consistencyhard previously been undetermined .

The first condition ensures that globally inconsis-tent states are not simulated while the second con-dition ensures that all globally consistent solutionsare still computed given the first restriction .The algorithm used to test a state for global con-

sistency exploits causality and structure within thecomponent graph CSP to reduce the complexityof finding a solution . First, a tree-clustering al-gorithm (Dechter & Pearl 1988 ; 1989) is used totransform the component graph CSP into an acycliccluster graph . Since the structure of the compo-nent graph CSP is constant throughout a simula-tion, this transformation significantly reduces thetime required to find a solution to the componentgraph by allowing DecSIM to use constraint prop-agation between clusters as opposed to computinga complete solution to the CSP. Second, causal-ity is used to further reduce the complexity of thisprocess by asserting the independence of causallyupstream components from those components thatare strictly downstream with respect to the causalordering . Please refer to (Clancy 1997) for a de-tailed discussion of this portion of the algorithm .Two primary benefits are provided by DecSIM

with respect to a standard QSINI simulation . First,by transforming the component graph into anacyclic cluster graph, the worst case complexity re-quired to find a solution to the component graphCSP is exponential in the size of the largest clusteras opposed to overall size of the component graph .Second, DecSIM is only required to find a singlesolution to the component graph for each compo-nent behavior as opposed to computing all possible

4 6

Page 7: Divide and Conquer: Acomponent-based qualitative simulation … · 2003. 8. 29. · Divide and Conquer: Acomponent-based qualitative simulation algorithm Daniel J. Clancy NASAAmes/Caelum

solutions as is required by a standard QSIM simu-lation .

An ExampleThe benefits provided by DecSIM can be demon-strated using a simple model of a sequence of cas-caded tanks . Two versions of this model will beused during the discussion . In the simpler version,a simple cascade is used while in the more complexversion a feedback loop exists by which the inflowto the top tank is controlled by the level in thebottom tank (see figure 2) .When performing a standard QSIM simulation of

a simple N-tank cascade, a total of 2N-1 behaviorsare generated enumerating all possible solutions tothe CSP. Many of these solutions, however, simplyprovide different temporal orderings of unrelatedevents . DecSIM, however, eliminates these distinc-tions generating a separate behavioral description,each containing a total of three behaviors, for eachtank . Thus, the overall number of behaviors is lin-ear in the number of tanks . In the controlled ver-sion of the N-tank cascade, DecSIM is still ableto provide significant improvements in the overallsimulation time due to its ability to partition theproblem into smaller sub-problems . For an 8 tankcascade, DecSIM generates an average of 28 behav-iors for each component while QSIM generates atotal of 1071 behaviors .

Theoretical ResultsTraditional techniques for qualitative simulation,while both sound and complete with respect tothe CSP defined by the model, are unable to scaleto larger problems .' DecSIM, on the other hand,trades completeness for efficiency . The followingresults are established in (Clancy 1997) .

Theorem 1 (DecSIM Soundness Guarantee)Given a consistent qualitative model M anda decomposition of the model into componentsI Cl, C2 . . . . Cfrl}, for all solutions B to the com-posite CSP defined by M, DecSIM generates theset of partial solutions {bl , b2, . . . , b�} such that fori :1<i<n ::IIv,(B)=b2 .io

'Note the incompleteness of qualitative simulationis with respect: to the set of real valued trajectories de-scribed by the behavioral description and not the CSP.

t0Bv,(B) is the projection of the solution onto the

subset of variables tz while component CL is assumedto describe the set of variables It .

QR99 Loch Awe, Scotland

Control signal u--------------------

netted in a loop topology .

Tank Al I OuiflowA

Tank

(a) Controlled two tank cascade

(b) Causal graph and variable partitioning

Outflow AComponentA

ControllerComponent

Component B

(c) Component graph

Controller

Figure 2 : Controlled two tank cascade

NettbwA omr 4-mttInf-A _

L~.eIAOatMcA M.

essmeAM

ConaoBrr Afoiel

r-C.'ornpwlmtACotltpment B

taeula.B-oro-

-A-B~ M+

aOntt6 nB

M

Ih

meBM.

The qualitative model of a controlled two tank cas-cade (a) is partitioned into three components : tankA,tankB and the controller .

DecSIM generates a causal graph of the model (b)that is used to identify the boundary variables . Thevariable partitioning is identified by the solid boxeswithin the causal graph .

9 Boundary variables are variables in other partitionsthat are causally upstream . Thus, Outf1owA is aboundary variable for component B and therefore in-cluded in the component ; however, InflowB is not aboundary variable for component A .

o The component graph (c) has three components con-

7

Page 8: Divide and Conquer: Acomponent-based qualitative simulation … · 2003. 8. 29. · Divide and Conquer: Acomponent-based qualitative simulation algorithm Daniel J. Clancy NASAAmes/Caelum

Theorem 2 (DecSIM Completeness Guarantee)Given a consistent model 1111 and a decompositionof the model into components {Cl, C2 . . . . C�L } suchthat there does not exist a cycle of size .3 or greaterin the component graph CSP, for all partial solu-tions bi generated by DecSIM describing the subsetof variables Vi , there exists a corresponding solu-tion to the composite CSP defined by Ill such thatbi - H,, (B) .

Note that the completeness theorem includes a re-striction on the maximum cycle size within thecomponent graph CSP. 11 Except for this one limita-tion, the behavioral description generated by Dec-SIM is identical to the description generated byQSIM except for the temporal ordering of behav-iors for variables in separate components (which isintentionally omitted) . Temporal ordering informa-tion, however, is still available if it is desired sinceDecSIM implicitly represents this information viathe constraints represented by the mapping main-tained between component states .

Incompleteness The source of the incomplete-ness comes from the characterization of the compo-nent graph CSP as a state-based CSP via the map-ping that is maintained during the simulation . Theproblem encountered is analogous to the distinctionbetween constraint propagation and constraint sat-isfaction with respect to the temporal continuityconstraints . Before allowing a state SA to partic-ipate in a solution to the component graph CSP,DecSIM requires that its predecessor participate ina solution . However, it does not check to ensurethat the solution containing SA satisfies the con-tinuity constraints with respect to a solution con-taining the predecessor of SA (see figure 3 for anexample) . To do this, DecSIM would be requiredto maintain a record of solutions to the componentgraph CSP to ensure that a proposed solution iscontinuous with a solution identified for the pre-ceding time-step .

In practice, the incompleteness of the algorithmhas not been a problem for a number of reasons .First, the conditions under which the incomplete-ness of the algorithm is encountered is quite re-stricted and only occurs when two components areclosely related . In fact, we have yet to encounterthis problem in any of the models that have been

"Due to use of causality, it is possible for there tobe multiple links between two components and thus acycle of size two .

QR99 Loch Awe, Scotland

FKey:

The figure describes a simple example in which the in-completeness of the algorithm results in a globally in-consistent state being classified as consistent .

Assume that components A, B and C participate ina cycle in the component graph CSP and that SA,SB and Sc' participate in a consistent solution tothe component graph CSP. (The subscript identifiesthe component while the superscript identifies thelocation of the state within a behavior .)

Furthermore, suppose that the successors of SA andSB (i.e . SA and S2

B) are equivalent with respect totheir shared variables ; however, they do not partic-ipate in a global solution to the component graph .However, both SA and SB participate in other solu-tions to the component graph and thus are markedglobally consistent . Since SA and Sa are compati-ble, however, the link connecting these two states isstill maintained even though this link does notticipate in a solution .

par-

If this occurs, then it is possible for the successors ofSA and SB (i . e . SA and SB) to be mapped to eachother and for this mapping to participate within aglobal solution to the component graph .

e Thus, S3 and SB are both marked globally consis-tent . However, there does not exist a composite be-havior containing the component behavior segmentsterminating in these states since the predecessors ofthese two states do not participate in a solution to-gether .

Figure 3 : Example demonstrating the potential in-completeness

4 8

Ssc

SA V soS .I. S A S s and S c partkipaa in a sdomum a, the comp,- graph .

Sc

A SA SA i ae ienorofS A_ _ _ _ S 9 $

A maps to S B but she twosate do not partici(ate in a gbbel wlutimto the rompnnen~ graph

Page 9: Divide and Conquer: Acomponent-based qualitative simulation … · 2003. 8. 29. · Divide and Conquer: Acomponent-based qualitative simulation algorithm Daniel J. Clancy NASAAmes/Caelum

tested . In addition, we have developed an algo-rithm that can be used to identify when this prob-lem occurs which can be run following completionof a simulation . Finally, qualitative simulation al-ready encounters a problem with behaviors beinggenerated that do not correspond to a real-valuedtrajectory of a dynamical system described by themodel . Thus, techniques using qualitative simu-lation already must account for possible spuriousbehaviors .

Computational complexityThe overall complexity of a standard QSIM simula-tion is determined by the size of the representationthat is being computed . The worst case complex-ity is exponential in the number of variables withinthe model . DecSIM reduces the size of the solutionspace by decomposing the model . For DecSI.M theworst case size is simply exponential in the num-ber of variables in the largest component . DecSIM,however, must also reason about the global consis-tency of a component state by solving the cornpo-nent graph CSP. Thus, the overall benefits providedby DecSIM depend upon the topology of the modeland the degree to which it lends itself to decompo-sition along with the variable partitioning selectedby the modeler .The following two conclusions, established in

(Clancy 1997), define the relationship between Dec-SIM and QSIM with respect to the complexity ofa simulation for a model that is decomposed intok partitions : 1) as the degree of overlap betweencomponents approaches zero, the size of the totalsolution space is reduced by an exponential factork; and 2) as the degree of overlap approaches afully connected constraint graph for the componentgraph CSP, the size of the DecSIM solution spaceis within a factor of k . In practice, the savingsprovided by a DecSIM simulation are quite pro-nounced as is demonstrated by our empirical re-sults . The primary source of these savings is thefact that DecSIM is only required to compute asingle solution to the component graph CSP (i.e.to ensure that each component behavior is consis-tent with at least one global solution) as opposedto computing all solutions (as QSIM does for thenon-decomposed model) .

Empirical EvaluationEmpirical evaluation has been used to measure thebenefits provided by a DecSIM simulation with re-

QR99 Loch Awe, Scotland

nc = Resource limitation prevented completion

Table 1 : Simulation Time Results : DecSIM vsQSINI-

spect to a standard QSIM simulation . Both Dec-SIM and QSIM were tested on a set of "extendible"models . An extendible model is a model composedof a sequence of identical components thus enablingthe incremental extension of the model to facili-tate an evaluation of the asymptotic behavior ofthe algorithm . The models used were variations onthe cascaded tanks example described in figure 2 .Three different versions were used ; each with a dif-ferent topology for the component graph CSP. Asimple cascade topology, a loop topology in whichthe top tank is controlled by the bottom tank, anda chain topology in which the outflow for tank n iscontrolled by the level for tank n + 1 .

For all three models, DecSIM performed ordersof magnitude better than QSIM. Table 1 shows thesimulation time results as the number of tanks arevaried while figure 4(a) plots the results for the loopconfiguration comparing QSIM to DecSIM . Thebenefits provided by DecSIM are even more pro-nounced for the other two topologies . Figure 4(b)provides a comparison of the results from the Dec-SIM simulation for all three topologies . Note thedependence of the computational complexity on thetopology of the model. In the loop configuration,the component graph CSP is composed of a sin-gle, large cycle . Thus, it is more likely to en-counter backtracking when determining if a com-ponent state is globally- consistent . Thus, the com-plexity of the simulation becomes exponential inthe number of tanks . DecSIM, however, still per-forms significantly better than QSIM. Conversely,for the simple N-tank cascade the complexity islinear in the number of tanks .

ConclusionsIn this paper, we have characterized qualitativesimulation as the composition of a state-based

4

of Cascade Chained LoopTanks Qsim DecS Qsim DecS Qsim DecS

2 0.20 0.815 3 .07 6.79 0.757 5 .583 0.62 1 .6 10 .9 19 .90 16.14 8.144 2 .2 3 .12 37.5 25 .98 89.41 12 .65 7.09 5 .49 139 36 .71 493.8 23 .26 21 .9 6 .32 676 62.40 2758 48.77 71 .5 8 .39 1633 "r 0 14474 1168 236 11 .6 8101 77 nc 442

Page 10: Divide and Conquer: Acomponent-based qualitative simulation … · 2003. 8. 29. · Divide and Conquer: Acomponent-based qualitative simulation algorithm Daniel J. Clancy NASAAmes/Caelum

16000

14000

12000

10000

E 9000H

¢' 6000

4000

2000

(a) DecSIM vs QSIM : Loop configuration450

Standard 61StM -DeosM -

4 5 6 7 6Number of Components

3 4 5 6

7 aNumber of Components

(b) DecSIM on different versions of the N-tank cascadeFigure 4 : DecSIM results

and a temporal-based CSP. Furthermore, we haveshown that the state-based representation that istraditionally used when performing a simulation isinherently limited thus restricting the degree towhich techniques based upon qualitative simula-tion can scale to larger, more realistic problems .DecSIM provides an alternative simulation algo-rithm that addresses this problem by decomposingthe model into components . Decomposition elimi-nates combinatoric branching due to the completetemporal ordering of behaviors for unrelated vari-ables contained in separate components . In ad-dition, by characterizing qualitative simulation asa general class of CSPs, we discuss how the Dec-SIM algorithm might be extended to other prob-lems besides qualitative simulation . In particu-lar, we have shown how the problems addressedby qualitative simulation and planning are quitesimilar . Hopefully, this characterization will allowtechniques from these two fields to be integratedthus providing a more unified representation thatcan be used to reason about both autonomous andnon-autonomous change within the physical world .

QR99 Loch Awe, Scotland

ReferencesBylander, T. 1994 . The computational complexityof propositional strips planning . Artificial Intelli-gence 69:165-204 .

Clancy, D . J ., and Kuipers, B . J . 1998 . Qual-itative simulation as a temporally-extended con-straint satisfaction problem . In Proc . of the Fif-teenth National Conference on Artificial Intelli-gence . AAAI Press .

Clancy, D . J . 1997 . Solving complexity and am-biguity problems in qualitative simulation . Tech-nical Report Al-TR97-264, Artificial IntelligenceLaboratory, The University of Texas at Austin .

de Kleer, J ., and Brown, J . S . 1985 . A qualitativephysics based on confluences . In Hobbs, J . R ., andMoore, R. C., eds ., Formal Theories of the Com-monsense World. Norwood, New Jersey : Ablex .chapter 4, 109-183 .Dechter, R., and Pearl, J . 1988 . Tree-clusteringschemes for constraint processing . In Proceedingsof the Seventh National Conference on ArtificialIntelligence . Los Altos, CA . : Morgan Kaufman .

Dechter, R., and Pearl, J . 1989 . Tree-clusteringfor constraint networks . Artificial Intelligence38:353-366 .

Forbus, K. 1984 . Qualitative process theory. Ar-tificial Intelligence 24:85-168 .

Iwasaki, Y . 1988 . Causal ordering in a mixedstrcuture . In Proc . of the Seventh National Con-ference on Artificial Intelligence, 313-318. AAAIPress / The MIT Press .

,

Kuipers, B . 1994 . Qualitative Reasoning: mod-eling and simulation with incomplete knowledge .Cambridge, Massachusetts : MIT Press .

Simon, H. A. 1969 . The Sciences of the Artificial .Cambridge : MIT Press .

Tsang, E . 1993 . Foundations of Constraint Satis-faction. San Diego, CA: Academic Press .

5 0