TR tabling presentation_2010_09
Upcoming SlideShare
Loading in...5
×
 

TR tabling presentation_2010_09

on

  • 313 views

Transaction Logic tabling,

Transaction Logic tabling,
Paul Fodor, Michael Kifer,
PPDP 2010

Statistics

Views

Total Views
313
Views on SlideShare
313
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

TR tabling presentation_2010_09 TR tabling presentation_2010_09 Presentation Transcript

  • Transaction Logic Implementation Tabled T R Summary Tabling for Transaction Logic Paul Fodor Michael Kifer State University of New York at Stony Brook Stony Brook, NY 11794, U.S.A 12th International ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming, Hagenberg, Austria
  • Transaction Logic Implementation Tabled T R SummaryOverview Tabling for Transaction Logic Transaction Logic is a logic for representing procedural knowledge Applications in logic programming, databases, AI planning, workflows, Web services, security policies, reasoning about actions Implementations (Flora2, Toronto TR) Problem with existing implementations: Not logically complete due to the inherent difficulty and time/space complexity (analogous to the difference between plain Prolog and Datalog) Solution: Tabling for a logically complete evaluation strategy for Transaction Logic
  • Transaction Logic Implementation Tabled T R SummaryOutline Overview of Transaction Logic Tabling Transaction Logic Proof theory with tabling Soundness and completeness results Termination Difficulties with implementing tabling State copying, comparison (time, space issues) Solutions: logs vs. full state materialization, various data structures (tries, balanced trees), table skipping Experimental results Conclusions and future work
  • Transaction Logic Implementation Tabled T R SummaryTransaction Logic Logic for programming state-changing actions and reasoning about their effects Elementary state transitions insert/1 and delete/1 specify basic updates of the current state of the database have both a truth value and a side effect on the database Connectives: classical logical connectives (∧, ∨, not ) and additional connectives (⊗, ⊕, ♦, , |) φ : −γ define γ to be an execution of φ; (Horn φ ⊗ ψ means: execute φ, then execute ψ; Serial TR)
  • Transaction Logic Implementation Tabled T R SummaryTransaction Logic A formula φ in Transaction Logic is a transaction and has a truth value over execution paths (sequences of states) s1 s2 s3 sn-2 sn-1 sn States: s1 (initial state), . . . , sn (final state) Semantics: φ executes along π iff φ is true on π Proof theory: executes φ along π as it proves φ
  • Transaction Logic Implementation Tabled T R SummaryTransaction Logic Example 1 Consuming paths (reachability in the graph by traversing edges and then swallowing them): reach(X , Y ) : −reach(X , Z ) ⊗ edge(Z , Y ) ⊗ delete(edge(Z , Y )). reach(X , X ). edge/2 is a binary fluent reach/2 is a binary action delete(edge(N, M)) is the action of deleting the edge(N,M)
  • Transaction Logic Implementation Tabled T R SummaryTransaction Logic Example 2 Hamiltonian cycle (visits each vertex exactly once, Hamiltonian cycles are detected by swallowing the already traversed vertexes): hCycle(Start, Start) : − notvertex(X ). hCycle(Start, X ) :− edge(X , Y ) ⊗ vertex(Y )⊗ delete(vertex(Y )) ⊗ insert(mark (X , Y ))⊗ hCycle(Start, Y ) ⊗ insert(vertex(Y )). reach(X , X ). edge, vertex and mark are fluents insert(mark (X , Y )) denotes the action of inserting mark(X,Y) in the state delete(edge(N, M)) is the action of deleting the edge(N,M)
  • Transaction Logic Implementation Tabled T R SummaryTransaction Logic Example 2 hCycle(Start, Start) : − notvertex(X ). hCycle(Start, X ) :− edge(X , Y ) ⊗ vertex(Y )⊗ delete(vertex(Y )) ⊗ insert(mark (X , Y ))⊗ hCycle(Start, Y ) ⊗ insert(vertex(Y )). reach(X , X ). The second rule does the search Many possible ways to fail Only few succeed The changes are backtrackable
  • Transaction Logic Implementation Tabled T R SummaryTransaction Logic Example 3 Planning for building pyramids of blocks (actions: pickup, putdown, recursive stack, unstack): stack (0, Block ). stack (N, X ) : − N > 0 ⊗ move(Y , X ) ⊗ stack (N − 1, Y ) ⊗on(Y , X ). stack (N, X ) : − N > 0 ⊗ on(Y , X ) ⊗ unstack (Y ) ⊗stack (N, X ). unstack (X ) : − on(Y , X ) ⊗ unstack (Y ) ⊗ unstack (X ). unstack (X ) : − isclear (X ) ∧ on(X , table). unstack (X ) : − (isclear (X ) ∧ on(X , Y ) ∧ Y = table) ⊗move(X , table). unstack (X ) : − on(Y , X ) ⊗ unstack (Y ) ⊗ unstack (X ). move(X , Y ) : − X = Y ⊗ pickup(X ) ⊗ putdown(X , Y ). pickup(X ) : − clear (X ) ⊗ on(X , Y ) ⊗delete(on(X , Y )) ⊗ insert(clear (Y )). putdown(X , Y ) : − clear (Y ) ⊗ not on(X , Z 1) ⊗not on(Z 2, X ) ⊗ delete(clear (Y )) ⊗insert(on(X , Y )).
  • Transaction Logic Implementation Tabled T R SummarySerial-Horn transaction logic Serial goals: (∃)β1 ⊗ β2 ⊗ 2 . . . ⊗ βn A serial-Horn rule is a statement of the form h : − b1 ⊗ b2 ⊗ . . . ⊗ bn . (1) h is an atomic formula b1 , ..., bn are literals. A literal is either an atomic formula or a negated fluent of the form not f Models - mappings from paths to classical models MP |= (∃)β1 ⊗ β2 ⊗ 2 . . . ⊗ βn Executional entailment P, D0 , D1 , . . . , Dn |= (∃) β1 ⊗ β2 ⊗ 2 . . . ⊗ βn
  • Transaction Logic Implementation Tabled T R SummarySerial-Horn transaction logic SLD-like resolution proof strategy Path F I aims to prove statements of the form (sequent) P, D --- Dn (∃) β1 ⊗ β2 ⊗ 2 . . . ⊗ βn An inference succeeds if and only if it finds an execution for the transaction on a sequence of database states D0 , . . . , Dn
  • Transaction Logic Implementation Tabled T R SummaryPath FI proof theory for serial-Horn transaction logic Axioms: P, D --- Dn ( ) Inference Rules: In Rules 1–3 below, σ is a substitution, a and b are atomic formulas, and φ and rest are serial goals. 1. Applying transaction definitions: Suppose a ← φ is a rule in P whose variables have been renamed apart so that the rule shares no variables with b ⊗ rest. If a and b unify with a most general unifier σ, then P, D --- Dn (∃) (φ ⊗ rest)σ P, D --- Dn (∃) (b ⊗ rest) 2. Querying the database: If b is a fluent literal, bσ and rest σ share no variables, and bσ is true in the database state D then P, D --- Dn (∃) rest σ P, D --- Dn (∃) (b ⊗ rest) 3. Performing elementary updates: If bσ and rest σ share no variables, and b σ is an elementary action that changes state D1 to state D2 then P, D2 --- Dn (∃) rest σ P, D1 --- Dn (∃) (b ⊗ rest)
  • Transaction Logic Implementation Tabled T R SummaryPath FI proof theory for serial-Horn transaction logic No particular way of applying the inference rules. If these rules are applied in the forward direction, then all execution paths will be enumerated, but undirected, exhaustive and implementational impractical Backward direction (the usual SLD resolution with left-to-right literal selection): goal-directed search, efficient, BUT incomplete (similarly to Prolog)
  • Transaction Logic Implementation Tabled T R SummaryConsuming Paths Tabling Example reach(X , Y ) : −reach(X , Z ) ⊗ edge(Z , Y ) ⊗ delete(edge(Z , Y )). reach(X , X ). Initial state: a b c d Query: reach(a, X ) for all X reachable from a and return states 1: reach(a,X) s0 [X/Z] 2: reach(a,Z),edge(Z,Y),delete(edge(Z,Y)) s0 Infinite derivation branch
  • Transaction Logic Implementation Tabled T R SummaryTabled Transaction Logic Tabling in Datalog Memoize calls Remember answers Major differences from tabling Datalog: Memoize the database states in which the calls were made Remember result states created by execution of calls
  • Transaction Logic Implementation Tabled T R SummaryTabled Transaction Logic Algorithm: On calling a subgoal to a tabled predicate in a state, check if this is the first occurrence of this call in that state: If the call is new, save (goal, state) in a global table, and continue using normal clause resolution to compute answers and the result database states for the subgoal The computed (answer , result − state) pairs are recorded in the answer table created for the (goal, state) pair If the call is not new and a pair (goal, state) exists in the table, the answers to the call are returned directly from the answer table for (goal, state)
  • Transaction Logic Implementation Tabled T R SummaryTabled Transaction Logic A tabled goal dominates another in tabled resolution if the two goals are variants of each other (variant tabling) the first goal subsumes the second (subsumptive tabling)
  • Transaction Logic Implementation Tabled T R SummaryModified proof theory for tabling for serial-Horntransaction logic 1a. Applying transaction definitions for tabled predicates: Suppose b ⊗ rest is a goal for a program P where b is a call to a tabled predicate encountered for the first time at state D (i.e., no dominating pair (c, D) is in the table space). Let a ← φ be a rule in P whose variables have been renamed apart from b ⊗ rest (i.e., the rule shares no variables with the goal) and suppose that a and b unify with the mgu σ. Then: P, D --- Dn (∃) (φ ⊗ rest)σ P, D --- Dn (∃) (b ⊗ rest) and the pair (b, D) is added to the table space. When the sequent P, D --- D (∃) (φσ)γ, for some substitution γ, is derived, the answer (bγ, D ) is added to the answer table associated with the table entry (b, D). 1b. Returning answers from answer tables: Suppose b ⊗ rest is a goal call to program P at state D, b’s predicate symbol is declared as tabled, and let there be a dominating pair (c, D) in the table space. Suppose that the answer table for (c, D) has an entry (a, D ) and a and b unify with mgu σ. Then: P, D --- Dn (∃) (rest)σ P, D --- Dn (∃) (b ⊗ rest) 1c. Applying transaction definitions for non-tabled predicates: Let a ← φ be a rule in P and a’s predicate symbol is not tabled. Assume that this rule’s variables have been renamed apart from b ⊗ rest and that a and b unify with mgu σ. Then P, D --- Dn (∃) (φ ⊗ rest)σ P, D --- Dn (∃) (b ⊗ rest)
  • Transaction Logic Implementation Tabled T R SummaryConsuming Paths Tabling Example reach(X , Y ) : −reach(X , Z ) ⊗ edge(Z , Y ) ⊗ delete(edge(Z , Y )). reach(X , X ). Step 1: 1: reach(a,X) s0 [X/Z] 2: reach(a,Z),edge(Z,Y),del.edge(Z,Y) s0 States: {s0} Solution table: Call,Initial state Answer-unification > Final state reach(a, X ) in s0 {} Lookup table: Node Call Index in Solution table (Answer) 2 reach(a, X ) in s0 0
  • Transaction Logic Implementation Tabled T R SummaryConsuming Paths Tabling Example reach(X , Y ) : −reach(X , Z ) ⊗ edge(Z , Y ) ⊗ delete(edge(Z , Y )). reach(X , X ). Step 2: 1: reach(a,X) s0 [X/Z] [X/a] 2: reach(a,Z),edge(Z,Y),del.edge(Z,Y) s0 [] s0 States: {s0} Solution table: Call,Initial state Answer-unifications > Final states reach(a, X ) in s0 {reach(a, a) > s0} Lookup table: Node Call Index in Solution table (Answer) 2 reach(a, X ) in s0 0
  • Transaction Logic Implementation Tabled T R SummaryConsuming Paths Tabling Example reach(X , Y ) : −reach(X , Z ) ⊗ edge(Z , Y ) ⊗ delete(edge(Z , Y )). reach(X , X ). Steps 3,4 and 5: a b 1: reach(a,X) s0 c d [X/Z] [X/a] 2: reach(a,Z),edge(Z,Y),del.edge(Z,Y) s0 [] s0 [Z/a]>s0 edge(a,Y),del.edge(a,Y) s0 [Y/b] [Y/c] del.edge(a,b) s0 del.edge(a,c) s0 a b a b [] s1 [] s2 c d c d States: {s0, s1 = {edge(a, c), edge(b, a), edge(b, d)}, s2 = {edge(a, b), edge(b, a), edge(b, d)} } Solution table: Call,Initial state Answer-unifications > Final states reach(a, X ) in s0 {reach(a, a) > s0, reach(a, b) > s1, reach(a, c) > s2} Lookup table: Node Call Index in Solution table (Answer) 2 reach(a, X ) in s0 1
  • Transaction Logic Implementation Tabled T R SummaryConsuming Paths Tabling Example reach(X , Y ) : −reach(X , Z ) ⊗ edge(Z , Y ) ⊗ delete(edge(Z , Y )). reach(X , X ). Steps 6,7 and 8: a b 1: reach(a,X) s0 c d [X/Z] [X/a] 2: reach(a,Z),edge(Z,Y),del.edge(Z,Y) s0 [] s0 [Z/a]>s0 [Z/b]>s1 edge(a,Y),del.edge(a,Y) s0 edge(b,Y),del.edge(b,Y) s1 [Y/b] [Y/c] [Y/a] [Y/c] del.edge(a,b) s0 del.edge(a,c) s0 del.edge(b,a) s1 del.edge(b,c) s1 a b a b [] s1 [] s2 [] s3 [] s4 c d c d States: {s0, s1, s2, s3 = {edge(a, c), edge(b, d)}, s4 = {edge(a, c), edge(b, a)} } Solution table: Call,Initial state Answer-unifications > Final states reach(a, X ) in s0 {reach(a, a) > s0, reach(a, b) > s1, reach(a, c) > s2, reach(a, a) > s3, reach(a, d) > s4} Lookup table: Node Call Index in Solution table (Answer) 2 reach(a, X ) in s0 2
  • Transaction Logic Implementation Tabled T R SummaryConsuming Paths Tabling Example Steps 9-15: 1: reach(a,X) s0 [X/Z] [X/a] 2: reach(a,Z),edge(Z,Y),del.edge(Z,Y) s0 [] s0 [Z/a]>s0 [Z/b]>s1 [Z/c]>s2 [Z/a]>s3 edge(a,Y),del.edge(a,Y) s0 edge(b,Y),del.edge(b,Y) s1 edge(c,Y),del.edge(c,Y) s2 edge(a,Y),del.edge(a,Y) s3 [Y/b] [Y/c] [Y/a] [Y/c] [Y/c] fail del.edge(a,b) s0 del.edge(a,c) s0 del.edge(b,a) s1 del.edge(b,c) s1 del.edge(a,c) s3 [] s1 [] s2 [] s3 [] s4 [] s5 1: reach(a,X) s0 [X/Z] [X/a] 2: reach(a,Z),edge(Z,Y),del.edge(Z,Y) s0 [] s0 [Z/a]>s0 [Z/b]>s1 [Z/c]>s2 [Z/a]>s3 [Z/d]>s4 [Z/c]>s5 edge(a,Y),del.edge(a,Y) s0 edge(b,Y),del.edge(b,Y) s1 edge(c,Y),del.edge(c,Y) s2 edge(a,Y),del.edge(a,Y) s3 edge(d,Y),del.edge(d,Y) edge(c,Y),del.edge(c,Y) [Y/b] [Y/c] [Y/a] [Y/d] [Y/c] fail fail fail del.edge(a,b) s0 del.edge(a,c) s0 del.edge(b,a) s1 del.edge(b,d) s1 del.edge(a,c) s3 [] s1 [] s2 [] s3 [] s4 [] s5 Call,Initial state Answer-unifications > Final states reach(a, X ) in s0 {reach(a, a) > s0, reach(a, b) > s1, reach(a, c) > s2, reach(a, c) > s5, reach(a, a) > s3, reach(a, d) > s4} Node Call Index in Solution table (Answer) 2 reach(a, X ) in s0 6
  • Transaction Logic Implementation Tabled T R SummaryConsuming Paths Tabling Example Call,Initial state Answer-unifications > Final states reach(a, X ) in s0 {reach(a, a) > s0, reach(a, b) > s1, reach(a, c) > s2, reach(a, c) > s5, reach(a, a) > s3, reach(a, d) > s4} Finds all solutions (answer substitutions and return states) The tabling algorithm terminates Does not repeat inferences
  • Transaction Logic Implementation Tabled T R SummaryTabling serial-Horn transaction logic The tabled proof theory is sound and complete Completeness in the sense that: it guarantees that all final states will be found it does not guarantee that all execution paths will be found Finding all execution paths is what we wanted to avoid: there can be an infinite number of ways to reach a final state
  • Transaction Logic Implementation Tabled T R SummaryTabled Transaction Logic The number of final states is often finite (finite number of possible graphs, planning) Termination: If φ is a serial-Horn goal and all proofs of P, D --- |= (∃) φ addressed by the proof theory mention only a finite number of database states and a finite number of goals and all recursive predicates in P are marked as tabled Then the tabling proof theory finds one or more proofs of P, D --- |= (∃) φ and terminates. If there exists a proof of the executional entailment P, D, ..., D |= (∃) φ using the proof theory then there is a tabled deduction that finds an execution of (∃) φ that starts at D and ends at D
  • Transaction Logic Implementation Tabled T R SummaryImplementation Tabled T R Issues The transactional semantics of actions Tabling of database states: Time - operations: Copying of states: once tabled the contents of that state must stay immutable Comparison of states: - for tabled transactions, check whether a goal/state pair is already tabled - newly created states need to be compared with other tabled states to determine if it is a genuinely new state or not Space - duplication of information in states
  • Transaction Logic Implementation Tabled T R SummarySpace optimizations Changes (logs) << States Differential logs: (InitialState, (InsertLog, DeleteLog)) saves space reduces the amount of time for copying states trade-off between the decreasing cost of storing and copying Various forms of compression Factoring: facts stored separately and shared using pointers Sharing of logs using tries: high degree of sharing Table skipping: only the states associated with certain tabled subgoals are stored and indexed for querying Double-differential logs: when table-skipping is used, only changes relative to the previous saved state are kept, not relative to the initial state main change log residual change log
  • Transaction Logic Implementation Tabled T R SummaryTime optimizations State comparison: Most state comparisons fail - determine that quickly via an incremental hash function Compare the rest in linear time using tries Separate state repository for the calls and states Data structures for querying separate query data structures from logs trade-off of update vs. query time Copying of states table skipping and factoring
  • Transaction Logic Implementation Tabled T R SummaryEvaluation for 6 implementations Common features: Data compression via factoring Differential logs State comparison via incremental hash functions and tries for the main differential logs (linear comparison)
  • Transaction Logic Implementation Tabled T R SummaryEvaluation for 6 implementations Implementation 1: no table skipping, logs are ordered lists Implementation 2: logs are ordered lists (optimal copying and sharing in state tries) and query tries (to speed up querying) Implementations 3a and 3b: use table skipping (reduce the number of tabled states, no state copying or comparison for execution of non-tabled actions), use sorted lists to represent logs, 3a uses single differential logs, 3b uses double differential logs Implementations 4a and 4b: use table skipping, use tries to represent logs, 4a uses single differential logs, 4b uses double differential logs
  • Transaction Logic Implementation Tabled T R SummaryPerformance evaluation - Consuming paths : −tr _table(reach/2). reach(X , Y ) : −reach(X , Z ) ⊗ edge(Z , Y ) ⊗ delete(edge(Z , Y )). reach(X , X ). Times for finding consuming paths in graphs: Graph size 100 250 350 # of Solutions 5050 31375 61425 CPU Mem. CPU Mem. CPU Mem. 1 0.128 806 1.544 4843 3.940 9473 2 0.212 5538 2.292 66413 5.996 173389 3a 0.136 807 1.540 4843 3.924 9473 3b 0.152 806 1.672 4843 4.608 9473 4a 0.224 10325 2.796 128434 7.880 337070 4b 0.204 5538 2.128 66413 5.680 172976 Using table skipping, double differential, tries slightly slower for small problems (few updates between tabled calls)
  • Transaction Logic Implementation Tabled T R SummaryPerformance evaluation - Consuming paths : −tr _table(reach/2). reach(X , Y ) : −reach(X , Z ) ⊗ edge(Z , Y ) ⊗ delete(edge(Z , Y )). reach(X , X ). Numbers of tabled states and state comparisons for finding consuming paths in graphs: Graph size 100 250 350 States Comp. States Comp. States Comp. 1 5051 5050 31376 31375 61426 61425 2 5051 5050 31376 31375 61426 61425 3a 5051 5050 31376 31375 61426 61425 3b 5051 5050 31376 31375 61426 61425 4a 5051 5050 31376 31375 61426 61425 4b 5051 5050 31376 31375 61426 61425
  • Transaction Logic Implementation Tabled T R SummaryPerformance evaluation - 10 Consuming paths in 10graphs : −tr _table(reach/2). reach(X , Y ) : −reach(X , Z )⊗ edge1 (Z , Y ) ⊗ delete(edge1 (Z , Y ))⊗ ... edge10 (Z , Y ) ⊗ delete(edge10 (Z , Y )). reach(X , X ). Time and space for building 10 consuming paths in 10 graphs Graph size 100 200 250 CPU Mem. CPU Mem. CPU Mem. 1 6.236 4580 47.642 18219 92.425 28881 2 8.568 371762 M.Err. M.Err. M.Err. M.Err. 3a 4.796 2533 37.182 10066 71.840 15620 3b 4.024 2533 30.073 10065 58.083 15620 4a 1.780 77873 13.536 596734 25.929 1155434 4b 1.292 39744 8.564 301429 16.325 582398 Table skipping, tries for storing logs, double differential helps 4b wins for multiple updates between tabled calls
  • Transaction Logic Implementation Tabled T R SummaryPerformance evaluation - Hamiltonian Cycles hCycle(Start, Start) :− notvertex(X ). hCycle(Start, X ) :− edge(X , Y ) ⊗ vertex(Y )⊗ delete(vertex(Y )) ⊗ insert(mark (X , Y ))⊗ hCycle(Start, Y ) ⊗ insert(vertex(Y )). reach(X , X ). Times for finding Hamiltonian cycles in graphs: Graph size 50 150 200 # of Solutions 50 150 200 CPU Mem. CPU Mem. CPU Mem. 1 0.252 2412 8.392 51543 23.405 118248 2 0.244 6111 4.144 132082 9.148 303932 3a 0.164 2362 3.956 51091 10.100 118566 3b 0.236 7337 5.644 187927 13.968 442537 4a 0.300 15284 6.852 330211 16.105 755352 4b 0.300 15446 5.696 379042 12.584 885453 Separate query data structures for efficient querying and updating Double differential (3b, 4b) reduces number of comparisons
  • Transaction Logic Implementation Tabled T R SummaryPerformance evaluation - Hamiltonian Cycles hCycle(Start, Start) :− notvertex(X ). hCycle(Start, X ) :− edge(X , Y ) ⊗ vertex(Y )⊗ delete(vertex(Y )) ⊗ insert(mark (X , Y ))⊗ hCycle(Start, Y ) ⊗ insert(vertex(Y )). reach(X , X ). Tabled states and state comparisons for finding Hamiltonian cycles: Graph size 50 150 States Comp. States Comp. 1 7403 7500 67203 67500 2 7403 7500 67203 67500 3a 4903 5051 44703 45151 3b 4903 5000 44703 45000 4a 4903 5051 44703 45151 4b 4903 5000 44703 45000
  • Transaction Logic Implementation Tabled T R SummaryPerformance evaluation - 10 graphs HamiltonianCycles hCycle(Start, Start) :− notvertex1 (X ) ∧ . . . ∧ notvertex10 (X ). hCycle(Start, X ) :− edge1 (X , Y ) ⊗ . . . ⊗ edge10 (X , Y ) ⊗ vertex1 (Y ) ⊗ . . . ⊗ vertex10 (Y )⊗ delete(vertex1 (Y )) ⊗ insert(mark1 (X , Y )) ⊗ . . . ⊗ hCycle(Start, Y ) ⊗ insert(vertex1 (Y )) ⊗ . . . ⊗ insert(vertex10 (Y )). reach(X , X ). Times for finding 10 Hamiltonian cycles in 10 graphs: Graph size 50 150 CPU Mem. CPU Mem. 1 4.912 164777 M.Err. M.Err. 2 6.052 424113 M.Err. M.Err. 3a 3.076 9878 86.505 255174 3b 4.340 14854 105.814 391963 4a 1.656 58959 M.Err. M.Err. 4b 1.356 46072 27.4210 1228925 4b scales better: table skipping, double differential
  • Transaction Logic Implementation Tabled T R SummaryPerformance evaluation - Blocks World stack (0, Block ). stack (N, X ) : − N > 0 ⊗ move(Y , X ) ⊗ stack (N − 1, Y ) ⊗on(Y , X ). stack (N, X ) : − N > 0 ⊗ on(Y , X ) ⊗ unstack (Y ) ⊗stack (N, X ). unstack (X ) : − on(Y , X ) ⊗ unstack (Y ) ⊗ unstack (X ). unstack (X ) : − isclear (X ) ∧ on(X , table). unstack (X ) : − (isclear (X ) ∧ on(X , Y ) ∧ Y = table) ⊗move(X , table). unstack (X ) : − on(Y , X ) ⊗ unstack (Y ) ⊗ unstack (X ). Numbers of tabled states and state comparisons for building pyramids in blocks worlds Blocks 5 6 7 States Comp. States Comp. States Comp. 1 1546 4210 13327 42792 130922 480326 2 1546 4210 13327 42792 130922 480326 3a 501 9767 4051 107882 37633 1364911 3b 501 1300 4051 13020 37633 144354 4a 501 9767 4051 107882 37633 1364911 4b 501 1300 4051 13020 37633 144354 Finds one way to build every possible pyramid of N blocks
  • Transaction Logic Implementation Tabled T R SummarySummary Adapted tabling from ordinary logic programs to Transaction Logic Complete in the sense that finds all final states Expensive to implement Proposed optimizations for time and space consumption Interpreter in XSB Prolog Optimizations and comparison Future Work: Better data structure for storing states using B+ trees (efficient copying and sharing) Extend tabling to Concurrent Transaction Logic (interleaved actions) Lift well-founded model semantics from classical LP to Transaction Logic