Transaction logic


Transaction Logic is an extension of predicate logic that accounts in a clean and declarative way for the phenomenon of state changes in logic programs and databases. This extension adds connectives specifically designed for combining simple actions into complex transactions and for providing control over their execution. The logic has a natural model theory and a sound and complete proof theory. Transaction Logic has a Horn clause subset, which has a procedural as well as a declarative semantics. The important features of the logic include hypothetical and committed updates, dynamic constraints on transaction execution, non-determinism, and bulk updates. In this way, Transaction Logic is able to declaratively capture a number of non-logical phenomena, including procedural knowledge in artificial intelligence, active databases, and methods with side effects in object databases.
Transaction Logic was originally proposed in 1993 by and and later described in more detail in An Overview of Transaction Logic and Logic Programming for Database Transactions. The most comprehensive description appears in Bonner & Kifer's technical report from 1995.
In later years, Transaction Logic was extended in various ways, including concurrency, defeasible reasoning, partially defined actions, and other features.
In 2013, the original paper on Transaction Logic has the of the Association for Logic Programming as the most influential paper from the proceedings of in the preceding 20 years.

Examples

Graph coloring

Here denotes the elementary update operation of transactional insert. The connective is called serial conjunction.

colorNode <- // color one node correctly
node ⊗ ¬ colored ⊗ color
⊗ ¬ ∧ colored)
⊗ tinsert.
colorGraph <- ¬uncoloredNodesLeft.
colorGraph <- colorNode ⊗ colorGraph.

Pyramid stacking

The elementary update represents the transactional delete operation.

stack <- N>0 ⊗ move ⊗ stack.
stack.
move <- pickup ⊗ putdown.
pickup <- clear ⊗ on ⊗
⊗ tdelete ⊗ tinsert.
putdown <- wider ⊗ clear
⊗ tinsert ⊗ tdelete.

Hypothetical execution

Here is the modal operator of possibility: If both and are possible, execute. Otherwise, if only is possible, then execute it.

execute <- <>action1 ⊗ <>action2 ⊗ action1.
execute <- ¬<>action1 ⊗ <>action2 ⊗ action2.

Dining philosophers

Here is the logical connective of parallel conjunction of Concurrent Transaction Logic.

diningPhilosophers <- phil | phil | phil | phil.

Implementations

A number of implementations of Transaction Logic exist:
All these implementations are open source.