robert kowalski and fariba sadri department of computing
play

Robert Kowalski and Fariba Sadri Department of Computing Imperial - PowerPoint PPT Presentation

Towards a Unifying Logic-Based Framework for Programming Databases AI knowledge representation and problem-solving Robert Kowalski and Fariba Sadri Department of Computing Imperial College London Outline KELPS - a simplified kernel for


  1. Towards a Unifying Logic-Based Framework for Programming Databases AI knowledge representation and problem-solving Robert Kowalski and Fariba Sadri Department of Computing Imperial College London

  2. Outline • KELPS - a simplified kernel for reactive logic-based production-style systems • Related work (MetateM, Transaction Logic) • LPS = KELPS + Logic Programs • MALPS = Multi Agent LPS (The Dining Philosophers) • Model-theoretic semantics • Operational semantics • Conclusions

  3. KELPS Programs are reactive rules with explicit time in the logical form:  X [antecedent(X)   Y consequent(X, Y)] antecedent(X)  consequent(X, Y) abbreviated whenever the antecedent is true, then the consequent is true at some time in the future.

  4. Ontology: facts (or fluents) + events (including actions) Model-theoretic semantics: facts are time-stamped Operational Semantics: facts updated destructively Computation: model generation e i S i S i+1 old-fact new-fact fact 1 fact 1 fact 2 fact 2 … … fact n fact n t i t i+1 = t i + ε i

  5. KELPS = Composite events + rules + composite actions pre-sensor detects possible fire in area A at time T 1 ∧ smoke detector detects smoke in area A at time T 2 ∧ |T 1 – T 2 |  60 sec ∧ max(T 1 , T 2 , T)  activate local fire suppression in area A at time T 3 ∧ T <T 3  T + 10 sec ∧  fire in area A at time T 4 ∧ T 3 <T 4  T 3 + 30 sec ∧ ∧ T 4 <T 5  T 4 + 10 sec send security guard to area A at time T 5 ∧ T <T 3 ‘  T + 120 sec ∨ call fire department to area A at time T 3 ‘ The alternative consequents are alternative conditional plans.

  6. Syntax of reactive rules in KELPS antecedent 1 (X) ∧… ∧ antecedent n (X)  consequent 11 (X, Y) ∧… ∧ consequent 1l1 (X, Y) ∨ … ∨ consequent m1 (X, Y) ∧… ∧ consequent mlm (X, Y) Each antecedent i (X) and consequent i j (X, Y) is: • an FOL condition in the vocabulary of state predicates • an event atom representing an event (including action) • a temporal constraint time 1 < time 2 or time 1 ≤ time 2 , where at least one of time 1 and time 2 is a variable.

  7. Outline • KELPS • Related work (MetateM, Transaction Logic) • LPS = KELPS + Logic Programs • MALPS = Multi Agent LPS (The Dining Philosophers) • Model-theoretic semantics • Operational semantics • Conclusions

  8. Comparison with MetateM (Michael Fisher et al) Programs = reactive rules in modal temporal logic: ‘past and present formula’ implies ‘present or future formula’ Computation = model generation. Model = possible worlds connected by an accessibility relation. States updated non-destructively by frame axioms.

  9. Comparison with Transaction Logic (Bonner and Kifer) Programs = sequences of FOL queries and database updates. Computation = model generation. Model = possible worlds. Truth values relative to paths between possible worlds. States (databases) updated destructively.

  10. Outline • KELPS • Related work • LPS = KELPS + Logic Programs • MALPS = Multi Agent LPS (The Dining Philosophers) • Model-theoretic semantics • Operational semantics • Conclusions

  11. LPS framework < R , L , D > and current state S The state S is a set of ground atomic sentences, representing: the extensional part of a deductive database, or program variables changed by destructive assignment, or a Herbrand model of the current state of the world. Reactive rules R Logic program L = L int  L events  L timeless  L temp L timeless defines time independent predicates. L int defines intensional predicates in terms of extensional predicates. L events defines composite events in terms of atomic events. L temp defines temporal predicates < , next . Domain theory D defines preconditions and postconditions of atomic events. Model-theoretic semantics: Generate actions such that R is true in the perfect model associated with the sequence of states S , external events and actions, extended by L  D .

  12. Blocks world < R , L , D > and current state S request(on(Block, Place), T1)  make-on(Block, Place, T2, T3)  T1 < T2 R : S* : Deductive database: extensional predicates on(Block, Place, T) . L int : clear(table, T) clear(Block, T)    X on(X, Block, T) L events : make-on(Block, Place, T, T)  on(Block, Place, T) make-on(Block, Place, T1, T3)  make-clear(Block, TB1, TB2)  make-clear(Place, TP1, TP2)  min(TB1, TP1, T1)  max(TB2, TP2, T2)  move(Block, Place, T3)  T2 < T3 make-clear(Place, T, T)  clear(Place, T) make-clear(Place, T1, T3)  on(Block, Place, T1)  make-clear(Block, T1, T2)  move(Block, table, T3)  T2 < T3 possible(move(Block, Place), T)  clear(Block, T)  clear(Place, T)  Block  Place D : initiates(move(Block, Place), on(Block, Place), T) terminates(move(Block, Place), on(Block, Support), T)  on(Block, Support,T)

  13. LPS: alternative external notations Transaction Logic: P  Q means P(T 1 )  Q(T 2 )  T 1 < T 2 or P(T 1 , T 2 )  Q(T 3 , T 4 )  T 2 < T 3 Modal temporal logic: P  ◊ Q means P(T 1 )  Q(T 2 )  T 1 < T 2 . P   Q means P(T)  Q(T+1) or P(T 1 )  Q(T 2 )  T 1 <T 2  T 1 + ε Graphical notation: t1 t2 P R Q t3 t4 means P(T 1 )  Q(T 2 )  R(T 3 )  T 1 + t1  T 3  T 1 + t2  T 2 + t3  T 3  T 2 + t4

  14. Dialogue/parsing example < R , L , D > where L = L events D = {} S = {} Reactive rule R : sentence(T1, T2)  sentence (T3, T4)  T2 < T3 < T2 + 10 Atomic events: word(my, 1, 2) word(name, 2, 3) word(is, 3, 4) word(bob, 4, 5) Composite events (and actions) L events : adjective(T1, T2)  word(my, T1, T2) adjective(T1, T2)  word(your, T1, T2) noun(T1, T2)  word(name, T1, T2) verb(T1, T2)  word(is, T1, T2) noun(T1, T2)  word(bob, T1, T2) noun(T1, T2)  word(what, T1, T2) sentence(T1, T3)  noun-phrase(T1, T2)  verb-phrase(T2, T3) noun-phrase(T1, T3)  adjective(T1, T2)  noun(T2, T3) noun-phrase(T1, T2)  noun(T1, T2) verb-phrase(T1, T3)  verb(T1, T2)  noun-phrase(T2, T3) verb-phrase(T1, T2)  verb(T1, T2)

  15. The operational semantics maintains only the current state and most recent events. S 1 S 4 S 5 S 7 S 8 S 2 S 3 S 6 S 9 S 10 e 4 e 5 e 6 e 2 e 7 e 1 e 3 e 8 1 my 2 name 3 is 4 bob 5 6 what 7 is 8 your 9 name 10

  16. The reactive rule is “partially” true in the Herbrand model: { word(my, 1, 2) word(name, 2, 3) word(is, 3, 4) word(bob, 4, 5) word(what, 6, 7) word(is, 7, 8) word(your, 8, 9) word(name, 9, 10) adjective(1, 2) noun(2, 3) verb(3, 4) noun(4, 5) noun(6, 7) verb(7, 8) adjective(8, 9) noun(9, 10) noun-phrase(1, 3) noun-phrase(2, 3) noun-phrase(4, 5) verb-phrase(3, 5) sentence(2, 4) sentence(2, 5) sentence(1, 5) noun-phrase(6, 7) noun-phrase(8, 10) noun-phrase(9, 10) verb-phrase(7, 10) sentence(6, 8) sentence(6, 10) }  Temp where Temp (includes 5 < 15) is the extension of the inequality relation defined by L temp .

  17. Outline • KELPS • Related work • LPS • MALPS = Multi Agent LPS (The Dining Philosophers) • Model-theoretic semantics • Operational semantics • Conclusions

  18. The Dining Philosophers

  19. The Dining Philosophers The initial state S 0 : available(fork 0 ) available(fork 1 ) available(fork 2 ) available(fork 3 ) available(fork 4 ) L timeless adjacent(fork 0 , philosopher(0), fork 1 ) adjacent(fork 1 , philosopher(1), fork 2 ) adjacent(fork 2 , philosopher(2), fork 3 ) adjacent(fork 3 , philosopher(3), fork 4 ) adjacent(fork 4 , philosopher(4), fork 0 )

  20. The Dining Philosophers – with time-free syntax time-to-eat(philosopher(I))  dine(philosopher(I)) dine(philosopher(I))  think(philosopher(I)), pickup-forks(philosopher(I)), eat(philosopher(I)), putdown-forks(philosopher(I))

  21. Atomic actions are defined by the domain specific event theory D think(philosopher(I)) initiates thinking(philosopher(I)). eat(philosopher(I)) initiates eating(philosopher(I)) terminates thinking(philosopher(I)). pickup-forks(philosopher(I)) terminates available(F 1 ) and available(F 2 ) preconditions available(F 1 ), available(F 2 ) where adjacent(F 1 , philosopher(I), F 2 ). putdown-forks(philosopher(I)) terminates eating(philosopher(I)) initiates available(F 1 ), available(F 2 ) where adjacent(F 1 , philosopher(I), F 2 ) .

Recommend


More recommend