https://github.com/ap-atul/goal-stack-planning
Goal Stack Planning implementation
https://github.com/ap-atul/goal-stack-planning
actions artificial-intelligence goal-stack-planner predicates
Last synced: 26 days ago
JSON representation
Goal Stack Planning implementation
- Host: GitHub
- URL: https://github.com/ap-atul/goal-stack-planning
- Owner: ap-atul
- License: mit
- Created: 2020-10-08T18:37:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-30T14:28:14.000Z (over 5 years ago)
- Last Synced: 2025-08-10T10:36:25.667Z (10 months ago)
- Topics: actions, artificial-intelligence, goal-stack-planner, predicates
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Goal Stack Planning
GSP is combination of both the Backward chaining and Forward chaining. GSP considers actions by reasoning in the
backward manner, but commits itself to actions only in the forward manner.It pushes sub goals onto the stack, and
picks up action only if the preconditions are satisfied
## Algorithm
```console
while stack is not empty:
if top of stack is predicate:
if predicate is true:
pop it
else:
pop it
push corresponding action that will satisfy that predicate onto stack
push preconditions of that action
if top of stack is action:
pop it
perform the action i.e add and delete it's effects from current state.
add that action to the actual plan
```
## Example
Consider below stacks
```
----- ----- -----
| B | | C | | B |
----- ----- ----- ----- -----
| A | | C | | D | | A | | D |
----- ----- ----- ----- -----
___________________ ____________
Start Goal
Plan ::
stack B D
unstack B A
stack C A
-----------------------------------------------
-----
| A |
----- -----
| C | | B |
----- ----- -----
| A | | B | | C |
----- ----- -----
____________ ______
Start Goal
Plan:
unstack C A
putdown C
stack B C
stack A B
```