DLQ
EN
Open the IDE

The DLQ IDE

Write a DLQ program on the left, see its model on the right. The IDE runs the engine in your browser: nothing is sent anywhere, and it works offline once loaded.

The minimal paths example: the program on the left, the relation minpath on the right.

Every screenshot here is a link that opens the IDE in the same state, so you can try each thing as you read.

Write

Run

Run (Ctrl+Enter) evaluates the program in the mode chosen next to it:

ComputeStep-wise evaluation, as the dissertation defines it: one model, stratum by stratum, each step adding what the rules derive from the facts before it.
SearchModel search: every order of deriving facts. It runs programs that negate themselves inside a recursion, which Compute must reject, and finds all their models. Weak constraints keep only the cheapest.
Search (stable)The same, keeping only the outcomes where every ~{ … } still holds at the end: the stable models (answer sets).

max steps stops an evaluation that does not end, such as a counter that keeps numbering new facts. The line above the result says how many steps and facts there were, and the strata in the order they were evaluated.

Read the result

Why is the path from c to b of length 4 a minimal path? Rule R3 made it from a path, which R2 made from a shorter path and an arc.

Debug: step by step

Debug runs the program and replays it one step of the evaluation at a time, as a debugger steps through code. Step 0 is the given facts; each step after it applies the rules to the facts derived before, and a stratum ends with a step that derives nothing new.

Step 3 of minimal paths: rule R2 fired and added six paths. The tables show the model as it was after the step, the new rows shaded.

Debug replays Compute. A program only Search can run shows its search in the picture instead, as a film.

Graphs

The Graph tab draws the program as the dissertation's chapter 3 does. Hover over a node for its definition; click it to go to it in the program: its line is banded, its name in bold, and every other place it is mentioned shaded. Click the node again to go on to the next mention. SVG and DOT save the graph.

Predicate dependenciesWhich predicate is derived from which (Fig. 3.1): attributives as nodes of their own, not on negations, strata as colour groups, the number of facts under each predicate; a full attributive inside a cycle in red.
Relations and rulesEach rule between the relations it reads and the one it derives (Fig. 3.2), with how the engine evaluates it: once, in semi-naive passes, or as an aggregate.
Argument dependenciesHow argument positions pass values to each other (Fig. 3.6): arcs through function terms marked f, bold on a cycle, which safety condition 7 forbids.
Variable dependenciesFor one rule, which of its variables depend on which (Fig. 3.5); a new counter is a vertex of its own.
Why …The derivation of a fact, after you ask Why? for it.
The node ancestor, clicked: its declaration banded, its six mentions shaded.

Pictures

A program can ask for its result to be drawn as the problem looks: the rings of the Towers of Hanoi moving, a map being coloured, shortest paths being found. It does so with a comment line at its top, a kind of picture followed by the relations it reads:

// picture: towers plan start stick
The Towers of Hanoi, move 7 of 15.

The Picture tab plays it (Space), steps through it frame by frame, and Video records it as a video file. For a model search, the colouring, seating, matching, pick and arcs pictures can also play how the search found them: every choice, dead end and model in turn, beside the tree of the search.

The search for colourings of a map: the tree of its choices on the right, its dead ends in red.

The kinds of picture

Each kind takes the names of the relations it draws, in this order; the example in brackets uses it.

LineWhat it draws
towers plan start stickThe Towers of Hanoi: plan(move, ring, from, to) played from the rings' places in start, the sticks in stick's order (towers of Hanoi).
stacks plan startThe blocks world: plan(move, block, to) played from start, whose columns are the blocks and whose row says what each stands on (blocks world).
paths arc path minpath aShortest paths from a over arc(from, to, len): the paths step by step, a shorter one replacing a longer one, then the tree of the shortest (minimal paths).
spread edge distA breadth-first search: dist(node, d) revealed ring by ring over the graph edge(a, b) (collaboration distance).
tree parent closure badge …A tree of parent(a, b); a closure relation (or -) drawn as curved arrows step by step; relations (node, value) as badges under the nodes (ancestors, bill of materials, org chart).
layers requires depth passed openItems in columns by depth, arrows from each prerequisite; per person, what they passed and what is open (course prerequisites).
groups road componentA directed graph, coloured group by group by component(node, leader) (connected components).
colouring border colourA map: regions joined by border(a, b), coloured by colour(region, colour), model after model (map colouring).
seating at like dislikeGuests at tables, at(person, table), friends and foes joined; one seating after another (seating, team building).
matching can_do assignTwo columns joined by can_do(a, b, cost); a model's assign drawn bold (task assignment).
pick cover groundA graph cover(a, b); the nodes a model picks in ground(node) filled (network search, cheapest network).
arcs edge in_tree rootA weighted graph edge(a, b, cost); a model's in_tree arcs bold, the root ringed (spanning tree with a weak constraint).
trees edge arc tree_cost best_cost rootCandidate spanning trees, each tree's arcs and cost, then the cheapest (spanning tree).
sets cover output ground_cost optimum_output pointCandidate sets on a graph, their costs, the best (monitoring).
teams member cost best …Candidate splits into teams, their costs, the best; pair relations drawn between two people of one team (team building).
bars emp name salary marker …Bars of a relation by the named columns; each marker relation marks the bars it agrees with (employees).
search relation …The search itself: the facts it chooses, the tree of its choices, its models and dead ends.

Data

The bill of materials: its components as an editable table, the totals it derives on the right.

Keys

Ctrl+EnterRun
Ctrl+SpaceSuggestions; ↑ ↓ choose, Enter or Tab take, Esc closes
TabIndent by four spaces
F10 · Shift+F10Debug: the next step · the step before
F8Debug: on to the next breakpoint
F9Set or clear a breakpoint on the rule at the cursor
EscEnd debugging; clear the highlight a graph node left
SpacePlay or pause the picture
← →On the divider between the panes: make the program narrower or wider