language
with
modularity
Vitor
Beires Nogueira
Orientador: Professor Doutor Salvador Pinto Abreu
Tese submetida d, (Jniaersidade d,e Euom para obtengd,o do grau de Doutor em Informdtica
Departamento
deInform6tica
Universidade
delivora
Dezembro de 2008
-\-iir*.#
Temporal
reasoning
in
a logic programming
language
with
modularity
Vitor
Beires Nogueira
Orientador: Professor Doutor Salvador Pinto
Abreu
ffi
)?o
t[^
a U.E Servipos AcarlirnicosDepartamento
deInformdtica
Llniversidade
de l0vora Dezembro de 2008D€P6
NAcknowledgments
First of all,
I
would like to thank my son Miguel and my wife Susana for their caringsupport throughout the years of this
work.
To my parents and sister also goes myendless gratitude.
I
thank my supervisor, Prof. Salvador Pinto Abreu, without whom this work wouldn'thave started, continued and most of all, finished. His participation on this thesis went
far beyond the expected critical watching and directing.
I
am thankful for the manyinteresting discussions that we had, during which he guided me into how to do scientific research.
I
thank him also for the great working conditions and for carefully reviewingnot only the contents but also the English, making this work not only understable but
also readabie.
I would also like to thank Prof. Gabriel Torcato David for his participation in this work. Besides providing me
with
great working conditions at the Faculdade de Engenhariaof Universidade do Porto, he also supervised the beginning of this thesis.
Throughout
this
thesis,I
also hadthe
chanceof
workingwith
membersof
Projet Contraintes at INRIA Rocquencourt and in particular with Prof. Daniel Diaz. Severalimportant results came out of such cooperation.
I
acknowledge the INRIA/GRICES project "Extensions au Logiciel Libre GNU Prolog" for the financial support that madethis collaboration possible.
I would like to acknowledge the Universidade de Evora and specifically the Departmento
de InformS,tica not only for the conditions given but also for the leave that allowed me
to focus entirely on this work.
I
also acknowledgethe
Centria (Centro de Intelig6nciaArtificial)
that
by
providingsupervisor funds, allowed me to participate in summer schools, conferences, workshops,
doctoral programs, etc.
Last, but definitely not least,
I
would liketo
dedicate this work to my friends, and in particular to Paulo Estudante who was there for me on many occasions.Abstract
Current Organisational Information Systems (OIS) deal
with
more and more infor-mationthat
is time dependent.In
this
work we provide a frameworkto
construct and maintain TemporalOIS.
This framework builds upon a logical language calledTemporal Contextual Logic Programming that deeply integrates modularity with tem-poral reasoning making the usage of a module time dependent. This language is an
evolution
of
another one, also introducedin
this
thesis,that
combines Contextual Logic Programmingwith
Temporal Annotated Constraint Logic Programming wheremodularity and time are orthogonal features. Both languages are formally discussed
and illustrated.
The main contributions of the work described in this thesis include:
Optimisation of Contextual Logic Programming (CxLP) through abstract inter-pretation.
Syntax and operational semantics for an independent combination of the temporal framework Temporal Annotated Constraint Logic Programming (TACLP) and
CxLP.
A
compiler for this language is also provided.Language (syntax and semantics) that integrates in a innovative way modularity (CxLP) with temporal reasoning (TACLP). In this language the usage of a given
module depends of the time of the context.
An
interpreter and a compiler for this language are described.Framework to construct and maintain Temporal Organisational Information
Sys-tems.
It
builds upon a revised specification of the language ISCO, addingtempo-ral classes and temporal data manipulation.
A
compiler targeting the language presented in the previous item is also given.Sum6,rio
Actualmente os Sistemas de InformagSo Organizacionais (SIO) lidam cada vez mais
com informagS,o que tem depend6ncias
temporais.
Neste trabalho concebemos umambiente de trabaiho para construir e manter SIO Temporais. Este ambiente assenta
sobre
um
linguagem l6gica denominada Temporal Contextual Logic Programming que integra modularidade com raciocinio temporal fazendo com que a utilizagSo deum m6dulo dependa do tempo do
contexto.
Esta linguagem 6a
evolugS,o de umaoutra, tamb6m introduzida nesta tese, que combina Contextual Logic Programming
com Temporal Annotated Constraint Logic Programming, na qual a modularidade e o
tempo s5o caracteristicas ortogonais. Ambas as linguagens s5,o formalmente discutidas e exemplificadas.
As principais contribuig6es do trabalho descrito nesta tese incluem:
OptimizagSo de Contextual Logic Programming (CxLP) atrav6s de interpretagS,o abstracta.
Sintaxe e semA,ntica operacional para uma linguagem que combina de um modo independente as linguagens Temporal Annotated Constraint Logic Programming (TACLP) e CxLP.
6
apresentado um compilador para esta linguagem.Linguagem (sintaxe e semA,ntica) que integra de um modo inovador modularidade (CxLP) com raciocfnio temporal (TACLP). Nesta linguagem a utilizagSo de um
dado m6dulo est5, dependente do tempo do contexto. E descrito um interpretador
e um compilador para esta linguagem.
Ambiente de trabalho para construir e fazer a manutengSo de SIO Temporais. Assenta sobre uma especificagS,o revista da linguagem ISCO, adicionando classes e
manipulagSo de dados temporais. 6 fornecido um compilador em que a iinguagem
Contents
Acknowledgments Abstract Sum6rioList
of Acronyms Preface lllxlx
Introduction
andMotivation
31.1
Introduction.
31.1.1
Time.
3l.L-2 Modularity
41.1.3
Organisational InformationSystems
51.2
Temporal (Logic-Based)OIS
5Temporal Reasoning
in
AI
2.1
Introduction .2.2
General Notions of Time2.2.1
Model of Time2.2.2
Temporal Qualification .2.3
Constraint-Based Temporal Reasoning2.3.1
Qualitative Temporal Constraints7 I 8 8 8
I
10 vll2.3.2
Metric PointConstraints
112.3.3
HybridApproaches
122.3.4
Programming Languages.
122.4
Temporal ModalLogic
152.4.1
Temporal Logic Programming2.5
Reasoning About Actions and Change2.5.1
The Situation Calculus .2.5.2
The Event Calculus2.5.3
Temporal2.6
ConclusionsNonmonotonic Reasoning
Temporal Databases
3.1
Introduction .3.2
Temporal Data Semantics3.3
Temporal Data Models and Languages3.3.1
Temporal Data Model.
.
.3.3.2
Temporal Languages3.4
Temporal Databases Design3.5
Temporal Database Products3.5.1
Log Explorer3.5.2
Time Navigator .3.5.3
Data Propagator3.5.4
SQL:20033.5.5
Oracle3.5.6
TimeDB3.6
Conclusions and Future PointersModular
Logic Programming4.1
Introduction . 15 t6 L7 18 18 19 2L 21 22 22 23 26 32 32 32 33 33 33 34 35 35 37 37CONTEATTS ix 38 38 39 39 4L 42 43 44 45 46 47 50 50 51 52 4.2 4.3 Algebraic Approach
4.2.7
The Algebra of Programs and Its Operators Logical Approach4.3.t
Embedded Implications4.3.2
Lexical Scoping4.3.3
Closed Scope Mechanisms4.3.4
Contextual Logic Programming4.3.5
Lexical Scoping as Universal Quantification Syntactic Approach4.4.1
Prolog Modules: the ISO Standard4.4.2
ImplementationsLogic and Objects
4.5.1
Object-Oriented Programming and Embedded Implications4.5.2
LogtalkConclusions
4.4
4.5
4.6
Contextual Logic
Programming
535.1
Introduction.
535.2
The CxLPLanguage
545.3
OperationalSemantics
555.3.1
Application of theRules
575.4
Declarative/Fix-PointSemantics
575.5
Extensions
585.6
Optimisations
595.6.1
Abstract Interpretation for Static ScopeSystems
605.7
Implementations
625.7.1
CSM (Contexts as SICStusModules)
625.8
Conclusions
66Temporal Reasoning
in
aModular
Language
676.1
Introduction.
676.2
CxLP with TemporalAnnotations
686.3
ConstraintTheory
706.4
OperationalSemantics
706.5
Interpreter and Compiler.
7L6.5.1
Time PointDomain
716.6
Related Work.
736.6.1
MuTACLP
746.6.2
OtherApproaches
766.7
ConcludingRemarks
777
Temporal Contextual Logic Programming7.7
Introduction .7.2
Language of TCxLP7.2.1, Annotating Units
.
807.2.2
Temporal AnnotatedContexts
817.2.3
Relating Temporal Contexts with TemporalUnits
817.3
Computing the Least UpperBound
8479
79
80
7.3.I
Ground Temporal Conditions7.3.2
Non Ground Temporal Conditions7.4
Operational Semantics7.4.1
Inference RulesTCxLP Compiler and Interpreter
7.5.L
From TCxLP to CxLP+TACLPApplication Examples
7.6.1
Management of Workflow Systems84 85 87 87 89 89 91 91 7.5 7.6
COAITE]V?S
7.6.2
Legal Reasoning7.6.3
Vaccination Program7.7
Related Work7.8
ConclusionsLanguage
for
Temporal OIS8.1
Introduction .8.2
Revising the ISCO Programming Language8.2.L
Classes8.2.2
Methods8.2.3
Inheritance8.2.4
Composition8.2.5
Persistence8.2.6
Data Manipulation Goals8.3
The ISTO Language8.3.1
Temporal Classes8.3.2
Temporal Data Manipulation Compilation Scheme for ISTO8.4.1
Classes8.4.2
Methods8.4.3
Inheritance8.4.4
Composition8.4.5
Persistence8.4.6
Data Manipulation Goals8.4.7
Temporal Classes8.4.8
Temporal Data Manipulation Goals Comparison with Other Approachesxl 94 95 97 98 8.4 99 99 100 100 101 L02 t02 103 105 106 106 t07 107 108 108 108 8.5 8.6 109 110 110 110 111 t12 1t2 Conclusions
E\rture Work 115 115 116 Conclusions and
9.1
Conclusions9.2
Future WorkGNU
Prolog/CX
tL7
A.1
Thtorial
Ll7A.1.1
Unit Directive.
ll7
A.I.2
UnitArguments
118A.1.3
ContextExtension
119A.7.4
CurrentContext
119A.1.5
Contexttaversal
1204..1.6 Context
Switch
1234.1.7
SupercontextA.1.8
Guided Context TlaversalA.1.9
Calling Context A.1.10 Lazy CallA.2
Reference Manual4.2.L
Introduction .4.2.2
Directives4.2.3
Operators4.2.4
UtilitiesConstraint Logic
Programming
1338.1
Introduction.
1338.2
ConstraintDomains
t348.2.L
Booleans:CLP(B)
1348.2.2
Pseudo-Booleans:CLP(PB)
1348.2.3
Rationals/Reals:CLP(R) .
1348.2.4
Finite Domains:CLP(FD)
L34 128 t24 L24 L25 L26 128 128 128 732CO,NITEAITS
8.3
Constraint SolversB.3.1
Incomplete Constraint Solvers8.4
Finite Domains8.4.1
Finite Domain Solvers8.4.2
Network ConsistencyB.4.3
Constraint Propagation (CP) vs. Backtracking8.4.4
Constraint Propagation and Heuristics8.4.5
Advanced Techniques8.4.6
GlobalConstraints8.4.7
Optimisation Constraints xlll 134 135 136 136 136 L37 L37 138 138 138 L40 B.5 B.6 Defeasible Constraints Conclusions 138 139 ReferencesList
of
Tables
1
Readingpaths
22.1
Tense logic modaloperators
153.1
Prototypical temporally ungrouped employeerelation
233.2
Prototypical temporally grouped employeerelation
243.3
Temporal datamodels
253.4
BCDMtuple
253.5
Evaluation of algebras againstcriteria
273.6
Table 3.5 (continued). .
295.1
Derivation: CxLP and embeddedimplications
627.L
Vaccination recommendedscheme
96List
of
Figures
Temporal qualification methods
The student enrolment process model
File
system
122I
92 2.7 7.7 A.1 xvllList
of
Acronyms
ACL
Annotated Constraint LogicBCDM
Bitemporal Conceptual Data ModelCLP
Constraint Logic ProgrammingCRUD
Create, Read, Update and DeleteCSP
Constraint Satisfaction ProblemCxLP
Contextual Logic ProgrammingEC
Event CalculuslA
Interval AlgebraISCO
Information System COnstruction languageISTO
Information System Tools for OrganisationsMuTACLP Multi-theory Temporal Annotated Constraint Logic Programming
OIS
Organisational Information SystemsSC
Situation CalculusSTP
Simple Temporal ProblemsTACLP
Temporal Annotated Constraint Logic ProgrammingTCSP
Temporal Constraint Satisfaction ProblemTCxLP
Temporal Contextual Logic ProgrammingPreface
This work is the synthesis of several yearsl of research. One of the most important
Iessons learned during that time was
that
research is by no means a straight line, onemight even say
that
it
is an (acyclic) graph. Not only did we foilow paths that turnedout
to
be dead-endsbut
also sometimes we hadto
abandon others which, although promising, would cause us to stray from our goals.One must say, that due to the (at least) lack of excellency of the author in the English
Ianguage, writing this thesis
in
such language was a boldact.
We ask for the readersympathy on this subject.
Structure
of
the Work
Chapter 1 briefly introduces the concepts of time and modularity together with a logic
programming perspective of Organisational Information Systems (OIS). This chapter also motivates for the integration of temporal reasoning
with
modularityin
order to obtain a language to construct and maintain OIS.For self containment reasons, we survey several approaches
to
temporal reasoning inArtificial
Intelligence, temporal databases and modularityin
logic programming in Chap(s). 2, 3 and 4, respectively.Chapter 5, besides describing the modular logic language
that
is at core of this work called Contextual Logic Programming (CxLP), also presentsa
revised specificationtogether with an optimisation framework obtained with abstract interpretation.
In
Chap. 6 we combine consolidated approaches for temporal reasoning (in this caseTemporal Annotated Constraint Logic Programming) and modularity (CxLP) into a
single language. Although such
a
combination provides an expressive language, in Chap. 7 we propose a model where the usage of a module is influenced by temporal conditions. Moreover, the CxLP program structure is very suitable for integrating with temporal reasoning sinceit
is quite straightforwardto
add the notion of. t'ime of thecontert and let
that
time helpin
deciding whether a certain module is eligible or not to solve a goal.In
Chap. 8 we proposeto
augment the ISCO frameworkfor
constructing OIS with an expressive means of representing andimplicitly
using temporal information. This evolution builds uponthe
frameworks proposedin
the
previouschapters.
Having simplicity as a design goal, we present a revised and stripped-down version of ISCO, keepingjust
some of the core featuresthat
we consider crucialin
a language for thedevelopment of Temporal OIS.
We draw some concluding remarks and provide pointers for future work
in
Chap. 9.In
AppendixA
we present atutorial
and a reference manual for the contextual partof
GNU Prolog/CX. Finally, in Appendix B we briefly overview Constraint Logic Pro-gramming.Part of this work has appeared before in
joint
publications with Prof. Salvador Abreu (my supervisor),Prof.
Gabriel David andProf.
Daniel Diaz.I
thank all of them for letting me use the following common work [NAD03, NAD04, ADN04, AN05, NA06b,AN06, ET06, NA06a, NA07d, NA07b, NA07a, NA07c].
Roadmap
There can be various reading paths for this thesis, in Table 1 we outiine some of them.
Subject Chapter
Survey on temporal reasoning Survey on modularity
Combining temporal reasoning and modularity Temporal Information Systems
Braue reader
t-2-3
7-4-5(optional)
L-2.3-6-7
L-2.3-7-8
1to9
Chapter
1
Introduction
and
Motivation
In
this chapter we start witha
brief overviewof
the concepts that areat
thecorc
of
thiswork:
time andmodularity.
We also provide a short descriptionof Organisational Information Systems from a logic programming point of view. Subsequently we argue for the need to integrate modularity with temporul reasoning
in
order to providea
high level languagein
whichto
construct and maintain Organisational Information Systems.1.1
Introduction
1.1.1
Time
Time is an elusive concept, studied across such diverse disciplines as physics,
mathemat-ics, linguistics, philosophy, etc. Each one provides an evolving perspective of Time: in
physics, Newton defined Time as a dimension in which events occur in sequence whereas
Einstein,
in
the special theory of relativity, stated "time intervals appear lengthenedfor events associated
with
objects in motion relative to an inertial observer" [Wik08].In
the last decades a great number of logic languagesthat
dealwith
Time have beenproposed. According
to
Van Benthem [Joh91], logic can be considered as a bridgebetween linguistics and mathematics since logic takes
into
considerationboth
theaspects of language and ontology. This author also points out
that
logics multiplicity of languages, theories of inference and formal semantics are adequate for the diverseintuitions inherent to the study of Time.
In a broad sense we can define a temporal database as a repository of temporal
informa-tion
[Cho94] therefore one can saythat
most database applications are supported by temporal databases. SQL [fS03] is often the language chosen for interacting with such databases. Although SQL is a very powerful language for writing queries, modificationsor
constraintsin
the
current state,it
doesnot
provide adequate supportfor
the temporal counterparts:for
instancethe
temporal equivalentto
an ordinary querycan
be
a
very challenging taskto
expressin
SQL.To
overcome such difficulties,several temporal data models, algebras and languages have been proposed. Moreover,
McKenzie and Snodgrass [LEMS91] demonstrated
that
the design space for temporalalgebras has,
in
some sense, been exploredin that all
combinationsof
basic design decisions have at least one representative algebra.The logical and
the
database approachto
Time are closelyrelated:
according to [BMRT02] temporal logic languages are responsible not only for the temporal databases theoretical foundations but also for their powerful knowledge representation and query Ianguages.Temporal reasoning plays an important role
in
many areas ofArtificial
Intelligence such as Natural Language, Planning, Agent-Based Systems, etc. Most approaches arerestricted
to
the
propositional case and follow an interval-based view originated in Allen's Interval Algebra [41183]. Moreover, temporal reasoning inAI
is concerned withusing additional assumptions (such as persistence
or
defaults)or
special procedures(like persistence) to derive conclusions [Cho9 ].
L.L.2
Modularity
Module systems are an essential feature of programming languages, nameiy because besides structuring programs they also allow the development of general purpose
li-braries.
A modular extension to logic programming has been the object of research over the last decades. In a broad sense one can distinguish three different approaches to modularity: the algebraic, the logical and the syntactic. The algebraic approach started with work
by
O'Keefe [O'K85] and considers logic programs as elementsof
an algebra, whose operators are the operators for composing programs. The logical approach is based onwork by Miller [Mil86, Mi189a], and extends the Horn language with logic connectives
for building and composing modules. Finally, the syntactic approach (see [HF06] for
a recent overview and a proposal of such approach) addresses the issue of the global and flat name space, dealing with the alphabet of symbols as a mean to partition large programs.
Contextual Logic Programming is modular extension of Horn clause logic proposed
by
Monteiro and Porto [MP89,MP93].
TheCxLP
ertens'ion goal can be regarded as a non-monotonic version of Millerimpli,cati,on goallMi86,
Mil89a]. The ertens'iongoal is denoted by >> and
D
>
G (D
is a set of ciauses and G a goal) is derivable1.2.
TEMPORAL (LOGTC-BASED) OrSfinite set
A
of atoms for predicates not definedin
D.
Therefore)
provides a sort of lexical scoping for predicates: predicatesin
G which are definedin D
are bound tosuch definitions, the others can be obtained from program
P.
Besides lexical scoping,CxLP also accounts for contextual reasoning,
that
is widely used for several Artificial Intelligence tasks such as natural language processing, planning, temporal reasoning,etc.
Workby
[AD03a] presents a revised specification of CxLP togetherwith
a newimplementation for
it
and also explains how this language can be viewed as a shift into the Object-Oriented Programming paradigm.1.1.3
Organisational
Information
Systems
Organisational Information Systems (OIS) have a
lot
to benefit from LogicProgram-ming (LP) characteristics such as the rapid prototyping ability, the relative simplicity
of
program development and maintenance, the declarative reading which facilitates both development and the understanding of existing code, thebuilt-in
solution-space search mechanism, the close semanticlink with
relational databases,just
to
name afew.
In
[Por03, ADN04] we find examples of LP languagesthat
were usedto
developand maintain information systems.
Information System COnstruction language (ISCO) [Abr01] is a state-of-the-art logical
framework for constructing Organisational Information Systems. ISCO is an evolution of the previous language
DL
[Abr00] and is based on a Constraint Logic Programming(CLP)
frameworkto
definethe
schema, represent data, access heterogeneous datasources and perform arbitrary computations.
In
ISCO, processes and data are struc-tured as classes which are represented as typedl Prolog predicates. An ISCO class may map to an external data source or sink, such as a table or view in a relational database,or
be entirely implemented as a regular Prolog predicate. Operations pertaining to ISCO classes include a querA which is similar to a Prolog call as well as three forms ofupdate.
L.2
Temporal (Logic-Based)
OIS
Chomicki and Toman [CT98] stated that current Information Systems deal with more
and more complex applications where, besides the static aspects
of
the world, one also hasto
model the dynami,cs,,i.
e., time, change and concurrency. This statementillustrates very clearly the importance of Time in OIS.
It
is our opinion that a languagefor OIS must have the capability of performing temporal representation and reasoning
beyond the ad hoc approaches.
The amount of information handled by OIS is enormous and has increased by orders of
magnitude over the last decades. Besides the already mentioned benefits of modularity,
we consider
that
this fact by itself should be sufficient to justifythat
modularity is asi,ne qua non condrtion for designing and implementing OIS.
One common approach in combining modularity and time in a language is to consider
them as independent, or orthogonal, features.
In
this work we start by presenting a Iogical based languagethat
follows such guidelines.Nevertheless, time and modularity can combine into a more
fruitful
environment, i. e.one where these features are more intertwined. We propose an extension of a modular Iogic language where temporal reasoning is deeply integrated, making the usage of a
module itself time dependent. We consider this proposition
to
be natural andin
factlargely employed
in
several domains where a given law, criteria application is timedependent.
Finally, we
will
show that the language above provides a sound basis for a framework to construct and maintain Temporal Organi,sati,onal Informat'ion Systems.Chapter
2
Temporal
Reasoning
in Artiflcial
Intelligence
This chapter provides an overview of temporal reasoning in Artificial Intelligence.
It
starts by introducing the notion of model of time and temporal qualification.Afterwards
it
describes several constraint and modal logic based proposals fortemporal reasoning. Finally, some theories for reasoning about actions and change
arc discussed.
2.L
Introduction
Temporal reasoning plays an important role
in
many areas ofArtificial
Intelligence such as Natural Language, Planning, Agent-Based Systems, etc. Most approaches arerestricted
to
the
propositional case and follow an interval-based view originated in Allen's Interval Algebra [AIl83] (see Sect. 2.3.1 for a description of such an algebra).Moreover, temporai reasoning
in
AI
is concernedwith
using additional assumptions(such as persistence
or
defaults)or
special procedures (like persistence)to
obtainconclusions [Cho9
].
For further reading on this subject see for instance [Vil94, CM00,Aug01, FGV05].
This chapter, for self-containment reasons, presents a general survey of temporal
rea-soning
in AI
and is organised as follows: Sect. 2-2 startsout by
specifying severalkey concepts pertaining
to
the foundationsof
temporal reasoning such as temporal ontologg, topology and quali,fi,cat'ion. Afterwards, we present three subfields of temporal representation and reasoningin
AI:
constraint-based temporal reasoning (Sect. 2.3),temporal modal logic (Sect.2.4) and reasoning about actions and change (Sect. 2.5).
The chapter ends
with a
brief summaryof the
concepts and approaches described therein.2.2
General Notions of Time
In this section we briefly describe the notions of model of time and temporal qualifica-tion.
2.2.L
Model of
Time
To define a model of time we need
to
define not only the ti,me ontologybut
also theti,me topology. By ti,me ontologA we mean the class or classes of objects time is made of,
i.e. one has to choose between ti,me poi.nts and i,nteruals as the basic temporal entities.
Regarding the ti,me topology we can consider different structures
for time,
namelywhether
it
is:discrete, dense or continuous;
bounded, partially bounded or unbounded;
linear, branching, circular or with a different structure.
Moreover,
it
is
helpfulto
know whatkind of
propertiesthe
structureof
temporal individuals have as a whole, i.e.:are all individuals comparable by the order relation (connectedness)? are ali individuals equal (homogeneity)?
is
it
the same to look at one side or at the other (symmetry)?2.2.2
Temporal Qualification
Temporal qualification refers "to the way logic is used to express that temporal
propo-sitions are true or false at different times" [RV05] and is by itself a very prolific field of
research.
Besides modal logic proposals, from a first-order point of view we can consider the following methods for temporal qualification: temporal arguments, token arguments,
temporal reification and temporal token
reification.
Fora
brief descriptionof
the different proposals please consider Fig. 2.1 taken from [RV05]. Temporal reificationassigns
a
special statusto
time
and allows quantification over propositions. The2.3.
COATS"RA INT-BASED TEMPORAL REASOAIIAIGReify_into(type) + Add_argument(time)
holds(effective(o, a, b,
Add_argu ment(token)
effective(o, a, b, ..., tt1 ), holds(ttl ), begin(tt1)=t1, end(tt1 )=t2 First-Order Logic
Modal Logic
Figure 2.1: Temporal qualification methods
to
distinguish betewen termsthat
denote real objectsof
the domain (termsof
the original object language) and terms that denote propositional objects (propositions of the original object language).2.3
Constraint-Based Temporal
Reasoning
According
to
[Pao] constraint-based approaches mainly focus on the definition of a representation formalism and of reasoning techniques to deal specifically with temporalconstraints between temporal entities, independently of the events and states associated
with them. Following these guidelines, a class of Constraint Satisfaction Problem (CSP) was defined, called Temporal Constraint Satisfaction Problem (TCSP), where variables represent time and constraints represent temporal relations between
them.
DifferentTCSPs are defined depending on the time entity that variables can represent, namely
time points, time intervals, durations (i.e. distances between time points) and the class
of constraints, namely qualitative, metric or both [SV98]. Each class of constraints is characterised by the underlying set of basi,c temporal relati,ons.L
TCSP constraints are
binary
and C6i:
{rt,.
..,r*}
is a
constraint2 between the variablesX,
and X7 where each 16 isa
basi,c temporal relati,on.A
si,ngleton labelli,ng lThe elements of all basic temporal relations are mutually exclusive and their union is the universalconstraint.
2The set is interpreted as a disjunction of relations.
I
Classical Logic Atomic Formula
assigns an r; to the pair X6, Xi,, and the solut'ions of a TCSP are its consistent singleton labelling.
The main techniques
to find
a solutionto
the general problem are path-consistency and backtracking algorithms. Finally, there are typically two tasks when working withTCSP:
deciding consistency and answering queries about scenariosthat
satisfy allconstraints.
For a comprehensive survey on this subject see
for
instance [SKD94, Kou95, SV96, Sch98, SV98]2.3.t
Qualitative
Temporal Constraints
Qualitative temporal constraints deal
with
the relative position between time points or intervals.Allen's
Interval
Algebra
The Interval Algebra (IA) was proposed by James F. Allen [AIl83]. In this work, domain elements are temporal intervalss and constraints are
built
using the thirteen basic relations between intervals: before, after, meets, met by, equal, ouerlaps, ouerlapped by,duri,ng, contai,ned by, starts, started bE, fini.shes, fini,shed bg. The operations on those
relations include composition and Boolean operators.
Intervals are used
to
qualify properti,es, euents and processes. We saythat
a proper-tg holds over an intervalif
and onlyif
it
holds for all its subintervals whereas a proccess occurs over an intervalif
it
occursin
at
least one ofits
subintervals. Events occurs over the smallest possible interval [Rib93].In
[VKvB9O]it
is shown that the satisfiability of AIIen's algebra is NP-complete. The study of maximal tractable subclasses startedwith
Nebel and Biirckert (ORD-Horn algebra [N894]) and recently Krokhinet.
al.
[KJJ03] showedthat
theIA
containsexactly eighteen maximal tractable subalgebras. Moreover,
they
also proved thatreasoning
in
any fragmentnot
entirely containedin
one of the these subalgebras is NP-complete.sBesides intervals, the only other structural property defined is that time is linear. Everything else
2.3.
COAIS"RA INT-BASED TEMPORAL REASOAIII\IGVilain
and
Kaut'z Point
Algebra
The Point Algebra was introduced by Vilain and Kautz [VK86l. In their proposal, the domain elements are the temporal points and define the three basic relations that can
hold between temporal points, i.e., before, equal and after
(<,:, >).
Moreover, the Point Algebra defines two operations between these point-point relations: com,posi,ti,onand i,ntersecti,on.
Regarding compiexity, the
full
point algebra is tractable [VK86, VKvB90, Hir97].Interval-Point
Algebra
The Interval-Point algebra was proposed by Vilain
in
[Vil82]. In this algebra variablesstand for time points or intervals and the oniy type of relations are between between
a point and an interval. Moreover, since
in
anintervallal,a2l
we have a11a2,
there are only five possible relations:before,
starts,
during, finishes
andafter.
The complexity of deciding satisfiability in this algebra is NP-complete [Mei96].Qualitative
Algebra
Meiri [Mei96, Mei91] proposes a combination of the all the preceding algebras: AIIen's
Interval Algebra, the point algebra and the interval-point algebra. As expected, this
proposal handles both time points and time intervals and can relate points with points,
points with intervals and intervals with intervals.
In
[JK0]
the authors identifyall
tractable fragments of this algebra and also provethat
all other fragments are NP-complete.2.3.2
Metric
Point
Constraints
The metric point constraints proposal is based on the notion of time points and the
distance between them, i.e. variables represent time points and the allowed temporal relations is the set
of
intervalsof
ti,me-structure.A
constraint has the formCu
:
{[or, br], . . . ,lor,b7,]] and stands fora:
(r,
<
Xi-
Xo<
bt)v
...Y
(oraXi-
Xt<bn)
aThe representation was taken from [SV98], replacing the conjunction by a disjunction that was
probably a typo.
There are three operators for the metric constraints: 'inuerse, i,ntersecti,on and
con'Lpo-si.ti.on.
With
respectto
complexity we havethat
deciding consistency and computing a solutionof a
metricpoint
constraint problemis
NP-complete[DMP91].
Finally,[SV98] describes the three known relation based tractable classes, i.e. Simp]e Temporal
Problems (STP), STP with inequation constraints (for continuous domains only) and
Star TCSPs.
2.3.3
Hybrid
Approaches
Meiri [Mei96l proposed a very expressive constraint language in which both qualitative and quantitative/metric constraints can be represented, this way allowing the
repre-sentation and processing
of
most typesof
constraints. This proposal combines theQuali,tati,ue Algebra (Sect. 2.3.L) with Metri,c Poi,nt Constrai,nts (Sect. 2.3.2).
Besides this general proposal, Meiri studied other subclasses
that
were also found tobe intractable:
o
qualitative point with unary metric;o
qualitative interval with unary metric.2.3.4
Programming
Languages
This section describes a short
list
of languages for temporal reasoningthat,
besidesbeing constraint-based, have some affinity
to
(Constraint) Logic Programming.Temporal Prolog
Temporal Prolog [Hry93] can be regarded as a "synthesis of temporal logic and of the Constraint Logic Programming paradigm,
in
which temporal constraints are formu-Iated". Temporal Prolog has several objectives, namely: the temporal logic inherentto
the language should be intuitive and efficient, easily integratedin
a LP paradigm and easyto
implement on top of the Prolog interpreters. Following these guidelines,Temporal Prolog proposed a first-order rei,fied, logic where H0LDS (P, T) means that the statement (".g. u Prolog clause) P holds (i.e., is true) in interval T and H0LDS(P) means
that
P holds without limitationto
a temporal interval. The interval-based axioms of Temporal Prolog are the following:2.3,
COIISTRA INT-BASED TEMPORAL REASOAIIAIG.
H0LDS(A)--
(VT)
HOLDS(A, T).o
HOLDS(A,T)
&o
HOLDS(A,U)
&o
HOLDS(A,S)
& H0LDS(B,
T)
---+ HOLDS (A &B,
T) .H0LDS(B,
V)
&union(U,
V,
T)
---+ HoLDS(A VB,
T).HOLDS(
-
A,
T)
--
disjoint(S,
T).florn
Ternporal
Reference Language13
Horn Temporal Reference Language [Pan95] is also a temporal extension
of
Prolog.In
this language, atoms can have temporal labelsto
express theirvalidity.
It
allowstwo types of extended atoms: events (not necessarily true over every subinterval) and
properties (hold over every subinterval). Moreover,
it
provides inference rules for these extended atoms together with a transformation from this language to Constraint LogicProgramming.
Temporal
Annotated Constraint
Logic Programming
Temporal Annotated Constraint Logic Programming (TACLP) [Frii93, Frti94b, F]ii96l is presented as an instance of Annotated Constraint Logic
(ACL)
[Frii96], suited forreasoning about time. ACL generalises basic first-order Ianguages with a distinguished class of terms called constrai,nts, and a distinguished class of terms, called annotat'ions, used to label a formula.
TACLP allow us to reason about qualitative and quantitative, definite and indefinite temporal information using time points and time periods as labels for atoms [RF00a]. This section presents a brief overview of TACLP that follows closely Sect. 2 of [RF00a]. For a more detailed explanation of TACLP see for instance [Frii96].
We consider
the
subsetof
TACLP
wheretime
points aretotally
ordered, sets of time points are convex and non-empty, and only atomic formulas can be annotated. Moreover clauses are free of negation.Time can be discrete or dense. Time points are totally ordered by the relation
(.
Wecall the set of time points
D
and supposethat
a set of operations (such as the binary operations +,-)
to
manage such points, is associatedwith
it.
We assumethat
the time-line is left-bounded by the number 0 and open to the future(-).
A
t'ime periodis an interval
[r,s] with 0
( r (
s
(
oo,r
e
D,
s
€ D
and represents the convex,non-empty set of time points
{t
Ir
<
t
< s}.
Therefore the interval [0,-[
denotes theDefinition
1 (Annotated Formula)
An annotated formula i,s of the formAa
whereA
i,s an atomi,c formula anda
an annotati,on. Lett
be a ti.me poi,nt andI
be a ti,me peri,od:(at)
The annotated formulaA
at
t
rneans thatA
holds at t'ime poi,nt t.(th)
The annotated formulaA th
I
means thatA
holds throughoutI,
i,.e.at
euery ti,me poi,nt i,n the peri,odI.
A
th-annotated formula can be defined'in terms of an at-annotated as:A th
I e
Vt(teI--+Aatt)
(i,n) The annotated formula
A in
I
rneans thatA
holds at some t'i,me poi,nt(s) i,n the ti,me peri,od I , but there i,s no knowledge when eractly. The i,n annotati,on accountsf orindefi,n'ite temporal i,nformati,on.
An
i,n-annotated formula can also be definedin
termsof
an
at-annotated as:AinIe 1t(te InAatt).
The set
of
annotations is endowedwith
a partial order relationf
which induces aIattice.
Given two annotationsa
andB,
lheintuition is
that
a
C
P
if
a
is "lessinformative" than
p
in the sense that for all formulas A, Ap+
Aa.In addition
to
Modus Ponens, TACLP has the following two inference rules:Aa 'yaa
rule
(r)
Aa
AP
'Y:alP
rule(l)
A1 A1
The rule
(f
) states that if a formula holds with some annotation, thenit
also holds withall
annotationsthat
are smaller accordingto
the lattice ordering. The rule(l)
saysthat if a formula holds with some annotation and the same formula holds with another
annotation then
it
holds in the least upper bound (denoted byu)
of the annotations.TACLP provides a constraint theory (detailed
in
Sect. 6.3).A
TACLP progran'L is a finite set of TACLP clauses.A
TACLP clause is a formula of the formAa
<-Cr,,...,Cn,Btat,,...,B*a*
(*,n )
0) whereA
is an atom,a
andai
are optional temporal annotations, the
Ci's
are the constraints and the @'s are the atomic formulas. Friihwirth [Frii96], besides providing a meta-interpreter for TACLPclauses, also presents a compilation scheme
that
translates TACLPinto
ConstraintLogic Programming. Finally, Raffaetd, and Friihwirth [RF00b, RF00a] provide both an
2.4.
TEMPORAL MODAL LOGIC2.4
Temporal
Modal
Logic
In
a
succinct way we can saythat
Modal Logics can be regarded asthe
logics of qualifiedtruth
[Che80].In
this
logic besides standard logical symbols one also hasmodal operators
that
are usedto
qualify formulasin
the
followingway:
if
A
is
aformula and
V
is a modal operator thenVA
is a formula.Although the term Temporal Logic is used
in
a broad sense when referringto
anyapproach
that
dealswith
temporal informationwithin a
logic framework,it
has amore specific definition related
to
the
Modal Logic approachto
temporalinforma-tion
[DMG94, Gal08]. Tense Logic [Pri57, Pri67, Pri68] definedby Arthur
Prior is regarded as the seminal work on thisfield.
Prior proposed the four modal operators described in Table 2.1. There are several formalismsthat
provide variations or exten-sions to the Tense Logic, such as:o
Event Logic [Gal87];o TM
[Rei89] of Reichgelt;o
Logic of time intervals [HS91] of Halpern and Shoham.See [Aug01] for an overview on the formalisms above.
Symbol
Expression SymbolisedG
"It
will
always be the casethat
. . . "F
"It
will
at some time be the casethat
. . . "H
"It
has always been the casethat
. . . "P
"It
has at some time been the casethat
. . . "Table 2.1: Tense logic modal operators
2.4.L
Temporal Logic Programming
This section follows the survey of Gergatsoulis
in
[Ger01] that states that the basis fordeveloping temporal logic programming languages are syntactic subsets of temporal and
modal logic which present well defined computational behaviour. One can consider two broad approaches
to
the specification of these languages: Iinear-time andbranching-time temporal logic programming languages.
The following languages use linear-time:
Templog [AMS9] extends Horn logic programming with the operators
Q
(next),n
(always) and0
(eventually). As an illustration consider the Fibonacci sequence using Templog:frb
(0)
.of
ib
(1)
.o
Chronolog [Org91] has two temporal operatorsfirst
and nert, whercfrst
standsfor the first moment in time and nert to the next moment in time. The foliowing is a simple example of this language:
first light
(green)
.next light
(amber)
<- light
(green)
.next light (red) <- light
(amber)
.next light (green) <- light
(red)
.o
Disjunctive Chronolog [GRP96] that combines Chronolog with Disjunctive Logic Programming.o
Chronolog(MC) [LO96] is an extension of Chronolog basedor
Clocked Temporal Logi,c where predicates are associatedwith
local clocks.o
Metric Temporal Logic Programming(MTL)
[Brz98] time can be either discreteor dense.
MTL
has two temporal operators E7 and0r
defined as:nrA
is trueif
A
is true in all moments in the intervalI
and0rA
is trueif
A
is true in somemoment in the interval
I.
As an illustration of a simple factin
in this language consider:n;zoos,zoozlsalarY
(Peter
,
55000)
'Cactus [RGP97] is a proposal of a branching-time language
that
supports two main operators: the temporal operator f i,rst which refers to the beginning of time and the temporal operatornerti
which refers to thei-th
child of the current moment.2.5
Reasoning
About
Actions and
Change
Reasoning about actions and change studies the evolution of (a portion of) the world
as the result of the occurrence of a set of actions andf or events [CM00]. The main
2.5.
REASOAIING ABOUT ACTIOIVS AI\ID CHANGEforward temporal projecti,on
that
can be regarded as inferring consequences of actions having some knowledgeof
whatis
currently believed. Usuallythis
isperformed by deducti,on.
backward temporal projecti,on
that
can be regarded as inferring explanations of given situations having some knowledge of what is currently believed. Usually this is performed by i,nducti,on.For a comprehensive study on inference of temporal knowledge see for instance [Rib93].
According
to
[CM00], temporal projection has to deal with three main problems:the rami,ficati,on problen'L: concerns the specification of the effects of a given event; the quali,fication problem'. concerns the specification of the conditions under which
an event actually produces the expected effects;
the frame problem:
its
relatedwith
the
ones above andits
the
problem of determining what stays the same about the world as time passes and actions are performed.Next we survey some of the more relevant theories of action and change.
2.5.L
The Situation
Calculus
L7
The Situation Calculus (SC) proposed by McCarthy and Hayes [MH69] was the first formal representation of time
in Artiflcial
Intelligence. This formalism allows one tomodel the evolution of a world and, although there is no explicit representation of time,
si,tuati,ons are used to model the flow of time. Besides situations, the SC also specifies
fi,uents and acti,ons:
o fluents are functions and predicates
that
change overo
act'ions standfor
the possible actionsthat
can beworld.
Except for the
initial
situation (usually denoted by ,So), all other situations are gener-ated by applying an action to a situation. As a simple illustration taken from the blocksworld, consider the (reified) fluent
on(A,
B) statingthat
block A is on top of block Band the auxiliary predicate HoIdsAt to specify when the fluents are true, one can say:
HoIdsAt (on
(A,
B),
result
(move(A,
B),
S))
to state that its true that A is on top Btime;
in the situation that results from moving A to B in situation S. Using predicates instead
of functions, i.e. in a non-reified form we have
on(A,
B,
result(move(A,
B),
S)). Finally, the main objectionto
SC comes from the factthat
is impossibleto
modelconcurrent actions.
2.5.2
The Event
Calculus
The Event Calculus (EC) formalism was proposed by Kowalski and Sergot [KS86] and
as the name states, the primitive objects are euents.
In
the EC, time is explicit and euents are somewhat similar to the act'ions of SC. An EC fluent holds at time pointsand there is an axiom to allow us to reason about intervals of times: a fluent is true at a point in time
if
an event initiated the fluentat
some timein
the past and was not terminated by an intervening event [RN03].The relation
Initiates
(Terminates) expresses that the occurrence of an event e at atime point
t
causes a fluentf
to become (cease to be) true. There is also the relationHappens
that
is usedto
statethat
an event e happensat
a timet.
As an example, Happens (Turn0ff (LightSwitch)
,
0:00)
states that the lightswitch was turned off at exactly 0:00.Finally, Kowalski and Sadri [KS97] proved that the Event Calculus and the Situation
Calculus are equivalent.
2.5.3
Temporal Nonmonotonic
Reasoning
The research on temporal nonmonotonic reasoning was tri,ggered by
the
Yale Shooti,ngProblem [HM87]. Although
this
isa
(very broad) field of research reaching beyondthe focus of the present work, for completeness reasons we decided
to
present a brief overview (that follows [Aug01]) of several key formalisms in this area.Shoham's
Non-Monotonic
Temporal
LogicShoham's non-monotonic temporal logic [Sho88] is based on model preference and uses
Chronologi,cal lgnorance as a criterion to define a partial order between the models, i.e.
it
prefers those models where a fact holds as late as possible.2.6,
COAICTUSIOAISExtended
Situation
CalculusIn [Pin9 ] Pinto adds explicit time to Situation Calculus and addresses several problems such as: representation of concurrent and complex action; reasoning on a continuous
ontology; easy reference to dates; etc.
Defeasible
Temporal
ReasoningIn
a broad sense one can saythat
argumentation systems allow usto
reason about a changing world where the available information is incomplete or unreliable. There are several examples of argumentation systemthat
embed temporal reasoning based onintervals, on instants or both (see [Aug01] for an overview).
2.6
Conclusrons
We started this section by describing the notions of model of time and of temporal
qualification.
We then reviewed several constraint-based and modal approaches to temporal reasoning, with a stronger emphasis on the former since the temporalrepre-sentation and reasoning followed throughout this work is constraint-based. Although,
on a first look, first-order and modal approaches can be regarded as radically different,
Galton noted that they rely on the common use of a first-order language: the former
uses
it
as the proper representation language and the later as a model theory. Finally,we briefly sketched the foundational theories for reasoning about actions and change.
The research on temporal representation and reasoning, even restricted to the one that "fits" under the domain of artificial intelligence is so vast that a chapter such as this one
can only
lightly
brush over some aspects. For a more systematic and comprehensive approach we suggest [FGV05].Chapter
3
Temporal
Databases
This chapter reviews the main concepts concerning temporal databases, namely temporal data semantics, models and languages. Morcover, besides some considera-tions about the design of these databases
it
also describes several temporal database products.3.1
Introduction
In a broad sense we can define a temporal database as a repository of temporal
informa-tion
[Cho94] therefore one can saythat
most database applications are supported by temporal databases. SQL [fS03] is often the language chosen for interacting with such databases. Althoughit
is a very powerful language for writing queries, modifications orconstraints in the current state,
it
does not provide adequate support for the temporal counterparts: for instance, expressing the temporal equivalent of an ordinary query can be a very challenging task in SQL. To overcome such difficulties, several temporal data models, algebras and languages have been proposed.McKenzie and Snodgrass [LEMS91] have shown
that
the design spacefor
temporalaigebras has
in
some sense been exploredin
that
all
combinationsof
basic design decisions have at least one representative algebra.In
this section we present a brief overview of the temporal data semantics (Sect. 3.2)together
with
the models and languages (Sect. 3.3) that we consider more significant.For a more in depth study on this subject the reader may refer
to
[TCG+93, DD02]. Since the practical aspects of databases are highly important, we also review several products that extend regular database management system in order to include temporal capabilities (Sect. 3.5). Although most of these products only consider the time betweenthe insertion and the removal of a fact from the database some applications already
suport the time when the fact is true in the modeled reality.
3.2
Temporal
Data
Semantics
According to [Jen00] a database models and records information about a part of reality
(modeled reality) where the diflerent aspects of this reality are represented by database
entities.
In
temporal databases, the facts recorded by the database entities can have an associated ti,me and this is usually defined as uali,d ti,me or as transacti,on ti,me:Definition 2
(Valid
Time)
The uali,d ti,me of a fact i,s the collected ti,mes - possi,bly spanni,ng the past, present, and future-
when the fact i,s true i,n the modeled reali,ty.Definition 3
(Tlansaction
Time)
The transact'ion t'imeof a
databasefact'is
the ti,me spanni,ng between when i,t was i.nserted i,nto the database and when i,t was logi,cally remoued from the database.Unlike the valid time, the transaction time may be associated with any database entity (not only with facts) and captures the time-varying states of the database. Applications that demand accountability or "traceability" rely on databases that record transaction
time.
Moreover, data consistencyis
ensured since the transaction timestamps aremaintained automatically by the DBMS.
There is no single answer on how to perceive time in reality and how to represent time in a database. As mentioned in Sect. 2.2, to define a model of time we need to consider
not only the time ontology but also the time topologg. In databases, a finite and discrete
time domain is typically assumed. Most often, time is assumed to be totally ordered,
but various partial orders have also been used.
3.3
Temporal
Data
Models and
Languages
According
to
[Dat99] a data model is an abstract, self-contained, logical definition of the obiects, operators, and soforth,
that
together constitute the abstract machinewith
which users interact.In
the relational data model, the relations are the objectsand data is operated on by means of a relational calculus or algebra,
with
equivalent expressive power.Several proposals for extending the relational data model to incorporate the temporal dimension
of
data have appearedin
the
literature.
These proposals have differed3.3,
TEMPORAL DATA MODELS AAID LANGUAGESconsiderably in the way that the temporai dimension has been incorporated both into the structure of the extended relations of these temporal models and into the extended
relational algebra or calculus
that
they define.Since there several dozen temporal data models, instead of providing a detailed
descrip-tion of each one we present a list with their names, main properties and references. A similar approach
will
be followed in overviewing the temporal languages in Sect. 3.3.2.The only exception is the language TSQL2 [IABC+gs] and
its
temporal data model(Bitemporal Conceptual Data Model), since this language is regarded as a consensual
temporal extension of SQL-92.
3.3.1
Temporal
Data
Model
A useful taxonomy for temporal data models was introduced by Clifford et. al. [CCT94, CCGTg5l who classified them into two main categories: temporally ungrouped (tuple time stamping) and temporallg grouped (attribute time stamping) data models. To
illustrate these two categories please consider tables 3.1 and 3.2 taken from [CCT94],
to
represent a temporal ungrouped and grouped, respectively, version of an employeerelation (in this modeled reaiity, employee Tom changes his narne
to
Thomas at time3).
EMPLOYEE
NAME
DEPT
SALARY
timeSales 20K
0Finance
20K
1Finance
20K
2MIS 27K
3Finance
20K
1MIS 3OK
2MIS 4OK
3Finance
20K
1Sales 20K
2Table 3.1: Prototypical temporally ungrouped employee relation
EMPLOYEE
NAME DEPT
SALARY
lifespan[
--+Tom
0 ---Sales
0 ---+ 20K 23 Tom Tom Tom Thomas Jim Jim Jim Scott Scottcontinued from previous page
NAME
DEPT
SALARY
lifespan 1+ Tom
1+
Finance
I
--+ 20K 2 ---*Tom
2 ---Finance
2'--+ 20K 3 ---+Thomas
3 ---+MIS
3
---+27K
{0,
1, 2, 3} 1 --+Jim
1 ---+Finance
1 --+ 20K2
---+Jim
2 --+MIS
2 --+ 30K $ ---+Jim
3 ---+MIS
3 ---+10K
{1, 2, 3} 1 ---+Scott
1 ---+Finance
7 --+ 20K 2 ---+Scott
2-*
Sales
2
--+20K
{L,2}
Table 3.2: Prototypical temporally grouped employee relation
These authors also show
that,
although the temporally ungrouped models are lessexpressive than the grouped ones, there is a grouping mechanism
for
capturing the additional semantic power of temporal grouping. Moreover, they propose a metric of historical relational completeness as a basic for determining the expressive power of the query languages over these models.Several data models use intervals
in
timestampsbut
that
doesn't meanthat
such models are interval-based: sometimes intervals are used as shorthands for time points.In
[BBJ98] the authors emphasise that the notions of point- and interval-basedtimes-tamps must be defined at the semantical level, Moreover, besides presenting a formal definition for these notions they also evaluate several temporal data models.
Table 3.3 (taken from [JSS95]) Iists several influential temporal data models. For a concise description
of
these models, togetherwith
their
comparison,the
interested reader is referredto
[JSS95].Data Model
Identifier
Time Dimensions ReferenceTemporally Oriented Data
Model
valid
Ariav [Ari86] Time RelationalModel
both
Ben-Zvi
lBZ82)valid
Brooks
[8ro56] Historical Relational DataModel
valid
CliffordHomogeneous Relational
Model valid
Gadia Heterogeneous RelationalModel valid
Yeungtransaction
Jensen
[JMR91Ilcc87l
[Gad88] lGY88l
valid
Jones uMSTeltransaction
Kimball
[Kim78]DM/r
Legol 2.0
Data
3.3.
TEMPORAL DATA MODELS AI\ID LANGUAGES 25continued from previous page
Data Model Identifier
TimeDimensions
ReferenceTemporal Relational Model Temporal Relational Model HQL
HSQL
Temporal Data Model TQuel
Postgres HQuel
Accounting Data Model
Time Oriented Data Base Model
valid valid valid valid vaiid both transaction valid both valid Lorentzos Navathe Sadeghi Sarda Segev Snodgrass Stonebraker Tansel Thompson Wiederhold [Lor88] lNA8el [Sad87] [Sar90b] lss87l [Sno87]
lsKelI
lrA86l [Thoe1] lGwwT5lTable 3.3: Temporal data models
Bitemporal
Conceptual
Data Model
The Bitemporal Conceptual Data Model (BCDM) [JS96] tries to maintain the
simplic-ity
of the relational model and capture the temporal aspects of the facts storedin
adatabase. One possible definition of the BCDM according
to
[Jen00] is:Definition 4
(Bitemporal
Conceptual
Data
Model)
both uali,d and transacti,on ti,mes are supported and the relati,ons are coalesced.l Moreouer, the ualue now anduntil changed are i,ntroduced
for
uali,d ti,me and transacti,on ti,me, respecti,uely.This is a conceptual model where no two tuples
with
mutually identical explicit at-tribute values are allowed, i.e. the full history of a fact is contained in exactly one tuple. To illustratethis
model, please considera
relation recording employee/departmentinformation, taken
from
[JSS95]: employee Jake was hiredby the
companyin
the shipping department for the interval fromtime
10to
time
15, and this fact becamecurrent
in
the databaseat
time5.
Afterwards, the personnel department discoversthat
Jake had really been hired from time 5 to time 20, and the database is correctedbeginning at time 10. Table 3.4 shows the corresponding bitemporal element.
Emp
DeptT
Jake
Ship
{(5,
10),...,
. . . ,(9, 15), (10, (5, 15),...,
(9, 10), 5),...,
(10, 20),...
) Table 3.4: BCDM tuplerValue equivalent tuples with the same non-timestamp attributes and adjacent or overlapping time