Picat The Planner Module 2 — Questions and Answers
Question 1: Which directive correctly imports the Picat planner module?
- import planner. (Correct answer)
- use planner.
- include planner.
- require planner.
Correct answer: import planner.
The correct syntax is `import planner.` placed at the top of the Picat source file.
Question 2: What are the two user-defined predicates that the Picat planner module requires?
- action/4 and final/1 (Correct answer)
- move/3 and goal/1
- transition/2 and done/1
- step/4 and terminal/2
Correct answer: action/4 and final/1
The planner requires `action(State, NextState, Action, Cost)` and `final(State)` to be defined by the user.
Question 3: What is the arity of the `action` predicate used in Picat's planner module?
- 4 (Correct answer)
- 2
- 3
- 5
Correct answer: 4
`action/4` takes four arguments: the current state, next state, the action term, and its cost.
Question 4: What does the second argument of `plan/2` return after a successful call?
- A list of action terms constituting the plan (Correct answer)
- The total cost of the plan
- The final goal state
- The number of steps taken
Correct answer: A list of action terms constituting the plan
`plan(State, Plan)` unifies Plan with a list of action terms that lead from State to a final state.
Question 5: In `plan/4`, what does the second argument (Limit) represent?
- An upper bound on the total resource cost (Correct answer)
- The maximum number of clauses to try
- The depth of the search tree
- The timeout in milliseconds
Correct answer: An upper bound on the total resource cost
`plan(State, Limit, Plan, Cost)` uses Limit as an upper bound on the accumulated action costs, not raw depth.
Question 6: What does the `final/1` predicate define in a Picat planning problem?
- The goal condition that a state must satisfy for the plan to succeed (Correct answer)
- The initial state of the problem
- The last action to be executed
- The cost threshold for termination
Correct answer: The goal condition that a state must satisfy for the plan to succeed
`final(State)` succeeds when State is a goal state, telling the planner when to stop searching.
Question 7: Which default search strategy does Picat's planner module employ?
- Iterative-deepening depth-first search (Correct answer)
- Breadth-first search
- Random restart hill climbing
- Uniform-cost search only
Correct answer: Iterative-deepening depth-first search
The planner uses iterative-deepening depth-first search (IDDFS) by default, progressively increasing the cost bound.
Which directive correctly imports the Picat planner module?