fast-downward-0.1.1.0: Solve classical planning problems (STRIPS/SAS+) using Haskell & Fast Downward.

Safe Haskell None Haskell2010

FastDownward

Description

This module exposes a small DSL for building and solving planning problems using Fast Downward - an open source solver for classical planning problems.

Using this module, you model problems with a finite-domain representation through state variables (see, Var, newVar), and model their changes through Effects (see readVar, and writeVar). If you're familiar with software transactional memory, an effect is like a transaction, except the process of solving will choose the appropriate sequence for you.

Synopsis

# Defining Problems

data Problem a Source #

The Problem monad is used to build a computation that describes a particular planning problem. In this monad you can declare state variables - Vars - using newVar, and you can solve planning problems using solve.

Instances

## Tests

data Test Source #

Tests are use to drive the solver in order to find a plan to the goal.

(?=) :: Ord a => Var a -> a -> Test Source #

Test that a Var is set to a particular value.

any :: [Test] -> Test Source #

Take the disjunction (or) of a list of Tests to a form new a Test that succeeds when at least one of the given tests is true.

Caution! The use of any introduces axioms into the problem definition, which is not compatible with many search engines.

# Solving Problems

Arguments

 :: Show a => SearchEngine -> [Effect a] The set of effects available to the planner. Each effect can return some domain-specific information of type a which you can use to interpret the plan. This will usually be some kind of Action type. -> [Test] A conjunction of tests that must true for a solution to be considered acceptable. -> Problem (SolveResult a) The list of steps that will converge the initial state to a state that satisfies the given goal predicates.

Given a particular SearchEngine, attempt to solve a planning problem.

data SolveResult a Source #

The result from the solver on a call to solve.

Constructors

 Unsolvable The problem was to be unsolvable. Crashed String String ExitCode Fast Downward crashed (or otherwise rejected) the given problem. Solved (Solution a) A solution was found.

data Solution a Source #

A successful solution to a planning problem. You can unpack a Solution into a plan by using totallyOrderedPlan and partiallyOrderedPlan.

runProblem :: MonadIO m => Problem a -> m a Source #

Leave the Problem monad by running the given computation to IO.

## Extracting Plans

totallyOrderedPlan :: Solution a -> [a] Source #

Extract a totally ordered plan from a solution.

partiallyOrderedPlan :: Ord a => Solution a -> (Graph, Vertex -> (a, Key, [Key]), Key -> Maybe Vertex) Source #

Deorder a plan into a partially ordered plan. This attempts to recover some concurrency when adjacent plan steps do not need to be totally ordered. The result of this function is the same as the result of graphFromEdges.