Picat The Planner Module 4 — Questions and Answers
Question 1: What optional predicate can be defined to enable informed (heuristic-guided) search in Picat's planner?
- heuristic/2 (Correct answer)
- estimate/2
- priority/2
- weight/2
Correct answer: heuristic/2
Defining `heuristic(State, H)` provides the planner with a cost-to-goal estimate H, enabling A*-style best-first search.
Question 2: For `heuristic/2` to guarantee optimal solutions, what property must the heuristic value H satisfy?
- H must never overestimate the true remaining cost (admissible) (Correct answer)
- H must equal the exact remaining cost
- H must always overestimate to prune aggressively
- H can be any non-negative number
Correct answer: H must never overestimate the true remaining cost (admissible)
An admissible heuristic never overestimates the true cost to goal, which guarantees that best_plan returns an optimal solution.
Question 3: Which `best_plan` variant also enforces an upper bound on the search cost?
- best_plan/3 (best_plan(State, Limit, Plan)) (Correct answer)
- best_plan/2 (best_plan(State, Plan))
- best_plan/1 (best_plan(State))
- best_plan/4 always ignores the limit
Correct answer: best_plan/3 (best_plan(State, Limit, Plan))
`best_plan/3` takes an explicit Limit argument and returns the cheapest plan whose cost does not exceed that limit.
Question 4: What mechanism does the Picat planner use to avoid re-expanding already-visited states?
- Tabling (memoization of visited states) (Correct answer)
- A global hash set maintained by the user
- Depth cutoff only
- Constraint propagation
Correct answer: Tabling (memoization of visited states)
The planner automatically tables visited states so that the same state is never expanded twice, preventing infinite loops and redundant work.
Question 5: In a `best_plan` search, what happens when two plans have the same total cost?
- The planner returns whichever it finds first during its search (Correct answer)
- It always returns the shorter plan
- It returns both plans via backtracking
- It raises an ambiguity error
Correct answer: The planner returns whichever it finds first during its search
The planner returns the first optimal-cost plan it discovers; tie-breaking among equal-cost plans is not specified and depends on search order.
Question 6: What is the minimum number of `action/4` clauses needed for a valid Picat planning problem?
- At least one (Correct answer)
- Exactly two
- Three or more
- Zero (the planner can infer actions)
Correct answer: At least one
At least one `action/4` clause must be defined so the planner has at least one possible transition to explore.
Question 7: Can a Picat `action/4` clause have a Cost of 0?
- Yes, zero-cost actions are allowed and represent free transitions (Correct answer)
- No, costs must be strictly positive
- Only if the action is the last in the plan
- Only with `plan_unbounded`, not with `plan`
Correct answer: Yes, zero-cost actions are allowed and represent free transitions
Zero is a valid non-negative cost; zero-cost actions are treated as free moves that do not increase the accumulated plan cost.
What optional predicate can be defined to enable informed (heuristic-guided) search in Picat's planner?