Datalog
Datalog is a declarative logic programming language. While it is syntactically a subset of Prolog, Datalog generally uses a bottom-up rather than top-down evaluation model. This difference yields significantly different behavior and properties from Prolog. It is often used as a query language for deductive databases. Datalog has been applied to problems in data integration, networking, program analysis, and more. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
Datalog is a declarative logic programming language. While it is syntactically a subset of Prolog, Datalog generally uses a bottom-up rather than top-down evaluation model. This difference yields significantly different behavior and properties from Prolog. It is often used as a query language for deductive databases. Datalog has been applied to problems in data integration, networking, program analysis, and more. parent(xerces, brooke). parent(brooke, damocles). The names are written in lowercase because strings beginning with an uppercase letter stand for variables. Here are two rules: ancestor(X, Y) :- parent(X, Y). ancestor(X, Y) :- parent(X, Z), ancestor(Z, Y). The :- symbol is read as "if", and the comma is read "and", so these rules mean: X is an ancestor of Y if X is a parent of Y. X is an ancestor of Y if X is a parent of some Z, and Z is an ancestor of Y. The meaning of a program is defined to be the set of all of the facts that can be deduced using the initial facts and the rules. This program's meaning is given by the following facts: parent(xerces, brooke). parent(brooke, damocles). ancestor(xerces, brooke). ancestor(brooke, damocles). ancestor(xerces, damocles). Some Datalog implementations don't deduce all possible facts, but instead answer queries: ?- ancestor(xerces, X). This query asks: Who are all the X that xerces is an ancestor of? For this example, it would return brooke and damocles. s(x, y). t(y). r(A, B) :- s(A, B), t(B). CREATE TABLE s ( z0 TEXT NONNULL, z1 TEXT NONNULL, PRIMARY KEY (z0, z1) ); CREATE TABLE t ( z0 TEXT NONNULL PRIMARY KEY ); INSERT INTO s VALUES ('x', 'y'); INSERT INTO t VALUES ('y'); CREATE VIEW r AS SELECT s.z0, s.z1 FROM s, t WHERE s.z1 = t.z0; ::= | "" ::= ":-" "." ::= "(" ")" ::= | "," | "" ::= | ::= | "," | "" Atoms are also referred to as . The atom to the left of the :- symbol is called the of the rule; the atoms to the right are the . Every Datalog program must satisfy the condition that every variable that appears in the head of a rule also appears in the body (this condition is sometimes called the ). There are two common conventions for variable names: capitalizing variables, or prefixing them with a question mark ? . Note that under this definition, Datalog does include negation nor aggregates; see for more information about those constructs. Rules with empty bodies are called . For example, the following rule is a fact: r(x) :- . The set of facts is called the or of the Datalog program. The set of tuples computed by evaluating the Datalog program is called the or . r(x). Some also allow writing 0-ary relations without parentheses, like so: p :- q. These are merely abbreviations (syntactic sugar); they have no impact on the semantics of the program. ===Free software/open source=== ===Non-free software=== FoundationDB provides a free-of-charge database binding for pyDatalog, with a tutorial on its use. Leapsight Semantic Dataspace (LSD) is a distributed deductive database that offers high availability, fault tolerance, operational simplicity, and scalability. LSD uses Leaplog (a Datalog implementation) for querying and reasoning and was created by Leapsight. LogicBlox, a commercial implementation of Datalog used for web-based retail planning and insurance applications. Profium Sense is a native RDF compliant graph database written in Java. It provides Datalog evaluation support of user defined rules. .QL, a commercial object-oriented variant of Datalog created by Semmle for analyzing source code to detect security vulnerabilities. SecPAL a security policy language developed by Microsoft Research. Stardog is a graph database, implemented in Java. It provides support for RDF and all OWL 2 profiles providing extensive reasoning capabilities, including datalog evaluation. StrixDB: a commercial RDF graph store, SPARQL compliant with Lua API and Datalog inference capabilities. Could be used as httpd (Apache HTTP Server) module or standalone (although beta versions are under the Perl Artistic License 2.0).
References
- Datalog Reloaded . · 1789254000.0
- 6.4. Negation - LogicBlox 3.10 Reference Manual . · 1789254000.0
- Proceedings of the ninth ACM SI . · 1789254000.0
- Differential Dataflow . · 1789254000.0
- Binary decision diagrams, relational algebra, and Datalog: deductive reasoning for Tcl . · 1789254000.0
- Volume 1: Programmer's Manual . · 1789254000.0
- Citation|url=http://foundationdb.com/documentation/latest/datalog.html |archive-url=https://archive.today/20130809001616/http://foundationdb.com/documentation/latest/datalog.html |archive-date=2013- . · 1789254000.0
- Leapsight . · 1789254000.0
- Semmle QL . · 1789254000.0
- SecPAL . Microsoft Research . · 1789254000.0
- SIGMOD 2011 . · 1789254000.0
- Programming Languages and Systems . · 1789254000.0
- Cite conference |last1=Chin |first1=Brian |last2=Dincklage |first2=Daniel von |last3=Ercegovac |first3=Vuk |last4=Hawkins |first4=Peter |last5=Miller |first5=Mark S. |last6=Och |first6=Franz |last7= . · 1789254000.0
- Proceedings of the 25th International Conference on Compiler C . · 1789254000.0
- Gryz. dl.acm.org . · 1789254000.0
- Citation | editor1-first = Hervé | editor1-last = Gallaire | editor2-first = John 'Jack' | editor2-last = Minker | contribution = Logic and Data Bases, Symposium on Logic and Data Bases, Centre d'ét . · 1789254000.0
- Foundations . · 1789254000.0
- Willsey, Max. Datalog . Declarative Program Analysis and Optimization . · 1789254000.0
- Logic-Based Program Synthesis and Transfor . · 1789254000.0
- Cite book |last1=Whaley |first1=John |last2=Avots |first2=Dzintars |last3=Carbin |first3=Michael |last4=Lam |first4=Monica S. |chapter=Using Datalog with Binary Decision Diagrams for Program Analysi . · 1789254000.0
- Cite book |last1=Hoder |first1=Kryštof |last2=Bjørner |first2=Nikolaj |last3=de Moura |first3=Leonardo |chapter=μZ– an Efficient Engine for Fixed Points with Constraints |date=2011 |editor-last=Gopa . · 1789254000.0
- Datalog in Academia and Industry . · 1789254000.0
- Cite journal |last1=Zaniolo |first1=Carlo |last2=Yang |first2=Mohan |last3=Das |first3=Ariyam |last4=Shkapsky |first4=Alexander |last5=Condie |first5=Tyson |last6=Interlandi |first6=Matteo |date=Sep . · 1789254000.0
- Chapter 7. Rules - LogicBlox 3.10 Reference Manual . · 1789254000.0
Cite this
"Datalog". 1789319100. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1374720427 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy