Transaction logic

Last updated

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.

Contents

Transaction Logic was originally proposed in [1] by Anthony Bonner and Michael Kifer and later described in more detail in [2] and. [3] The most comprehensive description appears in. [4]

In later years, Transaction Logic was extended in various ways, including concurrency, [5] defeasible reasoning, [6] partially defined actions, [7] and other features. [8] [9]

In 2013, the original paper on Transaction Logic [1] has won the 20-year Test of Time Award of the Association for Logic Programming as the most influential paper from the proceedings of ICLP 1993 conference in the preceding 20 years.

Examples

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

colorNode <-  // color one node correctly     node(N) ⊗ ¬ colored(N,_) ⊗ color(C)     ⊗ ¬(adjacent(N,N2) ∧ colored(N2,C))     ⊗ tinsert(colored(N,C)). colorGraph <- ¬uncoloredNodesLeft. colorGraph <- colorNode ⊗ colorGraph.

Pyramid stacking. The elementary update tdelete represents the transactional delete operation.

stack(N,X) <- N>0 ⊗ move(Y,X) ⊗ stack(N-1,Y). stack(0,X). move(X,Y) <- pickup(X) ⊗ putdown(X,Y). pickup(X) <- clear(X) ⊗ on(X,Y) ⊗              ⊗ tdelete(on(X,Y)) ⊗ tinsert(clear(Y)). putdown(X,Y) <-  wider(Y,X) ⊗ clear(Y)                   ⊗ tinsert(on(X,Y)) ⊗ tdelete(clear(Y)).

Hypothetical execution. Here <> is the modal operator of possibility: If both action1 and action2 are possible, execute action1. Otherwise, if only action2 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. [5]

diningPhilosophers <- phil(1) | phil(2) | phil(3) | phil(4).

Implementations

A number of implementations of Transaction Logic exist. The original implementation is available here. An implementation of Concurrent Transaction Logic is available here. Transaction Logic enhanced with tabling is available here. An implementation of Transaction Logic has also been incorporated as part of the Flora-2 knowledge representation and reasoning system. All these implementations are open source.

Additional papers on Transaction Logic can be found on the Flora-2 Web site.

Related Research Articles

Flood fill

Flood fill, also called seed fill, is an algorithm that determines and alters the area connected to a given node in a multi-dimensional array with some matching attribute. It is used in the "bucket" fill tool of paint programs to fill connected, similarly-colored areas with a different color, and in games such as Go and Minesweeper for determining which pieces are cleared. A variant called boundary fill uses the same algorithms but is defined as the area connected to a given node that does not have a particular attribute.

Logic programming is a programming paradigm which is largely based on formal logic. Any program written in a logic programming language is a set of sentences in logical form, expressing facts and rules about some problem domain. Major logic programming language families include Prolog, answer set programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:

Prolog is a logic programming language associated with artificial intelligence and computational linguistics.

In computer science, a priority queue is an abstract data type similar to a regular queue or stack data structure in which each element additionally has a "priority" associated with it. In a priority queue, an element with high priority is served before an element with low priority. In some implementations, if two elements have the same priority, they are served according to the order in which they were enqueued, while in other implementations, ordering of elements with the same priority is undefined.

Clean (programming language)

Clean is a general-purpose purely functional computer programming language. For much of the language's active development history it was called Concurrent Clean, but this was dropped at some point. Clean is being developed by a group of researchers from the Radboud University in Nijmegen since 1987.

Oz is a multiparadigm programming language, developed in the Programming Systems Lab at Université catholique de Louvain, for programming language education. It has a canonical textbook: Concepts, Techniques, and Models of Computer Programming.

Conceptual graph

A conceptual graph (CG) is a formalism for knowledge representation. In the first published paper on CGs, John F. Sowa used them to represent the conceptual schemas used in database systems. The first book on CGs applied them to a wide range of topics in artificial intelligence, computer science, and cognitive science.

In the fields of databases and transaction processing, a schedule of a system is an abstract model to describe execution of transactions running in the system. Often it is a list of operations (actions) ordered by time, performed by a set of transactions that are executed together in the system. If the order in time between certain operations is not determined by the system, then a partial order is used. Examples of such operations are requesting a read operation, reading, writing, aborting, committing, requesting a lock, locking, etc. Not all transaction operation types should be included in a schedule, and typically only selected operation types are included, as needed to reason about and describe certain phenomena. Schedules and schedule properties are fundamental concepts in database concurrency control theory.

GNOWSYS is a specification for a generic distributed network based memory/knowledge management. It is developed as an application for developing and maintaining semantic web content. It is written in Python. It is implemented as a Django app.

In computer science, a disjoint-set data structure, also called a union–find data structure or merge–find set, is a data structure that stores a collection of disjoint (non-overlapping) sets. Equivalently, it stores a partition of a set into disjoint subsets. It provides operations for adding new sets, merging sets, and finding a representative member of a set. The last operation allows to find out efficiently if any two elements are in the same or different sets.

