Algorithmadvanced
Answer set grounding
Also called ASP grounder, intelligent grounding.
Replaces variables of a safe ASP program by constants, producing only ground rules whose bodies can be true, by semi-naive evaluation.
- Time
- O(r · m^2 · c^k · d^2) worst
- Space
- O(m · r · c^k + d) extra
- Where
- c = the number of constants; d = the number of atoms in the domain; k = the largest number of variables in a rule; m = the largest number of positive body atoms in a rule; r = the number of rules
- Model
- Word RAM
- Properties
- deterministic
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Martin Gebser, Torsten Schaub, Sven Thiele, 2007
An answer set solver works on ground programs, but answer set programs are written with variables. A grounder replaces the variables by constants. The full instantiation, which tries every constant for every variable, is correct but much too large, so real grounders produce only the rule instances whose positive body can be true. They find these instances by semi-naive evaluation, as in Datalog, and then simplify the result with the atoms that are certainly true or certainly false. The output has the same stable models as the full instantiation, but it can still be exponential in the size of a rule.
In plain words
A rule with variables is a pattern for many rules, one for each way of filling in the variables with names from the program. Writing out every one of them is wasteful: most would talk about things that can never be true. The grounder works forward instead. It starts from the plain facts and asks which filled-in rules could fire, ignoring the "not" conditions for now. Each rule that could fire adds its conclusion to a growing list of possible facts. Then it repeats with the new facts only, so no filled-in rule is produced twice. When nothing new appears, it cleans up: conditions that are surely true are dropped, and rules that are surely blocked are deleted. The solver gets the small program that is left.
The problem
The input is a finite normal program with variables and constants but no function symbols. Its rules have the form , where the head and the body literals are atoms such as . The Herbrand universe is the set of constants of . A rule is safe if each variable in it occurs in some positive body atom . The full instantiation is the set of all ground instances of the rules over , and the stable models of are by definition those of (Gelfond and Lifschitz 1988). The output is a ground program with the same stable models as . Grounding is the first step before any propositional solver, such as the smodels search or conflict-driven solving.
The algorithm
GROUND(P)- 1
if some rule of P is not safe then fail - 2
O ← ∅; Δ ← the heads of the rules with no positive body atom; emit these rules - 3
while Δ ≠ ∅ do - 4
N ← ∅ - 5
for each rule r = h ← b1, …, bm, not c1, …, not cn with m ≥ 1, and each j = 1, …, m do - 6
for each substitution θ with biθ ∈ O for i < j, bjθ ∈ Δ, and biθ ∈ O ∪ Δ for i > j do - 7
emit rθ; N ← N ∪ {hθ} - 8
O ← O ∪ Δ; Δ ← N ∖ O - 9
D ← O; F ← the least model of the emitted rules that have no negative literal - 10
for each emitted rule h ← pos, not neg do - 11
if neg contains an atom of F then delete the rule ▷ it is blocked in every stable model - 12
else replace it by h ← (pos ∖ F), not (neg ∩ D) ▷ an atom outside D is never true - 13
return the remaining rules, without duplicates
Lines L2 to L8 evaluate the positive part of the program, with the negative literals ignored. The final is the domain , the least model of , which contains every atom of every stable model. At line L6, is the first position of an atom that is new in the last round: the earlier positions take only older atoms. So each pair of a rule and a substitution is found in exactly one round and at one position. Real grounders compute the join at line L6 with indexes on the bound arguments, as in a hash join; the Python code scans the atoms of each predicate.
Example
The program describes reachability from a start node, and a guess of a colour for each reached node:
edge(a, b). edge(b, c). start(a).
reach(X) ← start(X).
reach(Y) ← reach(X), edge(X, Y).
red(X) ← reach(X), not green(X).
green(X) ← reach(X), not red(X).
The constants are , and , so the full instantiation has rules.
| round | emitted instances | new atoms |
|---|---|---|
| 0 | the three facts | , , |
| 1 | ||
| 2 | , and the two colour rules for | , , |
| 3 | , and the two colour rules for | , , |
| 4 | the two colour rules for | , |
| 5 | none | none: stop |
The run emits 12 instances in 5 rounds. The definite rules give . Line L12 removes the atoms from the bodies, so the output is the six facts of and six rules such as . It has stable models, one for each colouring of the three nodes, the same as the 21 rules of the full instantiation.
The output can be exponential in the size of the input. The rule with the facts and has instances, and each of them derives a different atom, so none can be left out:
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |
|---|---|---|---|---|---|---|---|---|
| ground rules | 4 | 6 | 10 | 18 | 34 | 66 | 130 | 258 |
Correctness
The correctness proof has the details. First, semi-naive evaluation gives the domain and exactly the instances whose positive body lies in , each once: each atom has one round in which it is new, and an instance is found in the round after the last of its body atoms became new, at the first position that holds such an atom. Second, the other instances do not matter. Every rule of a reduct is a rule of , so the least model of lies in , and a rule with a body atom outside never fires. Third, simplification keeps the stable models. Every stable model contains the least model of the definite instances and lies in . For such a set , a rule with , , is deleted by the reduct anyway, a literal with is true, and a body atom in is true, so the reducts have the same least model.
Proof: The grounder keeps the stable models of the full instantiationfull
Let be a finite normal program with variables and constants but no function symbols. A rule is , where the form and the form . The rule is safe if each variable of and of the occurs in some . Let be the set of constants of (the Herbrand universe). An instance of is the ground rule for a substitution of its variables by constants of . The full instantiation is the set of all instances of all rules. Its stable models are by definition the stable models of (Gelfond and Lifschitz 1988).
For a ground program , is the definite program of the rules , is the Gelfond-Lifschitz reduct and is the least model.
Step 1: semi-naive evaluation computes the domain and its instances
Let , the domain, and let be the set of instances with .
The code emits each rule with an empty positive body (by safety it is ground), sets to the heads of these rules and . In round , for each rule with positive body and each position , it finds the substitutions with for , , and for . It emits . Then , and is the set of new heads minus . It stops when and returns .
Lemma 1. The sets are pairwise disjoint, and their union is . The emitted instances are exactly , and each pair (rule, substitution) with is emitted exactly once.
Proof. For an atom in some , call its entry round . Each is disjoint from , which contains all earlier 's, so each atom has at most one entry round. Every emitted head is a head of a rule of whose body is in (by induction on ), so the union is a subset of , and since is finite the loop stops. Conversely, let be an instance whose positive body atoms all have entry rounds, and let be the largest of them and the first position with . In round , , the atoms before have entry rounds below and are in , and the atoms after are in . So is emitted in round at position . It is emitted at no other round and position : that would need and all other entry rounds at most , so , and all entry rounds before below , so . The rules with an empty positive body are emitted once, before the loop, and never in it, because the loop runs over the positions of the positive body. The head of each emitted instance enters some unless it is already in . So the set of atoms with an entry round is closed under , and it contains the least model . With the first part, it is equal to , and the emitted instances are exactly those with positive body in , that is . Because the rule is safe, all its variables occur in , so is determined by and two different substitutions give two different instances.
Step 2: instances outside the domain do not matter
Lemma 2. and have the same stable models.
Proof. Let be any set of atoms. Each rule of is a rule of , so . A rule of that comes from an instance outside has a positive body atom outside , so it never fires in the computation of . Hence , since contains every rule that fires. So if and only if .
Step 3: simplification
Let be the least model of the instances in with no negative literal. The simplified program is built from as follows: delete each instance with some , ; in the others, delete each literal with and each positive body atom in ; remove duplicate rules.
Lemma 3. Every stable model of , and every stable model of , satisfies .
Proof. For : the rules with no negative literal are unchanged in , so , and . For : each head of is a head of and lies in . The rules of with no negative literal stay in with the atoms of removed from their bodies. Each atom of is derived from such rules whose bodies lie in , so in these rules are facts, and .
Lemma 4. and have the same stable models.
Proof. By Lemma 3 it is enough to compare the reducts for an with . Take an instance of . If meets , it meets , so deletes , and does not contain it. Otherwise contains . Since , exactly when . So keeps exactly when keeps . For a set , the two bodies are true in together, so the two definite programs have the same immediate consequences on sets that contain . Both least models contain (Lemma 3), and each least model is the least fixpoint, so each one is a fixpoint of the other operator. Hence the two least models are equal. Duplicates do not change a reduct or a least model.
Theorem. If every rule of is safe, then ground(P) has the same stable models as the full instantiation of over its constants.
Proof. By Lemma 1 the code computes and , and simplify computes . Lemmas 2 and 4 give the claim.
Size and time
A rule with variables has instances. The family with the facts and has with atoms, and every instance is in and in as a fact. So the ground program has rules for a non-ground program of size , and no grounder that writes out the ground program can be faster than on this family.
Let be the number of rules, the largest number of positive body atoms of a rule, , the largest number of variables in a rule, and . There are at most instances. In one round, for each rule and each position , the join visits at most partial substitutions, and each visit scans the at most atoms of one predicate. There are at most rounds. So the code takes time. Real grounders index the atoms on their bound arguments and order the body so that the join is cheaper, but the bound for the output remains.
What the tests check
The tests generate 300 random safe programs over the constants and , with the predicates , , and , so at most 9 ground atoms. They check that the domain and the instances from semi-naive evaluation equal those computed from the least model of the positive part of the full instantiation, and that the count of emitted instances equals the number of (rule, substitution) pairs with positive body in the domain. On 200 more programs they check that the output of ground has the same stable models as the full instantiation, by brute force with the reduct. They also check that an unsafe rule raises an error, and that the exponential family above gives rules for .
Complexity
A rule with variables over constants has instances, so a program with rules has at most instances, and the example family shows that the output can need rules for a program of size . No grounder can avoid this, because the output itself is that large. For the Python code, each round, rule and position visits at most partial substitutions, each visit scans at most atoms, and there are at most rounds, which gives time. The space is the stored instances plus the domain. For a fixed program, is a constant and grounding takes time polynomial in the number of facts. Deciding whether a normal program with variables has a stable model is NP-complete when the program is fixed and the facts are the input, and NEXPTIME-complete when the program is part of the input (Dantsin, Eiter, Gottlob and Voronkov 2001).
Properties
- Exact on the positive part. The domain is the least model of the positive part of the program, so no atom of a stable model is missed.
- Each instance once. Semi-naive evaluation finds each pair of a rule and a substitution exactly once.
- Stratified programs are solved. For a program without negation, the output is the least model as a list of facts, so the solver has nothing left to do. Grounders that also evaluate stratified negation solve stratified programs completely.
- Safety is necessary. An unsafe rule such as has an instance for each constant, and its meaning depends on which constants exist. Grounders reject it.
Variants and improvements
- Component order. Real grounders split the program along the strongly connected components of its predicate dependency graph and ground the components bottom-up. Atoms of finished lower components are then known exactly, so more literals can be decided.
- Stratified negation. If is in a lower component and is not derived, then is true and can be dropped as soon as that component is done; if is a fact, the rule can be deleted.
- Join order and indexes. Choosing the order of the body atoms and indexing atoms by their bound arguments change the cost of line L6 a great deal, though not the output.
- Function symbols and arithmetic. With function symbols the Herbrand universe is infinite; grounders accept such programs only under conditions that make the domain finite, and they evaluate arithmetic during grounding.
- Goal-directed grounding. Methods in the spirit of magic sets ground only the part of the program that a query needs.
When to use it
Every answer set system grounds first. Write the program so that the grounding is small: keep the number of variables per rule low, add domain predicates that restrict the variables, and avoid rules that join many large predicates. When the ground program is too large in practice, the problem usually lies in such a rule, not in the solver.
Pitfalls
- Grounding bottleneck. The output grows as . A rule with four variables over 1000 constants already has instances, which no system can write out.
- Unsafe rules. A variable that occurs only in the head, or only under , has no positive atom to bind it. Add a domain predicate to the body.
- The domain is an overestimate. An atom in is not necessarily true in a stable model, because ignores the negative literals. Only atoms of are certain.
- Simplification is semantic, not syntactic. Dropping is correct only for outside the domain. Dropping it because no rule for was emitted yet, in the middle of the evaluation, is wrong.
- Duplicates. Two rules of the program can have the same instance. This is harmless, but the counts of instances and of output rules then differ.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/answer-set-grounding/. The authors are listed in prov/JQHNQC.jsonl.
"""A grounder for safe normal programs with variables, by semi-naive evaluation.
An atom is a tuple (predicate, t1, ..., tk) of strings. A term that starts
with an upper-case letter is a variable; every other term is a constant. There
are no function symbols. A rule is (head, pos, neg) with pos and neg tuples of
atoms. A rule is safe when every variable of the head and of neg occurs in pos.
ground(program) returns a ground program in the format of lp.py, whose atoms
are the ground tuples. It has the same stable models as the instantiation of
the program over all constants (the Herbrand universe).
1. Semi-naive evaluation of the positive parts of the rules computes the
domain D, an overestimate of the atoms that some stable model can contain,
and emits each rule instance whose positive body lies in D exactly once.
2. Simplification removes what the domain and the definite part decide:
a rule with not c, where c is derived by the definite rules alone, is
deleted; a literal not c with c outside D is true and is deleted; a
positive body atom derived by the definite rules alone is deleted.
"""
import lp
def is_var(term):
return term[:1].isupper()
def variables(atoms):
return {t for atom in atoms for t in atom[1:] if is_var(t)}
def check_safe(rule):
head, pos, neg = rule
unsafe = variables((head,) + tuple(neg)) - variables(pos)
if unsafe:
raise ValueError(f"unsafe variables {sorted(unsafe)} in rule {rule}")
def match(pattern, fact, theta):
"""Extend the substitution theta so that pattern becomes fact, or return None."""
if pattern[0] != fact[0] or len(pattern) != len(fact):
return None
out = dict(theta)
for p, f in zip(pattern[1:], fact[1:]):
if is_var(p):
if out.setdefault(p, f) != f:
return None
elif p != f:
return None
return out
def subst(atom, theta):
return (atom[0],) + tuple(theta.get(t, t) for t in atom[1:])
def index(atoms):
"""Atoms grouped by (predicate, arity)."""
out = {}
for a in atoms:
out.setdefault((a[0], len(a)), []).append(a)
return out
def joins(pos, sources, theta=None, i=0):
"""All substitutions that map pos[i] into sources[i] for every i."""
if theta is None:
theta = {}
if i == len(pos):
yield theta
return
for fact in sources[i].get((pos[i][0], len(pos[i])), ()):
nxt = match(pos[i], fact, theta)
if nxt is not None:
yield from joins(pos, sources, nxt, i + 1)
def instantiate(program, stats=None):
"""Semi-naive evaluation. Return the domain and the list of rule instances with positive body in the domain."""
for rule in program:
check_safe(rule) # @line L1
instances = []
seen = set()
def emit(rule, theta):
head, pos, neg = rule
inst = (subst(head, theta), tuple(subst(b, theta) for b in pos), tuple(subst(c, theta) for c in neg))
if stats is not None:
stats["emitted"] = stats.get("emitted", 0) + 1
if inst not in seen:
seen.add(inst)
instances.append(inst)
return inst[0]
old = set()
delta = set()
for rule in program:
if not rule[1]:
delta.add(emit(rule, {})) # @line L2
rounds = 0
while delta: # @line L3
rounds += 1
new_atoms = set() # @line L4
old_ix, delta_ix, all_ix = index(old), index(delta), index(old | delta)
for rule in program:
pos = rule[1]
for j in range(len(pos)): # @line L5
# The first atom from the last round is at position j: earlier ones are old, later ones any.
sources = [old_ix] * j + [delta_ix] + [all_ix] * (len(pos) - j - 1)
for theta in joins(pos, sources): # @line L6
new_atoms.add(emit(rule, theta)) # @line L7
old |= delta
delta = new_atoms - old # @line L8
if stats is not None:
stats["rounds"] = rounds
return old, instances
def simplify(domain, instances):
"""Remove what the domain and the definite instances decide. Duplicates are removed; the order is kept."""
certain = lp.least_model([(h, pos, ()) for h, pos, neg in instances if not neg]) # @line L9
out = []
seen = set()
for h, pos, neg in instances: # @line L10
if any(c in certain for c in neg): # @line L11
continue
rule = (h, tuple(b for b in pos if b not in certain), tuple(c for c in neg if c in domain)) # @line L12
if rule not in seen:
seen.add(rule)
out.append(rule)
return out # @line L13
def ground(program, stats=None):
"""The simplified ground program."""
domain, instances = instantiate(program, stats)
return simplify(domain, instances)
lp.py 79 lines
# SPDX-License-Identifier: MIT
# Shared helper of the logic program pages of https://algorithm.tamnd.com/. The authors are listed in prov/.
"""Ground normal logic programs, for the logic program pages.
A program is a list of rules (head, pos, neg). The head is an atom, and pos and
neg are tuples of atoms: the rule is head <- pos[0], ..., not neg[0], ....
An atom is any hashable value that can be sorted with the other atoms, for
example a small int or a short string. A rule with pos and neg empty is a fact.
A program with every neg empty is definite.
The functions are the plain definitions, written for clarity and checked by
the tests of each page. The brute force enumerator accepts at most MAX_ATOMS
atoms. The algorithms of the pages live in their own files, not here.
"""
from itertools import combinations
MAX_ATOMS = 12
def atoms(program):
"""The sorted list of the atoms that occur in the program."""
out = set()
for head, pos, neg in program:
out.add(head)
out.update(pos)
out.update(neg)
return sorted(out)
def tp(program, interp):
"""The immediate consequence operator: the heads of the rules whose body is true in the set interp."""
return frozenset(h for h, pos, neg in program if all(b in interp for b in pos) and not any(c in interp for c in neg))
def least_model(program):
"""The least model of a definite program, as the limit of tp from the empty set."""
if any(neg for _, _, neg in program):
raise ValueError("least_model needs a definite program")
model = frozenset()
while True:
nxt = tp(program, model)
if nxt == model:
return model
model = nxt
def reduct(program, m):
"""The Gelfond-Lifschitz reduct of the program by the set m."""
return [(h, tuple(pos), ()) for h, pos, neg in program if not any(c in m for c in neg)]
def is_stable(program, m):
"""True when m is the least model of the reduct of the program by m."""
return least_model(reduct(program, m)) == frozenset(m)
def stable_models(program):
"""All stable models, by brute force over every subset of the atoms, sorted by size and then by content."""
universe = atoms(program)
if len(universe) > MAX_ATOMS:
raise ValueError(f"the brute force accepts at most {MAX_ATOMS} atoms")
found = []
for k in range(len(universe) + 1):
for subset in combinations(universe, k):
if is_stable(program, frozenset(subset)):
found.append(frozenset(subset))
return found
def random_program(rng, n_atoms, n_rules, max_pos=2, max_neg=2):
"""A random ground normal program over the atoms 0 .. n_atoms - 1, drawn with the random.Random rng."""
program = []
for _ in range(n_rules):
head = rng.randrange(n_atoms)
pos = tuple(rng.sample(range(n_atoms), rng.randint(0, min(max_pos, n_atoms))))
neg = tuple(rng.sample(range(n_atoms), rng.randint(0, min(max_neg, n_atoms))))
program.append((head, pos, neg))
return program
test_answer_set_grounding.py 127 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/answer-set-grounding/. The authors are listed in prov/JQHNQC.jsonl.
import random
import unittest
from itertools import product
import lp
from answer_set_grounding import ground, instantiate, is_var, subst
ARITY = {"p": 1, "q": 1, "r": 2, "s": 0}
CONSTANTS = ("a", "b")
VARS = ("X", "Y")
def constants_of(program):
out = set()
for h, pos, neg in program:
for atom in (h,) + tuple(pos) + tuple(neg):
out.update(t for t in atom[1:] if not is_var(t))
return sorted(out) or ["a"]
def rule_vars(rule):
h, pos, neg = rule
return sorted({t for atom in (h,) + tuple(pos) + tuple(neg) for t in atom[1:] if is_var(t)})
def full_instantiation(program, consts=None):
"""Every rule under every substitution of its variables by constants of the program."""
if consts is None:
consts = constants_of(program)
out = set()
for rule in program:
vs = rule_vars(rule)
for values in product(consts, repeat=len(vs)):
theta = dict(zip(vs, values))
h, pos, neg = rule
out.add((subst(h, theta), tuple(subst(b, theta) for b in pos), tuple(subst(c, theta) for c in neg)))
return sorted(out)
def naive_instances(program):
"""The instances whose positive body lies in the least model of the positive parts, by plain iteration."""
full = full_instantiation(program)
domain = lp.least_model([(h, pos, ()) for h, pos, neg in full])
return domain, {r for r in full if all(b in domain for b in r[1])}
def random_atom(rng, allow_vars):
pred = rng.choice(sorted(ARITY))
terms = [rng.choice(VARS + CONSTANTS) if allow_vars else rng.choice(CONSTANTS) for _ in range(ARITY[pred])]
return (pred,) + tuple(terms)
def random_program(rng):
program = []
for _ in range(rng.randint(1, 4)):
program.append((random_atom(rng, False), (), ()))
for _ in range(rng.randint(1, 5)):
pos = tuple(random_atom(rng, True) for _ in range(rng.randint(1, 2)))
safe = {t for atom in pos for t in atom[1:] if is_var(t)}
fix = lambda atom: (atom[0],) + tuple(t if not is_var(t) or t in safe else rng.choice(CONSTANTS) for t in atom[1:])
head = fix(random_atom(rng, True))
neg = tuple(fix(random_atom(rng, True)) for _ in range(rng.randint(0, 1)))
program.append((head, pos, neg))
return program
class TestGrounding(unittest.TestCase):
def test_example(self):
# Reachability with a choice between two colours of each reached node.
program = [
(("edge", "a", "b"), (), ()),
(("edge", "b", "c"), (), ()),
(("start", "a"), (), ()),
(("reach", "X"), (("start", "X"),), ()),
(("reach", "Y"), (("reach", "X"), ("edge", "X", "Y")), ()),
(("red", "X"), (("reach", "X"),), (("green", "X"),)),
(("green", "X"), (("reach", "X"),), (("red", "X"),)),
]
g = ground(program)
self.assertEqual(len(g), 12)
self.assertIn((("red", "c"), (), (("green", "c"),)), g)
self.assertEqual(len(lp.stable_models(g)), 8)
def test_semi_naive_finds_each_instance_once(self):
rng = random.Random(4483)
for _ in range(300):
program = random_program(rng)
stats = {}
domain, instances = instantiate(program, stats)
n_domain, n_instances = naive_instances(program)
self.assertEqual(domain, set(n_domain))
self.assertEqual(set(instances), n_instances)
# Each (rule, substitution) pair is produced in exactly one round and one position.
consts = constants_of(program)
pairs = sum(1 for r in program for i in full_instantiation([r], consts) if all(b in domain for b in i[1]))
self.assertEqual(stats["emitted"], pairs)
def test_same_stable_models_as_full_instantiation(self):
rng = random.Random(266)
for _ in range(200):
program = random_program(rng)
full = full_instantiation(program)
self.assertLessEqual(len(lp.atoms(full)), 9)
expected = lp.stable_models(full)
got = lp.stable_models(ground(program))
self.assertEqual(got, expected, program)
def test_unsafe_rule_is_rejected(self):
with self.assertRaises(ValueError):
ground([(("p", "X"), (), (("q", "X"),))])
def test_exponential_family(self):
# p(X1, ..., Xk) <- d(X1), ..., d(Xk) with d(a), d(b) has 2^k ground instances,
# and every one of them is a different fact in the output.
for k in range(1, 9):
vs = tuple(f"X{i}" for i in range(1, k + 1))
program = [(("d", "a"), (), ()), (("d", "b"), (), ()), (("p",) + vs, tuple(("d", v) for v in vs), ())]
g = ground(program)
self.assertEqual(len(g), 2 + 2 ** k)
self.assertEqual(len(lp.least_model(g)), 2 + 2 ** k)
if __name__ == "__main__":
unittest.main()
History
Gelfond and Lifschitz (1988) defined stable models of programs with variables through the ground instances. The lparse grounder of the smodels system and the grounder of DLV (Leone et al. 2006) introduced domain restrictions and intelligent grounding, which produce only the relevant instances. Gebser, Schaub and Thiele (2007) presented the gringo grounder, which accepts a larger class of programs. Its later versions are part of the clingo system, and like the method on this page they evaluate the positive part of the program bottom-up, in the manner of Datalog engines.
References
- Martin Gebser, Torsten Schaub and Sven Thiele, GrinGo: a new grounder for answer set programming, in Logic Programming and Nonmonotonic Reasoning (LPNMR 2007), Lecture Notes in Computer Science, Springer, 266 to 271 (2007), the gringo grounder and the class of programs it accepts
- Martin Gebser, Roland Kaminski, Benjamin Kaufmann and Torsten Schaub, Answer Set Solving in Practice, Morgan and Claypool (2012), Chapter 4, Grounding (safety, the instantiation of rules and the simplification of the ground program)
- Nicola Leone, Gerald Pfeifer, Wolfgang Faber, Thomas Eiter, Georg Gottlob, Simona Perri and Francesco Scarcello, The DLV system for knowledge representation and reasoning, ACM Transactions on Computational Logic 7(3) (2006), the intelligent grounding module of DLV
- Michael Gelfond and Vladimir Lifschitz, The stable model semantics for logic programming, in Robert A. Kowalski and Kenneth A. Bowen (eds.), Logic Programming: Proceedings of the Fifth International Conference and Symposium, MIT Press, 1070 to 1080 (1988), stable models of a program with variables defined through its ground instances
- Evgeny Dantsin, Thomas Eiter, Georg Gottlob and Andrei Voronkov, Complexity and expressive power of logic programming, ACM Computing Surveys 33(3), 374 to 425 (2001), the data complexity and program complexity of normal programs under the stable model semantics
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag JQHNQC Edit this page History Report an error Markdown