Qualitative Reasoning : Modeling and Reasoning about Incomplete

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
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
Department of Computer Science and Engineering
Indian Institute of Technology Kharagpur
Kharagpur, 721302, India.
Certificate
This is to certify that the thesis entitled Qualitative Temporal Reasoning: Modeling and
Reasoning about Incomplete Qualitative Temporal Information, submitted by Sudip
Roy, Undergraduate Student, in the Department of Computer Science and Engineering, Indian Institute of Technology, Kharagpur, India, for the award of the degree of Bachelor of
Technology, is a record of an original research work carried out by him under my supervision 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
Abstract
In this work, we propose a novel formal model which can conveniently model a complex 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 structure 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 models 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
1
1.1
Motivation and Aim of the Work . . . . . . . . . . . . . . . . . . . . . . .
1
1.2
Introduction To Qualitative Reasoning . . . . . . . . . . . . . . . . . . . .
2
1.2.1
Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
1.2.2
Qualitative Representations . . . . . . . . . . . . . . . . . . . . .
2
1.2.3
State, Time and Behaviours . . . . . . . . . . . . . . . . . . . . .
3
1.2.4
Qualitative State Graph . . . . . . . . . . . . . . . . . . . . . . . .
3
1.3
Discussion on Problems Addressed . . . . . . . . . . . . . . . . . . . . . .
3
1.4
Outline of Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4
2 Study of Related Topics
2.1
2.2
2.3
2.4
5
Temporal Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
2.1.1
Linear-Time Temporal Logic . . . . . . . . . . . . . . . . . . . . .
5
2.1.2
Branching-Time Temporal Logic (Computation Tree Logic) . . . .
6
Qualitative Reasoning over Time . . . . . . . . . . . . . . . . . . . . . . .
6
2.2.1
Interval and Point Algebra . . . . . . . . . . . . . . . . . . . . . .
6
2.2.2
TL-Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8
2.2.3
Timegraphs
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8
VModel - A Single State Qualitative Model . . . . . . . . . . . . . . . . .
9
2.3.1
Vmodel Ontology . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.2
VModel Advantages and Limitations . . . . . . . . . . . . . . . . 10
2.3.3
Extensions to VModel . . . . . . . . . . . . . . . . . . . . . . . . 11
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3 Qualitative Temporal Model
3.1
Entity-Relationship-Process Model . . . . . . . . . . . . . . . . . . . . . . 13
3.1.1
3.2
13
Model Ontology . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Formal Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
ii
CONTENTS
3.2.1
Entity Specification . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.2
Process Specification . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.3
Temporal Graph Specification . . . . . . . . . . . . . . . . . . . . 15
3.2.4
Qualitative State . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3
Grammar for Model Specification . . . . . . . . . . . . . . . . . . . . . . 16
3.4
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4 Reasoning Algorithms
19
4.1
State Space Exploration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2
Cycle Detection in Qualitative State Transition Diagram . . . . . . . . . . 21
4.3
Reachability Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3.1
4.4
Transitive Closure Computation . . . . . . . . . . . . . . . . . . . 22
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5 QualSym : Implementation and Software Development
23
5.1
Visual Drawing Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2
QML - Qualitative Modeling Language . . . . . . . . . . . . . . . . . . . 23
5.2.1
Parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.2.2
Visual Model to QML . . . . . . . . . . . . . . . . . . . . . . . . 25
5.2.3
QML to Visual Model . . . . . . . . . . . . . . . . . . . . . . . . 25
5.3
Natural Language Generation . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.4
Querying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.5
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6 Conclusions and Recommendations for Further Work
27
6.1
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.2
Extension beyond Point Algebra . . . . . . . . . . . . . . . . . . . . . . . 27
6.3
Compositionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.4
Information Extraction from Textual Explanations . . . . . . . . . . . . . . 28
A Examples
29
A.1 Oscillations of a Pendulum . . . . . . . . . . . . . . . . . . . . . . . . . . 29
A.1.1 Problem Description . . . . . . . . . . . . . . . . . . . . . . . . . 29
A.1.2 Visual Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
A.1.3 QML Specification . . . . . . . . . . . . . . . . . . . . . . . . . . 29
A.1.4 State Description . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
A.1.5 Qualitative State Transition Diagram . . . . . . . . . . . . . . . . . 34
CONTENTS
iii
A.1.6 Explanation in Natural Language . . . . . . . . . . . . . . . . . . 34
A.1.7 Testing Predictions . . . . . . . . . . . . . . . . . . . . . . . . . . 37
A.2 Three Tank Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
A.2.1 Problem Description . . . . . . . . . . . . . . . . . . . . . . . . . 37
A.2.2 Visual Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
A.2.3 QML Specification . . . . . . . . . . . . . . . . . . . . . . . . . . 38
A.2.4 State Description . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
A.2.5 Qualitative State Transition Table . . . . . . . . . . . . . . . . . . 48
A.2.6 Explanation in Natural Language . . . . . . . . . . . . . . . . . . 54
A.2.7 Testing Predictions . . . . . . . . . . . . . . . . . . . . . . . . . . 56
BIBLIOGRAPHY
58
List of Figures
2.1
Basic Relations of Allen’s Interval Algebra . . . . . . . . . . . . . . . . .
7
2.2
Example of a TL-graph . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
5.1
Drawing Interface of QualSym . . . . . . . . . . . . . . . . . . . . . . . . 24
A.1 Pendulum System in QualSym . . . . . . . . . . . . . . . . . . . . . . . . 30
A.2 Three Tank System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
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 qualitative 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 connecting 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 example. 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 systematic 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 differential 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 understanding a problem, when setting up more formal methods to solve particular problems, 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 continuous properties of the physical world. While hybrid models discretize the continuous domain 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 resolution and compositionality. [8]
Resolution : Resolution concerns the level of information detail in a representations. Resolution 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 formalize 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 information 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. Qualitative 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 behavior. 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 system in which each node corresponds to a distinct qualitative state and each transition between 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 attempts to solve a similar problem. After establishing the motivation and learning the fundamentals, 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 reasoning. 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 explanation 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 temporal
operators. We describe these briefly, with p and q being sub-formulas.
Future Temporal Operators
[]p
Henceforth p
<>p
p Until q
Eventually p
q holds some time in the future, and p holds at
p Awaits q
least up to the first 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
<->p
p Since q
p Backto q
(-)p
(˜)p
So-far p
Once p
q did hold some time in the past, and p held at least
down to the first q
Either p Since q, or [-]p
p holds at the previous time instance (and
current time is not 0)
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 science 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 intervals
State space approaches provide a crude sense of time that is useful in simple problemsolving tasks. A state is a description of the world (i.e., a database of facts) at an instantaneous 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 primitive relations (<, =, >) between any two points. Interval Algebra uses thirteen basic relations between intervals (shown in the figure below).
Figure 2.1: Basic Relations of Allen’s Interval Algebra
8
2.2.2
Study of Related Topics
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 axillary 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: consistency checking, ranking of the graph, formation of the chains and making all implicit <
relations explicit.
Task
Table 2.1: Task for Creation and Query of Timegraphs
Algorithm Used
Complexity
Checking Consistency
Tarjan’s Algorithm and Lin-
O(e)
ear <,6= edges search
Ranking the Graph
DAG-Longest-Paths
Algo-
O(n+e)
rithm
Forming the time chains and
—
O(n+e)
Gereveni’s approach
O(e6 =.(e + n +
the metagraph
Dealing with “not equal” relations
Querying
k)
—
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 Research 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 simulation 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, Controllers, 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 student 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 physical 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 complexity 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 textual explanations of the physical processes lacks fluency of natural language and is implemented 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 process 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 processes 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 consistency 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 encapsulation, 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 understanding 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 research 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 (properties) 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 processes on attributes. , Influences and CounterInfluence are used to represent functional
dependence between two parameters.
TemporalOrder - These include Precedes,Follows and Coincides relations between processes. 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)
Ei = Ai1 × Ai2 × Ai3 .... × Aik
(3.2)
where,
where Aij is the j th attribute of the ith entity
3.2.2 Process Specification
P = {P1 , P2 , ......, Pm }
(3.3)
Pi = ICi × InvCi × Ei
(3.4)
where,
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 operation i.e.
AP [=, <, >, ≤, ≥]AP
(3.5)
AP = Aij[+, −, ∗, ÷]AP
(3.6)
where
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
{<t (precedes), =t (coincides), 6=t , (excludes) ≤}
(3.7)
16
Qualitative Temporal Model
These relations model the point algebra over time. Two processes are said to coincide
if the activity of one implies that of the other. A process P 1 is said to precede P 2 if the
process P 1 must occur before P 2. A process P 1 is said to not-follow P 2 if the process P 1
must occur before or coincide with P 2. A process P 1 is said to exclude P 2 if the activity
of P 1 implies the inactivity of P 2.
3.2.4 Qualitative State
The qualitative state S of the system is defined by
• the states of the entities of the system defined by the values (qualitative) of the attributes of the entities.
• the set of currently active processes in the system. Processes are activated when their
initial conditions are satisfied and their temporal relationship permit so. Once active
they remain so as long as their invariant conditions are satisfied.
State Transition Table - The state transition table captures the transition between states of
the system and can be viewed as a directed graph with nodes corresponding to states of the
system and edges corresponding to the transition between states.
Some of the states may be marked as final state which mark a state where the system
reaches a termination. Such states may semantically correspond to forbidden states. (for
eg. a hazardous state of the three tank system).
3.3 Grammar for Model Specification
We provide a Context Free Grammar to specify the model. All non-terminals are italicized.
The naming of the symbols and the grammar is self-explanatory. M odel → EntityList
P rocessList RelationList
EntityList → Entity EntityList k φ
P rocessList → P rocess P rocessList k φ
RelationList → Relation RelationList k φ
Entity → EntityName AttributeList
AttributeList → Attribute AttributeList k φ
3.4 Summary
17
Attribute → AttributeName AttributeT ypeV alue
AttributeT ypeV alue → RealV alued k BooleanV alued
RealV alued → real (minkmaxkint)
BooleanV alued → boolean (truekfalse)
P rocess → ProcessName InitialConditions InvariantConditions Ef f ects
InitialConditions → Condition InitialConditions k φ
InvariantConditions → Condition InvariantConditions k φ
Condition → P recedents (<k>k=k<=k>=k) Antecedents
P recedent → Expression
Antecedent → Expression
Expression → Attribute k Attribute Operator Expression
Operator → (+ k − k ÷ k ∗)
Ef f ect → (Ef f ectT ype Attribute value ) k (Ef f ectT ype Attribute)
Ef f ectT ype → incrkdecrkassign
Relation → P rocess1 temporalOP P rocess2
P rocess1 → P rocess
P rocess2 → P rocess
temporalOP → (precedeskfollowskexcludeskcoincides)
3.4 Summary
In this chapter, we presented a novel qualitative temporal model which allows us to capture
the behavior of a physical system. The inclusion of processes as a dynamic entity and
the addition of temporal graph to impose an ordering between the processes allows us to
provide a greater flexibility in representing the physics behind the system. Such a model
also allows us to represent the entire behavior (the number of states the system can be is
exponential in the resolution of the attribute values) of the system in a concise and intuitive
nature and serves the requirement of using it as a tool to model the intuition behind a
phenomenon. We also provide a grammar for specifying the model. In the next chapter we
discuss various techniques for reasoning with the information contained in the model.
Chapter 4
Reasoning Algorithms
The primary motivation of proposing a novel qualitative temporal model was to have a concise and intuitive representation of a physical system. In order to extract meaningful and
useful information from the model, we need to compute the qualitative states the system
can be in as well as the various transitions which occur in the system. The state transition table captures such information. Below we propose certain algorithms which given a
model compute the state transition table, and subsequently use the transition table to extract
generic information about the system and its behaviour.
4.1 State Space Exploration
The problem addressed in this section is the indeterminacy generated by multiple execution
paths in the temporal graph and computing reachability in the state space corresponding to
the model.The algorithm mentioned below generates a state transition table which captures
all possible transitions in the state space of the model and aids in answering reachability
queries. The transition diagram also helps in prediction and tracing the sequence of events
leading to a particular state.
20
Reasoning Algorithms
Algorithm 1 ComputeTransitions (CS)
VARIABLES
Global T - State Transition Table
Local CS - Current state init Initial State (IS)
Global TG - Temporal Graph of the processes
Global FS - List of Final States
if CS ∈ FS then
Add < CS, (CS.AP ), φ > to T
end if
Let AP = List of Active Process in CS
for all SAP such that SAP ⊆ AP do
List of Possible Next States LNS = Simulate(S, SAP)
for all NS such that NS ∈ LNS do
if NS ∈ T then
Add < CS, (SAP ), N S > to T
else
Add < CS, (SAP ), N S > to T
ComputeTransitions(NS)
end if
end for
end for
The algorithm 2 described below, given a particular configuration of the system i.e.
the attributed values of all entities and a list of processes to be simulated, simulates the
processes and checks for any inconsistent state that may be arising out of it. For example
: A model simulating a water tub with processes filling and draining, it is not possible
to reason in an consistent manner the behavior of the level of water (with no quantitative
knowledge about the rates of inflow and outflow). However if only one of the processes is
active then the reasoning can be done easily on the level.
The situation can be handled in 2 ways. One is to stop the exploration along any
path which leads to an inconsistent state or explore all the possible consistent states which
can arise. For example in the above case if both the processes are active then the level
of water may be either increasing or decreasing with equal probability and thus both the
possible next states may be considered. The second approach though explores all possible
states of the model, does not give comprehensive guarantee of reachability but rather a
probabilistic estimation of the reachability at best. The algorithm below is for the first
4.2 Cycle Detection in Qualitative State Transition Diagram
21
approach, however by changing the next state computation by not restricting it to a single
possible state and changing the notion of consistency it can easily be transformed to cater
to the second approach.
Algorithm 2 Simulate(S, SAP)
state NS
for all Entity Ei do
for all Attribute Aj of Ei do
L
Let j denote the combination operator associated with attribute of type Aj
L
if
k P is consistent where P ∈ SAP ( Semantic definition depending on the
attribute ) then
N S.Ei .Aj =
L
k
P
else
return φ
end if
end for
end for
return NS
4.2 Cycle Detection in Qualitative State Transition Diagram
Cycles in the Qualitative State Transition Diagram represent repetitions or oscillations in
the system. The presence of a cycle in the qualitative state diagram indicates at least one
sequence by which the system remains active over an infinite amount of time. Thus, the
detection of cycles in the system provides useful information about the behaviour of the
system and aids in understanding. The qualitative state transition diagram can be abstracted
to be viewed as a directed graph G(V, E) (Note that such a graph is not a simple graph and
there can be multiple edges between states representing multiple processes which can take
the system from one state to the next). However, since we begin with an initial state, a
simple DFS run with the initial state as the root suffices to detect and report all cycles in
the system.
4.3 Reachability Test
It is interesting to address the problem of reachability between two qualitative states. For an
interactive model, the user must be allowed to ask questions about the which of the states
are actually reachable in the system. Also, another direction to it is to test the reachability
22
Reasoning Algorithms
and report the sequence of events that can take the system from a given state to another
state.
Given a partial (incomplete) configuration of the system, the task is to find out the
states which agree with the configuration and identify the paths by which such states can
be reached from the initial state. Thus, the problem has 2 directions - one is to identify the
states which agree and then identify the paths by which these states can be reached. The first
part can be dealt with by defining the semantics of equality or equivalence of two qualitative
states. With the semantics specified, the task reduces to computing all the qualitative states
the system can be in and test equivalence. The problem of computing all states has been
addresses in the section on State Space Exploration. The second problem of detecting the
path along which the states can be reached translates to a path search in the state transition
diagram generated as a result of State Space Exploration earlier. The path search can again
be interpreted as a DFS. It is to be noted that since, there can be multiple paths to reach a
state including some by looping through a cycle of states, a modified version of the DFS
algorithm needs to be used.
4.3.1
Transitive Closure Computation
Another way of addressing the problem will be to compute the transitive closure of the
state transition diagram and annotate each of the new additional edges added with the path
that takes the state from one to the other. Given this data structure and the pre-processing
required to compute it the problem of reachability of states can actually be addressed in a
linear time. The linearity is due to the state equivalence search over all possible states of
the system.
4.4
Summary
In this chapter, we presented algorithms which extract information from the qualitative
temporal model proposed earlier. Such information is useful in understanding the system.
The information computed using these algorithms is used to generate a user friendly explanation of the system in natural language. All of the algorithms discussed here have
been implemented and incorporated into the software QualSym. In the next chapter, we
discuss various implementation issues associated along with the procedure for generating
explanation of the information computed here in simple English language.
Chapter 5
QualSym : Implementation and
Software Development
We discuss the various implementation and software development issues associated with
the development of QUALSYM, the software for modelling and reasoning over qualitative
temporal model described in the earlier chapters. It must be understood that the software is
only a prototype and can have a number of extensions to enhance its feature and modelling
capacity. The complete software implementation has been done in Java.
5.1 Visual Drawing Interface
The software provides for a drag and drop drawing interface to allow the user to model the
system visually. There are three basic components which can be drawn visually. They are
the entities, processes and attributes. Relations between processes are depicted as colored
edges between them, such that the color of the edge is indicative of the type of relation
existing between them. The attribute cannot have an independent existence and must exist
with an entity. We use the canvas API in java to implement the drawing interface.
5.2 QML - Qualitative Modeling Language
We propose a new Modelling Language which is a variant of the Extensible Markup Language(XML) to represent the model. We choose XML to represent the model because over
the years it has evolved as a standard language for sharing structured information. Moreover, it being extensible allows the users to define mark-up elements, thereby allowing
for the extension of the model easily to include additional properties in future. The exact
24
QualSym : Implementation and Software Development
Figure 5.1: Drawing Interface of QualSym
specification of qualitative model using the language has been discussed in the following
section. An additional advantage of using XML is the availability of APIs for parsing XML
documents in many platforms including Java.
5.2.1
Parsing
The entire model is specified within <qmodel> </qmodel> tags.
Every model consists of three main sections
1. Entity Specification
2. Process Specification
3. Temporal Graph Specification.
Entity Specification
All entities are specified within <entity> </entity> tags. The entity is specified using its
title and type (thing/group of things/substance). Every entity is described using a list of
attributes specified using <attribute> and</attribute> tags. Every attribute is specified
5.2 QML - Qualitative Modeling Language
25
using its name, datatype, initial value and aggregator. In the present version of the software
we cater to only two data types - real and boolean. The real valued data can take up three
values corresponding to the attribute being minimum, maximum or somewhere in between.
The boolean valued attribute can be either true or false.
Process Specification
Every process delimited using <process> and </process> tags is specified using the initial
conditions (declared within <initial conditions> and </initial conditions>), the invariant
conditions (declared within <invariant conditions> and </invariant conditions>) and the
effects (declared within <effects> and </effects>). The specification of each of the above
is self-explanatory and can be easily understood by studying the examples in the Appendix
A.
Temporal Graph Specification
The temporal graph is initialized as having each of the processes corresponding to a node.
In order to add order to the processes edges must be placed in the graph. These edges
are specified within <relation> and </relation> tags. The exact nature of the relation is
specified by operator value which can assume one of coincides, precedes, not-follow and
excludes. These relations model the point algebra over time. Two processes are said to
coincide if the activity of one implies that of the other. A process P 1 is said to precede
P 2 if the process P 1 must occur before P 2. A process P 1 is said to not-follow P 2 if the
process P 1 must occur before or coincide with P 2. A process P 1 is said to exclude P 2 if
the activity of P 1 implies the inactivity of P 2.
5.2.2 Visual Model to QML
Even though the visual model is very effective in representing the system, it is not possible
to capture the dynamic information using a visual model. Thus, the drawing interface
can be used to generate QMLtemplate files. These template files must be modified to add
triggering and invariant conditions to the processes. Also, the effects of the processes on
entities must be specified manually by editing the QML.
5.2.3 QML to Visual Model
We enhance the basic QML to incorporate the position information of the visual objects in
the model. The position information of each object is mention as xpos and ypos tags in the
26
QualSym : Implementation and Software Development
specification of the object. This, allows us to recreate the visual model of the system given
a specification of the system in QML.
5.3
Natural Language Generation
The model specification in terms of entities, processes and a temporal order between them
can be simulated and mapped to the state space of the phenomenon using the algorithm described in the previous chapters. Since, each state is basically a description of the attributes
of the entities, the values of the attributes can be plugged into the templates in order to generate a meaningful textual representation of the phenomenon. It must be noted that though
the text output may not have a good fluency, it certainly will have a high fidelity as the information is represented is derived directly from the state description without introduction
of any ambiguity.
We provide for 2 level explanation of the system. First, we provide an overview of the
system by describing the entities and the processes. This basically is a textual representation of the model. Secondly, we also provide an in depth analysis of the model. which
provides explanations in natural language for each states of the model. Since, as discussed
in chapter 4, cycles carry important information about the system. Therefore, we provide
textual descriptions for all the cycles which are detected in the system.
5.4 Querying
The query in the environment can basically be mapped to a reachability study. Thus the
query is mentioned as a configuration of the system. Query answering thus basically involves a search in the state transition diagram of the model for the query state. This has
been previously discussed in Section 4.3.
5.5 Summary
In this chapter, we provide an overview of the actual software implementation and layout
the various components of the software. To review, the main components of the software
are a module for drawing interface, module for parsing QML, module for algorithms and a
module for natural language generation.
Chapter 6
Conclusions and Recommendations
for Further Work
6.1 Conclusion
In this work, we have proposed a simple and concise model to capture the qualitative behaviour of physical systems. In our knowledge this is the first effort to combine temporal information into a qualitative model with an intent to use it as an aid for teaching school level
physics. We have provided algorithms for extracting information of various resolutions for
the system by generating qualitative state transition diagrams, detecting cyclic/repetitive
behaviour of the system and also checking reachability of a qualitative state for the system.
In order to exhibit the power and utility of the model, we have developed a software
QualSym. QualSym provides a user friendly environment for the task of modeling and
understanding. In order to help users understand the behavior of the system they are modelling we provide for natural language explanations of the model. The complete process of
modelling and reasoning has been shown on two examples in the Appendix A.
6.2 Extension beyond Point Algebra
As discussed previously in section 2.2 there are various frameworks for reasoning about
temporal constraints. In this work, to maintain simplicity we have used Point Algebra.
However, it can be easily seen that most physical processes span over a period of time and
cannot be abstracted to a single time instant. Allen’s Interval Algebra with 13 relations
between intervals is one of the frameworks which provides an algebra over intervals. One
of possible extensions to the present model would be incorporate a tractable subalgebra of
28
Conclusions and Recommendations for Further Work
Allen’s Interval Algebra to model the temporal relation between various processes. This
will allow for a more intuitive way of representing and reasoning about things.
6.3
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.
Composing smaller models to build larger models provides an organized and hierarchical
representation of events. Even though the current version of the software does not support
composition, it is certainly a requirement to model complex environments. Various related
issues such as that of inheritance, interaction between models etc. needs to be looked into.
6.4
Information Extraction from Textual Explanations
Some work in the direction of conversion of a natural language text to a qualitative model
has been done [16, 14]., but still a lot of scope is left. For processing natural language texts
it is necessary to understand the connections between QP theory and natural language. It is
important for understanding the general cognitive plausibility of qualitative models. A few
topics to focus on are
• Investigate forms in which continuous properties can appear in written natural language
• Focus on physical quantities found in descriptions of physical processes such as expansion, movement or transfer
• Results may be used to write grammatical rules of a parser or in the design of information extraction algorithms
Appendix A
Examples
We discuss the complete workflow on two of the models in order to bring out the efficacy
of the model in solving other similar problems.
A.1 Oscillations of a Pendulum
A.1.1 Problem Description
We try to model a simple physical phenomenon of the oscillation of a pendulum and show
that various stages of the model. We start by providing the specification of the model in
the form of XML as shown in the diagrams below. The model can be graphically visualized as having four different processes (rising, falling, mean and extrema) acting on an
entity pendulum which is defined by its attributed namely speed, displacement and direction (Note that there may be other attributes as well such as mass, effective length etc. but
due to simplicity we only consider some of them). On applying the algorithms which were
described earlier we can obtain the state transition diagram which basically represents the
various states through which the system passes.
A.1.2 Visual Model
Shown in the fig A.1 is the visual representation of the pendulum system in the drawing
interface of QualSym.
A.1.3 QML Specification
<qmodel title="Oscillations of Pendulum">
<entity type="Thing" name="pendulum" xpos="407" ypos="274" scale="1.0">
<attribute name="displacement" type="real" init="min" xpos="548" ypos="184" scale="1.0"
30
Examples
Figure A.1: Pendulum System in QualSym
aggregator="sum"></attribute>
<attribute name="speed" type="real" init="max" xpos="257" ypos="187" scale="1.0"
aggregator="sum"></attribute>
<attribute name="direction" type="boolean" init="false" xpos="413" ypos="430" scale="1.0"
aggregator="and"></attribute>
</entity>
<process name="mean" xpos="393" ypos="20" scale="1.0" initial="true">
<initial_conditions>
<p entity ="pendulum" attribute = "displacement" comparator="=" value="min"></p>
<p entity ="pendulum" attribute = "direction" comparator="=" value="false"></p>
<p entity ="pendulum" attribute = "speed" comparator="=" value="max"></p>
</initial_conditions>
<invariant_conditions>
<p entity ="pendulum" attribute = "speed" comparator="=" value="max"></p>
<p entity ="pendulum" attribute = "displacement" comparator="=" value="min"></p>
<p entity ="pendulum" attribute = "direction" comparator="=" value="false"></p>
</invariant_conditions>
<effects>
<e type = "assign" entity = "pendulum" attribute = "direction" value = "true"></e>
</effects>
</process>
<process name="rising" xpos="33" ypos="275" scale="1.0" initial="false">
<initial_conditions>
A.1 Oscillations of a Pendulum
31
<p entity ="pendulum" attribute = "displacement" comparator="=" value="min"></p>
<p entity ="pendulum" attribute = "direction" comparator="=" value="true"></p>
<p entity ="pendulum" attribute = "speed" comparator="=" value="max"></p>
</initial_conditions>
<invariant_conditions>
<p entity ="pendulum" attribute = "displacement" comparator="=" value="int"></p>
<p entity ="pendulum" attribute = "speed" comparator=">" value="min"></p>
<p entity ="pendulum" attribute = "direction" comparator="=" value="true"></p>
</invariant_conditions>
<effects>
<e type = "decr" entity = "pendulum" attribute = "speed"></e>
<e type = "incr" entity = "pendulum" attribute = "displacement"></e>
</effects>
</process>
<process name="extrema" xpos="407" ypos="599" scale="1.0" initial="false">
<initial_conditions>
<p entity ="pendulum" attribute = "displacement" comparator="=" value="max"></p>
<p entity ="pendulum" attribute = "speed" comparator="=" value="min"></p>
<p entity ="pendulum" attribute = "direction" comparator="=" value="true"></p>
</initial_conditions>
<invariant_conditions>
<p entity ="pendulum" attribute = "speed" comparator="=" value="min"></p>
<p entity ="pendulum" attribute = "displacement" comparator="=" value="max"></p>
<p entity ="pendulum" attribute = "direction" comparator="=" value="true"></p>
</invariant_conditions>
<effects>
<e type = "assign" entity = "pendulum" attribute = "direction" value = "false"></e>
</effects>
</process>
<process name="falling" xpos="793" ypos="301" scale="1.0" initial="false">
<initial_conditions>
<p entity ="pendulum" attribute = "speed" comparator="=" value="min"></p>
<p entity ="pendulum" attribute = "direction" comparator="=" value="false"></p>
<p entity ="pendulum" attribute = "displacement" comparator="=" value="max"></p>
</initial_conditions>
<invariant_conditions>
<p entity ="pendulum" attribute = "speed" comparator=">" value="min"></p>
<p entity ="pendulum" attribute = "displacement" comparator="=" value="int"></p>
<p entity ="pendulum" attribute = "direction" comparator="=" value="false"></p>
</invariant_conditions>
<effects>
<e type = "incr" entity = "pendulum" attribute = "speed"></e>
<e type = "decr" entity = "pendulum" attribute = "displacement"></e>
</effects>
</process>
<relation type="temporal" process1="rising" operator = "precedes" process2="extrema"></relation>
<relation type="temporal" process1="extrema" operator = "precedes" process2="falling"></relation>
<relation type="temporal" process1="falling" operator = "precedes" process2="mean"></relation>
<relation type="temporal" process1="mean" operator = "precedes" process2="rising"></relation>
</qmodel>
32
A.1.4
Examples
State Description
STATE INFORMATION FOR S0
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
pendulum
displacement
pendulum
speed
pendulum
direction
ATTRIBUTE TYPE
ATTRIBUTE VALUE
real
real
min
max
boolean
false
ACTIVE PROCESSES
Process number 1 : mean
STATE INFORMATION FOR S1
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
pendulum
displacement
pendulum
speed
pendulum
direction
ATTRIBUTE TYPE
ATTRIBUTE VALUE
real
real
min
max
boolean
true
ACTIVE PROCESSES
Process number 1 : rising
STATE INFORMATION FOR S2
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
pendulum
displacement
pendulum
speed
pendulum
direction
ATTRIBUTE TYPE
ATTRIBUTE VALUE
real
real
max
min
boolean
true
ACTIVE PROCESSES
Process number 1 : extrema
STATE INFORMATION FOR S3
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
pendulum
displacement
pendulum
speed
pendulum
direction
ACTIVE PROCESSES
Process number 1 : falling
ATTRIBUTE TYPE
ATTRIBUTE VALUE
real
real
boolean
max
min
false
A.1 Oscillations of a Pendulum
33
STATE INFORMATION FOR S4
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
pendulum
displacement
pendulum
speed
pendulum
direction
ATTRIBUTE TYPE
ATTRIBUTE VALUE
real
real
int
max
boolean
false
ACTIVE PROCESSES
Process number 1 : falling
STATE INFORMATION FOR S5
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
pendulum
displacement
pendulum
speed
pendulum
direction
ATTRIBUTE TYPE
ATTRIBUTE VALUE
real
real
min
int
boolean
false
ACTIVE PROCESSES
STATE INFORMATION FOR S6
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
pendulum
displacement
pendulum
speed
pendulum
direction
ATTRIBUTE TYPE
ATTRIBUTE VALUE
real
real
int
int
boolean
false
ACTIVE PROCESSES
Process number 1 : falling
STATE INFORMATION FOR S7
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
pendulum
displacement
pendulum
speed
pendulum
direction
ACTIVE PROCESSES
STATE INFORMATION FOR S8
ATTRIBUTE TYPE
ATTRIBUTE VALUE
real
real
boolean
int
min
true
34
Examples
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
pendulum
displacement
pendulum
speed
pendulum
direction
ATTRIBUTE TYPE
ATTRIBUTE VALUE
real
real
max
int
boolean
true
ACTIVE PROCESSES
STATE INFORMATION FOR S9
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
pendulum
displacement
pendulum
speed
pendulum
direction
ATTRIBUTE TYPE
ATTRIBUTE VALUE
real
real
boolean
int
int
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 pendulum 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 have
no outgoing transition). They are S5, S7, S8,
We provide brief explanation of the processes involved in the system. The process mean is
activated when the displacement of pendulum is equal to minimum , the direction of pendulum is
equal to false and the speed of pendulum is equal to maximum. The process once active continues
to remain so as long as the speed of pendulum is equal to maximum , the displacement of pendulum
is equal to minimum and the direction of pendulum is equal to false. When the process is active, it
changes the value of direction of pendulum to true .
The process rising is activated when the displacement of pendulum is equal to minimum , the
direction of pendulum is equal to true and the speed of pendulum is equal to maximum. The process
once active continues to remain so as long as the displacement of pendulum is equal to a value in
between maximum and minimum , the speed of pendulum is greater than minimum and the direction
of pendulum is equal to true. When the process is active, it decreases the value of speed of pendulum
and 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. The
process 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 direction
of pendulum is equal to false and the displacement of pendulum is equal to maximum. The process
once active continues to remain so as long as the speed of pendulum is greater than minimum , the
displacement of pendulum is equal to a value in between maximum and minimum and the direction
of pendulum is equal to false. When the process is active, it increases the value of speed of pendulum 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 is
false. The state has mean as currently active processes. From this state, the states S1, can be reached
using processes mean.
We now provide an explanation of all possible transitions that can occur in the system given the
initial state above.
STATE S0 : For entity pendulum displacement is minimum, speed is maximum and direction is
false. The state has mean as currently active processes. From this state, the states S1, can be reached
using processes mean.
STATE S1 : For entity pendulum displacement is minimum, speed is maximum and direction
is 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 direction
is true. The state has extrema as currently active processes. From this state, the states S3, can be
reached using processes extrema.
STATE S3 : For entity pendulum displacement is maximum, speed is minimum and direction is
false. 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 direction
is false. The state has falling as currently active processes. From this state, the states S0, can be
reached using processes falling.
STATE S5 : For entity pendulum displacement is minimum, speed is intermediate and direction
is false. This is a terminal state and has no outgoing transitions.
STATE S6 : For entity pendulum displacement is intermediate, speed is intermediate and direction is false. The state has falling as currently active processes. From this state, the states S0, can
be reached using processes falling.
STATE S7 : For entity pendulum displacement is intermediate, speed is minimum and direction
is true. This is a terminal state and has no outgoing transitions.
STATE S8 : For entity pendulum displacement is maximum, speed is intermediate and direction
is true. This is a terminal state and has no outgoing transitions.
STATE S9 : For entity pendulum displacement is intermediate, speed is intermediate and direction is true. The state has rising as currently active processes. From this state, the states S2, can be
reached using processes rising.
OSCILLATIONS OR REPITIONS IN THE SYSTEM
************************************************
Various cycles in the state transition diagram represent oscillations or repition of sequences and
are thus important for the understanding of the overall phenomena.. Therefore we provide a concise
explanation for such cycles in the state transition diagram.
The following is a description of the 1th cycle in the transition table. The cycle constitutesthe
states S0->S1->S2->S3->S0. The processes falling take the system from state S3 to state S0.The
processes extrema take the system from state S2 to state S3.The processes rising take the system
from 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 constitutesthe
states S0->S1->S2->S3->S4->S0. The processes falling take the system from state S4 to state
S0.The processes falling take the system from state S3 to state S4.The processes extrema take the
system from state S2 to state S3.The processes rising take the system from state S1 to state S2.The
processes 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 constitutesthe
states S0->S1->S2->S3->S6->S0. The processes falling take the system from state S6 to state
S0.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.The
processes 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
A.2.2
Examples
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 transf er12 ,
transf er23 , transf er32 , transf er21 , pump and drain represent the activities of the system. The temporal information is shown by the two exclude edges. The exclude edge between transf er12 and transf er21 signify that the transfer from tank 1 to tank 2 and tank 2
to tank 1 cannot take place simulataneously. Similarly, from transf er23 and transf er32 .
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.
LEVEL
PUMP
TANK1
TRANS−
−FER
1 −−−> 2
TRANS−
FER
2−−−−> 1
EXCLUDES
TANK2
TRANS−
FER
2 −−−> 3
LEVEL
EXCLUDES
TRANS−
−FER
3 −−−> 2
TANK3
DRAIN
LEVEL
Figure A.3: Qualitative Model for Three Tank System
A.2.3
QML Specification
<qmodel title="THREE TANK SYSTEM">
<entity type="Thing" name="tank1" xpos="444" ypos="116" scale="1.0">
<attribute name="level" type="real" init="min" xpos="560" ypos="85" scale="1.0"
aggregator="sum"></attribute>
</entity>
A.2 Three Tank Problem
39
<entity type="Thing" name="tank2" xpos="444" ypos="242" scale="1.0">
<attribute name="level" type="real" init="min" xpos="560" ypos="221" scale="1.0"
aggregator="sum"></attribute>
</entity>
<entity type="Thing" name="tank3" xpos="444" ypos="361" scale="1.0">
<attribute name="level" type="real" init="min" xpos="560" ypos="331" scale="1.0"
aggregator="sum"></attribute>
</entity>
<process name="pump" xpos="220" ypos="19" scale="1.0" initial="true">
<initial_conditions>
<p entity="tank1" attribute="level" comparator="lt" value="max"></p>
</initial_conditions>
<invariant_conditions>
<p entity="tank1" attribute="level" comparator="lt" value="max"></p>
</invariant_conditions>
<effects>
<e type="incr" entity="tank1" attribute="level"></e>
</effects>
</process>
<process name="drain" xpos="640" ypos="450" scale="1.0" initial="false">
<initial_conditions>
<p entity="tank3" attribute="level" comparator=">" value="min"></p>
</initial_conditions>
<invariant_conditions>
<p entity="tank3" attribute="level" comparator=">" value="min"></p>
</invariant_conditions>
<effects>
<e type="decr" entity="tank3" attribute="level"></e>
</effects>
</process>
<process name="transfer_1_2" xpos="220" ypos="156" scale="1.0" initial="false">
<initial_conditions>
<p entity1="tank1" attribute1="level" comparator=">" entity2="tank2"
attribute2="level"></p>
</initial_conditions>
<invariant_conditions>
<p entity1="tank1" attribute1="level" comparator=">" entity2="tank2"
attribute2="level"></p>
</invariant_conditions>
<effects>
<e type="incr" entity="tank2" attribute="level"></e>
<e type="decr" entity="tank1" attribute="level"></e>
</effects>
</process>
<process name="transfer_2_3" xpos="220" ypos="306" scale="1.0" initial="false">
<initial_conditions>
<p entity1="tank2" attribute1="level" comparator=">" entity2="tank3"
attribute2="level"></p>
</initial_conditions>
<invariant_conditions>
<p entity1="tank2" attribute1="level" comparator=">" entity2="tank3"
40
Examples
attribute2="level"></p>
</invariant_conditions>
<effects>
<e type="incr" entity="tank3" attribute="level"></e>
<e type="decr" entity="tank2" attribute="level"></e>
</effects>
</process>
<process name="transfer_2_1" xpos="640" ypos="150" scale="1.0" initial="false">
<initial_conditions>
<p entity1="tank2" attribute1="level" comparator=">" entity2="tank1"
attribute2="level"></p>
</initial_conditions>
<invariant_conditions>
<p entity1="tank2" attribute1="level" comparator=">" entity2="tank1"
attribute2="level"></p>
</invariant_conditions>
<effects>
<e type="incr" entity="tank1" attribute="level"></e>
<e type="decr" entity="tank2" attribute="level"></e>
</effects>
</process>
<process name="transfer_3_2" xpos="640" ypos="269" scale="1.0" initial="false">
<initial_conditions>
<p entity1="tank3" attribute1="level" comparator=">" entity2="tank2"
attribute2="level"></p>
</initial_conditions>
<invariant_conditions>
<p entity1="tank3" attribute1="level" comparator=">" entity2="tank2"
attribute2="level"></p>
</invariant_conditions>
<effects>
<e type="incr" entity="tank2" attribute="level"></e>
<e type="decr" entity="tank3" attribute="level"></e>
</effects>
</process>
<relation type="temporal" process1="transfer_1_2" operator="excludes" process2="transfer_2_1">
</relation>
<relation type="temporal" process1="transfer_2_3" operator="excludes" process2="transfer_3_2">
</relation>
</qmodel>
A.2.4
State Description
STATE INFORMATION FOR S0
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
min
tank2
level
real
min
A.2 Three Tank Problem
tank3
level
41
real
min
ACTIVE PROCESSES
Process number 1 : pump
STATE INFORMATION FOR S1
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
max
tank2
level
real
min
tank3
level
real
min
ACTIVE PROCESSES
Process number 1 : transf er12
STATE INFORMATION FOR S2
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
min
tank2
level
real
max
tank3
level
real
min
ACTIVE PROCESSES
Process number 1 : transf er23
Process number 2 : transf er21
Process number 3 : pump
STATE INFORMATION FOR S3
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
max
tank2
level
real
min
tank3
level
real
max
ACTIVE PROCESSES
Process number 1 : drain
Process number 2 : transf er32
Process number 3 : transf er12
STATE INFORMATION FOR S4
42
Examples
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
int
tank2
level
real
max
tank3
level
real
min
ACTIVE PROCESSES
Process number 1 : transf er23
Process number 2 : transf er21
Process number 3 : pump
STATE INFORMATION FOR S5
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
max
tank2
level
real
int
tank3
level
real
max
ACTIVE PROCESSES
Process number 1 : drain
Process number 2 : transf er32
Process number 3 : transf er12
STATE INFORMATION FOR S6
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
min
tank2
level
real
max
tank3
level
real
int
ACTIVE PROCESSES
Process number 1 : drain
Process number 2 : transf er23
Process number 3 : transf er21
Process number 4 : pump
STATE INFORMATION FOR S7
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
A.2 Three Tank Problem
43
tank1
level
real
max
tank2
level
real
min
tank3
level
real
int
ACTIVE PROCESSES
Process number 1 : drain
Process number 2 : transf er32
Process number 3 : transf er12
STATE INFORMATION FOR S8
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
min
tank2
level
real
int
tank3
level
real
min
ACTIVE PROCESSES
Process number 1 : transf er23
Process number 2 : transf er21
Process number 3 : pump
STATE INFORMATION FOR S9
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
int
tank2
level
real
min
tank3
level
real
max
ACTIVE PROCESSES
Process number 1 : pump
Process number 2 : drain
Process number 3 : transf er32
Process number 4 : transf er12
STATE INFORMATION FOR S10
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
int
tank2
level
real
int
44
Examples
tank3
level
real
min
ACTIVE PROCESSES
Process number 1 : pump
Process number 2 : transf er23
STATE INFORMATION FOR S11
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
int
tank2
level
real
min
tank3
level
real
int
ACTIVE PROCESSES
Process number 1 : pump
Process number 2 : drain
Process number 3 : transf er32
Process number 4 : transf er12
STATE INFORMATION FOR S12
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
int
tank2
level
real
max
tank3
level
real
int
ACTIVE PROCESSES
Process number 1 : pump
Process number 2 : drain
Process number 3 : transf er21
Process number 4 : transf er23
STATE INFORMATION FOR S13
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
max
tank2
level
real
int
tank3
level
real
int
ACTIVE PROCESSES
A.2 Three Tank Problem
45
Process number 1 : drain
Process number 2 : transf er12
STATE INFORMATION FOR S14
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
max
tank2
level
real
int
tank3
level
real
min
ACTIVE PROCESSES
Process number 1 : transf er12
Process number 2 : transf er23
STATE INFORMATION FOR S15
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
min
tank2
level
real
int
tank3
level
real
max
ACTIVE PROCESSES
Process number 1 : transf er32
Process number 2 : pump
Process number 3 : transf er21
Process number 4 : drain
STATE INFORMATION FOR S16
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
int
tank2
level
real
int
tank3
level
real
int
ACTIVE PROCESSES
Process number 1 : pump
Process number 2 : drain
STATE INFORMATION FOR S17
46
Examples
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
int
tank2
level
real
min
tank3
level
real
min
ACTIVE PROCESSES
Process number 1 : pump
Process number 2 : transf er12
STATE INFORMATION FOR S18
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
max
tank2
level
real
max
tank3
level
real
min
ACTIVE PROCESSES
Process number 1 : transf er23
STATE INFORMATION FOR S19
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
max
tank2
level
real
max
tank3
level
real
int
ACTIVE PROCESSES
Process number 1 : drain
Process number 2 : transf er23
STATE INFORMATION FOR S20
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
min
tank2
level
real
int
tank3
level
real
int
ACTIVE PROCESSES
Process number 1 : pump
A.2 Three Tank Problem
47
Process number 2 : transf er21
Process number 3 : drain
STATE INFORMATION FOR S21
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
int
tank2
level
real
int
tank3
level
real
max
ACTIVE PROCESSES
Process number 1 : transf er32
Process number 2 : pump
Process number 3 : drain
STATE INFORMATION FOR S22
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
int
tank2
level
real
max
tank3
level
real
max
ACTIVE PROCESSES
Process number 1 : pump
Process number 2 : drain
Process number 3 : transf er21
STATE INFORMATION FOR S23
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
max
tank2
level
real
max
tank3
level
real
max
ACTIVE PROCESSES
Process number 1 : drain
STATE INFORMATION FOR S24
ENTITIES
48
Examples
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
min
tank2
level
real
max
tank3
level
real
max
ACTIVE PROCESSES
Process number 1 : pump
Process number 2 : drain
Process number 3 : transf er21
STATE INFORMATION FOR S25
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
min
tank2
level
real
min
tank3
level
real
max
ACTIVE PROCESSES
Process number 1 : pump
Process number 2 : drain
Process number 3 : transf er32
STATE INFORMATION FOR S26
ENTITIES
ENTITY NAME
ATTRIBUTE NAME
ATTRIBUTE TYPE
ATTRIBUTE VALUE
tank1
level
real
min
tank2
level
real
min
tank3
level
real
int
ACTIVE PROCESSES
Process number 1 : pump
Process number 2 : drain
Process number 3 : transf er32
A.2.5
Qualitative State Transition Table
CURRENT STATE ———> PROCESSES ———–> NEXT STATES
S0———>pump, ———>S1 S17
A.2 Three Tank Problem
S1———>transf er12 , ———>S2 S4 S8 S10
S2———>transf er23 , transf er21 , pump, ———>S3 S9 S5 S21 S7 S11 S13 S16
S3———>drain, transf er32 , transf er12 , ———>S2 S4 S8 S10 S6 S12 S20 S16
S4———>transf er23 , transf er21 , pump, ———>S3 S5 S7 S13
S5———>drain, transf er32 , transf er12 , ———>S2 S4 S6 S12
S6———>drain, transf er23 , transf er21 , pump, ———>S7 S11 S13 S16
S7———>drain, transf er32 , transf er12 , ———>S2 S4 S8 S10
S8———>transf er23 , transf er21 , pump, ———>S3 S9 S7 S11
S9———>pump, drain, transf er32 , transf er12 , ———>S4 S10 S12 S16
S10———>pump, transf er23 , ———>S3 S7
S10———>transf er23 , ———>S9 S11
S11———>pump, drain, transf er32 , transf er12 , ———>S4 S10
S11———>drain, transf er32 , transf er12 , ———>S2 S8
S11———>pump, transf er32 , transf er12 , ———>S4 S10
S11———>transf er32 , transf er12 , ———>S2 S8
S11———>pump, drain, transf er12 , ———>S4 S10
S11———>drain, transf er12 , ———>S2 S8
S11———>pump, transf er12 , ———>S12 S16
S12———>pump, drain, transf er21 , transf er23 , ———>S7 S13
S13———>drain, transf er12 , ———>S2 S4
S13———>transf er12 , ———>S6 S12
S13———>drain, ———>S14
S14———>transf er12 , transf er23 , ———>S15 S21 S20 S16
S15———>transf er32 , pump, transf er21 , drain, ———>S14 S10 S13 S16
S16———>pump, drain, ———>S14
S16———>drain, ———>S10
S16———>pump, ———>S13
S15———>pump, transf er21 , drain, ———>S1 S17 S7 S11
S17———>pump, transf er12 , ———>S4 S10
S17———>transf er12 , ———>S2 S8
S17———>pump, ———>S1
S15———>transf er32 , transf er21 , drain, ———>S14 S10 S13 S16
S15———>transf er21 , drain, ———>S1 S17 S7 S11
S15———>transf er32 , pump, drain, ———>S18 S4 S19 S12
S18———>transf er23 , ———>S3 S5 S7 S13
S19———>drain, transf er23 , ———>S7 S13
49
50
S19———>transf er23 , ———>S3 S5
S19———>drain, ———>S18
S15———>pump, drain, ———>S14 S10 S13 S16
S15———>transf er32 , drain, ———>S2 S6
S15———>drain, ———>S8 S20
S20———>pump, transf er21 , drain, ———>S1 S17
S20———>transf er21 , drain, ———>S1 S17
S20———>pump, drain, ———>S14 S10
S20———>drain, ———>S8
S20———>pump, transf er21 , ———>S7 S11
S20———>transf er21 , ———>S7 S11
S20———>pump, ———>S13 S16
S15———>transf er32 , pump, transf er21 , ———>S14 S10 S13 S16
S15———>pump, transf er21 , ———>S3 S9
S15———>transf er32 , transf er21 , ———>S14 S10 S13 S16
S15———>transf er21 , ———>S3 S9
S15———>transf er32 , pump, ———>S18 S4 S19 S12
S15———>pump, ———>S5 S21
S21———>transf er32 , pump, drain, ———>S18 S19
S21———>pump, drain, ———>S14 S13
S21———>transf er32 , drain, ———>S4 S12
S21———>drain, ———>S10 S16
S21———>transf er32 , pump, ———>S18 S19
S21———>pump, ———>S5
S21———>transf er32 , ———>S4 S12
S15———>transf er32 , ———>S2 S6
S14———>transf er23 , ———>S3 S7
S14———>transf er12 , ———>S2 S4
S12———>drain, transf er21 , transf er23 , ———>S7 S13
S12———>pump, transf er21 , transf er23 , ———>S3 S5
S12———>transf er21 , transf er23 , ———>S3 S5
S12———>pump, drain, transf er23 , ———>S7 S13
S12———>drain, transf er23 , ———>S11 S16
S12———>pump, transf er23 , ———>S3 S5
S12———>transf er23 , ———>S9 S21
S12———>pump, drain, transf er21 , ———>S1 S14
Examples
A.2 Three Tank Problem
S12———>drain, transf er21 , ———>S1 S14
S12———>pump, transf er21 , ———>S7 S13
S12———>transf er21 , ———>S7 S13
S12———>pump, drain, ———>S18
S12———>drain, ———>S4
S12———>pump, ———>S19
S11———>transf er12 , ———>S6 S20
S11———>pump, drain, transf er32 , ———>S18 S14
S11———>drain, transf er32 , ———>S4 S10
S11———>pump, transf er32 , ———>S18 S14
S11———>transf er32 , ———>S4 S10
S11———>pump, drain, ———>S1
S11———>drain, ———>S17
S11———>pump, ———>S7
S10———>pump, ———>S14
S9———>drain, transf er32 , transf er12 , ———>S2 S8 S6 S20
S9———>pump, transf er32 , transf er12 , ———>S4 S10 S12 S16
S9———>transf er32 , transf er12 , ———>S2 S8 S6 S20
S9———>pump, drain, transf er12 , ———>S4 S10 S12 S16
S9———>drain, transf er12 , ———>S2 S8 S6 S20
S9———>pump, transf er12 , ———>S22 S21
S22———>pump, drain, transf er21 , ———>S1 S14 S7 S13
S22———>drain, transf er21 , ———>S1 S14 S7 S13
S22———>pump, transf er21 , ———>S3 S5
S22———>transf er21 , ———>S3 S5
S22———>pump, drain, ———>S18 S19
S22———>drain, ———>S4 S12
S22———>pump, ———>S23
S23———>drain, ———>S18 S19
S9———>transf er12 , ———>S24 S15
S24———>pump, drain, transf er21 , ———>S1 S17 S14 S10 S7 S11 S13 S16
S24———>drain, transf er21 , ———>S1 S17 S14 S10 S7 S11 S13 S16
S24———>pump, transf er21 , ———>S3 S9 S5 S21
S24———>transf er21 , ———>S3 S9 S5 S21
S24———>pump, drain, ———>S18 S4 S19 S12
S24———>drain, ———>S2 S6
51
52
S24———>pump, ———>S23 S22
S9———>pump, drain, transf er32 , ———>S18 S14 S19 S13
S9———>drain, transf er32 , ———>S4 S10 S12 S16
S9———>pump, transf er32 , ———>S18 S14 S19 S13
S9———>transf er32 , ———>S4 S10 S12 S16
S9———>pump, drain, ———>S1 S7
S9———>drain, ———>S17 S11
S9———>pump, ———>S3
S8———>transf er21 , pump, ———>S1 S17
S8———>transf er23 , pump, ———>S3 S9 S7 S11
S8———>pump, ———>S14 S10
S8———>transf er23 , transf er21 , ———>S3 S9 S7 S11
S8———>transf er21 , ———>S1 S17
S8———>transf er23 , ———>S25 S26
S25———>pump, drain, transf er32 , ———>S18 S4 S14 S10 S19 S12 S13 S16
S25———>drain, transf er32 , ———>S2 S8 S6 S20
S25———>pump, transf er32 , ———>S18 S4 S14 S10 S19 S12 S13 S16
S25———>transf er32 , ———>S2 S8 S6 S20
S25———>pump, drain, ———>S1 S17 S7 S11
S25———>drain, ———>S0 S26
S26———>pump, drain, transf er32 , ———>S18 S4 S14 S10
S26———>drain, transf er32 , ———>S2 S8
S26———>pump, transf er32 , ———>S18 S4 S14 S10
S26———>transf er32 , ———>S2 S8
S26———>pump, drain, ———>S1 S17
S26———>drain, ———>S0
S26———>pump, ———>S7 S11
S25———>pump, ———>S3 S9
S7———>transf er32 , transf er12 , ———>S2 S4 S8 S10
S7———>drain, transf er12 , ———>S2 S4 S8 S10
S7———>transf er12 , ———>S6 S12 S20 S16
S7———>drain, transf er32 , ———>S18 S14
S7———>transf er32 , ———>S18 S14
S7———>drain, ———>S1
S6———>transf er23 , transf er21 , pump, ———>S3 S9 S5 S21
S6———>drain, transf er21 , pump, ———>S1 S17 S14 S10
Examples
A.2 Three Tank Problem
S6———>transf er21 , pump, ———>S7 S11 S13 S16
S6———>drain, transf er23 , pump, ———>S7 S11 S13 S16
S6———>transf er23 , pump, ———>S3 S9 S5 S21
S6———>drain, pump, ———>S18 S4
S6———>pump, ———>S19 S12
S6———>drain, transf er23 , transf er21 , ———>S7 S11 S13 S16
S6———>transf er23 , transf er21 , ———>S3 S9 S5 S21
S6———>drain, transf er21 , ———>S1 S17 S14 S10
S6———>transf er21 , ———>S7 S11 S13 S16
S6———>drain, transf er23 , ———>S26 S20
S6———>transf er23 , ———>S25 S15
S6———>drain, ———>S2
S5———>transf er32 , transf er12 , ———>S2 S4 S6 S12
S5———>drain, transf er12 , ———>S2 S4 S6 S12
S5———>transf er12 , ———>S24 S22
S5———>drain, transf er32 , ———>S18 S19
S5———>transf er32 , ———>S18 S19
S5———>drain, ———>S14 S13
S4———>transf er21 , pump, ———>S1 S14
S4———>transf er23 , pump, ———>S3 S5 S7 S13
S4———>pump, ———>S18
S4———>transf er23 , transf er21 , ———>S3 S5 S7 S13
S4———>transf er21 , ———>S1 S14
S4———>transf er23 , ———>S9 S21 S11 S16
S3———>transf er32 , transf er12 , ———>S2 S4 S8 S10 S6 S12 S20 S16
S3———>drain, transf er12 , ———>S2 S4 S8 S10 S6 S12 S20 S16
S3———>transf er12 , ———>S24 S22 S15 S21
S3———>drain, transf er32 , ———>S18 S14 S19 S13
S3———>transf er32 , ———>S18 S14 S19 S13
S3———>drain, ———>S1 S7
S2———>transf er21 , pump, ———>S1 S17 S14 S10
S2———>transf er23 , pump, ———>S3 S9 S5 S21 S7 S11 S13 S16
S2———>pump, ———>S18 S4
S2———>transf er23 , transf er21 , ———>S3 S9 S5 S21 S7 S11 S13 S16
S2———>transf er21 , ———>S1 S17 S14 S10
S2———>transf er23 , ———>S25 S15 S26 S20
53
54
Examples
A.2.6
Explanation in Natural Language
OVERVIEW
**************
The following is an explanation of the physical phenomena called ”THREE TANK SYSTEM”.
The model captures the effect of processes pump, drain, transf er12 , transf er23 , transf er21 and
transf er32 on the objects tank1 with real valued attribute level, tank2 with real valued attribute
level, 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 is
activated when the level of tank1 is less than maximum. The process once active continues to remain
so as long as the level of tank1 is less than maximum. When the process is active, it increases the
value of level of tank1 .
The process drain is activated when the level of tank3 is greater than minimum. The process
once active continues to remain so as long as the level of tank3 is greater than minimum. When the
process is active, it decreases the value of level of tank3 .
The process transf er12 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 level
of tank2 . When the process is active, it increases the value of level of tank2 and decreases the value
of level of tank1 .
The process transf er23 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 level
of tank3 . When the process is active, it increases the value of level of tank3 and decreases the value
of level of tank2 .
The process transf er21 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 level
of tank1 . When the process is active, it increases the value of level of tank1 and decreases the value
of level of tank2 .
The process transf er32 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 level
of tank2 . When the process is active, it increases the value of level of tank2 and decreases the value
of 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 states
S1, S17, can be reached using processes pump.
We now provide an explanation of all possible transitions that can occur in the system given the
initial state above.
STATE S0 : For entity tank1 level is minimum. For entity tank2 level is minimum. For entity
tank3 level is minimum. The state has pump as currently active processes. From this state, the states
S1, S17, can be reached using processes pump.
STATE S1 : For entity tank1 level is maximum. For entity tank2 level is minimum. For entity
tank3 level is minimum. The state has transf er12 as currently active processes. From this state,
the states S2, S4, S8, S10, can be reached using processes transf er12 .
STATE S2 : For entity tank1 level is minimum. For entity tank2 level is maximum. For entity
tank3 level is minimum. The state has transf er23 ,transf er21 and pump as currently active processes. From this state, the states S3, S9, S5, S21, S7, S11, S13, S16, can be reached using processes
transf er23 ,transf er21 and pump. S1, S17, S14, S10, can be reached using processes transf er21
and pump. S3, S9, S5, S21, S7, S11, S13, S16, can be reached using processes transf er23 and
pump. S18, S4, can be reached using processes pump. S3, S9, S5, S21, S7, S11, S13, S16, can
be reached using processes transf er23 and transf er21 . S1, S17, S14, S10, can be reached using
processes transf er21 . S25, S15, S26, S20, can be reached using processes transf er23 .
STATE S3 : For entity tank1 level is maximum. For entity tank2 level is minimum. For entity tank3 level is maximum. The state has drain,transf er32 and transf er12 as currently active
processes. From this state, the states S2, S4, S8, S10, S6, S12, S20, S16, can be reached using processes drain,transf er32 and transf er12 . S2, S4, S8, S10, S6, S12, S20, S16, can be reached using
processes transf er32 and transf er12 . S2, S4, S8, S10, S6, S12, S20, S16, can be reached using
processes drain and transf er12 . S24, S22, S15, S21, can be reached using processes transf er12 .
S18, S14, S19, S13, can be reached using processes drain and transf er32 . S18, S14, S19, S13, can
be reached using processes transf er32 . S1, S7, can be reached using processes drain.
Similar explanations are generated for 27 states in total. However due to space limitations
we have shown only 3
OSCILLATIONS OR REPITIONS IN THE SYSTEM
*******************************************
Various cycles in the state transition diagram represent oscillations or repition of sequences and are
thus important for the understanding of the overall phenomena.. Therefore we provide a concise
explanation for such cycles in the state transition diagram.
The following is a description of the 1th cycle in the transition table. The cycle constitutesthe
states S2->S3->S2. The processes drain, transf er32 and transf er12 take the system from state
S3 to state S2.The processes transf er23 , transf er21 and pump take the system from state S2 to
state S3.
The following is a description of the 2th cycle in the transition table. The cycle constitutesthe
states S3->S4->S3. The processes transf er23 , transf er21 and pump take the system from state
S4 to state S3.The processes drain, transf er32 and transf er12 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 constitutesthe
states S2->S3->S4->S5->S2. The processes drain, transf er32 and transf er12 take the system
from state S5 to state S2.The processes transf er23 , transf er21 and pump take the system from
state S4 to state S5.The processes drain, transf er32 and transf er12 take the system from state
S3 to state S4.The processes transf er23 , transf er21 and pump take the system from state S2 to
state S3.
The following is a description of the 4th cycle in the transition table. The cycle constitutesthe
states S4->S5->S4. The processes drain, transf er32 and transf er12 take the system from state
S5 to state S4.The processes transf er23 , transf er21 and pump take the system from state S4 to
state S5.
The following is a description of the 5th cycle in the transition table. The cycle constitutesthe
states S2->S3->S4->S5->S6->S7->S2. The processes drain, transf er32 and transf er12 take
the system from state S7 to state S2.The processes drain, transf er23 , transf er21 and pump take
the system from state S6 to state S7.The processes drain, transf er32 and transf er12 take the
system from state S5 to state S6.The processes transf er23 , transf er21 and pump take the system
from state S4 to state S5.The processes drain, transf er32 and transf er12 take the system from
state S3 to state S4.The processes transf er23 , transf er21 and pump take the system from state
S2 to state S3.
The following is a description of the 25th cycle in the transition table. The cycle constitutesthe states S2->S3->S4->S5->S6->S7->S8->S9->S10->S11->S12->S13->S2. The processes
drain and transf er12 take the system from state S13 to state S2.The processes pump, drain,
transf er21 and transf er23 take the system from state S12 to state S13.The processes pump and
transf er12 take the system from state S11 to state S12.The processes transf er23 take the system
from state S10 to state S11.The processes pump, drain, transf er32 and transf er12 take the system from state S9 to state S10.The processes transf er23 , transf er21 and pump take the system
from state S8 to state S9.The processes drain, transf er32 and transf er12 take the system from
state S7 to state S8.The processes drain, transf er23 , transf er21 and pump take the system from
state S6 to state S7.The processes drain, transf er32 and transf er12 take the system from state
S5 to state S6.The processes transf er23 , transf er21 and pump take the system from state S4 to
state S5.The processes drain, transf er32 and transf er12 take the system from state S3 to state
S4.The processes transf er23 , transf er21 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 environment 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[8]
[9]
[10]
[11]
[12]
cial Intelligence, 74:207–248, 1995.
P. J. Hayes. The second naive physics manifesto. pages 46–63, 1990.
T. A. Henzinger. The theory of hybrid automata. pages 278–292. IEEE Computer Society
Press, 1996.
M. Huth and M. Ryan. Logic in Computer Science: modelling and reasoning about systems
(Portuguese language edition). Cambridge University Press, 2008.
B. K. In. Qualitative simulation, 1986.
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 Artificial Intelligence in Engineering, 3:185–191, 1988.
[14] A. Nakhimovsky. Temporal reasoning in natural language understanding: The temporal structure 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 reasoning. In Readings in Qualitative Reasoning about Physical Systems, pages 377–382. Morgan
Kaufmann, 1986.