Existential Query Answering in the Blocks World
The Blocks World is a classic symbolic-AI domain in which named blocks are related by predicates such as on(x, y). A knowledge base (KB) stores facts about the current configuration, and a query asks whether a logical statement follows from those facts.
Given:
the query is:
This asks:
Does there exist at least one object that is above block ?
In standard Blocks World terminology, on(x, y) usually means that block is directly on block . The relation above may either be interpreted as a synonym for direct on, or as a transitive relation meaning “somewhere higher in the same stack.” Under either interpretation, the fact provides a witness: .
Therefore, the answer is true, with substitution:
and proof:
Hence:
Footnotes
-
Blocks world - Overview of the classic symbolic-AI planning domain. ↩
Core Insight
For an existential query, one valid witness is sufficient. Since D is directly on B, D satisfies the variable w.
1. Formalizing the Knowledge Base
The constants are:
- : a block
- : a block
- : a block
- : a block
The binary predicate on(x, y) represents a direct spatial relationship:
The KB is:
The query uses the predicate above:
In a simple representation, we can define:
This rule states that anything directly on is also above .
Thus:
Since is an object for which above(D, B) is true, the existential query succeeds.
Important terms include constant, predicate, knowledge base, and witness.
2. Understanding the Existential Quantifier
The symbol is the existential quantifier.
The expression:
means:
There is at least one object such that is above .
The variable can be replaced by each known object:
The query is true if at least one of these grounded statements is true. From the KB:
- is not given.
- is not given.
- is not given.
- follows from .
Therefore:
is true with witness .
The existential query does not require every object to be above , nor does it require the witness to be unique. It only requires one satisfying object.
3. Direct on Versus General above
A crucial modeling issue is the intended meaning of above.
Direct interpretation
If above(x, y) means exactly “ is directly on ,” then:
The query is immediately answered by .
Transitive interpretation
If above(x, y) means “ is anywhere above in a stack,” then the relation is transitive:
For example, if the KB contained:
then we could infer:
and, because is on :
we could also infer:
However, the supplied KB contains only and . There is no connection between the stack containing and the stack containing . The direct witness is already sufficient.
4. Visualizing the Two Stacks
The facts describe two independent stacks:
The relevant stack is:
The fact involving and is irrelevant to the query because it does not place any object above :
does not imply:
No rule connects to , and no rule connects the two stacks.
Key terms include direct relation, transitivity, stack, and ground atom.
Solving the Existential Query
- 1Step 1
The query contains the variable w in ∃w above(w, B). The task is to find at least one object that can replace w.
- 2Step 2
The named blocks in the KB are A, B, C, and D. These are the possible substitutions for w.
- 3Step 3
The second argument must be B, because the query asks for an object above B.
- 4Step 4
The fact on(D, B) has B in its second position. It therefore identifies D as an object directly on B.
- 5Step 5
Because a block directly on B is above B, infer above(D, B).
- 6Step 6
Set w = D. The resulting statement above(D, B) is true.
- 7Step 7
Since at least one witness exists, ∃w above(w, B) is true.
Candidate Substitutions for w
Only D satisfies the query under the supplied knowledge base.
5. Proof by Substitution
Existential queries can be answered by finding a substitution that makes the formula true.
Start with:
Choose the substitution:
Applying gives:
From the KB:
Using the rule:
we derive:
Therefore:
and consequently:
The notation means that the query is logically entailed by the KB: every interpretation that satisfies the KB also satisfies .
Forward-Chaining Derivation
- 1Step 1
Begin with F = {on(A, C), on(D, B)}.
- 2Step 2
Use the rule on(x, y) → above(x, y) with x = D and y = B.
- 3Step 3
Add above(D, B) to the set of known consequences.
- 4Step 4
The derived fact matches the pattern above(w, B), with substitution w = D.
- 5Step 5
Return true and the witness D.
6. Why the Other Fact Does Not Answer the Query
The first fact is:
It supports the conclusion:
but the query requires an object above :
The second argument does not match:
- Fact:
- Required target:
Therefore, this fact cannot directly satisfy the query.
The second fact is:
Its second argument is exactly , so it supplies the required witness.
This illustrates unification, argument position, and logical entailment.
Common Questions and Edge Cases
Do Not Confuse Failure with Negation
If no witness were found, that would usually mean the query is not entailed. It would not automatically prove that ∀w ¬above(w, B), unless a closed-world assumption were explicitly adopted.
7. Closed-World and Open-World Readings
The interpretation of missing facts matters in knowledge representation.
Closed-world assumption
Under a closed-world assumption, facts not present in the KB are treated as false. This is common in database-style reasoning.
Under this interpretation:
- is true.
- , , and are false unless derived.
- The existential query is true because is a witness.
Open-world assumption
Under an open-world assumption, missing facts are unknown rather than false. This is common in formal knowledge representation and ontology-based systems.
Even under the open-world assumption, the query is still true because the KB explicitly supports:
The distinction would matter for a negative query such as:
The absence of a known witness would not necessarily establish that negative claim under open-world reasoning.
means that at least one object is above B.
8. Relation to Blocks World Planning
In planning systems, a Blocks World state is commonly represented as a set of predicates such as On-Block(x, y), On-Table(x), Clear(x), and HandEmpty(). Operators change the state by adding and deleting predicates; their preconditions determine when an action is legal.
The present problem is not asking for a plan. It is a state-query problem:
- It does not ask how to move a block.
- It does not specify a goal configuration.
- It asks whether a relation is supported by the current KB.
The distinction is important:
| Task | Example | Required reasoning |
|---|---|---|
| State query | Inspect facts and infer consequences | |
| Planning | Move from to | Search for legal actions |
| Goal testing | Is above ? | Check whether a proposition holds |
| State transition | Apply unstack(D,B) | Update predicates using action effects |
The same predicate vocabulary can support both querying and planning, but the reasoning task is different.
Footnotes
-
The Blocks World - Course material describing state representations and predicates. ↩
-
Classical Planning - Lecture notes on Blocks World operators, preconditions, add effects, and delete effects. ↩
Reasoning Pathway
Represent
1Encode the configuration as facts: on(A, C) and on(D, B)."
Parse
2Recognize the query as an existential statement asking for a witness above B."
Match
3Compare the query target B with the second arguments of the known on facts."
Infer
4Use on(D, B) to derive above(D, B)."
Answer
5Return true with witness D."
Blocks World Query Reasoning
Final Answer
Yes. The query ∃w above(w, B) is entailed by the KB. A valid witness is w = D, because on(D, B) implies above(D, B).
Knowledge Check
What does the query ∃w above(w, B) ask?
Explore Related Topics
Relational Algebra Equivalence: Why $\pi_A(R) - \pi_A((\pi_A(R) \times S) - R)$ Represents Division
The expression
[ \pi_A(R)-\pi_A\big((\pi_A(R)\times S)-R\big) ]
is a derived form of the relational‑algebra division operator, returning all (A) values that pair with every tuple in (S).
- Division is defined as (R\div S={a\mid\forall b\in S,;(a,b)\in R}).
- The formula works by (1) projecting candidate (A) values, (2) forming all required ((A,B)) pairs with (S), (3) subtracting existing pairs to find missing ones, (4) projecting the missing (A) values, and (5) removing them from the candidates.
- In the example, (R(A,B)={(1,x),(1,y),(2,x),(2,y),(3,x)}) and (S(B)={x,y}) yield (R\div S={1,2}).
- This construction captures the universal (“for all”) query pattern, unlike selection, join, or simple projection.
CYK Membership Test for the String “baaba”
Designing a Four-Input Logic Circuit with an Equality Condition