Skip to main content

AI Planning as Satisfiability

Project description

planning_sat

AI Planning as Satisfiability

About

This library implements Planning as Satisfiability that can be used to solve STRIPS-like AI Planning Problems using PDDL. When passed the domain and problem representations in PDDL, the library returns Solution Plan if any.

Documentation

If you are interested in understanding the details, please read my post at TBD

Installation

pip install planning_sat

or, you can clone this repository

Example

PDDL for representing planning domain and problem

The Dock-Worker Robots Domain and Problem are provided in the domain directory. There are also Simple Domain and Problem in the same directory. You can create your PDDL files, or you can download them from the internet.

Use as a CLI Script

You can execute the script directly by passing it the required arguments which are:

  • path to the domain file
  • path to the problem file
  • length of plan

example:

python3 dpll.py -d domain/simple-domain.pddl -p domain/simple-problem.pddl -l 1 -f

Including the library in your project

If you want to include the library in your project, you can install it with pip. The steps are simple:

  • Create an encoder object which will encode the Planning Problem to a boolean (propositional) formula in CNF (Conjunctive Normal Form)
  • Create a DPLL object which will run Davis–Putnam–Logemann–Loveland algorithm over the encoded problem to determine whether it is satisfiable or not
import planning_sat.encoder as encoder
from planning_sat.dpll import DPLL

domain_file = "domain/simple-domain.pddl"
problem_file = "domain/simple-problem.pddl"
encoder = encoder.PlanningProblemEncoder(domain_file, problem_file, length=1)
dpll = DPLL()
satisfiable, model = dpll(encoder.propositional_formulas)

pddlpy

pddlpy included in this repo is the work of Hernán M. Foffani, it is copied from here. It is copied because it won't work when installed as a package due to the wrong version of the antlr4 package. There are no changes made to it.

Issues

Please report issues if you found bugs or raise a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

planning_sat-0.0.1.tar.gz (43.9 kB view details)

Uploaded Source

Built Distribution

planning_sat-0.0.1-py3-none-any.whl (50.5 kB view details)

Uploaded Python 3

File details

Details for the file planning_sat-0.0.1.tar.gz.

File metadata

  • Download URL: planning_sat-0.0.1.tar.gz
  • Upload date:
  • Size: 43.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for planning_sat-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7af6fff9d84a701430625fa5247b50bdd5df1d0e0b565c8ca1979661ba8b0f03
MD5 2fce19a642f121b95e46621834ff4331
BLAKE2b-256 8ca41792a483b070145b673ef74fc61db9a245fc5128f501dcef51ea820b7be8

See more details on using hashes here.

File details

Details for the file planning_sat-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: planning_sat-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 50.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for planning_sat-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f8d7bf336e25686fac0f9008053de3f14505665335a6c4c800242602060b5fd0
MD5 a574c59b0649d8bd8c704228ad2a7489
BLAKE2b-256 e59f98fdc698fa1a603f5750aa06ea2f173c618fca4c4043e87aa4ab1d25fde3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page