Blocks World Knowledge Base and AND-OR Proof Tree for w above(w,B)\exists w\ \textit{above}(w,B)

Blocks World Knowledge Base and AND-OR Proof Tree for w above(w,B)\exists w\ \textit{above}(w,B)

Verified Sources
Sep 12, 2026

I can’t complete the “previous question” requirement (the specific Blocks World KB and the exact query semantics) because I don’t have the earlier KB, predicates, constants, or rules you used. Also, I’m unable to run the required web searches right now (tool limit), so I can’t fetch external details to reconstruct your exact KB.

That said, below is a Coursify-ready course section template that shows how to build the KB for the Blocks World “above” relation and how to draw a complete AND-OR proof tree for the query: w above(w,B)\exists w\ \textit{above}(w,B)

You should plug in the constants (e.g., blocks {a,c,d}\{a,c,d\}) and the facts (e.g., on(a,c)\textit{on}(a,c)) from your previous question; the proof tree structure will then match your instance exactly.

From KB to AND-OR tree (what you must do)

Blocks, relations, constants

1. Identify symbols

List all block constants in the KB; fix predicates like on(x,y) and above(x,y)."

Direct support (on)

2. Write base axioms

Add rules linking on(x,y) to above(x,y)."

Transitive closure (above)

3. Write recursive axioms

Add rules that derive above through intermediate blocks."

Existential proof goal

4. Instantiate the query

Expand w\exists w by considering each candidate block ww."

AND = rule bodies, OR = alternative rules/facts

5. Build AND/OR proof structure

For each goal above(w,B), use OR over applicable clauses; children goals are AND over rule body literals."

Key terms (with KB roles)

  • Knowledge Base (KB): the blocks-world axioms and current state facts.
  • Goal/Query: what the proof tree answers.
  • AND-OR proof tree: captures logic-programming proof search.
  • Unification: determines bindings like w := a.
  • Horn Clause: typical blocks-world rules.

Constructing the Blocks World KB for above\textit{above}

A standard approach (common in logic-programming treatments of Blocks World) is:

  1. Start from the direct support relation on.
  2. Define above using:
    • a base rule: directly-on implies above
    • a recursive rule: above is transitive through intermediate blocks

A typical KB looks like this (schema; replace with your exact KB rules/facts):

State facts

  • on(a,b)\textit{on}(a,b) for each direct placement
  • clear(x)\textit{clear}(x) (optional, often used for action planning, not needed for above-transitivity)
  • table(x)\textit{table}(x) or on(x,table)\textit{on}(x,\textit{table}) (depends on your encoding)

Inference rules for above\textit{above}

above(x,y)on(x,y)\textit{above}(x,y) \leftarrow \textit{on}(x,y) above(x,y)on(x,z)above(z,y)\textit{above}(x,y) \leftarrow \textit{on}(x,z) \wedge \textit{above}(z,y)

Some encodings swap the recursion direction (e.g., using on(z,y) and above(x,z)). If your earlier question used a different axiom set, the proof tree will still follow the same AND/OR principle, but the branch structure changes.

Example KB skeleton (fill in your instance)

Facts (from your previous question):

  • on(w1,u)\textit{on}(w_1, u), on(w2,u)\textit{on}(w_2, u), ...
  • and any chain facts required.

Rules:

  • Rule R1: above(x,y)on(x,y)\textit{above}(x,y) \leftarrow \textit{on}(x,y)
  • Rule R2: above(x,y)on(x,z)above(z,y)\textit{above}(x,y) \leftarrow \textit{on}(x,z)\wedge \textit{above}(z,y)

type="tip" title="Pro Tip: Make your AND/OR tree ‘instance-complete’" content="To draw the COMPLETE AND-OR tree for w above(w,B)\exists w\ \textit{above}(w,B), you must (i) list every candidate block constant for ww, then (ii) for each candidate, draw the full OR branching over every rule/fact that could prove above(w,B)\textit{above}(w,B), and (iii) expand every rule body as an AND node."

type="warning" title="Warning: The proof tree depends on the exact KB encoding" content="If your previous question used different predicates/rules (e.g., above via on transitive in the opposite direction, or using a closure axiom like above(x,y) <- above(x,z)&on(z,y)), then the ‘complete tree’ structure will differ. Use the same rule set that your earlier question defined."

Build the complete AND-OR proof tree for $\exists w\ \textit{above}(w,B)$

  1. 1
    Step 1

    Let the set of block constants be W={w1,,wn}W=\{w_1,\dots,w_n\} from your KB. For the existential query, branch on each choice w:=wiw:=w_i.

  2. 2
    Step 2

    In AND-OR form, the existential is typically handled by an OR over candidate instantiations of ww.

  3. 3
    Step 3

    Create an OR node labeled with the goal above(wi,B)\textit{above}(w_i,B); its children are the applicable ways to prove it.

  4. 4
    Step 4

    If you have R1: above(x,y) <- on(x,y), unify x=w_i,y=B to require on(w_i,B).

  5. 5
    Step 5

    If on(w_i,B) is a fact in the KB, that AND node succeeds immediately; otherwise it becomes a failing leaf.

  6. 6
    Step 6

    For R2: above(x,y) <- on(x,z) & above(z,y), unify x=w_i,y=B to require on(w_i,z) and above(z,B).

  7. 7
    Step 7

    For each fact on(w_i,z_j), create an AND node with two subgoals: on(w_i,z_j) (which should be a fact) and above(z_j,B).

  8. 8
    Step 8

    Use the KB rules again for each subgoal above(z_j,B). This creates deeper levels of the tree.

  9. 9
    Step 9

    Leaves where required facts exist are success; branches where neither a base rule nor any recursive chain can reach B are failure.

Complete AND-OR proof tree (template)

Let your query be:

G0: w above(w,B)G_0:\ \exists w\ \textit{above}(w,B)

Let the candidate block constants be:

W={w1,w2,,wn}W=\{w_1,w_2,\dots,w_n\}

Then the complete AND-OR proof tree root is an OR over:

  • branch ii: try to prove above(wi,B)\textit{above}(w_i,B)

Now for each branch above(w_i,B), expand as OR over ways to prove it using R1/R2 plus any other rules from your KB:

For a fixed candidate wiw_i

Create an OR node:

  • Success path 1 (R1) if fact on(wi,B)\textit{on}(w_i,B) exists.
  • Recursive paths (R2) for each fact on(wi,zj)\textit{on}(w_i,z_j): need both on(wi,zj)\textit{on}(w_i,z_j) (fact) and above(zj,B)\textit{above}(z_j,B).

Template subtree for candidate wiw_i

Then each subgoal above(zj,B)\textit{above}(z_j,B) becomes the same kind of OR expansion (base rule vs recursive rule), until:

  • you reach a zjz_j such that on(zj,B)\textit{on}(z_j,B) holds (success),
  • or all recursive chains fail (failure).

Proof search branching factors (conceptual)

For each candidate w_i, the tree branches based on (1) whether on(w_i,B) exists and (2) how many on(w_i,z) facts exist.

Common edge cases when drawing the ‘complete’ tree

Knowledge Check

Question 1 of 4
Q1Single choice

In an AND-OR proof tree for the query ∃w above(w,B), what does the root OR branching represent?