The Planner Module Flashcards
7 cards from real Picat practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 The Planner Module flashcards as text
What optional predicate can be defined to enable informed (heuristic-guided) search in Picat's planner?
Answer: heuristic/2
Defining `heuristic(State, H)` provides the planner with a cost-to-goal estimate H, enabling A*-style best-first search.
For `heuristic/2` to guarantee optimal solutions, what property must the heuristic value H satisfy?
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.
Which `best_plan` variant also enforces an upper bound on the search cost?
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.
What mechanism does the Picat planner use to avoid re-expanding already-visited states?
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.
In a `best_plan` search, what happens when two plans have the same total cost?
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.
What is the minimum number of `action/4` clauses needed for a valid Picat planning problem?
Answer: At least one
At least one `action/4` clause must be defined so the planner has at least one possible transition to explore.
Can a Picat `action/4` clause have a Cost of 0?
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.