langgoap.infer_start_state

langgoap.infer_start_state#

infer_start_state(actions)[source]#

Build a clean-slate world state from action preconditions and effects.

Collects every condition key referenced in preconditions and boolean effects, then sets each to False. Non-boolean effect values are skipped.

This eliminates the hand-written start-state factories common in notebooks and tutorial modules:

start = infer_start_state(actions)
# → {"has_data": False, "report_complete": False, ...}
Parameters:

actions (list[ActionSpec]) – List of actions whose preconditions/effects define the planning state space.

Returns:

A dict mapping every discovered boolean condition key to False.

Return type:

dict[str, bool]