<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Differential Datalog</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Leonid</forename><surname>Ryzhyk</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">VMware Research</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Mihai</forename><surname>Budiu</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">VMware Research</orgName>
							</affiliation>
						</author>
						<title level="a" type="main">Differential Datalog</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">78CA25E91AA2227DB20BDB0188CAD76F</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T05:30+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Many real-world applications based on deductive databases require incrementally updating output relations (tables) in response to changes to input relations. To make such applications easier to implement we have created Differential Datalog (DDlog), a dialect of Datalog that automates incremental computation. A DDlog programmer writes traditional, non-incremental Datalog programs. However, the execution model of DDlog is fully incremental : at runtime DDlog programs receive streams of changes to the input relations (insertions or deletions) and produce streams of corresponding changes to derived relations. The DDlog compiler translates DDlog programs to Differential Dataflow (DD) [17] programs; DD provides an incremental execution engine supporting all the relational operators, including fixed-point. The DDlog language is targeted for system builders. In consequence, the language emphasizes usability, by providing a rich type system, a powerful expression language, a module system, including string manipulation, arithmetic, and integration with C, Rust, and Java. The code is open-source, available using an MIT permissive license <ref type="bibr" target="#b0">[1]</ref>.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>Motivation. Many real-world applications must update their output in response to input changes. Consider, for example, a cluster management system such as Kubernetes <ref type="bibr" target="#b10">[11]</ref>, that configures cluster nodes to execute a user-defined workload. As the workload changes, e.g., container instances are added or removed from the system, the configuration must change accordingly. In a large cluster computing configuration from scratch is prohibitively expensive. Instead, modern cluster management systems, including Kubernetes, apply changes incrementally, only updating state effected by the change.</p><p>As another example, program analysis frameworks like Doop <ref type="bibr" target="#b4">[5]</ref> evaluate a set of rules defined over the abstract syntax tree of the program. Such an analyzer can be integrated into an IDE to alert the developer as soon as a potential bug is introduced in the program. This requires re-evaluating the rules after every few keystrokes. In order to achieve interactive performance when working with very large code bases, the re-evaluation must occur incrementally, preserving as much as possible intermediate results computed at earlier iterations.</p><p>Incremental algorithms tend to be significantly more complex than their nonincremental versions. An incremental algorithm must propagate input changes to the output via all intermediate computation steps. This, in turn, requires <ref type="bibr" target="#b0">(1)</ref> maintaining intermediate computation results for each step, and (2) implementing an incremental version of each operation, which, given an update to its input, computes an update to its output. Incremental computations that operate on relational state are ubiquitous throughout systems management software stacks. The complexity of the incremental algorithms greatly impacts the development cost, feature velocity, maintainability, and performance of the control systems.</p><p>We argue that, instead of dealing with the complexity of incremental computation on a case-by-case basis, developers should embrace programming tools that solve the problem once and for all. In this paper we present one such tool -Differential Datalog (DDlog) -a programming language that automates incremental computation. A DDlog programmer only has to write a Datalog specification for the original (non-incremental) problem. From this description the DDlog compiler generates an efficient incremental implementation.</p><p>Overview. DDlog is a bottom-up, incremental, in-memory, typed Datalog engine for building embedded deductive databases.</p><p>Bottom-up: DDlog starts from a set of ground facts (provided by the user) and computes all possible derived facts by following Datalog rules, in a bottomup fashion. (In contrast, top-down engines are optimized to answer individual user queries without computing all possible facts ahead of time.)</p><p>Incremental: whenever presented with changes to the ground facts, DDlog only performs the minimum computation necessary to compute all changes in the derived facts. This has significant performance benefits, and only produces output of minimum size, also reducing communication requirements. DDlog evaluation is always incremental ; non-incremental (traditional) evaluation can be implemented as a special case, starting from empty relations.</p><p>In-memory: DDlog stores and processes data in memory<ref type="foot" target="#foot_0">1</ref> . At the moment, DDlog keeps all the data in the memory of a single machine <ref type="foot" target="#foot_1">2</ref> .</p><p>Typed: Pure Datalog does not have concepts like data types, arithmetic, strings or functions. To facilitate writing of safe, maintainable, and concise code, DDlog extends Datalog with:</p><p>-A powerful type system, including Booleans, unlimited precision integers, bit-vectors, strings, tuples, and Haskell-style tagged unions. -Standard integer and bit-vector arithmetic.</p><p>-A simple functional language containing functions that allows expressing many computations over these data-types in DDlog without resorting to external functions. -String operations, including string concatenation and interpolation.</p><p>-The ability to store and manipulate sets, vectors, and maps as first-class values in relations, including performing aggregations. Embedded: while DDlog programs can be run interactively via a command line interface, the primary use case is to run DDlog in the same address space with an application that requires deductive database functionality. A DDlog program is compiled into a Rust library that can be linked against a Rust, C/C++ or Java program (bindings for other languages can be easily added).</p><p>DDlog is an open-source project, hosted on github <ref type="bibr" target="#b0">[1]</ref> using an MIT-license.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Differential Datalog (DDlog)</head><p>A DDlog program operates on typed relations. The programmer defines a set of rules to compute a set of output relations based on input relations (Figure <ref type="figure" target="#fig_0">1</ref>). Rules are evaluated incrementally: given a set of changes to the input relations (insertions or deletions), DDlog produces a set of changes to the output relations (expressed also as insertions or deletions).</p><p>Here we give a brief overview of the language; the DDlog language reference <ref type="bibr" target="#b21">[22]</ref> and tutorial <ref type="bibr" target="#b22">[23]</ref> provide a detailed presentation of language features.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">Type system.</head><p>DDlog is a statically-checked, strongly-typed language; users specify types for relations, variables, functions, but often DDlog can infer types from the context. The type system is inspired by Haskell, and supports a rich set of types. Base types include Booleans, bit-strings (e.g., bit&lt;32&gt;), infinite-precision integers (bigint), and UTF-8 strings. Derived types are tuples, structures, and tagged unions (which generalize enumerated types). We currently do not allow defining recursive types like lists or trees; however DDlog contains three builtin collection types: maps, sets, and arrays (described in Section 2.4). Figure <ref type="figure" target="#fig_1">2</ref> shows several type declarations.</p><p>Generic types are supported; type variables are syntactically distinguished by a tick: 'A. The language contains a built-in reference type Ref&lt;'T&gt;. Unlike other languages, two references are equal if the objects referred are equal; thus references do not alter the nature of Datalog. References can be used to reduce memory consumption when complex objects are stored in multiple relations.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2">Relations and Rules.</head><p>Relations are strongly typed; the value in each column must have a staticallydetermined type. There are three kinds of relations in DDlog: Input relations: the content of these relations is provided by the environment, in an incremental way. Output relations: these are computed by the DDlog program, and the DDlog runtime will inform the environment of changes in these relations. Intermediate relations: these are also computed by the DDlog program, but they are hidden from the environment.</p><p>Figure <ref type="figure" target="#fig_2">3</ref> shows three relation declarations. An input relation may declare an optional primary key -which is a set of columns that can be used to delete entries efficiently by specifying only the key.</p><p>DDlog rules are composed of standard Datalog operators: joins, antijoins, and unions, illustrated in Figure <ref type="figure" target="#fig_2">3</ref>, as well as aggregation, and flatmap, discussed in Section 2.4. DDlog allows recursive rules with stratified negation: intuitively, a DDlog relation cannot recursively depend on its own negation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3">Computations in rules.</head><p>Much of DDlog's power stems from its ability to perform complex computation inside rules. For example, the rule in Figure <ref type="figure">4</ref>  and width tables on the object id column, and then computes the area of the object as the product of its height and width. The DDlog expression language supports arithmetic, string manipulation, control flow constructs and function calls.</p><p>Local variables. Local variables are used to store intermediate results of computations. In DDlog, local variables can be introduced in three different contexts:</p><p>(1) variables can be defined directly in the body of a rule, e.g., the area variable in Figure <ref type="figure">4;</ref> (2) a variable can be defined in a match pattern, as in Figure <ref type="figure" target="#fig_4">5</ref>; and (3) finally, a variable can be defined inside an expression, e.g., the res variable in Figure <ref type="figure" target="#fig_5">6</ref>. A variable is visible within the syntactic scope where it was defined.</p><p>"Imperative" rule syntax. We have also defined an alternative syntax for rules, inspired by the FLWOR syntax of XQuery expressions <ref type="bibr" target="#b3">[4]</ref>. The "imperative" fragment offers several statements: skip (does nothing), for, if, match, block statements (enclosed in braces), and variable definitions var...in. An example is shown in Figure <ref type="figure">4</ref>. This language is essentially a language of monoid comprehensions <ref type="bibr" target="#b6">[7]</ref>, so it is easily converted to a traditional Datalog representation using a syntax-directed translation in the compiler front-end. Recursive relations cannot be expressed using this syntax.</p><p>Integers. The integer types (bigint and bit&lt;N&gt;) provide the standard arithmetic operations, as well as bit-wise operations, bit selection v[15:8], shifting, and concatenation.</p><p>Strings All primitive types contain built-in conversions to strings, and users can implement string conversion functions for user-defined types (like Java's toString() method). Expressions enclosed within ${...} in a string literal are  interpolated : they are evaluated at run-time, converted to strings and substituted; this is a feature inspired by JavaScript; for example "x+y=${x+y}".</p><p>Pattern matching. DDlog borrows the match expression from ML and Haskell; a match expression simultaneously performs pattern-matching against type constructors or values, and also can bind values. Figure <ref type="figure" target="#fig_4">5</ref> shows a match expression that uses a nested pattern to extract a byte from a value a with type OptionalIPAddress (this type was defined in Figure <ref type="figure" target="#fig_1">2</ref>). For example, the last case binds the addr variable to the value of the ipv6addr field.</p><p>Pattern matching can also be used directly in the body of a rule, as in the last line from Figure <ref type="figure" target="#fig_4">5</ref>, which extracts only IPv6 addresses from the Host relation and binds their value to the addr variable, which in turn is used in the left-hand side of the rule defining IPv6Addr relation.</p><p>Functions. DDlog functions encapsulate pure (side-effect-free) computations. Example functions are lastByte from Figure <ref type="figure" target="#fig_4">5</ref>, and concat from Figure <ref type="figure" target="#fig_5">6</ref>. Recursive functions are not supported. Users and libraries can declare prototypes of extern functions, which must be implemented outside of DDlog (e.g., in Rust), and linked against the DDlog program at link time. The compiler assumes that extern functions are pure.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.4">Collections</head><p>The DDlog standard library contains three built-in generic collection types (implemented natively in Rust): Vec&lt;'T&gt;, Set&lt;'T&gt; and Map&lt;'K, 'V&gt;. Values of these types can be stored as first-class values within relations. Equality for values of these types is defined element-wise. In theory such types are not necessary, since collections within relations can be represented using separate relations. We have introduced them into the language because many practical applications have data models that contain nested collections; by supporting collection-valued columns natively in DDlog we can more easily interface with such applications, // declare external function returning a vector of strings extern function split ( s : string , sep : string ): Vec &lt; string &gt; // DDlog function to concatenate all elements of a vector function concat ( s : Vec &lt; string &gt; , sep : string ): string = { var res = " " ; for ( e in s ) { res = ( if ( res != " " ) ( res + sep ) else res ) + e }; res // last value is function evaluation result } input relation Phrases ( p : string ) relation Words ( w : string ) // Words contains all words that appear in some phrase Words ( w ) : -Phrases ( p ) , var w = FlatMap ( split (p , " ␣ " )).</p><p>// Shortest path between each pair of points x , y // (x , y ) is the key for grouping // min is the function used to aggregate data in each group ShortestPath (x , y , min_cost ) : -Path (x , y , cost ) , var min_cost = Aggregate (( x , y ) , min ( cost )). without the need to write glue code to convert collections back and forth into separate relations using foreign keys. Figure <ref type="figure" target="#fig_5">6</ref> shows the declaration in DDlog of an external function which splits a string into substrings using a separator; this function returns a vector of strings.</p><p>for loops can be used to iterate over elements in collections. Figure <ref type="figure" target="#fig_5">6</ref> shows an implementation of the function concat, the inverse of split, which uses a loop.</p><p>The FlatMap operator can be used to flatten a collection into a set of DDlog records, as illustrated in the definition of relation Words in Figure <ref type="figure" target="#fig_5">6</ref>.</p><p>The Aggregate operator can be used to evaluate the equivalent of SQL groupby-aggregate queries. The aggregate operator has two arguments: a key function, and an aggregation function. The aggregation function receives a group of records that share the same key. The ShortestPath relation in Figure <ref type="figure" target="#fig_5">6</ref> is computed using aggregation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.5">Module system</head><p>DDlog offers a simple module system, inspired by Haskell and Python, which allows importing definitions (types, functions, relations) from multiple files. The user can add imported definitions directly into the name space of the importing module or keep them in a separate name space to prevent name collisions. Similar to Java packages, module names are hierarchical and the module name hierarchy must match the paths on the the filesystem where modules are stored. The directive import library.module will load the module from file library/module.dl.</p><p>The DDlog standard library is a module containing a growing collection of useful functions and data structures: some generic functions and data-types, such as min, string manipulation and conversion to strings, functions to manipulate vectors, sets, maps (insertion, deletion, lookup, etc.).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">DDlog Implementation</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Compiling DDlog to Differential Dataflow</head><p>Differential Dataflow. The core execution engine of DDlog is Differential Dataflow (DD). Differential Dataflow <ref type="bibr" target="#b16">[17]</ref> is a streaming big-data processing system which provides incremental (differential) computation. DD is an incremental mapreduce-like system, but supporting a wide set of relational operators, including recursion (fixed-point) and joins. Section 4.3 in <ref type="bibr" target="#b16">[17]</ref> describes the core relational operators that are used by our compiler to implement DDlog operators. DD is described in several publications <ref type="bibr" target="#b19">[20,</ref><ref type="bibr" target="#b16">17]</ref> and has an open-source implementation with online documentation <ref type="bibr" target="#b15">[16,</ref><ref type="bibr" target="#b14">15]</ref>.</p><p>Compilation. Figure <ref type="figure" target="#fig_6">7</ref> shows how DDlog programs are compiled. The DDlog compiler is written in Haskell. The compiler generates Rust code (as text files); the Rust code is compiled and linked with the open-source Rust version of the DD library <ref type="bibr" target="#b13">[14]</ref>. The DD engine operates on multisets, where elements can have positive or negative cardinalities; to get a set semantics we need to apply distinct operators on some multisets, in particular, output collections.</p><p>The DDLog compiler performs parsing, type inference, validation, and several optimization steps. In order to compute incremental results the DD runtime has to maintain temporal indexes (indexed by logical time), containing previous versions of relations. Many of our optimizations are geared towards reducing memory consumption; for example, we attempt to share indexes between multiple collections and operators. We use reference counting for large values, but stack-based implementations for small values. The non-linear operators (like distinct) can be very expensive, so we try to minimize their usage. The compiler attempts reuse common prefixes of disjoint rules.</p><p>The output of the DDlog compiler is a dataflow graph, which may contain cycles (introduced by recursion). The nodes of the graph represent relations; the relations are computed by dataflow relational operators. Edges connect each operator to its input and output relations. DD natively implements the following operators: map, filter, distinct, join, antijoin, groupby, union, aggregation, and flatmap. Each operator has a highly optimized implementation, incorporating temporal indexes that track updates to each relation over time and allow efficient incremental evaluation. The DD library is responsible for executing the emitted dataflow graph across many cores by running a user-defined number of worker threads. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Interacting with DDlog programs</head><p>Transactional API. The interaction with a running DDlog program is done through a transactional API. At any time only one transaction can be outstanding. After starting a transaction the user can insert and delete any number of tuples from input relations. When attempting to commit a transaction all updates are applied atomically and changes to all output relations are produced. Users register an upcall to be notified of these changes.</p><p>The DDlog API is implemented in Rust, with bindings available for other languages, currently C and Java.</p><p>The command-line interface. For every DDlog program the compiler generates a library that exports the transactional API, which can be invoked from Rust or other languages. The compiler also generates a command-line interface program (CLI) that allows users to interact with the DDlog program directly via a command line or a script. The CLI allows users to start transactions, insert or delete tuples in input relations, commit transactions, dump the contents of relations, and get statistics about resource consumption. The CLI is also used for regression testing and debugging.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Applications</head><p>Controller for Virtual Networks. The most significant DDlog program we have written so far is a reimplementation of OVN <ref type="bibr" target="#b20">[21]</ref> -a production-grade virtual network controller used to implement the network substrate for cloud management systems.</p><p>OVN translates a set of network management policies into OpenFlow rules that have to be installed on the virtual switches in the network. The logic is very complicated, comprising tens of input, output and intermediate relations.</p><p>The original program was written in C, and is not fully incremental. The DDlog implementation has about 6000 lines of code, about the same size as the original code base, but it is fully incremental. With the exception of a small number of library functions imported from C, we were able to implement the entire OVN logic in DDlog. This would not be feasible with a more traditional dialect of Datalog that does not support types and expressions.</p><p>Firewall management. We have re-implemented a proprietary network management application in DDlog. The application manages a firewall in a network of switches and virtual machines (VMs). The firewall is driven by a centralized policy; when the policy changes, the local rules have to be updated in all network devices. The core of this program is a graph reachability problem in a directed graph, which is a recursive query written in a few lines of DDlog.</p><p>We compare the performance of the DDlog implementation (blue lines) with a production-ready hand-written incremental Java program, which has been heavily optimized (pink lines). The Java program has several thousands lines of code. The graphs are synthetic network topologies; the average node degree is 2.</p><p>Figure <ref type="figure" target="#fig_7">8</ref> shows execution time and memory consumption of the two implementations. On the X axis we always have the graph size in nodes, and on the Y axis performance. You will note that the DDlog program performs several times better than the hand-optimized Java implementation. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Related work</head><p>A survey of Datalog engines can be found in <ref type="bibr" target="#b12">[13]</ref>. Here we focus on incremental evaluation; a survey of incremental evaluation is <ref type="bibr" target="#b8">[9]</ref>. Notable algorithms include Delete-Rederive <ref type="bibr" target="#b9">[10]</ref>, FOIES <ref type="bibr" target="#b5">[6]</ref>. Saha <ref type="bibr" target="#b23">[24]</ref> provides an algorithm for tabled logic programs. The Backward-Forward algorithm <ref type="bibr" target="#b18">[19]</ref> improves DRed under some circumstances. IncA <ref type="bibr" target="#b24">[25,</ref><ref type="bibr" target="#b25">26]</ref> is a Datalog dialect for incremental program analysis; it introduces the DRed L algorithm. Another class of algorithms use provenance to perform incremental computation <ref type="bibr" target="#b11">[12]</ref>. Several recent paper describe systems that use incremental evaluation for relational computation models: <ref type="bibr" target="#b1">[2,</ref><ref type="bibr" target="#b26">27]</ref>.</p><p>The only other incremental Datalog engine that we are aware of is a LogiQL <ref type="bibr" target="#b7">[8]</ref>, a commercial product of LogicBlox <ref type="bibr" target="#b2">[3]</ref>. Unfortunately there is no published data about the performance of the LogicBlox incremental engine.</p><p>DDlog is built on top of Differential Dataflow <ref type="bibr" target="#b13">[14]</ref>; several declarative incremental query engines generalizing Datalog were built on top of Differential Dataflo <ref type="bibr" target="#b19">[20,</ref><ref type="bibr" target="#b16">17]</ref>. Some of the DDlog features were inspired by .Net LINQ <ref type="bibr" target="#b17">[18]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Conclusion and future work</head><p>DDlog is a young project. The language is evolving quickly, driven by the use cases. We place paramount importance on language usability; this is why we have enhanced Datalog with many non-traditional constructs. Our goal is to reduce as much as possible the need to transition between multiple languages when writing large projects.</p><p>Our ongoing work on DDlog focuses on continuous improvement of its performance and memory utilization, as well as use-case-driven evolution of its syntax, features, and libraries. We welcome any contributions or users!</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Fig. 1 .</head><label>1</label><figDesc>Fig. 1. Incremental evaluation of a Datalog program.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>/Fig. 2 .</head><label>2</label><figDesc>Fig. 2. Type declarations in DDlog. None, Some, IPv6Address are pattern constructors.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Fig. 3 .</head><label>3</label><figDesc>Fig.3. A graph described by two relations and a rule to compute paths in the graph that exclude some nodes.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head></head><label></label><figDesc>function lastByte ( a : OptionalIPAddress ): bit &lt;8 &gt; = { match ( a ) { None -&gt; 0 , Some { IPv4Address {. ipv4addr = addr }} -&gt; addr [7:0] , Some { IPv6Address {. ipv6addr = addr }} -&gt; addr [7:0] } } relation Host ( address : OptionalIPAddress ) // Rule that performs matching on address structure IPv6Addr ( addr ) : -Host (. address = Some { IPv6Address { addr }}).</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_4"><head>Fig. 5 .</head><label>5</label><figDesc>Fig. 5. Pattern matching used in a DDlog function and in a rule.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_5"><head>Fig. 6 .</head><label>6</label><figDesc>Fig. 6. Operations on collections: iteration, flattening, aggregation.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_6"><head>Fig. 7 .</head><label>7</label><figDesc>Fig. 7. DDlog compilation flow.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_7"><head>Fig. 8 .</head><label>8</label><figDesc>Fig. 8. DDlog performance as a function of the graph size. (1) the time taken to execute the non-incremental reachability computation (inserting all nodes and edges in a single transaction); (2) the peak memory consumption; (3) the time to insert an additional 12% edges into the graph, and (4) the time to delete 3% of the edges.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head></head><label></label><figDesc>computes an inner join of height</figDesc><table><row><cell>input relation Height ( object_id : int , height : int )</cell></row><row><cell>input relation Width ( object_id : int , width : int )</cell></row><row><cell>output relation Area ( object_id : int , area : int )</cell></row><row><cell>// Compute the area of an object as the product of</cell></row><row><cell>// its height and width .</cell></row><row><cell>Area ( oid , area ) : -Height ( oid , h ) , Width ( oid , w ) ,</cell></row><row><cell>var area = w * h .</cell></row><row><cell>// Alternative syntax for defining the same relation .</cell></row><row><cell>for o in Height // o is a tuple with fields ( object_id , height )</cell></row><row><cell>for o1 in Width if o1 . oid == o . oid</cell></row><row><cell>Area ( o . oid , o1 . width * o . height )</cell></row></table><note>Fig.4. Rule examples. The first rule uses expressions and variablesvar introduces a variable binding. The second rule is equivalent with the first one, but is written using an imperative-style syntax.</note></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">In a typical use case, a DDlog program is used in conjunction with a persistent database; database records are fed to DDlog as inputs and the derived facts computed by DDlog are written back to the database; DDlog does not include a storage engine.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1">The core engine of DDlog is differential dataflow<ref type="bibr" target="#b13">[14]</ref>, which supports distributed computation over partitioned data; we may add this capability in the future.</note>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<monogr>
		<ptr target="https://github.com/ryzhyk/differential-datalog.Re-trieved" />
		<title level="m">Differential Datalog</title>
				<imprint>
			<date type="published" when="2018-12">December 2018</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">DBtoaster: Higher-order delta processing for dynamic, frequently fresh views</title>
		<author>
			<persName><forename type="first">Y</forename><surname>Ahmad</surname></persName>
		</author>
		<author>
			<persName><forename type="first">O</forename><surname>Kennedy</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Koch</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Nikolic</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proceedings of the VLDB Endowment</title>
				<meeting>the VLDB Endowment</meeting>
		<imprint>
			<date type="published" when="2012">2012</date>
			<biblScope unit="volume">5</biblScope>
			<biblScope unit="page" from="968" to="979" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">Design and implementation of the LogicBlox system</title>
		<author>
			<persName><forename type="first">M</forename><surname>Aref</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><surname>Cate</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><forename type="middle">J</forename><surname>Green</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><surname>Kimelfeld</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Olteanu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Pasalic</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><forename type="middle">L</forename><surname>Veldhuizen</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Washburn</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conf. on Management of Data (SIGMOD)</title>
				<imprint>
			<date type="published" when="2015">2015</date>
			<biblScope unit="page" from="1371" to="1382" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<monogr>
		<title level="m" type="main">XQuery 1.0: An XML query language</title>
		<author>
			<persName><forename type="first">S</forename><surname>Boag</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Chamberlin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><forename type="middle">F</forename><surname>Fernández</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Florescu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Robie</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Siméon</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Ştefănescu</surname></persName>
		</author>
		<ptr target="http://www.w3.org/TR/xquery" />
		<imprint>
			<date type="published" when="2002-03">2002. March 2019</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">Strictly declarative specification of sophisticated points-to analyses</title>
		<author>
			<persName><forename type="first">M</forename><surname>Bravenboer</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Y</forename><surname>Smaragdakis</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA)</title>
				<imprint>
			<date type="published" when="2009">2009</date>
			<biblScope unit="page" from="243" to="262" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">First-order incremental evaluation of Datalog queries</title>
		<author>
			<persName><forename type="first">G</forename><surname>Dong</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Su</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Database Programming Languages (DBPL)</title>
				<meeting><address><addrLine>London, UK</addrLine></address></meeting>
		<imprint>
			<date type="published" when="1994">1994</date>
			<biblScope unit="page" from="295" to="308" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">Towards an effective calculus for object query languages</title>
		<author>
			<persName><forename type="first">L</forename><surname>Fegaras</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Maier</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM SIGMOD Record</title>
		<imprint>
			<biblScope unit="volume">24</biblScope>
			<biblScope unit="page" from="47" to="58" />
			<date type="published" when="1995">1995</date>
			<publisher>ACM</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">LogiQL: A declarative language for enterprise applications</title>
		<author>
			<persName><forename type="first">T</forename><forename type="middle">J</forename><surname>Green</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Symposium on Principles of Database Systems (PODS)</title>
				<imprint>
			<date type="published" when="2015">2015</date>
			<biblScope unit="page" from="59" to="64" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Maintenance of materialized views: Problems, techniques, and applications</title>
		<author>
			<persName><forename type="first">A</forename><surname>Gupta</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><forename type="middle">S</forename><surname>Mumick</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">IEEE Data Eng. Bull</title>
		<imprint>
			<biblScope unit="volume">18</biblScope>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="3" to="18" />
			<date type="published" when="1995">1995</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Maintaining views incrementally</title>
		<author>
			<persName><forename type="first">A</forename><surname>Gupta</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><forename type="middle">S</forename><surname>Mumick</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><forename type="middle">S</forename><surname>Subrahmanian</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conf. on Management of Data (SIGMOD)</title>
				<imprint>
			<date type="published" when="1993">1993</date>
			<biblScope unit="page" from="157" to="166" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<monogr>
		<author>
			<persName><surname>Kubernetes</surname></persName>
		</author>
		<ptr target="https://kubernetes.io/" />
		<title level="m">Production-grade container orchestration</title>
				<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<analytic>
		<title level="a" type="main">Recursive computation of regions and connectivity in networks</title>
		<author>
			<persName><forename type="first">M</forename><surname>Liu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><forename type="middle">E</forename><surname>Taylor</surname></persName>
		</author>
		<author>
			<persName><forename type="first">W</forename><surname>Zhou</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Z</forename><forename type="middle">G</forename><surname>Ives</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><forename type="middle">T</forename><surname>Loo</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Data Engineering (ICDE)</title>
				<meeting><address><addrLine>Shanghai, China</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2009-04-02">29 March-2 April 2009</date>
			<biblScope unit="page" from="1108" to="1119" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<analytic>
		<title level="a" type="main">Datalog: Concepts, history, and outlook</title>
		<author>
			<persName><forename type="first">D</forename><surname>Maier</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><forename type="middle">T</forename><surname>Tekle</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Kifer</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><forename type="middle">S</forename><surname>Warren</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Declarative Logic Programming</title>
				<editor>
			<persName><forename type="first">M</forename><surname>Kifer</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">Y</forename><forename type="middle">A</forename><surname>Liu</surname></persName>
		</editor>
		<imprint>
			<date type="published" when="2018">2018</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<monogr>
		<title level="m" type="main">Differential Dataflow</title>
		<author>
			<persName><forename type="first">F</forename><surname>Mcsherry</surname></persName>
		</author>
		<ptr target="https://github.com/TimelyDataflow/differential-dataflow" />
		<imprint>
			<date type="published" when="2019-01">January 2019</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b14">
	<monogr>
		<title level="m" type="main">Differential Dataflow API reference</title>
		<author>
			<persName><forename type="first">F</forename><surname>Mcsherry</surname></persName>
		</author>
		<ptr target="https://docs.rs/differential-dataflow/0.8.0/differential_dataflow" />
		<imprint>
			<date type="published" when="2019-03">March 2019</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b15">
	<monogr>
		<title level="m" type="main">Differential Dataflow documentation</title>
		<author>
			<persName><forename type="first">F</forename><surname>Mcsherry</surname></persName>
		</author>
		<ptr target="https://timelydataflow.github.io/differential-dataflow" />
		<imprint>
			<date type="published" when="2019-03">March 2019</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b16">
	<analytic>
		<title level="a" type="main">Differential Dataflow</title>
		<author>
			<persName><forename type="first">F</forename><surname>Mcsherry</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Murray</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Isaacs</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Isard</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Conference on Innovative Data Systems Research (CIDR)</title>
				<imprint>
			<date type="published" when="2013-01">January 2013</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b17">
	<analytic>
		<title level="a" type="main">Unifying tables, objects and documents</title>
		<author>
			<persName><forename type="first">E</forename><surname>Meijer</surname></persName>
		</author>
		<author>
			<persName><forename type="first">W</forename><surname>Schulte</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Bierman</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Workshop on Declarative Programming in the Context of Object-Oriented Languages (DPCOOL)</title>
				<meeting><address><addrLine>Uppsala, Sweden</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2003-08-25">August 25 2003</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b18">
	<analytic>
		<title level="a" type="main">Incremental update of Datalog materialisation: The backward/forward algorithm</title>
		<author>
			<persName><forename type="first">B</forename><surname>Motik</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Y</forename><surname>Nenov</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Piro</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Horrocks</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">AAAI Conference on Artifficial Intelligence (AAAI)</title>
				<meeting><address><addrLine>Austin, TX</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2015">January 25-30 2015</date>
			<biblScope unit="page" from="1560" to="1569" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b19">
	<analytic>
		<title level="a" type="main">Naiad: A timely dataflow system</title>
		<author>
			<persName><forename type="first">D</forename><forename type="middle">G</forename><surname>Murray</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Mcsherry</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Isaacs</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Isard</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Barham</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Abadi</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">ACM Symposium on Operating Systems Principles (SOSP)</title>
				<meeting><address><addrLine>Farminton, Pennsylvania</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2013">2013</date>
			<biblScope unit="page" from="439" to="455" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b20">
	<monogr>
		<author>
			<persName><surname>Ovn</surname></persName>
		</author>
		<ptr target="http://www.openvswitch.org/support/dist-docs/ovn-architecture.7.html" />
		<title level="m">Open Virtual Network architecture</title>
				<imprint>
			<date type="published" when="2019-03">March 2019</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b21">
	<monogr>
		<title level="m" type="main">Differential Datalog (DDLog) language reference</title>
		<author>
			<persName><forename type="first">L</forename><surname>Ryzhyk</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Budiu</surname></persName>
		</author>
		<ptr target="https://github.com/ryzhyk/differential-datalog/blob/master/doc/language_reference/language_reference.md" />
		<imprint>
			<date type="published" when="2018-12">December 2018</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b22">
	<monogr>
		<title level="m" type="main">A differential Datalog (DDLog) tutorial</title>
		<author>
			<persName><forename type="first">L</forename><surname>Ryzhyk</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Budiu</surname></persName>
		</author>
		<ptr target="https://github.com/ryzhyk/differential-datalog/blob/master/doc/tutorial/tutorial.md" />
		<imprint>
			<date type="published" when="2018-12">December 2018</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b23">
	<analytic>
		<title level="a" type="main">Incremental evaluation of tabled logic programs</title>
		<author>
			<persName><forename type="first">D</forename><surname>Saha</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><forename type="middle">R</forename><surname>Ramakrishnan</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Logic Programming (ICLP)</title>
				<imprint>
			<date type="published" when="2003">2003</date>
			<biblScope unit="page" from="392" to="406" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b24">
	<analytic>
		<title level="a" type="main">Incrementalizing latticebased program analyses in Datalog</title>
		<author>
			<persName><forename type="first">T</forename><surname>Szabó</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Bergmann</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Erdweg</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Voelter</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Object-Oriented Programming, Systems, Languages and Applications (OOPSLA)</title>
				<meeting><address><addrLine>Boston, MA</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2018-10">Oct. 2018</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b25">
	<analytic>
		<title level="a" type="main">IncA: A DSL for the definition of incremental program analyses</title>
		<author>
			<persName><forename type="first">T</forename><surname>Szabó</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Erdweg</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Voelter</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Automated Software Engineering (ASE)</title>
				<imprint>
			<date type="published" when="2016">2016</date>
			<biblScope unit="page" from="320" to="331" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b26">
	<analytic>
		<title level="a" type="main">Incremental view maintenance over array data</title>
		<author>
			<persName><forename type="first">W</forename><surname>Zhao</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Rusu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><surname>Dong</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Wu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Nugent</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">ACM International Conference on Management of Data (ICMD)</title>
				<imprint>
			<publisher>ACM</publisher>
			<date type="published" when="2017">2017</date>
			<biblScope unit="page" from="139" to="154" />
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
