langgoap.explain_no_plan

langgoap.explain_no_plan#

explain_no_plan(start, goal, actions)[source]#

Explain why A* could not find a valid plan.

Performs a lightweight static analysis of the action set to surface two categories of failure:

  1. Unreachable conditions — goal conditions whose required value the start state does not hold and no action produces. They can never be met regardless of ordering, so the root cause is a missing action or a typo in the goal.

  2. Missing preconditions — precondition values that actions require but that neither hold in the start state nor are produced by any other action. These create unsatisfiable prerequisite chains.

Comparisons are value-aware: x=False is not satisfied by an action that sets x=True, and 0/"" count as present.

Parameters:
  • start (PlanningState) – The initial world state from which A* searched.

  • goal (GoalSpec) – Goal specification whose conditions A* failed to satisfy.

  • actions (list[ActionSpec]) – The full set of actions A* had available.

Returns:

A NoPlanExplanation with categorised unreachable conditions, missing preconditions, and a human-readable suggestion.

Return type:

NoPlanExplanation