interval algebra seminar report

Upload: manisharya11

Post on 07-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 Interval Algebra Seminar report

    1/20

    Interval Algebra

    Manish Arya

    19.07.2011

    1

  • 8/3/2019 Interval Algebra Seminar report

    2/20

    CONTENTS

    Contents

    1 Introduction 3

    2 Motivation 4

    3 Algebra Formalism 5

    3.1 1-D Point Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    3.2 Point - Interval Algebra . . . . . . . . . . . . . . . . . . . . . . . 6

    3.3 Interval - Interval Algebra . . . . . . . . . . . . . . . . . . . . . . 6

    4 Maintaining Temporal Relations 9

    4.1 Basic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    4.1.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    4.1.2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    5 Reference Intervals 13

    5.1 Using Reference Intervals . . . . . . . . . . . . . . . . . . . . . . 13

    5.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    6 Completeness 18

    7 Conclusion and Outlook 19

  • 8/3/2019 Interval Algebra Seminar report

    3/20

    1 INTRODUCTION

    1 Introduction

    Temporal logic is the branch of logic in which the reference of time exists. Firstorder logic has its limitations with respect to the temporal logic. Consider theproposition reporting state Marry is awake is to be expressed with first orderlogic. The above mentioned proposition has homogeneous temporal incidence,which implies that state must hold for all subintervals of the interval. For ex-ample, if Marry is awake from 8AM to 10PM then it is valid for all subintervalsbetween 8AM to 10PM. This can be easily modeled through first order logicusing ForAll () operator. Consider another proposition reporting state Marryworks while she is awake is to be expressed with first order logic. This proposi-tion has inhomogeneous temporal incidence, which implies that state does nothold for all subintervals of the interval. For example, if Marry works from 11AM

    to 6PM then it is not valid for all subintervals between 8AM to 10PM whenshe is awake. However, there are operators like Next, Until which can modelsuch cases too. But, it is not trivial to express such propositions with first orderlogic. Consider the case where we want to define While, During, Overlap andMeet constructs. The representation for non-trivial constructs in First orderlogic is not easy and becomes difficult to model [Gal08].

    Time point is value of time at a unique instant. And, a Time interval canbe defined as a range (set) where end points are defined by time points. Therehave been various methods to express temporal logic. Most of them are makinguse of the time points. Allens interval algebra plays a crucial role in expressingtemporal logic. The basic element of Allens method is time interval at the placeof time point which gives it an advantage over other methods like state-space

    approaches [Sac77], date-line systems [Hen73] and allows it more flexibility inrepresentation.

    Suppose, we want to express,

    I received a letter yesterday.

    It is expressible if we consider a time point and keep its value relative to thevalue of now. Consider more complex case,

    I received a letter after yesterday but before tomorrow.

    This can also be taken care of if we define two time points whose values are

    maintained with respect to current time. Consider another case,

    I received a letter yesterday between 3-4 PM in afternoon.

    One can think about defining a time interval with a time point. Consider anothercase,

    I received a letter yesterday between 3-4 PM while I was not in the house.

    Or, I received a letter yesterday between 3-4 PM while I was not in thehouse and I was in the lecture which was from 2.30-4 PM.

  • 8/3/2019 Interval Algebra Seminar report

    4/20

    2 MOTIVATION

    The representation with time point becomes more complex to model with more

    time clauses in proposition. A basic intuition says that the usage of time intervalcan represent such events more easily than that of time point. It might be ableto express such cases more appropriately as the unit of reasoning will be timeinterval at the place of time point. And, one can also represent cases involvingtime point by making time interval smaller.

    Chapter 2 tells about the advantage of time intervals over time points andgives overview of existing temporal logic approaches. Chapter 3 gives the alge-bra formalism for Allens algebra. Chapter 4 explains the basic algorithm formaintaining temporal relations in Allens interval algebra and Chapter 5 givesa modification over the algorithm in the form of reference intervals. Chapter6 discusses the completeness of Allens approach and Chapter 7 concludes theseminar paper and provides a brief outlook.

    2 Motivation

    If time points are considered as basic unit then time interval can be representedby modeling their endpoints. Suppose an intervals left end is denoted by tand right by t+. It can be seen clearly that t < t+. If we want to comparetwo intervals t1 and t2, where t1 is before t2. Then, it can be said by t1+ < t2.This notation should fill up the task for temporal reasoning. However, thisrepresentation is too uniform and does not help to structure the knowledge sothat it can be easily used for reasoning problem whether some condition is beingsatisfied during some event.

    Consider a case in which some condition P holds during interval t1. Consideranother interval t2 which is during t1. Then, it can be stated that P holdsduring t2 also. Consider another interval t3 which is during t2. Then, it can bestated that P holds during t3 also. A point to be noted is that during relationcan specify a hierarchy in which propositions can be inherited.

    < t1 >

    < t2 >

    < t3 >

    If some condition holds during t1, it also holds during t2 and t3 too. This helps ingetting rid of storage of redundant information. Suppose, if some property holdsduring today then one need to consider the intervals which take place today.An interval in the hierarchy of yesterday is not needed to be considered. And,there is still no clear explanation of how to take advantage of these propertiesusing time point based approaches which encouraged author to move towardtime interval approaches.

    There have been various methods for temporal representation which can bebroadly classified in state-space approaches, date-line systems, before/after chain-ing and methods which use formal model for time.

  • 8/3/2019 Interval Algebra Seminar report

    5/20

    3 ALGEBRA FORMALISM

    State-space approaches provide a basic representation of time that is more suit-

    able for simple cases. They describe world at instantaneous points. Actions canbe modeled in such system as function mapping between states. And, if theprevious states are retained we have a representation of time in discrete stepsstored in the form of a database. Here, each event can be modeled into a stateand assigned its truth value. However, it becomes too expensive to maintain allpresent, past and future states. Therefore, most of the systems maintain onlypresent states [Sac77].

    A database is an example of date-line systems. They record each and every dataentry with respect to date. And, duration between two events can be calculatedusing simple operations. But, there are many events which cannot be assigneda precise date and therefore cannot be represented using this system. Considerthe case where we want to represent the proposition Two events A and B did

    not happen together. Here, two events A and B do not have a well-defined date.It can be said that this fact can be taken care by assigning fuzzy (any) dateswhich are different from each other. We need to assign event A and B a fuzzydate and must assume that one event took place before another to represent theabove mentioned information. Here, we had to additionally assign that EitherAwas before B orB was before A, which was not intended by original proposition.The representation becomes more complicated if two events are referencing totime intervals at the place of time points [Hen73].

    Before/after chaining uses concept of chains. A chain is a set S, such thatfor each x and y in S, x y or x y. Here, each time point could lead toseveral paths in past and future. And, a series of points in past and future canprovide time chains. Chaining allows storing the temporal information quite

    directly. For example, a time point leading to many paths in past and future.But, it becomes difficult to search long chains for particular time points asthe temporal information grows. Additionally, two events A and B which aredisjoint cannot be represented with this system unless disjunction is representedexplicitly [KG77].

    There are wide ranges of methods which use formal model for time. One no-table method of them dealing with artificial intelligence is the situation calculus.The main elements of the situation calculus are the actions, the fluents, and thesituations. Here, knowledge is represented as a series of situations and each situ-ation describes the world at an instant of time. Actions, situations, and objectsare elements of the domain and the fluents are modeled as either predicates orfunctions. But, this theory is apt for the cases where only one event can occur

    at a time [RU71].

    3 Algebra Formalism

    Interval algebra represents information in term of time intervals. The authorhas introduced a formalism to represent this algebra so that the application ofalgorithm becomes easier. There are three possible relations () betweentwo points. An overview of possible relationships among different notationsis provided in Figure 1. The number of possible relationships between the

  • 8/3/2019 Interval Algebra Seminar report

    6/20

    3 ALGEBRA FORMALISM

    Figure 1: Relationships in different notations.

    end points depends on type of algebra which has been explained in followingsubsections.

    3.1 1-D Point Algebra

    Consider two ordered points a, b. There are 3 possible relations between them.

    a < b

    a = b

    a > b

    3.2 Point - Interval Algebra

    Consider one point a and an interval [x, y]. There could be 3 3 = 9 possiblerelations. Although, only 5 of them are valid as we know x < y from the intervalinformation.

    a < x, y

    a = x, (a < y )

    x < a < y

    a = y, (x < a)

    a > y, x

    3.3 Interval - Interval Algebra

    Consider two intervals A = [a1, a2] and B = [b1, b2]. There could be 333 = 27possible relations. Although, only 13 of them are valid as we know a1 < a2 andb1 < b2 from the interval information [Muk].

    The possible 13 relations are given in Figure 2. Here i after the relation impliesthe inverse relation. And, the inverse for equals remains the same.

    Another notation to denote relationships between intervals is showing themthrough a network where node represents the individual interval and edges

  • 8/3/2019 Interval Algebra Seminar report

    7/20

    3 ALGEBRA FORMALISM

    Figure 2: The thirteen possible relations between intervals.

    Relation Network Representation1 X during Y NX (d) NY2 X during Y or NX (d s f) NY

    X starts Y orX finishes Y

    3 X overlaps Y or NX (o oi < >) NYY overlaps X orX before Y or

    Y before X

    Table 1: Representing temporal relations knowledge in a network.

    between them represent the possible relationships. If there is more than onerelationship between two intervals then they are put in same parenthesis. Inaddition, all the possible relationships are entered when there is uncertaintyabout the relationship. These 13 relations are mutually exclusive which givesno scope of ambiguity in this notation. The syntax for representing the intervalsin the form of network is as:

    Interval1 Relationships I nterval2 =

    NodeInterval1 (Relationship symbols) NodeInterval2

    Some examples of network representation are provided in Table 1.

  • 8/3/2019 Interval Algebra Seminar report

    8/20

  • 8/3/2019 Interval Algebra Seminar report

    9/20

    4 MAINTAINING TEMPORAL RELATIONS

    4 Maintaining Temporal Relations

    Allens interval algebra represents information in form of a network. It is as-sumed that network has complete information about the intervals. Whenevera new fact is entered into the network all possible consequences are calculated.It is done by calculating the transitive closure of temporal relations which isexplained later. The new fact will bring a relation between two intervals whichin turn may bring new relations among other intervals through the transitiv-ity among intervals. For e.g., i before j added and it is known that j startsk. Then, it can be inferred that i before k. The transitivity table for all thepossible relations is given in Table 2.

    4.1 Basic Algorithm

    The following method can be used to calculate transitive relationship betweentwo sets of relationships. Let C be the transitive relationship set. Let, R1 andR2 are the edge relationships and a fact is added to the network.

    A simple way to calculate the change in temporal relationship as new facts areintroduced in the network is described in Algorithm 1.

    Algorithm 1 Constraints (R1, R2)

    Require: C := for each r1 in R1 do

    for each r2 in R2 doC := C+Transitive value (r1, r2) //Transitive value can be read from

    // the Table 2end for

    end for

    Lets assume intervals are denoted by i, j. N(i, j) represents the existing relationbetween them on the edge and R(i, j) is the new relation added between i andj. Then, the way to maintain temporal relations in the network is described inAlgorithm 2.

    Algorithm 2 Add R(i, j)

    N(i, j) := N(i, j) R(i, j)for all k with N(k, i) do

    N(k, j) := N(k, j) Constraints(N(k, i), N(i, j)))end for

    for all k with N(j,k) doN(i, k) := N(i, k) Constraints(N(i, j), N(j,k))

    end for

    4.1.1 Example

    Here is a simple example to explain above mentioned algorithm. Assume wehave the given facts:

  • 8/3/2019 Interval Algebra Seminar report

    10/20

    4 MAINTAINING TEMPORAL RELATIONS

    Lunch is before, during, starts or finishes with afternoon.

    Breakfast is before or meets afternoon.

    Lets say Lunch is denoted by L, Afternoon by A and Breakfast by B. When thefirst fact is stored in the system, there was no prior information in the system,so it simply adds

    L (< d s f ) A

    After, adding the second fact

    B (< m) > A

    We could see that both facts have a common node A. So, transitivity closurewill be applied here. Lets rewrite this information using A as a common node.

    B (< m) A (> disifi) L

    We have used inverse properties of relations to write the fact in opposite di-rection. We could have written the facts in another direction too, which wouldhave needed inverse of fact 2. Now, it is clear that there exists a relation be-tween B and L as B A and A L. We go by algorithm and calculate theConstraints for this pair of facts.

    T() = ()

    T(

  • 8/3/2019 Interval Algebra Seminar report

    11/20

    4 MAINTAINING TEMPORAL RELATIONS

    We can see that there is quite a possibility of relationships between B and L.

    But, it is alright as interval algebra tries to keep the redundancies unless thereis no clear reason to remove them. Now, lets add the fact that

    Breakfast is before Lunch

    which can be written as

    B (

  • 8/3/2019 Interval Algebra Seminar report

    12/20

    4 MAINTAINING TEMPORAL RELATIONS

    Figure 3: An inconsistent labeling.

    4.1.2 Analysis

    The algorithm continues to operate until new facts are added to the system. But,there is a upper limit to the number of changes as there are only 13 possiblerelationships between intervals. It means a relationship can be changed only in

    13 ways. The number of changes would be limited to 13 Number of binaryrelations among N nodes, which is

    13 [(N 1) + (N 2) + .. + (N N)]

    13 [(N N) (N(N + 1)/2)]

    13 [(N (N 1))/2]

    We can see that the effect propagation for N additions takes O(N2) time. There-fore, one addition on average takes O(N) time. But, the major problem is spacehere as it takes O(N2) space for N temporal intervals which is nominal in thecase of point representation. But, it can be taken care by reference intervals

    (explained later).There are inconsistencies possible with Allens algorithm. Allens algorithmguarantees consistent relationships only for 3 nodes sub-network. It impliesthat a network is possible which may seem consistent with respect to threenode relationships but does not have consistency with respect to all the nodesin the network. Consider the example given in Figure 3.

    Now, there could be two possible relations for A D, derived from path

    1. A B D

    2. A C D

  • 8/3/2019 Interval Algebra Seminar report

    13/20

    5 REFERENCE INTERVALS

    Figure 4: The connectness of a network with Reference Intervals.

    While it is allowed by second path to have relationship ( o m) for A D, it

    is not allowed by path 1. It means the whole network will not have consistentlabeling.

    To ensure total consistency one would have to recursively look for three arcs,then four arcs etc. While there are methods available to do so, the computationalcomplexity would reach to exponential value for them. If consistency is desiredfor any sub-network, it can be found through a simple backtracking search withalternate path labeling until a consistent labeling is found [All90].

    5 Reference Intervals

    Reference intervals have been used to limit the space requirements and they do

    so by making interval relations less explicit. Reference intervals are also timeintervals, but their usage allows doing the computation differently. They areused to group together cluster of intervals. In these clusters, transitive closurefor all pair of intervals is fully computed. And, these clusters are related tothe rest of the intervals only through reference intervals to minimize explicitrelationships among intervals.

    5.1 Using Reference Intervals

    An interval may belong to one or more reference intervals depending upon char-acterization of reference intervals. And, it is denoted by putting the referenceintervals after the interval in parenthesis. For example, refer to Figure 4.

    I1(R1) implies that interval I1 belongs to reference interval R1.

    I4(R1, R2) implies that interval I4 belong to the reference interval R1 andR2 both.

    The algorithm to add any new relation using the reference interval remains sameas the basic algorithm with a few changes, as described in Algorithm 3.

    The only difference is ofComparable function. While deducing a new relation itis checked that end points are comparable. And, it can be checked as describedin Algorithm 4.

  • 8/3/2019 Interval Algebra Seminar report

    14/20

    5 REFERENCE INTERVALS

    Algorithm 3 Add with Reference Interval R(i, j)

    N(i, j) := N(i, j) R(i, j)for all k with N(k, i) and Comparable(k, i) do

    N(k, j) := N(k, j) Constraints(N(k, i), N(i, j)))end for

    for all k with N(j,k) and Comparable(i, k) doN(i, k) := N(i, k) Constraints(N(i, j), N(j,k))

    end for

    Algorithm 4 Comparable (i, j)

    Require: two nodes i and jif Ref(i) Ref(j) = null then

    return True //(share at least one common reference interval)

    end ifif i Ref(j) then

    return True //(i has reference interval as j)end if

    if j Ref(i) thenreturn True //(j has reference interval as i)

    end if

    As we know reference intervals are just like any other intervals, they can alsohave reference intervals which may provide us with the hierarchy of referenceintervals. In most of the cases, this hierarchy is tree-like for clear identificationof reference intervals. An example is given in Figure 5.

    If two intervals are not explicitly related in network, then a relationship betweenthem can be found by finding a path through reference intervals hierarchy net-work and then applying transitive closure to the relations in the path. Thepossible relationship can be found as described in Algorithm 5.

    Here the function Find-path does straight forward path search with the restric-tion that a path should be between a node and its reference interval except forthe paths where direct connection is found.

    Consider the path n1, n2, n3, . . . . , nk, nk+1, . . . ., nm1, nm for the example.

    Figure 5: A Tree-Like Hierarchy Based on Reference Intervals.

  • 8/3/2019 Interval Algebra Seminar report

    15/20

    5 REFERENCE INTERVALS

    Algorithm 5 Network Relation between nodes i and j through reference inter-

    valsRequire: two nodes i and jif N(I, j)exists then

    Return N(I, j)else

    Paths :=Find-path(I, j)for each edge in path do

    R := R Constraints (along path)end for

    Return Rend if

    If the only direct connection in this path is between node nk and nk+1then,

    For i = 1 to k, ni+1 is reference interval of ni

    And, for i = k + 1 to m, ni is reference interval of ni+1

    The Constraints function calculation is same as defined above. It takes twoedges and finds transitive closure between them. Consider the same path asabove i.e., n1, n2, n3, . . . . , nk, nk+1, . . . ., nm1, nm

    Here relationship between (1, m) can be calculated as:

    R := N(1, 2)

    Constraint(R, N(2, 3))

    Constraint(R, N(3, 4))

    . . . . .

    Constraint(R, N(nm1, nm))

    After this, R holds the relationship R(1, m). Here, N(i, j) represents the existingrelations between intervals i and j on the edge.

    5.2 Examples

    Consider the Master program of a student and its details are as:student finishes master program in given two years with 1st two semesters in1st year and last two semesters in 2nd year. Student takes a course of knowl-edge representation (KR) in 1st semester, finishes 1st seminar and DSM in 2nd

    semester. In 3rd semester student covers 2nd seminar, practical and starts withthe thesis work and the last semester was fully devoted for remaining of thethesis work. Above information can be defined in term of reference interval asgiven in Figure 6.

    Suppose, we want to calculate possible relationship between KR course andthesis. There is no direct relationship between KR and thesis. So, we searcha path between intervals KR and thesis.

  • 8/3/2019 Interval Algebra Seminar report

    16/20

    5 REFERENCE INTERVALS

    Figure 6: A Reference Hierarchy for Master Course.

    KR(1st sem)(d) 1st sem(1st year)(

  • 8/3/2019 Interval Algebra Seminar report

    17/20

    5 REFERENCE INTERVALS

    Figure 7: A Reference Hierarchy for a Year.

    Consider an example where we break down a year. A year is made up of fourseasons Summer, Autumn, Winter, Spring. Each season has three months.We break season Winter into two parts Winter1 and Winter2 because yearstarts with Winter and finishes with Winter. We also know that Fools dayand V acations fall in April. With the above conditions, network looks as givenin Figure 7.

    Now, we add the information that March comes before the Fools day (drawnin green colour). We can infer a new relationship from this path:

    March(Spring) (

  • 8/3/2019 Interval Algebra Seminar report

    18/20

    6 COMPLETENESS

    Spring(Y ear) (f i) M ay(Spring) (

  • 8/3/2019 Interval Algebra Seminar report

    19/20

    7 CONCLUSION AND OUTLOOK

    7 Conclusion and Outlook

    Interval algebra is a system for reasoning about temporal logic and interval al-gebra does this in an expressive and computational effective way. It can alsocategorize the information in terms of reference intervals which allows controlon the amount of deduction automatically done by the system. Reference inter-vals help in saving the space by discarding unnecessary explicit relations usinghierarchy. This system could be effectively used in places where temporal infor-mation is imprecise and relative and using dates cannot solve the purpose.

    This approach formed one of the pioneers for temporal logic and reasoning.It has been used in various researches. This approach has potential to pro-vide solutions to various applications dealing with temporal logic like Robotics,Molecular Biology [SWL10, BM96] etc. And, there is a wide scope of further

    work over interval algebra.

  • 8/3/2019 Interval Algebra Seminar report

    20/20

    REFERENCES

    References

    [All90] James F. Allen. Maintaining knowledge about temporal intervals,pages 361372. Morgan Kaufmann Publishers Inc., San Francisco,CA, USA, 1990.

    [BM96] Peter Van Beek and Dennis W. Manchak. The design and experimen-tal analysis of algorithms for temporal reasoning. Journal of ArtificialIntelligence Research, pages 118, 1996.

    [DC00] Wes Cowley Department and Wes Cowley. An interval algebra for in-determinate time. In In Proceedings of the Seventeenth National Con-ference on Artificial Intelligence (AAAI 2000, pages 470475. AAAIPress, 2000.

    [Gal08] Antony Galton. Temporal logic. In Edward N. Zalta, editor, TheStanford Encyclopedia of Philosophy. Fall 2008 edition, 2008.

    [Hen73] Gary G. Hendrix. Modeling simultaneous actions and continuous pro-cesses. Artificial Intelligence, 4(3-4):145 180, 1973.

    [KG77] K. M. Kahn and A. G. Gorry. Mechanizing temporal knowledge, 1977.

    [Muk] Amitabha Mukerjee.

    [Ren01] Jochen Renz. A spatial odyssey of the interval algebra: 1. directedintervals, 2001.

    [RU71] N. Rescher and A. Urquhart. Temporal Logic. Springer, 1971.

    [Sac77] E. D. Sacerdoti. A structure for plans and behavior, 1977.

    [SWL10] Stefan Schiffer, Andreas Wortmann, and Gerhard Lakemeyer. Self-Maintenance for Autonomous Robots controlled by ReadyLog. InFelix Ingrand and Jeremie Guiochet, editors, Proceedings of the 7thIARP Workshop on Technical Challenges for Dependable Robots inHuman Environments, pages 101107, Toulouse, France, June 16-172010.