Qualitative Reasoning : Modeling and Reasoning about Incomplete Qualiative Temporal Information Thesis submitted in partial fulfillment of the requirements for the degree of Bachelor of Technology by Sudip Roy under the guidance of Dr. Partha Pratim Chakrabarti Department of Computer Science and Engineering Indian Institute of Technology Kharagpur Kharagpur, WB 721302, India May 2009
72
Embed
Bachelor of Technology Sudip Roy Dr. Partha Pratim Chakrabarti
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Qualitative Reasoning :Modeling and Reasoning
aboutIncomplete Qualiative Temporal Information
Thesis submitted in partial fulfillment
of the requirements for the degree
of
Bachelor of Technology
by
Sudip Roy
under the guidance of
Dr. Partha Pratim Chakrabarti
Department of Computer Science and EngineeringIndian Institute of Technology Kharagpur
Kharagpur, WB 721302, IndiaMay 2009
Qualitative Reasoning :Modeling and Reasoning
aboutIncomplete Qualiative Temporal Information
Thesis submitted in partial fulfillment
of the requirements for the degree
of
Bachelor of Technology
by
Sudip Roy
under the guidance of
Dr. Partha Pratim Chakrabarti
Department of Computer Science and EngineeringIndian Institute of Technology Kharagpur
Kharagpur, WB 721302, IndiaMay 2009
Department of Computer Science and EngineeringIndian Institute of Technology Kharagpur
Kharagpur, 721302, India.
Certificate
This is to certify that the thesis entitled Qualitative Temporal Reasoning: Modeling andReasoning about Incomplete Qualitative Temporal Information, submitted by SudipRoy, Undergraduate Student, in the Department of Computer Science and Engineering, In-
dian Institute of Technology, Kharagpur, India, for the award of the degree of Bachelor ofTechnology, is a record of an original research work carried out by him under my supervi-
sion and guidance. The thesis fulfills all requirements as per the regulations of this Institute.
Neither this thesis nor any part of it has been submitted for any degree or academic award
elsewhere.
Dr. Partha Pratim Chakrabarti
Acknowledgments
I owe my deepest gratitude to my supervisor, Dr. Partha Pratim Chakrabarti for the
free exchange of ideas, constructive criticism, guidance, encouragement and moral support
throughout the work. It is his supervision with the clear ideas and sharp mind that helped
me to be focused in the right direction. Without his invaluable advice and support it would
not have been possible to complete this work.
I would also like to express my gratitude to Mr. Subrat Panda (Research Scholar) whose
constant encouragement and motivation helped me in completing this work.
I would like to thank my parents for their support and encouragement. It is their prayers
and best wishes that I could complete this mammoth task.
Sudip Roy
AbstractIn this work, we propose a novel formal model which can conveniently model a com-
plex environment with large numbers of states in a simple and concise manner. We model a
dynamic system in terms of objects which are passive entities possessing certain qualitative
properties and processes which capture the change in these properties. The model is based
on qualitative calculus which allows a flexible representation of only the information that is
available and actually needed. It is targeted towards representation of physical phenomena
taught at school and college levels, so as to act as an aid for teaching and understanding
of the basics of physics.
Previous published related works in the field build models to capture a single qualitative
state without any form of temporal ordering of processes. We use the timegraph data struc-
ture to capture the temporal relation between the processes. We also propose algorithms
for state space exploration and address the problem of reachability of a qualitative state.
As part of this work, a software has been developed as an interface for designing mod-
els and reasoning using them. The software provides for a user friendly drawing interface
for creation and specification of the model. The visual representation is translated into a
XML based language, QML which is parsed to build the models. The software simulates
the model using the algorithms mentioned above. In order to promote its functionality as a
teaching aid, we generate easy to understand explanations of the model and its behaviour
in natural language. The explanation is given at two levels : an overview of the model
and an indepth analysis which explains each state, path and cycle in the state transition
diagram.
Contents
1 Introduction 11.1 Motivation and Aim of the Work . . . . . . . . . . . . . . . . . . . . . . . 1
A.3 Qualitative Model for Three Tank System . . . . . . . . . . . . . . . . . . 38
Chapter 1
Introduction
1.1 Motivation and Aim of the Work
One of the primary purposes and motivations of qualitative reasoning is to emulate the
thought process of humans. Thus it is clear that reasoning and inferencing from qualita-
tive information is much more easier for humans. Consider for example “the car heading
towards us is slowing down” versus “the derivative of the car’s speed along the line con-
necting us is -12mph”. Clearly the first description of the event which is a qualitative one
is much more easily processed by a person than the second one in spite of the second one
containing more information than the first.
This project aims at developing a qualitative model which can capture the behavior of a
physical system and thus serve as a learning and teaching aid for students. We try to develop
sound and complete models which can capture the behaviour of a physical system. We
propose efficient algorithms to explore all possible qualitative states of the system and make
suitable inferences which serve us in understanding the physics behind the phenomena in
an intuitive manner. We also look into the reachability problem i.e. given a state of the
system, is another qualitative state reachable from the given state. In order to promote it as
an teaching aid, we provide natural language explanations of the model.
An analysis of the utility of the project can be best discussed with the following ex-
ample. Consider an example : What is the difference between classroom teaching and
reading from a book ? Firstly,teachers usually tend to explain the problem in a system-
atic way. They start by providing a top level explanation of the problem without directly
jumping into the equations or formulae. A top level qualitative explanation introduces
the problem to the students, and lays the foundation for an in depth quantitative analysis.
Secondly, the teacher differs from a book because of the fact that he/she can interpret the
2 Introduction
queries/questions of the students and can answer them suitably, modifying his/her answers
over subsequent queries. This is something which the book fails to do. Thus, if we can
create qualitative models which capture all possible behaviors of the system, then we can
not only reason but also answer specific queries and refine the system with each additional
information. Thirdly, the model serves as a compact representation of the entire problem.
(Cognitive Economy)
1.2 Introduction To Qualitative Reasoning
Qualitative reasoning is the area of AI which creates representations for continuous aspects
of the world, such as space, time and quantity, which support reasoning with very little
information.[5]
1.2.1 Motivation
Qualitative reasoning is motivated by two observations [3].
• People draw useful and subtle conclusions about the physical world without differ-
ential equations. In our daily lives we figure out what is happening around us and
how we can affect it, working with far less data, and less precise data, than would be
required to use traditional, purely quantitative methods
• Scientists and Engineers appear to use qualitative reasoning when initially under-
standing a problem, when setting up more formal methods to solve particular prob-
lems, and when interpreting the results of qualitative simulations, calculations, or
measurements.
.
1.2.2 Qualitative Representations
Qualitative representations provide notations for describing and reasoning about continu-
ous properties of the physical world. While hybrid models discretize the continuous do-
main in order to reason about the system, the knowledge in the hybrid models is complete.
Qualitative models on the other hand reason about incomplete knowledge by providing an
abstraction of the knowledge. [9, 15] Two key issues in qualitative representations are res-
olution and compositionality. [8]
Resolution : Resolution concerns the level of information detail in a representations. Res-
olution is an issue because the goal of qualitative reasoning is to understand how little
1.3 Discussion on Problems Addressed 3
information suffices to draw useful conclusions. Low resolution information is available
more often than precise information.
Compositionality : Compositionality concerns the ability to combine representations for
different aspects of a phenomenon or system to create a representation of the phenomenon
or system as a whole. It is an issue because one goal of Qualitative Reasoning is to formal-
ize the modeling process itself.
1.2.3 State, Time and Behaviours
A qualitative state is a set of propositions that characterize a qualitatively distinct behavior
of a system. A qualitative state describing a falling ball, for instance, would include infor-
mation about what physical processes are occurring (e.g. motion downwards, acceleration
due to gravity) and how the parameters of the ball change (e.g. its position is getting lower
and its downward velocity is increasing).
Qualitative representations can be used to partition behavior into natural units. Quali-
tative state can have transitions to several next states, reflecting ambiguity in the qualitative
representations.
A sequence of qualitative states occurring over a particular span of time is called be-
havior. Behaviors can be described using purely qualitative knowledge, purely quantitative
knowledge, or a mixture of both.
1.2.4 Qualitative State Graph
A Qualitative State Graphis a graphical representation of the qualitative model of the sys-
tem in which each node corresponds to a distinct qualitative state and each transition be-
tween these states correspond to edges in the state graph. The behaviors of a system is a
sequence of qualitative states occurring over a particular span of time [11].
If continuous values are represented by quantity spaces and sources of comparisons are
limit points, then a finite set of qualitative states is sufficient to describe every possible
behaviours of the system. A collection of such qualitative states and their transitions is
called envisionment.
1.3 Discussion on Problems Addressed
In this work, we address the problem of generating the Qualitative State Graph from a
model. We model every physical system as a collection of passive entities and a system
4 Introduction
of interacting processes which change the properties of the entities and hence define their
behaviour in the environment.
Given a model, we use qualitative reasoning techniques to generate the qualitative state
graph which captures every possible qualitative state the system can be and also provides
us information on the various paths along which the state can be reached. The model allows
for a polynomial representation of an exponential number of states of the system and thus
is extremely concise. The task of computing the qualitative state graph from the model is
at an abstract level similar to the problem of constructing a Deterministic Finite Automata
from a Non-Deterministic one, but with qualitative calculus involved.
Since, the work is directed towards facilitating understanding of school level physics,
it is important to provide for easy representation of the information. We achieve it in two
ways -
• visual drawing interface to specify the model.
• generating natural language explanations of the phenomena to aid understanding
1.4 Outline of Thesis
In chapter 2 we introduce the fundamentals necessary for understanding and appreciating
the work. These include basics of temporal logic, qualitative representations, time graphs,
efficient algorithms for reasoning over time and a small discussion on VModel which at-
tempts to solve a similar problem. After establishing the motivation and learning the fun-
damentals, in chapter 3 we propose out formal model and define the syntax and semantics
of the model. We also provide a grammar for generating a specification of the model. In
chapter 4, we discuss algorithms for solving the various problems associated with reason-
ing. The implementation and software development aspects of the project are discussed
briefly in chapter 5. This includes a discussion on the generation of natural language expla-
nation for the model. We conclude in chapter 6 and provide recommendations for further
directions of research on the topic. We discuss in detail the complete workflow on two
commonly referred to problems in the field - the oscillations of a pendulum and the three
tank problem.
Chapter 2
Study of Related Topics
2.1 Temporal Logic
Temporal logic is a convenient formalism for specifying and verifying properties of reactive
systems, as first pointed out by Pnueli in 1977. A formula of temporal logic describes the
set of infinite sequences for which it is true, also known as a temporal property . A given
system satisfies a property if all of its computations belong to this set. [10]
2.1.1 Linear-Time Temporal Logic
A model of linear-time temporal logic (LTL) is an infinite sequence of states where each
point in time has a unique successor. Temporal formulas are evaluated over such a sequence
of states together with an index i=0,1,2,... of the i’th state.
Syntax and Informal Description
Besides the usual logical connectives, temporal formulas can be composed using temporaloperators. We describe these briefly, with p and q being sub-formulas.
Future Temporal Operators
[]p Henceforth p
<>p Eventually p
p Until q q holds some time in the future, and p holds at
least up to the first q
p Awaits q Either p holds indefinitely, or p Until q
()p p holds at the next time instance
Past Temporal Operators
6 Study of Related Topics
[-]p So-far p
<->p Once p
p Since q q did hold some time in the past, and p held at least
down to the first q
p Backto q Either p Since q, or [-]p
(-)p p holds at the previous time instance (and
current time is not 0)
(˜)p p holds at the previous time instance or the
current time is 0 (there is no previous time instance)
Semantics
A temporal logic formula p is satisfiable if there is a sequence of states S such that S,0
|= p. It is valid if the negation is unsatisfiable. A propositional temporal formula is a
temporal formula where all atoms are propositional variables (a propositional temporal
formula therefore does not contain quantification and compound predicates).
2.1.2 Branching-Time Temporal Logic (Computation Tree Logic)
LTL implicitly quantifies universally over paths. Therefore, properties which assert the
existence of a path can be expressed in LTL. Branching-time logics solve this problem by
allowing us to quantify explicitly over paths.
Computation Tree Logic is a branching time logic, meaning that its model is a tree-like
structure in which the future is not determind; there are different paths in the future, any
one of which might be the ’actual’ path that is realized.
2.2 Qualitative Reasoning over Time
In this section we analyze the various temporal representations and reasoning algorithms
proposed [18, 1, 13].
2.2.1 Interval and Point Algebra
Reasoning about temporal constraints is an important task in many areas of computer sci-
ence and elsewhere including scheduling, natural language processing, planning, database
theory, technical diagnosis, circuit design etc [17, 12, 19]. Among the frameworks for
formalizing this type of problem are:
• Point algebra (by van Beek and Cohen) - For expressing relations between time
points
2.2 Qualitative Reasoning over Time 7
• Point Interval Algebra (by Vilain) For expressing relations between time points and
intervals
• Allen’s Interval Algebra For expressing qualitative information between time inter-
vals
State space approaches provide a crude sense of time that is useful in simple problem-
solving tasks. A state is a description of the world (i.e., a database of facts) at an instanta-
neous point in time. Actions are modeled in such systems as functions mapping between
states.
Point Algebra (PA) uses points as the fundamental units and there are 3 possible prim-
itive relations (<,=, >) between any two points. Interval Algebra uses thirteen basic rela-
tions between intervals (shown in the figure below).
Figure 2.1: Basic Relations of Allen’s Interval Algebra
8 Study of Related Topics
2.2.2 TL-Graphs
Timegraphs are graphs partitioned into a set of chains on which the search is supported by
a metagraph data structure. The algorithms herein enable construction of a timegraph from
a given set of PA-relations, querying a timegraph, and efficiently checking the consistency
of a timegraph augmented by a set of PA-disjunctions [7, 2].
Representing temporal relations through graphs
Definition 1 : A temporally labeled graph (TL-graph) is a graph with at least one vertex
and a set of labeled edges, where each edge (v,l,w) connects a pair of distinct vertices v,w.
The edges are either directed and labeled ≤ or <, or undirected and labeled 6=.
A model of a TL-graph is an interpretation of the vertex names as elements of a totally
order set T (with strict ordering <), such that all names attached to the same vertex denote
the same element and the interpretations of names attached to distinct vertices satisfy the
constraints expressed by the edge(s), if any, connecting those vertices.
Definition 2 : A TL-graph is consistent is and only if it has at least one model.
Definition 3 : In a TL-graph we call a path a ≤-path if each label li is ≤ or <. A ≤-
path is a <-path if at least one of these labels is <.
Definition 4 : A ≤-path (<-path) of length n from v0 = vn. A TL-graph is acyclic if it
does not contain any ≤-cycle.
Theorem 1 A TL-graph is consistent iff it does not contain any <-cycle, or any ≤-cycle
that has two vertices connected by an edge with label 6=.
2.2.3 Timegraphs
Definition 5 : A timegraph is an acyclic TL-graph partitioned into a set of time chains,
such that each vertex is on one and only one time chain. A time chain is a ≤-path, plus
possibly transitive edges connecting pairs of vertices on the ≤-path.
Distinct chains of a timegraph can be connected by cross-edges (these, and certain axil-
lary edges, will also be called metaedges). Vertices connected by cross-edges are called
cross-connected vertices (or metavertices).
2.3 VModel - A Single State Qualitative Model 9
Figure 2.2: Example of a TL-graph
The construction of a timegraph from a TL-graph consists of four main steps: consis-
tency checking, ranking of the graph, formation of the chains and making all implicit <
relations explicit.
Table 2.1: Task for Creation and Query of TimegraphsTask Algorithm Used Complexity
Checking Consistency Tarjan’s Algorithm and Lin-
ear <, 6= edges search
O(e)
Ranking the Graph DAG-Longest-Paths Algo-
rithm
O(n+e)
Forming the time chains and
the metagraph
— O(n+e)
Dealing with “not equal” re-
lations
Gereveni’s approach O(e 6 =.(e + n +
k)
Querying — O(n+e)
2.3 VModel - A Single State Qualitative Model
Qualitative Reasoning being a fairly new field of research in computer science, not much
has been done in this field and more so in the direction of its application in education.
10 Study of Related Topics
Among the few works, the most significant has been the contribution of Qualitative Re-
search Group of Northwestern University, who have developed a software Vmodel [4, 6]
which addresses the problem stated above to some extent. The tool provides with visual
representations to help middle-school students to create qualitative models. It also provides
software coaches, which use simple analysis of the model structure plus qualitative simula-
tion to provide feedback and explanations. It is necessary to analyze the software in order
to bring out its limitations which serve as one of the motivations for this work.
2.3.1 Vmodel Ontology
A qualitative model is represented in terms of some elementary entities — processes, basic
stuff, parameters, connectors, controllers, comparisons and causes. Processes represent the
QP theory notion of physical process. Basic stuffs represent objects, groups and substances
in the world. Parameters represent the QP theory notion of quantity. Connectors, Con-
trollers, Comparisons and Causes act as relationships between processes and basic stuff
acting and modifying their parameters.
2.3.2 VModel Advantages and Limitations
VModel is the first work in the direction of developing software for education. It has stu-
dent friendly visual notations which make modelling interesting for students. It allows to
formulate, analyze, test and revise models. Each of the above approaches are crucial to
understanding science. Simplicity of qualitative simulation allows the software to run on
systems with very low processing power.
On the other hand, VModel has several limitations which limit the number of physi-
cal phenomena that can be accurately captured by the model. The qualitative simulation
method used in VModel is very simple. Every process instance is assumed to be active
throughout the simulation. It deals with a single qualitative state, thus avoiding the com-
plexity of branching behaviours and envisioning. Any phenomena which consists of several
processes with a temporal ordering between them cannot be mapped to a vmodel. The tex-
tual explanations of the physical processes lacks fluency of natural language and is imple-
mented in a plug-in format. There is no module which deals with constructions of models
from natural language descriptions (even in controlled language).
Keeping in mind all the advantages of such a software and the limitations in the present
softwares we try to overcome the limitations by proposing a new qualitative model which
addresses many of these issues.
2.3 VModel - A Single State Qualitative Model 11
2.3.3 Extensions to VModel
Based on the analysis of Vmodel, TL-graphs and timegraphs we propose certain extensions
to overcome the limitations and increase the coverage of the tool.
Temporal Ordering
In order to simplify the process of modelling, Vmodel makes an assumption that every pro-
cess instance must be active. It deals with a single qualitative state avoiding the complexity
of branching behaviours and envisioning. However, this severely restricts the space of pro-
cesses which can be represented using it. Any temporal ordering between processes cannot
be imposed. Thus any complex process which consists of a pipeline (sequence) of simple
processes cannot be represented in the model. In order to remove the above limitation we
take note of the TL-graphs and timegraphs described in section 2.2 and 2.3. Initially, we
consider only 3 relations namely ≤t,=t and <t which correspond to precedes,coincides
and strictly precedes relations between the processes respectively. (Such an assumption
reduces the complexities of the algorithms used for simulation and reasoning. The set can
be expanded to include all the thirteen relations of interval algebra. Work in this direction
is aimed at in the future.).
It must be noted here that the algorithms for TL-graph and timegraphs are not directly
applicable to the graph which represents the temporal ordering of the processes in the
model. This is because of the different semantics which changes the notion of consis-
tency defined earlier for TL-graphs. The graph obtained from the processes represents a
sequence by which processes are executed and may contain cycles which represent infinite
(or finite if constraints area attached) sequence of states through which the system passes.
Thus, new modified algorithms need to be presented to account for the semantics as the
TL-graph is no more a DAG (as it was assumed while construction of timegraphs.
Encapsulation
Encapsulation captures the principle of information hiding in which information about
some system is hidden from other systems which are not affected by such information.
It can considered analogous to a black box implementing a particular function, the details
of which are irrelevant. The only relevant thing being the input to the black box and the
output obtained from it. In the real world, complex physical phenomena exhibit encap-
sulation, as it is composed of many simpler physical phenomena, the details of which are
hidden from the external world. For an accurate representation of such phenomena, it is
necessary that the qualitative model used must account for such phenomena.
12 Study of Related Topics
Let us consider a small example to bring out the necessity and efficacy of encapsulation.
Composition
Compositionality concerns the ability to combine representations for different aspects of
a phenomenon or system to create a representation of the phenomenon or system as a
whole. It is an issue because one goal of qualitative reasoning is to formalize the modeling
process itself. Composition is difficult to implement as two different models with different
frames of reference need to overlap and have a common time of origin and synchronize
accordingly. Thus composition either requires the specification of additional information
for synchronization. However, certain simple composition in which the two models are
temporally independent can be overlapped. Consider for example a model account for
the process of rising and falling of a bathtub and another model which accounts for the
temperature control with processes heating and cooling. In this case, we can compose the
two models which have common set of entities to come up with a coherent composed model
which models the two temporally independent processes. We propose to augment every
attribute of an entity with a composition operator from the set of max,min,sum,avg,priority
to define the semantics of multiple influences on a single attribute.
2.4 Summary
In this chapter, we presented a brief description of few of the topics relevant to the under-
standing of this work. We discussed the basics of temporal logic and its types. We presented
a brief study of research in the area of qualitative modeling over time. As part of this re-
search we presented an in depth analysis of a similar system for qualitative modelling and
explored the advantages of such a software as well as delved into the enhancements which
can be made to improve the utility of the software.
Chapter 3
Qualitative Temporal Model
3.1 Entity-Relationship-Process Model
The Entity-Relationship (ER) Model is a widely used data model for database design. It
provides a convenient graphical representation to view data, relationships and constraints.
An entity is an object that exists in the real world and is distinguishable from other objects.
We express the distinction by associating with each entity a set of attributes that describes
the object. A relationship is an association among several entities. A relationship set is
collection of relationships of the same type, and an entity set is a collection of entities of
the same type.
While the ER model captures the static information of the world, it does not capture the
semantics of changes associated with the attributes of entity instances. Thus, we introduce
an extension which captures the dynamic information. Processes are defined as objects
which exist over an interval of time and affect the attributes of entities in a deterministic
manner. The details of the improvised entity-relation model are discussed below.
3.1.1 Model Ontology
Entity
A physical object in the real world distinguishable from others by a set of attributes (prop-
erties) is called an entity. An entity can represent a thing like a ball, a group/collection of
things like herd or even some substance like water. Attributes are measurable properties of
the entity
14 Qualitative Temporal Model
Relationships
There are various classes of relationships. They are
Comparisons - Various information about parameters is expressed via comparisons i.e.
Greater than, less than and equals.
Connectors - Rather than confining the set to some predefined relations we give an open
hand to the users to define the connectors apart from a small set of relationships. The query
answering system should be able to answer queries based on relationships between various
objects.
Effects - These include Increases and Decreasesand are used to define the effects of pro-
cesses on attributes. , Influences and CounterInfluence are used to represent functional
dependence between two parameters.
TemporalOrder - These include Precedes,Follows and Coincides relations between pro-
cesses. Though there are in reality 13 relationships (in Interval Algebra) possible we take
only a subset to simplify modelling.
Processes
Every process is defined by a set of initial conditions, a set of invariant conditions and
a set of effects. The initial conditions act as a trigger which initiate the simulation of the
process whenever the conditions are satisfied. The process continues to be simulated till the
invariant conditions set are satisfied and in each simulation cycle the effects are executed
which update the values of attributes of entities in the world. To incorporate the temporal
constraints between processes we also impose the condition that a process whose initial
condition is satisfied is simulated only if it follow the previous process executed in the time
graph. The details of the algorithm for state space exploration using the notion of processes
has been discussed in Chapter 4.
3.2 Formal Model
The temporal qualitative models proposed can conveniently model a complex environment
with large number of states in a simple and finite model. The model is based on qualitative
calculus which allows a flexible representation of only the information that is available and
actually needed. In this section, based on the model discussed previously we define the
model formally.
3.2 Formal Model 15
3.2.1 Entity Specification
E = {E1, E2, ....., En} (3.1)
where,
Ei = Ai1 ×Ai2 ×Ai3....×Aik (3.2)
where Aij is the jth attribute of the ith entity
3.2.2 Process Specification
P = {P1, P2, ......, Pm} (3.3)
where,
Pi = ICi × InvCi ×Ei (3.4)
where ICi is the set of initial conditions, InvCi is the set of invariant conditions and Ei is
the set of effects produced by the process Pi.
The grammar for expressing initial and invariant condition is restricted to arithmetic op-
eration i.e.
AP [=, <, >,≤,≥]AP (3.5)
where
AP = Aij[+,−, ∗,÷]AP (3.6)
Every condition is thus a proposition in predicate logic with the attribute values of the
entities as propositional variables.
3.2.3 Temporal Graph Specification
T = G(P,E)
such that
P1(R)P2 ∈ E
if and only if P1 is temporally related to P2 by R where R is one of
ENTITY NAME ATTRIBUTE NAME ATTRIBUTE TYPE ATTRIBUTE VALUE
pendulum displacement real min
pendulum speed real max
pendulum direction boolean false
ACTIVE PROCESSES
Process number 1 : mean
STATE INFORMATION FOR S1
ENTITIES
ENTITY NAME ATTRIBUTE NAME ATTRIBUTE TYPE ATTRIBUTE VALUE
pendulum displacement real min
pendulum speed real max
pendulum direction boolean true
ACTIVE PROCESSES
Process number 1 : rising
STATE INFORMATION FOR S2
ENTITIES
ENTITY NAME ATTRIBUTE NAME ATTRIBUTE TYPE ATTRIBUTE VALUE
pendulum displacement real max
pendulum speed real min
pendulum direction boolean true
ACTIVE PROCESSES
Process number 1 : extrema
STATE INFORMATION FOR S3
ENTITIES
ENTITY NAME ATTRIBUTE NAME ATTRIBUTE TYPE ATTRIBUTE VALUE
pendulum displacement real max
pendulum speed real min
pendulum direction boolean false
ACTIVE PROCESSES
Process number 1 : falling
A.1 Oscillations of a Pendulum 33
STATE INFORMATION FOR S4
ENTITIES
ENTITY NAME ATTRIBUTE NAME ATTRIBUTE TYPE ATTRIBUTE VALUE
pendulum displacement real int
pendulum speed real max
pendulum direction boolean false
ACTIVE PROCESSES
Process number 1 : falling
STATE INFORMATION FOR S5
ENTITIES
ENTITY NAME ATTRIBUTE NAME ATTRIBUTE TYPE ATTRIBUTE VALUE
pendulum displacement real min
pendulum speed real int
pendulum direction boolean false
ACTIVE PROCESSES
STATE INFORMATION FOR S6
ENTITIES
ENTITY NAME ATTRIBUTE NAME ATTRIBUTE TYPE ATTRIBUTE VALUE
pendulum displacement real int
pendulum speed real int
pendulum direction boolean false
ACTIVE PROCESSES
Process number 1 : falling
STATE INFORMATION FOR S7
ENTITIES
ENTITY NAME ATTRIBUTE NAME ATTRIBUTE TYPE ATTRIBUTE VALUE
pendulum displacement real int
pendulum speed real min
pendulum direction boolean true
ACTIVE PROCESSES
STATE INFORMATION FOR S8
34 Examples
ENTITIES
ENTITY NAME ATTRIBUTE NAME ATTRIBUTE TYPE ATTRIBUTE VALUE
pendulum displacement real max
pendulum speed real int
pendulum direction boolean true
ACTIVE PROCESSES
STATE INFORMATION FOR S9
ENTITIES
ENTITY NAME ATTRIBUTE NAME ATTRIBUTE TYPE ATTRIBUTE VALUE
pendulum displacement real int
pendulum speed real int
pendulum direction boolean true
ACTIVE PROCESSES
Process number 1 : rising
A.1.5 Qualitative State Transition Diagram
CURRENT STATE ———> PROCESSES ———–> NEXT STATES
S0———>mean, ———>S1
S1———>rising, ———>S2 S7 S8 S9
S2———>extrema, ———>S3
S3———>falling, ———>S0 S4 S5 S6
S4———>falling, ———>S0
S6———>falling, ———>S0
S9———>rising, ———>S2
A.1.6 Explanation in Natural Language
OVERVIEW**************
The following is an explanation of the physical phenomena called ”Oscillations of Pendulum”.The model captures the effect of processes mean, rising, extrema and falling on the objects pendu-lum with real valued attribute displacement, real valued attribute speed and binary attribute direc-
A.1 Oscillations of a Pendulum 35
tion.
The system can be in 9 number of states. 3 out of the 9 states are terminal states (i.e. they haveno outgoing transition). They are S5, S7, S8,
We provide brief explanation of the processes involved in the system. The process mean isactivated when the displacement of pendulum is equal to minimum , the direction of pendulum isequal to false and the speed of pendulum is equal to maximum. The process once active continuesto remain so as long as the speed of pendulum is equal to maximum , the displacement of pendulumis equal to minimum and the direction of pendulum is equal to false. When the process is active, itchanges the value of direction of pendulum to true .
The process rising is activated when the displacement of pendulum is equal to minimum , thedirection of pendulum is equal to true and the speed of pendulum is equal to maximum. The processonce active continues to remain so as long as the displacement of pendulum is equal to a value inbetween maximum and minimum , the speed of pendulum is greater than minimum and the directionof pendulum is equal to true. When the process is active, it decreases the value of speed of pendulumand increases the value of displacement of pendulum .
The process extrema is activated when the displacement of pendulum is equal to maximum ,the speed of pendulum is equal to minimum and the direction of pendulum is equal to true. Theprocess once active continues to remain so as long as the speed of pendulum is equal to minimum ,the displacement of pendulum is equal to maximum and the direction of pendulum is equal to true.When the process is active, it changes the value of direction of pendulum to false .
The process falling is activated when the speed of pendulum is equal to minimum , the directionof pendulum is equal to false and the displacement of pendulum is equal to maximum. The processonce active continues to remain so as long as the speed of pendulum is greater than minimum , thedisplacement of pendulum is equal to a value in between maximum and minimum and the directionof pendulum is equal to false. When the process is active, it increases the value of speed of pendu-lum and decreases the value of displacement of pendulum .
IN-DEPTH ANALYSIS**************************
The system is initially in the following state.
STATE S0 : For entity pendulum displacement is minimum, speed is maximum and direction isfalse. The state has mean as currently active processes. From this state, the states S1, can be reachedusing processes mean.
We now provide an explanation of all possible transitions that can occur in the system given theinitial state above.
STATE S0 : For entity pendulum displacement is minimum, speed is maximum and direction isfalse. The state has mean as currently active processes. From this state, the states S1, can be reachedusing processes mean.
STATE S1 : For entity pendulum displacement is minimum, speed is maximum and directionis true. The state has rising as currently active processes. From this state, the states S2, S7, S8, S9,
36 Examples
can be reached using processes rising.
STATE S2 : For entity pendulum displacement is maximum, speed is minimum and directionis true. The state has extrema as currently active processes. From this state, the states S3, can bereached using processes extrema.
STATE S3 : For entity pendulum displacement is maximum, speed is minimum and direction isfalse. The state has falling as currently active processes. From this state, the states S0, S4, S5, S6,can be reached using processes falling.
STATE S4 : For entity pendulum displacement is intermediate, speed is maximum and directionis false. The state has falling as currently active processes. From this state, the states S0, can bereached using processes falling.
STATE S5 : For entity pendulum displacement is minimum, speed is intermediate and directionis false. This is a terminal state and has no outgoing transitions.
STATE S6 : For entity pendulum displacement is intermediate, speed is intermediate and direc-tion is false. The state has falling as currently active processes. From this state, the states S0, canbe reached using processes falling.
STATE S7 : For entity pendulum displacement is intermediate, speed is minimum and directionis true. This is a terminal state and has no outgoing transitions.
STATE S8 : For entity pendulum displacement is maximum, speed is intermediate and directionis true. This is a terminal state and has no outgoing transitions.
STATE S9 : For entity pendulum displacement is intermediate, speed is intermediate and direc-tion is true. The state has rising as currently active processes. From this state, the states S2, can bereached using processes rising.
OSCILLATIONS OR REPITIONS IN THE SYSTEM************************************************
Various cycles in the state transition diagram represent oscillations or repition of sequences andare thus important for the understanding of the overall phenomena.. Therefore we provide a conciseexplanation for such cycles in the state transition diagram.
The following is a description of the 1th cycle in the transition table. The cycle constitutesthestates S0->S1->S2->S3->S0. The processes falling take the system from state S3 to state S0.Theprocesses extrema take the system from state S2 to state S3.The processes rising take the systemfrom state S1 to state S2.The processes mean take the system from state S0 to state S1.
The following is a description of the 2th cycle in the transition table. The cycle constitutesthestates S0->S1->S2->S3->S4->S0. The processes falling take the system from state S4 to stateS0.The processes falling take the system from state S3 to state S4.The processes extrema take thesystem from state S2 to state S3.The processes rising take the system from state S1 to state S2.Theprocesses mean take the system from state S0 to state S1.
The following is a description of the 3th cycle in the transition table. The cycle constitutesthestates S0->S1->S2->S3->S6->S0. The processes falling take the system from state S6 to stateS0.The processes falling take the system from state S3 to state S6.The processes extrema take the
A.2 Three Tank Problem 37
system from state S2 to state S3.The processes rising take the system from state S1 to state S2.Theprocesses mean take the system from state S0 to state S1.
A.1.7 Testing Predictions
In order to find out if a particular state of assignment of values to attributes in reachable
from the initial state we specify the query in the form of an assignment to the values to the
variables. For example for the query:
pendulum speed max and
pendulum displacement max
the software will reason to conclude that it is not a reachable state. Had it been a reachable
state the software would have displayed the states which agree with the prediction. The
information about how this state can be reached from any other given state can also be easily
derived by finding all paths between the states in the qualitative state transition diagram.
A.2 Three Tank Problem
A.2.1 Problem Description
The figure below shows a simple system of three couple tanks. This system consists of 6
components: 3 tanks, 2 pipes between them and a pump. The pump fills the first tank with
a liquid. The pipes between the tanks have limited flow rate. The last tank has a hole where
the liquid can run out.
Figure A.2: Three Tank System
38 Examples
A.2.2 Visual Model
The visual model shown in figure A.2 captures the qualitative behaviour of the system.
The model is defined by 3 entities which are the three tanks. Processes transfer12,
transfer23, transfer32, transfer21, pump and drain represent the activities of the sys-
tem. The temporal information is shown by the two exclude edges. The exclude edge be-
tween transfer12 and transfer21 signify that the transfer from tank 1 to tank 2 and tank 2
to tank 1 cannot take place simulataneously. Similarly, from transfer23 and transfer32.
Every entity is associated with an attribute level which basically corresponds to the level
of the liquid in the tank. The level can either be maximum indicating a full tank, minimum
indicating an empty tank or intermediate indicating a partially filled tank. Depending on the
relative levels of the tanks and considering the temporal constraints, the various processes
are activated. The conditions are speficied in the qml file shown in section A.2.3.
EXCLUDES
EXCLUDES
TANK1
TANK2
TANK3
LEVEL
LEVEL
LEVEL
PUMP
TRANS−−FER 1 −−−> 2
TRANS−FER2 −−−> 3
TRANS−FER 2−−−−> 1
TRANS−−FER3 −−−> 2
DRAIN
Figure A.3: Qualitative Model for Three Tank System
The following is an explanation of the physical phenomena called ”THREE TANK SYSTEM”.The model captures the effect of processes pump, drain, transfer12, transfer23, transfer21 andtransfer32 on the objects tank1 with real valued attribute level, tank2 with real valued attributelevel, and tank3 with real valued attribute level.
The system can be in 26 number of states.
We provide brief explanation of the processes involved in the system. The process pump isactivated when the level of tank1 is less than maximum. The process once active continues to remainso as long as the level of tank1 is less than maximum. When the process is active, it increases thevalue of level of tank1 .
The process drain is activated when the level of tank3 is greater than minimum. The processonce active continues to remain so as long as the level of tank3 is greater than minimum. When theprocess is active, it decreases the value of level of tank3 .
The process transfer12 is activated when the level of tank1 is greater than the level of tank2 .The process once active continues to remain so as long as the level of tank1 is greater than the levelof tank2 . When the process is active, it increases the value of level of tank2 and decreases the valueof level of tank1 .
The process transfer23 is activated when the level of tank2 is greater than the level of tank3 .The process once active continues to remain so as long as the level of tank2 is greater than the levelof tank3 . When the process is active, it increases the value of level of tank3 and decreases the valueof level of tank2 .
The process transfer21 is activated when the level of tank2 is greater than the level of tank1 .The process once active continues to remain so as long as the level of tank2 is greater than the levelof tank1 . When the process is active, it increases the value of level of tank1 and decreases the valueof level of tank2 .
The process transfer32 is activated when the level of tank3 is greater than the level of tank2 .The process once active continues to remain so as long as the level of tank3 is greater than the levelof tank2 . When the process is active, it increases the value of level of tank2 and decreases the valueof level of tank3 .
IN-DEPTH ANALYSIS**************************
The system is initially in the following state.
STATE S0 : For entity tank1 level is minimum. For entity tank2 level is minimum. For entity
A.2 Three Tank Problem 55
tank3 level is minimum. The state has pump as currently active processes. From this state, the statesS1, S17, can be reached using processes pump.
We now provide an explanation of all possible transitions that can occur in the system given theinitial state above.
STATE S0 : For entity tank1 level is minimum. For entity tank2 level is minimum. For entitytank3 level is minimum. The state has pump as currently active processes. From this state, the statesS1, S17, can be reached using processes pump.
STATE S1 : For entity tank1 level is maximum. For entity tank2 level is minimum. For entitytank3 level is minimum. The state has transfer12 as currently active processes. From this state,the states S2, S4, S8, S10, can be reached using processes transfer12.
STATE S2 : For entity tank1 level is minimum. For entity tank2 level is maximum. For entitytank3 level is minimum. The state has transfer23,transfer21 and pump as currently active pro-cesses. From this state, the states S3, S9, S5, S21, S7, S11, S13, S16, can be reached using processestransfer23,transfer21 and pump. S1, S17, S14, S10, can be reached using processes transfer21
and pump. S3, S9, S5, S21, S7, S11, S13, S16, can be reached using processes transfer23 andpump. S18, S4, can be reached using processes pump. S3, S9, S5, S21, S7, S11, S13, S16, canbe reached using processes transfer23 and transfer21. S1, S17, S14, S10, can be reached usingprocesses transfer21. S25, S15, S26, S20, can be reached using processes transfer23.
STATE S3 : For entity tank1 level is maximum. For entity tank2 level is minimum. For en-tity tank3 level is maximum. The state has drain,transfer32 and transfer12 as currently activeprocesses. From this state, the states S2, S4, S8, S10, S6, S12, S20, S16, can be reached using pro-cesses drain,transfer32 and transfer12. S2, S4, S8, S10, S6, S12, S20, S16, can be reached usingprocesses transfer32 and transfer12. S2, S4, S8, S10, S6, S12, S20, S16, can be reached usingprocesses drain and transfer12. S24, S22, S15, S21, can be reached using processes transfer12.S18, S14, S19, S13, can be reached using processes drain and transfer32. S18, S14, S19, S13, canbe reached using processes transfer32. S1, S7, can be reached using processes drain.
Similar explanations are generated for 27 states in total. However due to space limitationswe have shown only 3
OSCILLATIONS OR REPITIONS IN THE SYSTEM*******************************************Various cycles in the state transition diagram represent oscillations or repition of sequences and arethus important for the understanding of the overall phenomena.. Therefore we provide a conciseexplanation for such cycles in the state transition diagram.
The following is a description of the 1th cycle in the transition table. The cycle constitutesthestates S2->S3->S2. The processes drain, transfer32 and transfer12 take the system from stateS3 to state S2.The processes transfer23, transfer21 and pump take the system from state S2 tostate S3.
The following is a description of the 2th cycle in the transition table. The cycle constitutesthestates S3->S4->S3. The processes transfer23, transfer21 and pump take the system from stateS4 to state S3.The processes drain, transfer32 and transfer12 take the system from state S3 to
56 Examples
state S4.
The following is a description of the 3th cycle in the transition table. The cycle constitutesthestates S2->S3->S4->S5->S2. The processes drain, transfer32 and transfer12 take the systemfrom state S5 to state S2.The processes transfer23, transfer21 and pump take the system fromstate S4 to state S5.The processes drain, transfer32 and transfer12 take the system from stateS3 to state S4.The processes transfer23, transfer21 and pump take the system from state S2 tostate S3.
The following is a description of the 4th cycle in the transition table. The cycle constitutesthestates S4->S5->S4. The processes drain, transfer32 and transfer12 take the system from stateS5 to state S4.The processes transfer23, transfer21 and pump take the system from state S4 tostate S5.
The following is a description of the 5th cycle in the transition table. The cycle constitutesthestates S2->S3->S4->S5->S6->S7->S2. The processes drain, transfer32 and transfer12 takethe system from state S7 to state S2.The processes drain, transfer23, transfer21 and pump takethe system from state S6 to state S7.The processes drain, transfer32 and transfer12 take thesystem from state S5 to state S6.The processes transfer23, transfer21 and pump take the systemfrom state S4 to state S5.The processes drain, transfer32 and transfer12 take the system fromstate S3 to state S4.The processes transfer23, transfer21 and pump take the system from stateS2 to state S3.
The following is a description of the 25th cycle in the transition table. The cycle constitutes-the states S2->S3->S4->S5->S6->S7->S8->S9->S10->S11->S12->S13->S2. The processesdrain and transfer12 take the system from state S13 to state S2.The processes pump, drain,transfer21 and transfer23 take the system from state S12 to state S13.The processes pump andtransfer12 take the system from state S11 to state S12.The processes transfer23 take the systemfrom state S10 to state S11.The processes pump, drain, transfer32 and transfer12 take the sys-tem from state S9 to state S10.The processes transfer23, transfer21 and pump take the systemfrom state S8 to state S9.The processes drain, transfer32 and transfer12 take the system fromstate S7 to state S8.The processes drain, transfer23, transfer21 and pump take the system fromstate S6 to state S7.The processes drain, transfer32 and transfer12 take the system from stateS5 to state S6.The processes transfer23, transfer21 and pump take the system from state S4 tostate S5.The processes drain, transfer32 and transfer12 take the system from state S3 to stateS4.The processes transfer23, transfer21 and pump take the system from state S2 to state S3.
There are 218 such cycles and explanations are generated for each of them in a similar
manner. Due to space constraints they have not been shown here
A.2.7 Testing Predictions
In order to find out if a particular state of assignment of values to attributes in reachable
from the initial state we specify the query in the form of an assignment to the values to the
variables. The result of the query is displayed as a dialog. For example for the query in the
A.2 Three Tank Problem 57
form of the configuration : tank1 : level : max tank2 : level : int tank3 : level min
The result is is displayed as the state S14 agrees with the configuration. Had it been a
configuration which cannot be reached from the initial state by any sequence of actions, an
appropriate message saying so would have been displayed.
Bibliography
[1] P. V. Beek. Reasoning about qualitative temporal information. Artificial Intelligence, 58:728–734, 1992.
[2] T. Bittner. Approximate qualitative temporal reasoning. Annals of Mathematics and Artificial
Intelligence, 35:39–80, 2001.[3] B. Bredeweg and P. Struss. Current topics in qualitative reasoning. AI Magazine, 24(4):13–16,
December 2004.[4] K. Carney, R. Harris, B. Sherin, K. Forbus, and K. Forbus. A qualitative modeling environ-
ment for middle-school students: A progress report. In St. Mary?s University, pages 65–72,2001.
[5] K. D. Forbus. Qualitative reasoning, 1996.[6] K. D. Forbus, K. Carney, B. L. Sherin, and L. C. U. II. Vmodel: A visual qualitative modeling
environment for middle-school students. In AAAI, pages 820–827, 2004.[7] A. Gerevini and L. Schubert. Efficient algorithms for qualitative reasoning about time. Artifi-
cial Intelligence, 74:207–248, 1995.[8] P. J. Hayes. The second naive physics manifesto. pages 46–63, 1990.[9] T. A. Henzinger. The theory of hybrid automata. pages 278–292. IEEE Computer Society
Press, 1996.[10] M. Huth and M. Ryan. Logic in Computer Science: modelling and reasoning about systems
(Portuguese language edition). Cambridge University Press, 2008.[11] B. K. In. Qualitative simulation, 1986.[12] A. Krokhin, P. Jeavons, and P. Jonsson. Reasoning about temporal relations: The tractable
subalgebras of allen’s interval algebra. Journal of the ACM, 50:2003, 2001.[13] B. Kuipers. Qualitative simulation using time-scale abstraction. International Journal Artifi-
cial Intelligence in Engineering, 3:185–191, 1988.[14] A. Nakhimovsky. Temporal reasoning in natural language understanding: The temporal struc-
ture of the narrative. In In Proceedings of the 3rd European Meeting of the Association for
Computational Linguistics, pages 262–269, 1987.[15] O. Sokolsky, , O. Sokolsky, and H. S. Hong. Qualitative modeling of hybrid systems. In In
Proc. of the Montreal Workshop, 2001.[16] P. R. Sven. Qualitative physics as a component in natural language semantics:.[17] A. Travers, S. Venkatesh, and D. Kieronska. A point-based representation for intervals. pages
169–174, Nov 1995.
60 BIBLIOGRAPHY
[18] L. Vila. A survey on temporal reasoning in artificial intelligence, 1994.[19] M. Vilain, H. Kautz, and P. Beek. Constraint propagation algorithms for temporal reason-
ing. In Readings in Qualitative Reasoning about Physical Systems, pages 377–382. MorganKaufmann, 1986.