In computer science, software transactional memory (STM) is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. It is an alternative to lock-based synchronization. STM is a strategy implemented in software, rather than as a hardware component. A transaction in this context occurs when a piece of code executes a series of reads and writes to shared memory. These reads and writes logically occur at a single instant in time; intermediate states are not visible to other (successful) transactions. The idea of providing hardware support for transactions originated in a 1986 paper by Tom Knight. The idea was popularized by Maurice Herlihy and J. Eliot B. Moss. In 1995 Nir Shavit and Dan Touitou extended this idea to software-only transactional memory (STM). Since 2005, STM has been the focus of intense research and support for practical implementations is growing.

Answer set programming (ASP) is a form of declarative programming oriented towards difficult search problems. It is based on the stable model semantics of logic programming. In ASP, search problems are reduced to computing stable models, and answer set solvers—programs for generating stable models—are used to perform search. The computational process employed in the design of many answer set solvers is an enhancement of the DPLL algorithm and, in principle, it always terminates.

Glossary of Unified Modeling Language (UML) terms provides a compilation of terminology used in all versions of UML, along with their definitions. Any notable distinctions that may exist between versions are noted with the individual entry it applies to.

A precedence graph, also named conflict graph and serializability graph, is used in the context of concurrency control in databases.

B-Prolog is a high-performance implementation of the standard Prolog language with several extended features including matching clauses, action rules for event handling, finite-domain constraint solving, arrays and hash tables, declarative loops, and tabling. First released in 1994, B-Prolog is now a widely used CLP system. The constraint solver of B-Prolog was ranked top in two categories in the Second International Solvers Competition, and it also took the second place in P class in the second ASP solver competition and the second place overall in the third ASP solver competition. B-Prolog underpins the PRISM system, a logic-based probabilistic reasoning and learning system. B-Prolog is a commercial product, but it can be used for learning and non-profit research purposes free of charge.

CLACL, representing CLAC-Language is the result of ongoing theoretical research which aims to provide a formal description of the logical choices relating to the definition of organizational processes of composition.

Flora-2 is an open source semantic rule-based system for knowledge representation and reasoning. The language of the system is derived from F-logic, HiLog, and Transaction logic. Being based on F-logic and HiLog implies that object-oriented syntax and higher-order representation are the major features of the system. Flora-2 also supports a form of defeasible reasoning called Logic Programming with Defaults and Argumentation Theories (LPDA). Applications include intelligent agents, Semantic Web, knowledge-bases networking, ontology management, integration of information, security policy analysis, automated database normalization, and more.

Concurrent logic programming is a variant of logic programming in which programs are sets of guarded Horn clauses of the form:

Rulelog is an expressive semantic rule-based knowledge representation and reasoning (KRR) language. It underlies knowledge representation languages used in systems such as Flora-2, SILK and others. It extends well-founded declarative logic programs with features for higher-order syntax, frame syntax, defeasibility, general quantified expressions both in the bodies of the rules and their heads, user-defined functions, and restraint bounded rationality.

References

  1. 1 2 A.J. Bonner and M. Kifer (1993), Transaction Logic Programming, International Conference on Logic Programming (ICLP), 1993.
  2. A.J. Bonner and M. Kifer (1994), An Overview of Transaction Logic, Theoretical Computer Science, 133:2, 1994.
  3. A.J. Bonner and M. Kifer (1998), Logic Programming for Database Transactions in Logics for Databases and Information Systems, J. Chomicki and G. Saake (eds.), Kluwer Academic Publ., 1998.
  4. A.J. Bonner and M. Kifer (1995), Transaction Logic Programming (or A Logic of Declarative and Procedural Knowledge). Technical Report CSRI-323, November 1995, Computer Science Research Institute, University of Toronto.
  5. 1 2 A.J. Bonner and M. Kifer (1996), Concurrency and communication in Transaction Logic, Joint Intl. Conference and Symposium on Logic Programming, Bonn, Germany, September 1996
  6. P. Fodor and M. Kifer (2011), Transaction Logic with Defaults and Argumentation Theories. In Technical communications of the 27th International Conference on Logic Programming (ICLP), July 2011.
  7. M. Rezk and M. Kifer (2012), Transaction Logic with Partially Defined Actions. Journal on Data Semantics, August 2012, vol. 1, no. 2, Springer.
  8. H. Davulcu, M. Kifer and I.V. Ramakrishnan (2004), CTR-S: A Logic for Specifying Contracts in Semantic Web Services. Proceedings of the 13-th World Wide Web Conference (WWW2004), May 2004.
  9. P. Fodor and M. Kifer (2010), Tabling for Transaction Logic. In Proceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming (PPDP), July 2010.