From 91b2a23c7838ebb28594d636b71dd58ccda7b96e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sun, 20 Nov 2016 23:52:55 +0100 Subject: [PATCH 1/2] Added a sequential, fixed-horizon meta encoding. --- encodings/sequential-horizon.lp | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 encodings/sequential-horizon.lp diff --git a/encodings/sequential-horizon.lp b/encodings/sequential-horizon.lp new file mode 100644 index 0000000..135a22e --- /dev/null +++ b/encodings/sequential-horizon.lp @@ -0,0 +1,36 @@ +#const horizon=1. + +% Check feature requirements +:- requires(feature(actionCosts)). +:- requires(feature(axiomRules)). +:- requires(feature(conditionalEffects)). + +% Horizon, must be defined externally +time(0..horizon). + +% Establish initial state +holds(Variable, Value, 0) :- initialState(Variable, Value). + +% Perform actions +1 {occurs(Action, T) : action(Action)} 1 :- time(T), T > 0. + +% Check preconditions +:- occurs(Action, T), precondition(Action, Variable, Value), not holds(Variable, Value, T - 1), time(T), time(T - 1). + +% Apply effects +caused(Variable, Value, T) :- occurs(Action, T), postcondition(Action, _, Variable, Value). +modified(Variable, T) :- caused(Variable, Value, T). + +holds(Variable, Value, T) :- caused(Variable, Value, T), time(T). +holds(Variable, Value, T) :- holds(Variable, Value, T - 1), not modified(Variable, T), time(T), time(T - 1). + +% Check that variables have unique values +:- variable(Variable), not 1 {holds(Variable, Value, T) : contains(Variable, Value)} 1, time(T). + +% Check mutexes +:- mutexGroup(MutexGroup), not {holds(Variable, Value, T) : contains(MutexGroup, Variable, Value)} 1, time(T). + +% Verify that goal is met +:- goal(Variable, Value), not holds(Variable, Value, horizon). + +#show occurs/2. From 58e784408c5d1274e834aed513791b652db1151f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Tue, 22 Nov 2016 02:17:07 +0100 Subject: [PATCH 2/2] Fixed incorrect build status badge in readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index def6fc1..ca6278a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# plasp [![GitHub Release](https://img.shields.io/github/release/potassco/plasp.svg?maxAge=3600)](https://github.com/potassco/plasp/releases) [![Build Status](https://img.shields.io/travis/potassco/plasp/develop.svg?maxAge=3600&label=build (master))](https://travis-ci.org/potassco/plasp?branch=master) [![Build Status](https://img.shields.io/travis/potassco/plasp/develop.svg?maxAge=3600&label=build (develop))](https://travis-ci.org/potassco/plasp?branch=develop) +# plasp [![GitHub Release](https://img.shields.io/github/release/potassco/plasp.svg?maxAge=3600)](https://github.com/potassco/plasp/releases) [![Build Status](https://img.shields.io/travis/potassco/plasp/master.svg?maxAge=3600&label=build (master))](https://travis-ci.org/potassco/plasp?branch=master) [![Build Status](https://img.shields.io/travis/potassco/plasp/develop.svg?maxAge=3600&label=build (develop))](https://travis-ci.org/potassco/plasp?branch=develop) > Translate PDDL to ASP