252
Ph. D. Jointly submitted at the Institut National des Sciences Appliqu´ ees de Lyon (Ecole Doctorale Informatique, Information pour la Soci´ et´ e) and the Universidad de las Am´ ericas-Puebla (School of Engineering, Deparment of Computer Science). By Claudia ZEPEDA CORT ´ ES On December 12 th , 2005 “Evacuation Planning using Answer Set Programming” ——————————————————– PhD Committee Chair, Pr. Herv´ e MARTIN, U. Joseph Fourier, Grenoble, France Tutors: Reviewers: Pr. Robert Laurini, INSA of Lyon Dr. Fran¸ cois Fages, INRIA, Paris Dr. Christine Solnon, C. Bernard U. of Lyon Dr. Jos´ e Arrazola Ram´ ırez, BUAP Dr. Mauricio Osorio Galindo, UDLA-Puebla Examiner: Dr. David Sol Mart´ ınez, UDLA-Puebla Dr. Guillermo Morales Luna, CINVESTAV

Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

  • Upload
    donhan

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Ph. D.

Jointly submitted atthe Institut National des Sciences Appliquees de Lyon

(Ecole Doctorale Informatique, Information pour la Societe)and the Universidad de las Americas-Puebla

(School of Engineering, Deparment of Computer Science).

By

Claudia ZEPEDA CORTES

On December 12th, 2005

“Evacuation Planning using Answer Set Programming”

——————————————————–PhD Committee Chair, Pr. Herve MARTIN, U. Joseph Fourier,

Grenoble, France

Tutors: Reviewers:Pr. Robert Laurini, INSA of Lyon Dr. Francois Fages, INRIA, ParisDr. Christine Solnon, C. Bernard U. of Lyon Dr. Jose Arrazola Ramırez, BUAPDr. Mauricio Osorio Galindo, UDLA-Puebla Examiner:Dr. David Sol Martınez, UDLA-Puebla Dr. Guillermo Morales Luna, CINVESTAV

Page 2: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

ii

Page 3: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

iii

Page 4: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

iv

Page 5: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

v

Page 6: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

vi

Page 7: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Thanks to my mexican advisors:

Dr. Mauricio Osorio and

Dr. David Sol.

Thanks to my french advisors:

Pr.Robert Laurini, and

Dra. Christine Solnon.

Thanks to my mother, father and family.

Thanks to the outside readers:

Dr. Jose Arrazola,

Dr. Francois Fages,

Dr. Guillermo Morales, and

Pr. Herve Martin.

Thanks to all my friends.

Page 8: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Acknowledgments

This work has been supported by:

• Laboratoire Franco-Mexicain d’Informatique (LAFMI). Project: SIRPO.

• The Mexican Council of Science and Technology (CONACyT) Ref. No. W 35804

A.

• The Mexican Council of Science and Technology (CONACyT) Ref. No. 37837-A.

• Universidad de las Americas, Puebla (UDLAP).

• Institut National des Sciences Appliquees de Lyon (INSA).

Page 9: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Contents

Prolog vi

Abstract 1

1 Resumen en Espanol 1

1.1 Introduccion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Antecedentes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.2.1 Answer Set Programming . . . . . . . . . . . . . . . . . . . . . 3

1.2.2 Programas-RC y Programas Abductivos . . . . . . . . . . . . . 6

1.2.3 Programas Logicos con Disyuncion Ordenada . . . . . . . . . . 7

1.2.4 Planificacion en Answer Sets . . . . . . . . . . . . . . . . . . . . 8

1.2.5 Un lenguaje para preferencias de planes: Lenguaje PP . . . . . 11

1.3 Contribucion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

1.3.1 Programas Logicos con Disyuncion Ordenada Extendidos . . . . 13

1.3.2 Answer Set Mınimos Generalizados y Disyuncion Ordenada . . . 15

1.3.3 Preferencias en terminos de programas con Disyuncion Ordenada

Extendidos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

1.3.4 Informacion geografica . . . . . . . . . . . . . . . . . . . . . . . 18

1.3.5 Problema de plan de evacuacion . . . . . . . . . . . . . . . . . . 19

Usando reglas-RC . . . . . . . . . . . . . . . . . . . . . . . . . . 20

ii

Page 10: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CONTENTS iii

Usando el Lenguaje PP . . . . . . . . . . . . . . . . . . . . . . 21

1.3.6 Extendiendo el Lenguaje PP . . . . . . . . . . . . . . . . . . . 22

1.3.7 Contenido Semantico . . . . . . . . . . . . . . . . . . . . . . . . 22

1.4 Conclusiones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2 Resume en Francais 24

2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

2.2 Etat de l’ art . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

2.2.1 Answer Set Programming . . . . . . . . . . . . . . . . . . . . . 26

2.2.2 CR-Programmes et Programmes Abductifs . . . . . . . . . . . . 29

2.2.3 Programmes Logiques avec Disjonction Ordonnee . . . . . . . . 31

2.2.4 Planification dans Answer Sets . . . . . . . . . . . . . . . . . . 32

2.2.5 Un langage pour des preferences de plans: le Langage PP . . . 34

2.3 Contribucion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

2.3.1 Programmes Logiques avec Disjonction Ordonnee Etendue . . . 36

2.3.2 Answer Set Minimum Generalise et Disjonction ordonnee . . . . 38

2.3.3 Preferences en termes de programme avec Disjonction Ordonnee

Etendue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

2.3.4 Information geographique . . . . . . . . . . . . . . . . . . . . . 41

2.3.5 Probleme de plan d’evacuation . . . . . . . . . . . . . . . . . . . 42

En utilisant les CR-regles . . . . . . . . . . . . . . . . . . . . . 43

En utilisant le Langage PP . . . . . . . . . . . . . . . . . . . . 44

2.3.6 En etendant le Langage PP . . . . . . . . . . . . . . . . . . . . 45

2.3.7 Contenu Semantique . . . . . . . . . . . . . . . . . . . . . . . . 45

2.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

Introduction 46

Page 11: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CONTENTS iv

Background Part 54

3 Evacuation Planning 56

3.1 Volcanic emergency management . . . . . . . . . . . . . . . . . . . . . 56

3.2 Emergency management in the Popocatepetl volcano . . . . . . . . . . 58

3.3 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

4 Answer Set Programming 60

4.1 Answer Set Programming framework . . . . . . . . . . . . . . . . . . . 60

4.2 Answer sets in terms of Intuitionistic Logic . . . . . . . . . . . . . . . . 62

4.3 Additional Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

4.4 Programs with predicate symbols and variables . . . . . . . . . . . . . 64

4.5 Adding sorts to Answer Set Programming framework . . . . . . . . . . 66

4.6 Answer Set Solvers and systems used in this work . . . . . . . . . . . . 67

4.7 CR-Programs and Abductive Logic Programs . . . . . . . . . . . . . . 69

4.8 Logic Programs with Ordered Disjunction . . . . . . . . . . . . . . . . 73

4.9 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

5 Planning problems 75

5.1 Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

5.2 Answer Set Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

5.2.1 Language A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

5.2.2 Answer set encoding of planning problems modeled in language A 82

5.2.3 Language B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.3 A language for Planning Preferences: PP Language . . . . . . . . . . . 90

5.3.1 Computing answer sets of planning problems with preferences . 93

5.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

Page 12: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CONTENTS v

Contribution Part 94

Introducction 96

6 Extended ordered disjunction programs 99

6.1 Definition of extended ordered disjunction programs . . . . . . . . . . . 100

6.2 Translation from an abductive logic program to a standard ordered dis-

junction program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

6.3 Preferences in terms of extended ordered programs with double negation 109

6.3.1 Computing preferred answer sets for extended ordered programs 123

6.3.2 Obtaining the maximal answer sets of a program with respect to

a set of atoms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

6.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

7 Modeling evacuation plan problems 133

7.1 Evacuation plan problem information . . . . . . . . . . . . . . . . . . . 134

7.2 Procedure to construct the hazard zone background knowledge . . . . . 136

7.3 Popocatepetl volcano information . . . . . . . . . . . . . . . . . . . . . 139

7.4 Example: Background knowledge of a hazard zone . . . . . . . . . . . . 140

7.5 Complexity of evacuation plan problems . . . . . . . . . . . . . . . . . 141

7.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

8 Alternative evacuation plan problem 144

8.1 Alternative evacuation plan problem assumptions . . . . . . . . . . . . 146

8.2 Using Consistency Restoring Programs . . . . . . . . . . . . . . . . . . 152

8.2.1 Using standard ordered disjunction programs to compute the al-

ternative evacuation plans from a CR-Program . . . . . . . . . . 156

8.3 Using PP Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

Page 13: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CONTENTS vi

8.3.1 Computing answer sets of planning problems with preferences

using extended ordered disjunction programs . . . . . . . . . . . 165

8.4 Extending PP language with parametric basic desires . . . . . . . . . . 168

8.5 Language PP and Temporal Logic . . . . . . . . . . . . . . . . . . . . 173

8.5.1 Inheriting the LTL framework to PP . . . . . . . . . . . . . . . 173

8.5.2 Taking advantage of the working framework of LTL . . . . . . . 175

8.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

9 Semantic Contents 177

9.1 Semantic Contents definition . . . . . . . . . . . . . . . . . . . . . . . . 178

9.2 Some properties of the semantic contents . . . . . . . . . . . . . . . . . 179

9.3 Finding variants of answer sets from semantic contents . . . . . . . . . 184

9.3.1 Answer sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186

9.3.2 Partial answer sets . . . . . . . . . . . . . . . . . . . . . . . . . 188

Using Partial answer sets to restore consistency . . . . . . . . . 191

9.3.3 Generalized answer sets . . . . . . . . . . . . . . . . . . . . . . 193

9.3.4 Minimal generalized answer sets . . . . . . . . . . . . . . . . . . 197

9.3.5 Compositionality of programs . . . . . . . . . . . . . . . . . . . 202

9.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

10 Conclusions 204

A Ejemplos 208

B Exemples 218

Bibliography 229

Page 14: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Prolog

This thesis corresponds to a Ph. D. jointly submitted at the UDLA in Mexico and

the INSA in France. Then it is included a summary of this work twice, one written

in Spanish (Chapter 1) and the other in French (Chapter 2). Of course, it is always

possible to skip these summaries and read the complete version of this thesis that is

written in English.

Page 15: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Abstract

Currently, people involved in protection against disaster situations must make the de-

cisions about preparing and executing evacuation plans for potential causes of disaster.

Hence, it would be desirable to develop a system capable of obtaining and analyz-

ing evacuation plans based on knowledge about their particular environment, the ge-

ographic data and their own capabilities, and of exchanging information and services

with similar systems as well as with persons. A possible formalism used to develop

such system could be Answer Set Programming (ASP). ASP is a declarative knowledge

representation and logic programming language[14]. ASP represents a new paradigm

for logic programming that allows, using the concept of negation as failure, to handle

problems with default knowledge and produce non-monotonic reasoning.

Specifically, the objective of our work is to investigate and evaluate the capabilities

of Answer Set Programming to represent disaster situations in order to give support in

defining evacuation plans.

The motivation of our work is based on the idea that ASP posses most of the

capabilities that would be desirable that such system should have: It is possible translate

geographic information into a format that ASP can handle. There exists Answer Set

Planning that provides a natural and elegant way to model planning problems [16].

ASP uses the concept of negation as failure that allows us to express exceptions and

represent incomplete knowledge. In ASP there exist different approaches to express

Page 16: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

preferences. ASP allows to express restrictions.

In order to investigate and evaluate the capabilities of ASP to represent disaster

situations we studied the format of geographic information. Based in our own experience

we introduce a procedure to construct the hazard zone background knowledge from non

spatial part of the geographic information.

Normally, in a zone in risk there is a set of pre-defined evacuation routes. However,

in a real case it is possible that part of the pre-defined evacuation routes become blocked.

In this case definition of alternative evacuation plans are needed. We use Consistency

Restoring rules (CR-rules) in order to obtain the alternative evacuation plans. We

also prove that programs with CR-rules can be properly represented using ordered

disjunction logic programs (ODLP).

The alternative evacuation routes obtained using CR-rules do not consider any other

characteristic of the path that they follow. Hence, we propose to use language PP in

order to express preferences at different levels over the alternative plans. We also

define PPpar language, as an extension of PP language where the connectives allow to

represent compactly preferences having a particular property. Additionally, we present

a brief overview about the relationship between language PP and propositional Linear

Temporal Logic (LTL), since we consider that language PP could take advantage of

the working framework of LTL to express preferences.

We also propose an extension of ODLP to a wider class of logic programs. Moreover,

we show that in particular extended ordered rules with negated negative literals could

be useful to allow a simpler and easier encoding of obtaining the preferred plans w.r.t

preferences expressed in PP .

Finally, we introduce the notion of Semantic Contents of a program as an alternative

point of view to obtain different answer set semantics of a program. One of them is a

new semantics introduced in this work, called partial answer sets.

Page 17: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Chapter 1

Resumen en Espanol

1.1 Introduccion

Actualmente, los responsables de la proteccion contra situaciones de desastre deben

tomar decisiones sobre la preparacion y ejecucion de los planes de evacuacion con-

siderando causas potenciales de desastre. Por lo tanto, serıa deseable desarrollar un

sistema capaz de obtener y de analizar los planes de la evacuacion. Donde este sistema

este basado en el conocimiento sobre su ambiente particular, los datos geograficos y sus

propias capacidades. Ademas, debe ser capaz de intercambiar informacion y servicios

con sistemas similares ası como con las personas. Un formalismo que proponemos para

desarrollar tal sistema es Answer Set Programming (ASP). ASP es un lenguaje de pro-

gramacion logico y declarativo para la representacion del conocimiento [14]. ASP repre-

senta un nuevo paradigma para la programacion logica que permite, manejar problemas

con conocimiento por defecto y razonamiento no-monotonico mediante con el concepto

de la negacion como falla.

Especıficamente, el objetivo de nuestro trabajo es investigar y evaluar las capaci-

dades de ASP para representar situaciones del desastre con el objetivo de dar ayuda

en la definicion de planes de evacuacion. La motivacion de nuestro trabajo se baso

1

Page 18: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

en la idea que ASP cuanta con muchas de las capacidades que tal sistema debe tener:

Es posible traducir la informacion geografica a un formato que ASP pueda manejar.

Existe Answer Set Planning que proporciona una manera natural y elegante de mode-

lar los problemas de planificacion [16]. ASP utiliza el concepto de negacion como falla

que permite expresar excepciones, restricciones y representar conocimiento incompleto.

Ademas en ASP existen diversos enfoques para expresar preferencias.

Para lograr nuestro objetivo, comenzamos estudiando el formato de la informacion

geografica. Basados en nuestra propia experiencia proponemos un procedimiento para

extraer el conocimiento necesario para representar la zona del peligro a partir de la

informacion geografica. Ademas consideramos que normalmente en una zona en riesgo

hay un conjunto de rutas de evacuacion predefinidas. Sin embargo, en un caso real es

posible que parte de estas rutas predefinidas se bloqueen. En este caso la definicion

de planes de evacuacion alternativos es necesaria. Utilizamos Reglas para restaurar

consistencia (reglas-RC) para obtener los planes de evacuacion alternativos. Tambien

mostramos que los programas con reglas-RC se pueden representar correctamente u-

sando programas con disyuncion ordenada (ODLP).

Utilizamos el Lenguaje PP para expresar preferencias a diversos niveles sobre los

planes alternativos. Definimos el lenguaje PPpar, como extension del lenguaje PPdonde sus conectivos permiten que representemos de forma compacta las preferencias

que tienen una caracterıstica en particular. Ademas, en este trabajo presentamos una

breve descripcion sobre la relacion entre la lenguaje PP y la logica lineal proposicional

temporal (LTL), puesto que consideramos que el lenguaje PP podrıa tomar ventaja

del marco de trabajo de LTL para expresar preferencias.

Tambien desarrollamos una extension de ODLP a una clase mas amplia de pro-

gramas logicos. Es importante mencionar que un subconjunto de estos programas son

utiles para permitir una codificacion mas simple y mas facil de obtener los planes

2

Page 19: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

preferidos con respecto a las preferencias expresadas en PP . Finalmente, introducimos

la nocion de Contenido Semantico de un programa como un punto de vista alternativo

para obtener variantes de la semantica de Answer Sets. Una de estas variantes es una

nueva semantica que introducimos en este trabajo, llamada answer sets parciales.

1.2 Antecedentes

1.2.1 Answer Set Programming

El uso de Answer Set Programming (ASP) permite describir un problema computa-

cional como un programa logico cuyos answer sets corresponden a las soluciones de

problema dado. En este trabajo, un programa es interpretado como una teorıa proposi-

cional y la unica negacion usada es la negacion como falla. Para lectores no familiari-

zados con este enfoque, recomendamos [38, 33] como lectura posterior. Por lo tanto

nuestra discusion se limita a programas proposicionales.

Usamos el lenguaje de la logica proposicional de la manera usual, donde los sımbolos

proposicionales son p, q, . . . ; los conectivos proposicionales son ∧,∨,→,⊥, y los sımbolos

auxiliares son (, ). Una formula proposicional bien formada es definida inductivamente

como sigue: Un sımbolo proposicional es una formula proposicional bien formada. Si f

y g son formulas proposicionales bien formadas, entonces tambien lo son ¬f , f∧g, f∨g,

f → g. Una formula proposicional bien formada puede ser llamada solo formula. Un

atomo es un sımbolo proposicional. Dada cualquier formula bien formada f , asumimos

que ¬f es exactamente la abreviacion de f → ⊥ y > es la abreviacion de ⊥ → ⊥.

Hacemos enfasis en que la unica negacion usada en este trabajo es la negacion como

falla y es representada por el sımbolo ¬. Vale la pena mencionar que siempre es posible

manejar la otra negacion llamada clasica o tambien negacion fuerte, denotada por

3

Page 20: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

−, por medio de transformar los atomos con negacion clasica [15]. Cada atomo con

negacion clasica, −a, que ocurre en la formula es sustituido por un nuevo atomo, a◦,

y la regla ¬(a ∧ a◦) es agregada. La regla ¬(a ∧ a◦) puede tambien ser escrita como

(a ∧ a◦) → ⊥ basada en el hecho de que ¬f es solo una abreviacion de f → ⊥.

La firma de un programa P , denotada como LP , es el conjunto de atomos que

ocurren en P . Una literal es cualquier atomo p (una literal positiva) o la negacion de

un atomo ¬p (una literal negativa). Una literal negada es el signo de negacion ¬ seguido

por una literal, i.e. ¬p or ¬¬p. En particular, f → ⊥ es llamada restriccion y tambien

es denotada como ← f . Una teorıa regular o programa logico es solo un conjunto de

formulas bien formadas, y puede ser llamado solamente teorıa o programa cuando no

surjan ambiguedades.

En algunas definiciones usamos logica intuicionista, la cual sera denotada por I.

Para un conjunto dado de atomos M y un programa P , escribiremos P `I M para

abreviar [27] para toda a ∈ M . Para un conjunto dado de atomos M y un programa

P , escribiremos P °I M para denotar que: P `I M y que P es consistente con respecto

a I (es decir, que no hay una formula A tal que P `I A y P `I ¬A). Algunas veces

escribiremos ` en lugar de `I cuando no surjan ambiguedades. Ahora definimos los

answer sets (o modelos estables) de programas logicos. La semantica de answer sets fue

primero definida en terminos de la ası llamada reduccion Gelfond-Lifschitz [14] donde

es estudiada en el contexto de transformaciones sobre el programa dependientes de la

sintaxis. Nosotros seguimos un enfoque alternativo estudiado por Pearce [38] y tambien

estudiado por Osorio et.al. [33]. Este enfoque caracteriza los answer sets de una teorıa

proposicional en terminos de logica intuicionista y es presentada en el siguiente teorema.

La notacion esta basada en [33].

Theorem 1.1. Sea P una teorıa y M un conjunto de atomos. M es un answer set

4

Page 21: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

para P sii P ∪ ¬(LP \M) ∪ ¬¬M °I M .

Como notacion adicional que sera utilizada en el resto de este trabajo tenemos lo

siguiente: Un conjunto finito de formulas P es consistente [27] si no hay alguna formula

A tal que A y ¬A sean teoremas de P . Un conjunto finito de formulas P es completo

[27] si, para cualquier formula A de P , P ` A o P ` ¬A. Un conjunto finito de formulas

P ′ es una extension de un conjunto finito de formulas P [27] si cada teorema de P es

un teorema de P ′. Dados dos conjuntos X y Y , escribimos X ⊂ Y para denotar que

X ⊆ Y and X 6= Y .

Como de costumbre en Answer Set Programming, consideramos que un programa

con sımbolos del predicado es solamente una abreviatura del programa sin variables,

denotado como sinV ariables(P ).

En algunos casos, necesitamos modelar algunos problemas usando sımbolos del

predicado con variables, donde estas variables deben ser instanciadas solamente con

un subconjunto del universo de Herbrand del programa. Esta clase de programas se

llama programas de clases con sımbolos de predicado [4]. Por ejemplo, utilizaremos pro-

gramas de clases con sımbolos de predicado cuando estudiamos la codificacion de un

problema de planificacion en la seccion 1.2.4.

Actualmente, hay varios resolvedores para Answer Sets. En este trabajo hemos

usado DLV1 , SMODELS2 , un frontend para DLV llamado DLVK3 , una modifi-

cacion de SMODELS que puede ser usada para obtener los answer sets preferidos bajo

la semantica de Disyuncion Ordenada llamado PSMODELS, y el Logics Workbench

(LWB)4 que nos permite trabajar con logica Intucionista [38].

1 http://www.dbai.tuwien.ac.at/proj/dlv/2 http://www.tcs.hut.fi/Software/smodels/3 http://www.dbai.tuwien.ac.at/proj/dlv/K/4 http://www.lwb.unibe.ch/about/index.html

5

Page 22: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

1.2.2 Programas-RC y Programas Abductivos

Las reglas para restaurar consistencia (reglas-RC) son las reglas que se agregan a los

programas logicos disyuntivos estandares, pero se aplican solamente cuando las reglas

regulares (las reglas estandar) en el programa conducen a inconsistencia. Una regla-

RC es escrita como α+← β, lo cual se lee intuitivamente como: Si el programa es

inconsistente, entonces asumimos α ← β. En otro caso, ignore la regla. Recordamos el

siguiente ejemplo presentado en [3], puesto que ilustra claramente el uso de las reglas-

RC. En este ejemplo r1 denota el nombre de la regla-RC.

a ← ¬b.

¬ a.

r1 : b+← .

Las primeras dos reglas son reglas regulares y la tercera regla es una regla-RC. Esta

clase de programas sera llamada CR-programas. Podemos ver que el programa sin la

regla-RC es inconsistente. Sin embargo, si la regla-RC se utiliza entonces se restaura la

consistencia, ası el answer set {¬a, b} es obtenido.

La semantica de los programas-RC se define en terminos de los answer sets mınimos

generalizados. En [3] los autores dan una traduccion de programas-RC a programas

logicos abductivos, que llaman hard reduct, y la semantica se define como los answer

sets mınimos generalizados del hard reduct del programa.

Las definiciones siguientes se encuentran en [3]:

Definition 1.1. [3] Un programa logico abductivo es un par 〈P, A〉 donde P es un

programa arbitrario y A un conjunto de atomos, llamado abducibles.

Definition 1.2. [3] Sea 〈P, A〉 programa logico abductivo y ∆ ⊆ A. Decimos que

M(∆) es un answer set generalizado de P con respecto a A sii M(∆) es un answer set

de P ∪∆.

6

Page 23: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Definition 1.3. [3] Sean M(∆1) y M(∆2) dos answer sets generalizados de P con

respecto a A. Definimos M(∆1) < M(∆2) sii ∆1 ⊂ ∆2 (orden por inclusion de conjun-

tos).

Definition 1.4. Sea P un programa y sea A un conjunto de atomos. M(∆) es un

answer set mınimo generalizado de P con respecto a A y el orden < sii M(∆) es

un answer set generalizado de P y es mınimo con respecto al orden por inclusion de

conjuntos.

Finalmente, el ejemplo siguiente ilustra como la semantica de los programas-RC se

define en terminos de los answer sets mınimos generalizados.

Example 1.1. Sea P1 = {p ← ¬q. r ← ¬s. q ← t. s ← t. ← p, r} el programa del

Ejemplo 4 introducido en [3]. Podemos ver que el programa P1 no tiene answer sets.

Sin embargo, para restaurar consistencia, podemos definir un Programa-RC que agrega

algunas reglas-RC. Por ejemplo, definamos el Programa-RC P ′1 = P1 ∪ CR1 donde

CR1 = {r1 : q+←, r2 : s

+←, r3 : t+←}. Como mencionamos, la semantica de P ′

1 esta

definida en terminos de los answer sets mınimos generalizados. Entonces, traduciendo

P ′1 en un programa logico abductivo obtenemos 〈P1, A〉 donde el conjunto de abducibles

es A = {q, s, t}. Podemos verificar que los answer sets mınimos generalizado de P1 son

{q, r}, {s, p} y {t, q, s}.

1.2.3 Programas Logicos con Disyuncion Ordenada

En [7], Brewka introdujo los Programas Logicos con Disyuncion Ordenada, abreviados

como LPODs. Para definir esta clase de programas, el conectivo ×, llamado disyuncion

ordenada, se agrega al sistema de conectivos para formulas proposicionales presentados

en la Seccion 1.2.1. La intuicion detras de los LPODs es expresar conocimiento por falla

7

Page 24: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

con conocimiento sobre preferencias de una manera simple y elegante [9]. Como hemos

mencionado en la Seccion 1.2.1, en este trabajo estamos considerando solamente un tipo

de negacion, negacion como falla, pero esto no afecta la validez de los resultados dados

en [7]. Formalmente, un programa logico con disyuncion ordenada es un conjunto de

reglas de la forma:

C1 × . . .× Cn ← A1, . . . , Am,¬B1, . . . ,¬Bk (1.1)

donde Ci, Aj y Bl son todos atomos sin varables. C1 . . . Cn son normalmente llamados

las opciones de una regla y su lectura intuitiva es la siguiente: Si el cuerpo es verdadero

y C1 es posible, entonces C1; si C1 no es posible, entonces C2; . . . ; si ninguno de

C1, . . . , Cn−1 es posible entonces Cn. Algunos casos especiales se pueden precisar, n = 0

(restricciones), n = 1 (programas extendidos), m = k = 0 (hechos). La semantica de

los programas logico con disyuncion ordenada sera presentada en la Seccion 1.3.1

donde una extension de los programas logicos con disyuncion ordenada se presenta.

Actualmente, hay una modificacion de SMODELS5 que se puede utilizar para el calculo

del los answer set preferidos de los programas logicos con disyuncion ordenada llamada

PSMODELS6 [9].

1.2.4 Planificacion en Answer Sets

En un problema del planificacion, estamos interesados en buscar una secuencia de a-

cciones que conduzca de un estado inicial dado a un estado que define la meta. Para

especificar totalmente un problema del planificacion, necesitamos indicar que acciones

se permiten en un plan. La planificacion en Answer Sets usa lenguajes de acciones para

especificar los efectos de acciones y en particular son usados para modelar problemas

5 http://www.tcs.hut.fi/Software/smodels/6 http://www.tcs.hut.fi/Software/smodels/priority/

8

Page 25: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

de planificacion [16]. Algunos de estos lenguajes de accion son A,B, y C [16]. Por otra

parte, un problema del planificacion especificado en estas clases de lenguajes tiene una

codificacion natural y facil en Answer Set Programming.

Languaje A. El alfabeto del lenguaje A consiste de dos conjuntos no vacıos y

disjuntos de sımbolos F llamado el conjunto de fluentes, y A llamado el conjunto de

acciones. Intuitivamente, un fluente expresa una caracterıstica de un objeto en un

mundo, y forma parte de la descripcion de los estados del mundo. Una literal fluente

es un fluente o un fluente precedido por ∼. Un estado σ es un conjunto de fluentes.

Decimos que un fluente f se cumple en un estado σ si f ∈ σ. Decimos que un fluente

literal ∼ f se cumple en σ si f 6∈ σ. Cuando las acciones son ejecutadas exitosamente

cambian el estado del mundo. Las situaciones son representaciones de la historia de la

ejecucion de acciones. La situacion inicial [an, . . . , a1] corresponde a la historia donde

la accion a1 se ejecuta en la situacion inicial, seguida por a2, y ası hasta an. Hay una

relacion simple entre situaciones y estados. En cada situacion s algunos fluentes son

verdaderos y algunos otros son falsos.

El lenguaje A se puede dividir en tres sub-languajes: lenguaje para descripcion del

dominio, lenguaje de observacion y lenguaje de consulta. Dado un problema del pla-

nificacion, este puede ser expresado en una lenguaje de acciones por medio de un triple

(D, O, G) tal que D es la descripcion del dominio, O es el conjunto de observaciones y

G es el conjunto de condiciones de la meta. Por otra parte, es posible definir una co-

dificacion en Answer Sets de este problema de planificacion especificado en un lenguaje

de acciones, denotada como π(D, O, G, l), donde l es un numero entero positivo que

corresponde a la longitud del plan, es decir, el numero de las acciones que se deben

realizar para alcanzar la meta.

Entonces, es posible obtener la solucion del problema de planificacion (los planes)

de los answer sets de π(D, O, G, l). La idea basica es que decidimos sobre una longitud

9

Page 26: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

del plan l para enumerar ocurrencias de las acciones hasta los puntos del tiempo que

corresponden a esa longitud, y codificar las metas como restricciones acerca del tiempo

l + 1, tales que los answer sets que codifican las ocurrencias de las acciones que no

satisfacen la meta en el tiempo l + 1 son eliminados. Ası cada uno de los answer sets

que sobreviven a las restricciones corresponde a un plan. Es importante mencionar

que en la codificacion en Answer Sets de los problemas de planificacion expresados en

lenguaje A, si f es un literal fluente negativa ∼ g entonces f sera codificada como

neg(g), donde, neg(g) corresponde la negacion clasica.

Los detalles de estos sublenguajes y como obtener la codificacion de un problema

del planificacion de una especificacion en un lenguaje de acciones pueden encontrarse

en [16, 4]. Presentamos solamente un ejemplo que muestra como especificar el problema

simple del planeacion del mundo de los bloques en lenguaje A que proviene de [4].

Example 1.2. El problema de planificacion de los cubos puede ser expresado en

lenguaje A como sigue:

1. Clase: block(X). En el resto de este ejemplo, X y Y varıan en la clase block.

2. Fluentes: on(X, Y ), ontable(X), clear(X), holding(X), handempty

3. Acciones: pick up(X), put down(X), stack(X,Y ), unstack(X, Y )

4. Condiciones de ejecucion, denotadas por D:

executable pick up(X) if clear(X), ontable(X), handempty.

executable put down(X) if holding(X).

executable stack(X, Y ) if holding(X), clear(Y ).

executable unstack(X, Y ) if clear(X), on(X, Y ), handempty.

5. Proposiciones de efecto.

pick up(X) causes ∼ ontable(X),∼ clear(X), holding(X),∼ handempty.

10

Page 27: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

put down(X) causes ontable(X), clear(X),∼ holding(X), handempty.

stack(X,Y ) causes ∼ holding(X),∼ clear(Y ), clear(X), handempty, on(X, Y ).

unstack(X, Y ) causes holding(X), clear(Y ),∼ clear(X),∼ handempty,∼ on(X, Y ).

6. Considerando la clase block como {a, b, c, d} las condiciones iniciales, denotadas

por I, son descritas como:

initially(clear(a)). initially(clear(c)). initially(clear(d)). initially(handempty).

initially(ontable(c)). initially(ontable(b)). initially(on(a, b)). initially(on(d, c)).

7. Las condiciones de meta, denotadas por G, son el conjunto de literales

{on(a, c), on(c, b), ontable(d)}.

El Lenguaje B resulta cuando el Lenguaje A es extendido para permitir proposi-

ciones de causa estaticas. Usando proposiciones de causa estaticas podemos expresar

conocimiento acerca de los estados en base a los estados que son posibles o validos. Este

conocimiento puede ser usado indirectamente para inferir efectos de acciones, ejecutabi-

lidad de las acciones o ambas. Mas detalles acerca de proposiciones de causa estaticas y

codificacion de problemas expresados en Lenguaje B pueden ser encontrados en [16, 4].

1.2.5 Un lenguaje para preferencias de planes: Lenguaje PP

El lenguaje PP [43] permite la especificacion de preferencias del usuario. Ademas

PP cuenta con una implementacion en programacion logica, basada en Answer Set

Programming. El lenguaje PP permite especificar preferencias entre posibles planes

y tambien preferencias temporales sobre los planes. Las preferencias que representan

tiempo son expresadas usando los conectivos temporales next, always, until y eventually.

Hay tres clases de preferencias en PP [43] deseos basicos, preferencias atomicas y prefe-

rencias generales . En este trabajo estudiamos las dos primeras clases de preferencias

11

Page 28: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

porque ellas fueron utiles para expresar preferencias en los planes de evacuacion.

Un deseo basico, denotado como ϕ, es una formula de PP que expresa una preferen-

cia sobre una trayectoria con respecto a la ejecucion de una cierta accion o con respecto

a los estados que la trayectoria llega cuando se ejecuta una accion.

Una preferencia atomica representa un orden entre formulas de deseo basico. Indica

que las trayectorias que satisfacen ϕ1 son preferibles a los que satisfagan ϕ2, etc. Clara-

mente, las formulas de deseo basico son casos especiales de las preferencias atomicas.

1.3 Contribucion

Recordemos que el objetivo de nuestro trabajo es investigar y evaluar las capacidades de

Answer Set Programming para representar situaciones del desastre con el fin de apoyar

en la definicion de planes de la evacuacion. Para ello comenzamos a analizar como la

informacion geografica de la zona de desastre a modelar se puede traducir a un formato

que Answer Sets es capaz de manejar. Continuamos estudiando y aplicando diversos

enfoques en Answer Sets que son utiles para definir los planes de la evacuacion, tales

como, Programas-RC, Programas Logicos con Disyuncion Ordenada, planificacion en

Answer Sets, el lenguaje para preferencias de planes y los answer sets mınimos general-

izados. Especıficamente, definimos la extension de Programas Logicos con Disyuncion

Ordenada y vimos su utilidad. Ademas se presento como y porque los enfoques en

Answer Sets mencionados se aplican para definir planes de la evacuacion y tambien se

presentaron algunas debilidades de estos enfoques que este trabajo trata.

12

Page 29: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

1.3.1 Programas Logicos con Disyuncion Ordenada Extendi-

dos

En [7] la cabeza de las reglas con disyuncion ordenada es definida en terminos de literales

sin variables. En esta seccion, la cabeza y el cuerpo para reglas con disyuncion orde-

nada extendidas son definidos en terminos de formulas porposicionales bien formadas.

Consideramos que una sintaxis mas amplia para estas reglas podrıa darnos algunas

ventajas. Por ejemplo, el uso de expresiones jerarquizadas podrıa simplificar la tarea

de escribir programas logicos y mejorar su legibilidad puesto que podrıa permitirnos

escribir reglas mas cortas y de una manera mas natural.

Definition 1.5. Una regla con disyuncion ordenada extendida es una formula proposi-

cional bien formada como se definio en la Seccion 1.2.1, o una formula de la forma:

f1 × . . .× fn ← g (1.2)

donde f1, . . . , fn, g son formulas proposicionales bien formadas. Un programa con

disyuncion ordenada extendido es un conjunto finito de reglas con disyuncion ordenada

extendida.

Las formulas f1 . . . fn generalmente son llamadas las opciones de una regla y su

lectura intuitiva es como sigue: si el cuerpo es verdadero y f1 es posible, entonces

f1; si f1 no es posible, entonces f2; . . . ; si ninguno de f1, . . . , fn−1 es posible entonces

fn. El caso particular donde toda fi es una literal y g es una conjuncion de literales

corresponde a los programas con disyuncion ordenada originales segun lo presentado

por Brewka en [7], y que llamaremos programas con disyuncion ordenada estandar.

Recordamos que los programas con disyuncion ordenada estandar de Brewka utilizan

el conectivo para la negacion fuerte.

13

Page 30: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Aquı consideraremos solamente un tipo de negacion (negacion como falla) pero esto

no afecta los resultados dados en [7]. Si n = 0 la regla es ademas una restriccion, es

decir, ⊥ ← g. Si n = 1 es una regla extendida y si g = > la regla es un hecho y se

puede escribir como f1 × . . . × fn. Ahora, presentamos la semantica de los programas

con disyuncion ordenada extendidos. La mayorıa de las definiciones presentadas aquı

se toman de [7, 9].

Definition 1.6. [7]Sea r := f1 × . . . × fn ← g una regla con disyuncion ordenada

extendida. Para 1 ≤ k ≤ n la k-esima opcion de r es definida como sigue: rk := (fk ←g,¬f1, . . .¬fk−1).

Definition 1.7. [7] Sea P un programa con disyuncion ordenada extendido. P ′ es un

programa particionado de P si es obtenido por reemplazar cada regla r := (f1 × . . .×fn ← g) en P por una de sus opciones r1, . . . , rk. M es un answer set de P sii es un

answer set7 de un programa particionado P ′ de P .

Definition 1.8. [7]Sea M un answer set de un programa con disyuncion ordenada

extendido P y sea r := (f1 × . . . × fn ← g) una regla de P . Definimos el grado de

satisfaccion de r con respecto a M, denotado por degM(r), como sigue:

—si M ∪ ¬(LP \M) 6`I g, entonces degM(r) = 1.

— si M ∪¬(LP \M) `I g entonces degM(r) = min1≤i≤n {i | M ∪ ¬(LP \M) `I fi}.

El teorema siguiente indica la relacion entre los answer sets de un programa con

disyuncion ordenada extendido y el grado de satisfaccion de cada regla en el programa.

Theorem 1.2. [7] Sea P un programa con disyuncion ordenada extendido. Si M es

un answer set of P entonces M satisface todas las reglas en P con algun grado.

7 Notemos que debido a que no estamos considerando negacion fuerte, no hay posibilidad de teneranswer sets inconsistentes.

14

Page 31: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Definition 1.9. [9] Sea P un programa con disyuncion ordenada extendido y M un

conjunto de literales. Definimos SiM(P ) = {r ∈ P | degM(r) = i}.

Con las definiciones anteriores introdicumos dos tipos diferentes de relaciones de

preferencia entre los answer sets de un programa con disyuncion ordenada extendido:

preferencia basada en inclusion de conjuntos y preferencia basada en la cardinalidad de

conjuntos.

Definition 1.10. [9] Sea M y N answer sets de un programa con disyuncion ordenada

extendido P . Entonces decimos que M es preferido por inclusion a N , denotado como

M >i N , sii hay un i tal que SiN(P ) ⊂ Si

M(P ) y para todo j < i, SjM(P ) = Sj

N(P ).

Decimos que M es preferido por cardinalidad a N , denotado como M >c N , sii hay un

i tal que |SiM(P )| > |Si

N(P )| y para todo j < i,∣∣Sj

M(P )∣∣ =

∣∣SjN(P )

∣∣.

Definition 1.11. [9] Sea M un answer set de un programa con disyuncion ordenada

extendido P . M es un answer set preferido por inclusion de P si no hay algun answer

set M ′ de P , M 6= M ′, tal que M ′ >i M . M es un answer set preferido por cardinalidad

de P si no hay M ′ answer set de P , M 6= M ′, tal que M ′ >c M .

1.3.2 Answer Set Mınimos Generalizados y Disyuncion Orde-

nada

Ahora, definimos una caracterizacion de los answer set mınimos generalizados de un

programa en terminos de un programa con disyuncion ordenada estandar. Este resul-

tado teorico prueba que ambos programas abductivos y los programas con reglas-RC

se pueden representar correctamente usando disyuncion ordenada.

Definition 1.12. Sea 〈P, A〉 un programa logico abductivo. Entonces, definimos una

traduccion a un programa con disyuncion ordenada estandar, denotado por ord(P,A),

15

Page 32: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

como sigue: Primero, para alguna literal a ∈ A la regla ra es definida como a• × a,

donde a• es una literal que no ocurre en el programa original. Definimos ord(P, A) =

P ∪ {ra | a ∈ A}.

Lemma 1.1. M ∩ LP es un answer set generalizado del programa logico abductivo

〈P, A〉 sii M es un answer set de ord(P, A).

El teorema siguiente prueba la validez de nuestra traduccion para la semantica de

programa logicos abductivos.

Theorem 1.3. Sea 〈P, A〉 un programa logico abductivo y M un conjunto de atomos.

M∩LP es un answer set mınimo generalizado de 〈P, A〉 sii M es un answer set preferido

por inclusion de ord(P, A).

1.3.3 Preferencias en terminos de programas con Disyuncion

Ordenada Extendidos

Podemos especificar un orden entre los answer sets de un programa con disyuncion

ordenada extendido con respecto a una lista de atomos.

Definition 1.13. Sea P un programa normal. Sean M y N dos answer sets de P . Sea

C = [c1, c2, . . . , cn] un conjunto ordenado de formulas. El answer set M es preferido al

answer set N con respecto a C ∪ P (denotado como M <C∪P N) si

• existe i = min(1 ≤ k ≤ n) tal que M ∪¬(LP \M) `I ci y N ∪¬(LP \N) 6`I ci; y

• para todo j < i,

M ∪ ¬(LP \M) `I cj y N ∪ ¬(LP \N) `I cj o

M ∪ ¬(LP \M) 6`I cj y N ∪ ¬(LP \N) 6`I cj.

16

Page 33: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Proposition 1.1. Sea C = [c1, c2, . . . , cn] un conjunto ordenado de formulas; entonces

<C∪P es un orden parcial.

Un answer set M de un programa normal P es el mas preferido si no hay otro

answer set N de P que sea preferido a M .

Example 1.3. Sea C = [b, c] un conjunto ordenado de atomos. Sea P el siguiente

programa normal: {a ← . c ← ¬b. b ← ¬c.}. Podemos verificar que P tiene dos

answer sets, {a, b} y {a, c}. Tambien que el answer set {a, b} es preferido al answer set

{a, c} con respecto a C, i.e., {a, b} <C∪P {a, c} y que {a, b} es tambien el mas preferido

answer set.

Definition 1.14. Sea P un programa normal y C = [c1, c2, . . . , cn] un conjunto or-

denado de atomos tal que C ⊆ LP . Definimos una regla con disyuncion ordenada

extendida definida de C, denotada como rC , como sigue: rC := (¬¬c1 × ¬¬c2 × . . .׬¬cn × all pref) tal que all pref /∈ LP .

Lemma 1.2. Sea P un programa normal y C = [c1, c2, . . . , cn] un conjunto ordenado

de atomos tal que C ⊆ LP . Sea rC la regla con disyuncion ordenada extendida definida

de C. Entonces M es un answer set preferido por inclusion de P ∪ rC sii (M ∩LP ) es

el mas preferido answer set con respecto a C ∪ P .

Example 1.4. Consideremos otra vez el programa P del Ejemplo 1.3 y el conjunto

ordenado de atomos C = [b, c]. Entonces, P ∪ rC es el siguiente programa {a ← . c ←¬b. b ← ¬c. ¬¬b׬¬c× all pref.}. Podemos verificar que {a, b} es el mas preferido

answer set con respecto a C ∪P y que es tambien un answer set preferido por inclusion

de P ∪ rC .

Vale la pena mencionar que ni ejecutando PSMODELS8 [9] o siguiendo la definicion

8 http://www.tcs.hut.fi/Software/smodels/priority/

17

Page 34: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

dada por Brewka [7] para disyuncion ordenada podemos obtener los answer sets preferi-

dos por inclusion de conjuntos para programas con disyuncion ordenada extendidos. La

razon es que la definicion dada por Brewka para disyuncion ordenada tiene restricciones

sintacticas.

Sin embargo, en particular cuando este programa tiene reglas de disyuncion orde-

nada extendidas usando literales negativas negadas podemos facilmente traducir este

programa a un programa con disyuncion ordenada estandar y entonces usar PSMOD-

ELS para obtener los answer sets preferidos [46]. En la siguiente definicion y lema los

atomos a•, a◦, no ocurren en el programa original P .

Definition 1.15. Sea ¬¬a una literal con doble negacion como falla. Definimos el

conjunto de reglas con disyuncion ordenada asociadas a ¬¬a como sigue:

R(¬¬a) := { ← ¬a, a•. a• ← ¬a◦. a◦ ← ¬a. ← a, a◦. }.

Lemma 1.3. Sea P programa normal y sea C = [c1, c2, . . . , cn] un conjunto ordenado de

atomos tal que C ⊆ LP . Sea C• = [c•1, c•2, . . . , c

•n] un conjunto ordenado de atomos tales

que {c•i ∈ C | 1 ≤ i ≤ n} ∩ LP = ∅. Sea rC la regla con disyuncion ordenada extendida

definida de C. Sea r•C la regla con disyuncion ordenada extendida definida de C•. Sea

A =⋃

ci∈C and 1≤i≤n R(¬¬ci). Entonces M es un answer set preferido por inclusion de

P ∪ r•C ∪ A sii M ∩ LP es un answer set preferido por inclusion de P ∪ rC.

1.3.4 Informacion geografica

La mayorıa de la informacion necesaria para modelar el problema del plan de la evac-

uacion se debe obtener de la informacion geografica. Definimos un procedimiento para

construir el conocimiento acerca de la zona del peligro a partir de la informacion ge-

ografica. Este procedimiento es resultado de nuestra propia experiencia al haber tra-

bajado con esta clase de datos. Vale la pena mencionar que en este trabajo probamos

18

Page 35: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

todos nuestros resultados con una pequena parte de los datos geograficos verdaderos

sobre zona del peligro de Popocatepetl del volcan, puesto que los datos verdaderos de

toda esta zona casi fueron obtenidos al terminar este trabajo. El procedimiento puede

ser descrito en terminos de los siguientes pasos: Extraccion de la informacion descrip-

tiva [1] que forma parte de la informacion geografica con ayuda de una herramienta

que maneja este tipo de informacion, reparacion de inconsistencias, y finalmente anadir

informacion descriptiva adicional.

1.3.5 Problema de plan de evacuacion

Para obtener los planes de la evacuacion, comenzamos a modelar el problema de los

planes de evacuacion usando Answer Set Planning.

Normalmente, en una zona del riesgo se definen rutas evacuacion por las autoridades

en la zona del riesgo. Cada ruta de evacuacion comienza en un conjunto de lugares en

riesgo, atraviesa otros lugares de menor riesgo y llega a lugares fuera de riesgo. Algunas

veces, el lugar fuera de riesgo corresponde a un refugio. Cada refugio tiene bastantes

provisiones para la gente. Sin embargo, algunos peligros que pueden acompanar un

desastre pueden resultar en el bloqueo de parte de las rutas de evacuacion predefinidas.

Entonces es necesario definir planes alternativos de evacuacion. El problema de definir

planes de evacuacion alternativos (AEP-problema) puede ser enunciado como sigue:

Hay un conjunto de rutas de evacuacion predefinidas para la gente que viveen la zona del peligro. Cada ruta de evacuacion predefinida puede tenervarios puntos iniciales, pero un solo punto final. En caso de que una partede una ruta de evacuacion predefinida sea inaccesible, entonces los evacuadosdeben buscar una trayectoria alternativa. Esta trayectoria alternativa puedepertenecer o no a otra ruta de la evacuacion. Si no pertenece a una rutade la evacuacion entonces se prefiere, en orden que descendente, llegar a uncierto punto que pertenece a una ruta de la evacuacion o a un refugio o aun lugar fuera de riesgo.

19

Page 36: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Presentamos dos soluciones al problema de definir planes de evacuacion alternativos,

ambos usan Answer Set Planning y algunos enfoques en Answer Sets para preferencias.

Aplicar preferencias resulta ser una manera muy natural y eficaz de obtener una solucion

apropiada para algunos problemas. Por ejemplo, en caso de tener un conjunto de

deseos acerca de un plan de evacuacion que quisieramos satisfacer y al mismo tiempo

no todos ellos pueden ser satisfechos simultaneamente. Otro ejemplo es cuando dado

un problema del planificacion, se podrıa obtener un alto numero de soluciones. Por

tanto, es necesario expresar preferencias para elegir alguno de los planes posibles de

evacuacion. Las soluciones presentadas en este trabajo se dirigen a la especificacion de

tales preferencias entre planes factibles. Hemos explorado dos enfoques en answer sets:

reglas-RC y el Lenguaje PP .

Usando reglas-RC

Ampliamos un problema de planificacion modelado usando Answer Set Planning agre-

gandole reglas-RC [47, 50]. La idea es obtener los planes de evacuacion alternativos

aprovechando la definicion de una regla-RC y utilizar estas reglas solo si no hay manera

de obtener un plan de evacuacion cuando parte de la ruta predefinida se bloquea. Por lo

tanto, las reglas-RC son definidas sobre las acciones usadas para modelar el problema.

En caso de que una regla-RC se aplique se restaura la consistencia permitiendo obtener

los planes de evacuacion alternativos. En particular, la regla-RC que agregamos es la

siguiente:

r2 : action(travel(B, P,Q, R′)) +← bus(B), road(P,Q, R′).

La intuicion de la regla-RC r2 es que es posible viajar de P a Q si hay un segmento

de camino de P a Q. En contraste a la accion regular travel definida en π(D, O, G, l),

esta regla-RC no checa si el camino de P a Q pertenece a una ruta de evacuacion,

20

Page 37: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

es decir, no es importante si R′ es igual a cero o no. De esta forma, r2 nos permite

encontrar los planes de evacuacion alternativos. Veanse los ejemplos A.1, A.2, y A.3 en

el Apendice A que muestra como podemos usar las reglas-RC para obtener los planes

de evacuacion alternativos. Hacemos hincapie en que dado un programa con reglas-

RC que obtiene los planes de evacuacion alternativos, podemos traducirlo de acuerdo

a la Definicion 1.12 para obtener un programa con disyuncion ordenada estandar y

entonces usar PSMODELS9 para obtener los answer sets preferidos que corresponden

a los planes de evacuacion alternativos.

Usando el Lenguaje PP

Como hemos visto, usar reglas-RC permite obtener los planes de evacuacion alternativos

sin embargo, estos planes alternativos no consideran ninguna otra caracterıstica de la

trayectoria que ellos siguen. Por lo tanto, consideramos el lenguaje PP para expresar

preferencias sobre los planes alternativos a diversos niveles. Decidimos utilizar PPporque nos permite expresar preferencias en terminos del tiempo. Por ejemplo, siempre

se prefiere evacuar a la gente en riesgo siguiendo las rutas de evacuacion predefinidas.

Sin embargo, si eventualmente parte de las rutas de evacuacion se bloquea entonces los

evacuados viajaran fuera de la ruta de evacuacion hasta que ellos lleguen a un refugio.

Tambien demostramos que las reglas con disyuncion ordenada y con literales negativas

negadas podrıan ser utiles para permitir una codificacion mas simple y mas facil de

obtener los planes preferidos con respecto a una preferencia expresada en la lenguaje

PP . El ejemplo A.4 en el apendice A muestra el uso de la lenguaje PP para expresar

las preferencias entre los planes de la evacuacion.

9 http://www.tcs.hut.fi/Software/smodels/priority/

21

Page 38: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

1.3.6 Extendiendo el Lenguaje PP

Mientras que utilizamos PP para expresar preferencias nos dimos cuenta que hay algu-

nas preferencias que no se pueden expresar en una manera simple y natural puesto que

estas preferencias resultan ser muy grandes. Por lo tanto, para tener una representacion

mas natural de esta clase de preferencias definimos el lenguaje PPpar. PPpar es una

extension del lenguaje PP donde los conectivos proposicionales y temporales permiten

representar de manera compacta las preferencias que tienen una caracterıstica comun

en particular. Vease el ejemplo A.5 del Apendice A.

Ademas hemos considerado el hecho de que el lenguaje PP podrıa tomar ventaja

de todo el desarrollo teorico de la Logica Proposicional Lineal Temporal (LTL) para

expresar preferencias. Por lo tanto hemos analizado como podrıamos establecer la

relacion entre el lenguaje PP y LTL.

1.3.7 Contenido Semantico

Hemos presentado la nocion de Contenido Semantico de un programa como un punto

de vista alternativo para obtener diferentes semanticas en answer sets de un programa.

En particular, mostramos como obtener los answer sets estandar, los answer sets gen-

eralizados, los answer sets mınimos generalizados y una nueva semantica que llamamos

answer sets parciales. Finalmente, proponemos hacer uso de los answer sets parciales

para obtener planes de evacuacion parciales.

1.4 Conclusiones

En esta tesis hemos propuesto investigar y evaluar las capacidades deAnswer Set Pro-

gramming para representar situaciones del desastre con el objeto de dar la ayuda en

22

Page 39: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

definir planes de la evacuacion. Llegamos a la conclusion que usando Answer Set

Programming es posible representar situaciones del desastre y sobre todo aprovechar

sus capacidades y los diversos enfoques en Answer Sets que existen actualmente para

obtener los planes de evacuacion. Ademas, mostramos como y porque los enfoques en

Answer Sets estudiados son utiles para definir los planes de evacuacion. Finalmente,

presentamos algunas debilidades de estos enfoques que tratamos en este trabajo.

Un asunto interesante para la investigacion a futuro es el uso de algunos enfoques

Answer Sets dirigidos a hacer la generacion de los answer sets mas eficaz en la generacion

de los planes de evacuacion. Por ejemplo con respecto a sus requisitos de la memoria

podrıan usarse mecanismos mas eficaces como el que se propone en [5]. Otra direccion

que podrıa investigarse es modelar dominios dinamicos usando Answer Sets para generar

los planes de evacuacion donde las caracterısticas relevantes de los eventos exogenos (por

ejemplo una explosion o los flujos de la lava) que ocurren en una zona del peligro y la

informacion de dicha zona sean consideradas. Los enfoques en Answer Sets usados en [3]

para modelar sistemas dinamicos y en [10] para modelar flujos de lava podıan ayudarnos

en esta direccion. Finalmente, serıa interesante ampliar nuestro uso del Contenido

Semantico para encontrar algunas otras variantes de la semantica de answer set, tales

como los programas con disyuncion ordenada y entonces, analizar su uso para obtener

los planes de la evacuacion. Por ejemplo en [48] se ilustran algunos ejemplos pequenos

usando los answer set parciales definidos en terminos de su contenido semantico.

23

Page 40: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Chapter 2

Resume en Francais

2.1 Introduction

Actuellement, les responsables de la protection contre les situations de desastre doivent

prendre les decisions sur la preparation et l’execution des plans d’evacuation en con-

siderant les causes potentielles du desastre. Pour cette raison, est serıa souhaitable

de developper un systeme capable d’obtenir et d’analyser les plans d’evacuation. Ou

ce systeme est base sur la connaissance relative a una region particuler, des donnees

geographiques et de leurs propres capacites. En plus, le systeme doit etre capable

d’echanger l’information et les services avec des systemes analogues, ainsi que avec les

etres humains.

bases sur la connaissance du milieu particulier, des donnees geographiques et de

leurs propres capacites et d’echanger l’information et les services avec des systemes

semblables comme pour les etres humains. Pour developper un tel systeme, on peut

utiliser Answer Set Programming (ASP). ASP est un langage de programmation logique

et declaratif pour la representation de la connaissance [14]. ASP represente un nouveau

paradigme pour la representation logique qui permet, selon le concept de la negation

par echec, de resoudre des problemes avec la connaissance par defaut et de permettre

24

Page 41: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

un raisonnement non- monotone.

L’objectif de notre travail est precisement de faire des recherches et d’evaluer les

capacites de ASP a representer des situations de desastre ayant pour objectif d’aider

a definir des plans d’evacuation. La motivation de notre travail se base sur l’idee que

ASP possede de nombreuses qualites qu’un tel programme doit avoir: Il est possible

de traduire l’information geographique dans un format que ASP peut comprendre. Il

existe Answer Set Planning qui procure une maniere naturelle et elegante de mod-

eler les problemes de planification [16]. ASP utilise le concept de negation par echec

qui permet d’exprimer des exceptions, des restrictions et de representer une connais-

sance incomplete. Il existe en plus, dans ASP, plusieurs approches afin d’exprimer des

preferences.

Pour atteindre notre objectif, nous commencons par l’etude du format de l’informa-

tion geographique. En nous basant sur notre propre experience, nous proposons un

procede pour extraire la connaissance necessaire afin de representer la zone de danger

de l’in-formation geographique. Nous considerons aussi que, normalement, dans une

zone a risque, il y a un ensemble de voies d’evacuation predefinies. Pourtant, dans une

situation reelle, il est possible qu’une partie de ces voies predefinies soient bloquees.

Dans ce cas, la definition de plans alternatifs d’evacuation est necessaire. Nous utilisons

Consistency restoring rules (CR-regles) pour obtenir les plans d’evacuation alternatifs.

Nous montrons egalement que les programmes avec CR-regles peuvent se representer

correctement en utilisant des programmes de disjonction ordonnee (ODLP).

Nous proposons d’utiliser le langage PP pour exprimer des preferences a divers

niveaux sur les plans alternatifs. Nous definissons le langage PPpar, comme extension

du langage PP ou ses connectifs permettent que nous representions de maniere com-

pacte les preferences qui ont une caracteristique particuliere. En plus, nous presentons

une breve description au sujet de la relation entre le langage PP et la logique lineaire

25

Page 42: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

propositionnelle temporelle (LTL), puisque nous considerons que le langage PP peut

profiter de travail deja fait pour LTL pour exprimer des preferences.

Nous proposons aussi une extension de ODLP a une classe plus vaste de programmes

logiques. Il est important de mentionner qu’un sous-ensemble de ces programmes est

utile pour permettre une codification plus simple et plus facile afin d’obtenir les plans

preferes respectivement aux preferences exprimees dans PP . Finalement, nous intro-

duisons la notion de Contenu Semantique d’un programme comme point de vue alter-

natif pour obtenir des variantes de la semantique de Answer Sets. Une de ces variantes

est une semantique nouvelle introduite dans ce travail appelee answer sets parciels.

2.2 Etat de l’ art

2.2.1 Answer Set Programming

L’utilisation de Answer Set Programming (ASP) permet de decrire un probleme in-

formatique comme un programme logique auquel answer sets procure les solutions du

probleme donne. Dans ce travail, un programme est interprete comme une theorie

propositionnelle et l’unique negation utilisee est la negation par echec. Pour les lecteurs

non familiarises avec cette approche, nous recommandons [38, 33]. Donc, notre propos

se limite aux programmes propositionnels.

Nous utiliserons le langage de logique propositionnel de la maniere habituelle, ou les

symboles propositionnels sont: p, q, . . . ; les connectifs propositionnels sont: ∧,∨,→,⊥,

et les symboles auxiliaires sont: (, ). Une formule propositionnelle bien formee est definie

inductivement comme suit: Un symbole propositionnel est une formule propositionnelle

bien formee. Si f et g sont des formules propositionnelles bien formees, alors ¬f , f ∧ g,

f ∨ g, f → g le sont aussi. Une formule propositionnelle bien formee peut etre appelee

26

Page 43: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

seulement formule. Un atome est un symbole propositionnel. Pour toute formule

donnee bien formee f , nous assumons que ¬f est exactement l’abreviation de f → ⊥y > qui est l’abreviation de ⊥ → ⊥. Nous insistons sur le fait que l’unique negation

utilisee dans ce travail est la negation par echec et elle est representee par le symbole

¬. Il vaut la peine de mentionner qu’il est toujours possible de traiter l’autre negation

appelee classique ou encore negation forte, rendue par −, en transformant les atomes

avec negation classique [15]. Chaque atome avec negation classique, −a, qui apparaıt

dans la formule est remplace par un nouvel atome, a◦, et la regle ¬(a∧ a◦) est ajoutee.

La regle ¬(a ∧ a◦) peut aussi etre ecrite comme (a ∧ a◦) → ⊥, base sur le fait que ¬f

est juste l’abreviation de f → ⊥.

Une signature L est un ensemble fini d’atomes. La signature d’un programme P ,

notee comme LP , est un ensemble d’atomes qui apparaissent dans P . Une litteral est

n’importe quel atome p (un litteral positive) ou la negation d’un atome (un litteral

negatif). Une litteral nie est le signe de negation ¬ suivi par un litteral, i.e. ¬p or

¬¬p. En particulier, f → ⊥ est appele restriction et elle est aussi indique comme

← f . Une theorie reguliere ou programme logique est uniquement un ensemble de

formules bien formees, et peut appeler theorie ou programme quand ils ne surviennent

pas d’ambiguıtes.

Dans quelques definitions, nous utilisons logique intuitionniste, lequel sera signaler

par I. Pour un ensemble donne d’atomes M et un programme P , nous ecrirons P `I M

pour abreger P `I a pour toute a ∈ M . Pour un ensemble donne d’atomes M et un

programme P , nous ecrirons P `I M pour indiquer que: P `I M , et P est consistant

relativement a I (c’est a dire qu’il n’y a pas de formule A tel que P `I A et P `I

¬A). Parfois, nous ecrirons ` au lieu de `I quand ils ne surviennent pas d’ambiguıtes.

Definissons maintenant les answer sets (ou modeles stables) des programmes logiques.

La semantique de answer sets a ete d’abord definie dans les termes de reduction Gelfond-

27

Page 44: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Lifschitz [14] et elle est habituellement etudiee dans le contexte des transformations

dependantes de la syntaxe dans le programme. Nous suivons une approche alternative

etudiee par Pearce [38] et par Osorio et.al. [33]. Cette approche caracterise les answer

sets d’une theorie propositionnelle en terme de logique intuitionniste et elle est presentee

dans le theoreme suivant. La notation est basee sur [33].

Theorem 2.1. Etant donne P une theorie et M un ensemble d’atomes. M est un

answer set pour P si et seulement si P ∪ ¬(LP \M) ∪ ¬¬M °I M .

Comme annotation additionnelle utilisee dans le reste de ce travail, on trouvera: Un

ensemble fini de formules P est consistant [27] s’il n’y a aucune formule A tel que A et

¬A soient des theoremes de P . Un ensemble fini de formules P est complet [27] si, pour

n’importe quelle formule A de P , P ` A ou P ` ¬A. Un ensemble fini de formules P ′

est une extension d’un ensemble fini de formules P [27] si chaque theoreme de P il y

a un theoreme de P ′. Etant donne deux ensemble X et Y , nous ecrivons X ⊂ Y pour

indiquer que X ⊆ Y and X 6= Y .

Comme d’habitude dans Answer Sets Programming, nous admettons qu’un pro-

gramme avec des symboles du predicat est seulement une abreviation du programme

ground, indique comme ground(P ).

Dans certains cas, nous avons besoin de modeler quelques problemes en utilisant des

symboles du predicat avec des variables, ces variables doivent etre presentees unique-

ment avec un sous-ensemble de l’univers de Herbrand du programme. Ce type de

programme s’appelle programmes pourvu de classes avec des symboles du predicat [4].

Nous les utiliserons par exemple quand nous etudierons la codification d’un probleme

de planification dans la Section 2.2.4. On trouve actuellement plusieurs resolutions de

answer sets. Dans ce travail, nous avons utilise: DLV1 , SMODELS2 , un “frontend”

1 http://www.dbai.tuwien.ac.at/proj/dlv/2 http://www.tcs.hut.fi/Software/smodels/

28

Page 45: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

pour DLV appele DLVK3 , une modification de SMODELS qui peut etre utilisee pour

obtenir les answer sets preferes selon la semantique de disjonction ordonnee appelee

PSMODELS et le Logics Workbench(LWB)4 qui nous permet de travailler avec la

logique intuitionniste.

2.2.2 CR-Programmes et Programmes Abductifs

Les regles pour restaurer la consistance (CR-regles) sont les regles qui s’ajoutent aux

programmes logiques alternatifs standard, mais ils s’appliquent seulement quand les

regles standard dans le programme menent a l’inconsistance. Une CR-regle est ecrite

comme α+← β, ce qu’on lit intuitivement comme: Si le programme est inconsistant,

alors nous assumons α ← β. Dans un autre cas, on ignore la regle. Rappelons l’exemple

suivant presente dans [3], etant donne qu’il illustre clairement l’utilisation des CR-regles.

Dans cet exemple, r1 indique le nom de la CR-regle.

a ← ¬b.

¬ a.

r1 : b+← .

Les deux premieres regles sont regles normales et la troisieme regle est une CR-regle. Ce

sort de programme sera appele CR-programmes. Nous pouvons voir que le programme

sans la CR-regle est inconsistant. Pourtant, si la CR-regle s’utilise alors, la consistance

est restauree et on obtient l’answer set {¬a, b}.La semantique de CR-programmes se definit en termes des answer sets minimums

generalises. Dans [3] les auteurs donnent une traduction de CR-programmes en pro-

grammes logiques abductifs qu’ils nomment hard reduct, et la semantique se definit

comme les answer sets minimums generalises du hard reduct du programme.

3 http://www.dbai.tuwien.ac.at/proj/dlv/K/4 http://www.lwb.unibe.ch/about/index.html

29

Page 46: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Les definitions suivantes se trouvent dans [3]:

Definition 2.1. [3] Un programme logique abductif est un couple 〈P,A〉 ou P est un

programme arbitraire et A un ensemble d’atomes, appele abducibles.

Definition 2.2. [3] Etant donne 〈P, A〉 un programme logique abductif et ∆ ⊆ A.

Nous disons que M(∆) est un answer set generalise de P relative A si et seulement si

M(∆) est un answer set de P ∪∆.

Definition 2.3. [3] Etant donne M(∆1) et M(∆2) deux answer sets generalises de P

relative A. Nous definissons M(∆1) < M(∆2) si et seulement si ∆1 ⊂ ∆2 (ordre par

inclusion d’ensembles).

Definition 2.4. Etant donne P un programme et etant donne A un ensemble d’atomes.

M(∆) est un answer set minimum generalise de P relative a A et l’ordre < si et

seulement si M(∆) est un answer set generalise de P et elle est minime respectivement

a l’ordre par inclusion d’ensembles.

Finalement, l’exemple suivant montre comment la semantique des CR-programmes

se definit en termes answer set minimums generalises.

Example 2.1. Etant donne P1 = {p ← ¬q. r ← ¬s. q ← t. s ← t. ← p, r.} le

programme de l’Exemple 4 introduit dans [3]. Nous pouvons voir que le programme

P1 n’a pas answer sets. Pourtant, pour restaurer la consistance, on peut definir un

CR-programme qui ajoute quelques CR-regles. Par exemple, nous definissons le CR-

programme P ′1 = P1 ∪ CR1 ou CR1 = {r1 : q

+←, r2 : s+←, r3 : t

+←}. Comme nous le

mentionnions, la semantique de P ′1 est definie dans les termes des answer set minimums

generalises. Donc, en traduisant P ′1 dans un programme logique abductif on obtient:

〈P1, A〉 ou l’ensemble de abducibles est A = {q, s, t}. Nous pouvons verifier que les

answer sets minimums generalises de P1 sont {q, r}, {s, p} et {t, q, s}.

30

Page 47: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

2.2.3 Programmes Logiques avec Disjonction Ordonnee

Dans [7] Brewka a introduit des Programmes Logiques avec Disjonction Ordonnee,

ayant pour abreviation LPODs. Pour definir ce type de programmes, le connectif ×, ap-

pele disjonction ordonnee, s’ajoute au systeme des connectifs pour des formules propo-

sitionnelles presentees dans la Section 2.2.1. L’idee derriere les LPODs est d’exprimer

une connaissance par defaut avec une connaissance sur les preferences d’une maniere

simple et elegante [9]. Comme nous l’avons mentionne dans la section 2.2.1, nous con-

siderons dans ce travail uniquement un type de negation, la negation par echec, mais

ceci n’affecte pas la validite des resultats donnee dans [7].

Formellement, un programme logique avec disjonction ordonnee est un ensemble de

regles de la forme:

C1 × . . .× Cn ← A1, . . . , Am,¬B1, . . . ,¬Bk (2.1)

ou Ci, Aj y Bl sont tous des atomes ground. C1 . . . Cn sont normalement appeles les

options d’une regle et sa lecture intuitive est la suivante:

Si le corps est vrai et C1 est possible, alors C1; si C1 n’est pas possible, alors C2;

. . . ; si aucun de C1, . . . , Cn−1 n’est possible alors Cn. On peut preciser quelques cas

speciaux, n = 0 (restrictions), n = 1 (programmes etendus), m = k = 0 (faits). La

semantique des programmes logiques avec disjonction ordonnee sera presentee dans la

Section 2.3.1 ou une extension des programmes logiques avec disjonction ordonnee est

presentee. Actuellement, il y a une modification de SMODELS5 qu’on peut utiliser pour

le calcul des answer sets preferes des programmes logiques avec disjonction ordonnee,

appelee PSMODELS6 [9].

5 http://www.tcs.hut.fi/Software/smodels/6 http://www.tcs.hut.fi/Software/smodels/priority/

31

Page 48: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

2.2.4 Planification dans Answer Sets

Dans un probleme de planification, nous nous interessons a la recherche d’une sequence

d’actions qui conduise d’un etat initial donne a un etat qui definit le but. Pour specifier

totalement un probleme de planification, nous avons besoin d’indiquer que des actions

se permettent dans un plan. La planification dans Answer Sets utilise des langages

d’actions pour specifier les effets des actions et ils sont utilises en particulier pour

modeler des problemes de planification [16]. Certains de ces langages d’action sont

A,B, et C [16]. D’autre part, un probleme de planification specifique a ce type de

langage a une codification naturelle et facile dans Answer Set Programing.

Langage A. L’alphabet du langage A consiste en deux ensembles non vides et de

disjonctions de symboles F appele l’ensemble des fluents, et A appele l’ensemble des

actions. Intuitivement, un fluent exprime une caracteristique d’un objet dans un monde

et fait partie de la description des etats du monde. Une fluent litteral est un fluent ou

un fluent precede de ∼. Un etat σ est un ensemble de fluents.

Disons qu’un fluent f se realise dans un etat σ si f ∈ σ. Disons qu’un fluent

litteral ∼ f se realise dans σ si f 6∈ σ. Quand les actions sont executees avec succes,

elles changent l’etat du monde. Les situations sont des representations de l’histoire

de l’execution des actions. La situation initiale [an, . . . , a1] correspond a l’histoire ou

l’action a1 s’execute dans la situation initiale, suivie par a2, et jusqu’a an. Il y a une

relation simple entre des situations et des etats. Dans chaque situation quelques fluents

sont vrais et d’autres sont faux.

Le langage A peut se diviser en trois sous-langages Langage pour la description

du domaine, Langage d’observation, et Langage de consultation. Si on a un probleme

de planification, il peut etre exprime dans un langage d’actions au moyen d’un triple

(D, O, G) tel que D est la description du domaine, O est l’ensemble des observations

32

Page 49: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

et G est l’ensemble des conditions du but. D’autre part, il est possible de definir une

codification dans Answer Sets de ce probleme de planification specifie dans un langage

d’actions, indique comme π(D, O, G, l), ou l est un numero entier positif qui correspond

a la longitude du plan, c’est a dire le numero des actions a realiser pour atteindre le

but.

Il est donc possible d’obtenir la solution du probleme de la planification (les plans)

i.e. des answer sets de π(D,O, G, l). L’idee de base est que nous decidons de la longitude

du plan pour enumerer les circonstances des actions jusqu’aux points du temps qui

correspondent a cette longitude et codifier les buts comme restrictions par rapport au

temps l + 1, tel que les answer sets qui codifient les ocurrences des actions qui ne

satisfont pas le but dans le temps sont elimines. Ainsi chaque answer sets qui survit

aux restrictions correspond a un plan. Il est important de mentionner que dans la

codification dans Answer Sets des problemes de la planification exprimes en langage

A, si f est un fluent litteral negatif ∼ g donc f sera codifie comme neg(g), ou neg(g)

correspond a la negation classique.

Les details de ces sous-langages et la maniere d’obtenir la codification d’un probleme

de planification d’une specification du langage d’actions se trouvent dans [16, 4]. Nous

presentons seulement un exemple qui demontre comment specifier un probleme simple

de la planification du monde des blocs dans un langage A provenant de [4].

Example 2.2. Le probleme simple de la planification du monde des forets.

1. Fluentes: on(X,Y ), ontable(X), clear(X), holding(X), handempty

2. Actions: pick up(X), put down(X), stack(X,Y ), unstack(X,Y )

3. Conditions d’execution, denotees par D:

executable pick up(X) if clear(X), ontable(X), handempty.

executable put down(X) if holding(X).

33

Page 50: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

executable stack(X, Y ) if holding(X), clear(Y ).

executable unstack(X, Y ) if clear(X), on(X, Y ), handempty.

4. Propositions d’effet.

pick up(X) causes ∼ ontable(X),∼ clear(X), holding(X),∼ handempty.

put down(X) causes ontable(X), clear(X),∼ holding(X), handempty.

stack(X,Y ) causes ∼ holding(X),∼ clear(Y ), clear(X), handempty, on(X, Y ).

unstack(X, Y ) causes holding(X), clear(Y ),∼ clear(X),∼ handempty,∼ on(X, Y ).

5. Considerant block comme {a, b, c, d} les conditions initiales, denotees par I, sont

decrites comme:

initially(clear(a)). initially(clear(c)). initially(clear(d)). initially(handempty).

initially(ontable(c)). initially(ontable(b)). initially(on(a, b)). initially(on(d, c)).

6. Les conditions de but, denotees par G, sont l’ensemble de de litteraux

{on(a, c), on(c, b), ontable(d)}.

Le Langage B apparaıt quand le langage A est etendu pour permettre des propo-

sitions de cause statiques. En utilisant des propositions de causes statiques, on peut

exprimer une connaissance au sujet des etats qui sont possibles ou valides. Cette con-

naissance peut etre utilise indirectement pour deduire des effets d’actions, le fonction-

nement des actions ou les deux. On peut trouver plus de details sur les propositions de

cause statiques et la codification de problemes exprimes en langage B dans [16, 4].

2.2.5 Un langage pour des preferences de plans: le Langage

PP

Le langage PP [43] est un langage pour le specification de preferences del utilisateur

avec une implementation dans la programmation logique, basee sur Answer Set Pro-

gramming. Le langage permet de specifier des preferences entre des plans possibles et

34

Page 51: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

egalement des preferences temporelles sur les plans. Les preferences qui representent le

temps sont exprimes a l’aide des connectifs temporels next, always, until et eventually.

Il y a trois classes de preferences dans PP [43] desirs basiques, preferences atomiques

et preferences generales . Dans ce travail, nous etudions les deux premieres classes

car elles ont ete utiles pour exprimer des preferences dans les plans d’evacuation. Un

desir basique, indique comme ϕ, est une formule de PP qui exprime une preference sur

une trajectoire relative a l’execution d’une certaine action ou relative aux etats de la

trajectoire quand l’action se realise.

Une preference atomique represente un ordre entre formules de desir basique. Il

indique que les trajectoires qui satisfont ϕ1 sont preferables a celles qui satisfont ϕ2, etc.

En clair, les formules de desir basique sont des cas speciaux de preferences atomiques.

2.3 Contribucion

Rappelons que l’objectif de notre travail est de faire des recherches et d’evaluer les ca-

pacites de Answer Set Programming pour representer des situations de desastre ayant

pour but d’aider a la definition de plans d’evacuation. Pour cette raison, nous com-

mencons a analyser comment l’information geographique de la zone de desastre a mod-

eler peut etre traduite dans un format que Answer Sets est capable de comprendre.

Nous continuons en etudiant et en appliquant diverses approches de Answer Sets qui

sont utiles pour definir les plans d’evacuation tels que CR-Programmes, les programmes

logiques avec disjonction ordonnee, la planification dans Answer Sets, le langage pour

des preferences de plans et les answer sets minimums generalises. De maniere specifique,

nous proposons l’extension des Programmes Logiques avec Disjonction Ordonnee et

nous voyons son utilite. Nous allons presenter comment et pourquoi les approches

mentionnees de Answer Sets s’appliquent pour definir des plans d’evacuation et nous

35

Page 52: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

presentons aussi quelques disaventajes des approches traitees dans ce travail.

2.3.1 Programmes Logiques avec Disjonction Ordonnee Etendue

Dans [7] la tete des regles avec disjonction ordonnee etendue est definie en termes de

ground litterales. Dans cette section, la tete et le corps des regles avec disjonction

ordonnees etendues sont definis en termes de formules propositionnelles bien formees.

Nous considerons qu’une syntaxe plus simple pour ces regles pourrait nous donner

quelques avantages. Par exemple, l’utilisation d’expressions hierarchisees pourrait sim-

plifier la tache d’ecrire des programmes logiques et d’ameliorer sa lisibilite puisqu’il

nous permettrait d’ecrire des regles plus courtes et plus naturelles.

Definition 2.5. Une regle avec disjonction ordonnee etendue est une formule propo-

sitionnelle bien formee comme on la definie dans la Section 2.2.1, ou une formule de la

forme:

f1 × . . .× fn ← g (2.2)

ou f1, . . . , fn, g sont des formules propositionnelles bien formees. Un programme avec

disjonction ordonnee etendue est un ensemble fini de regles avec disjonction ordonnee

etendue.

Les formules f1 . . . fn sont generalement appelees les options d’une regle et leur lec-

ture individuelle est la suivante: si le corps est vrai et f1 est possible, alors f1; si f1

n’est pas possible, alors f2; . . . ; si aucun de f1, . . . , fn−1 n’est possible, alors fn. Le

cas particulier ou toute fi est un litteral et g est un ensemble de litterales correspon-

dant aux programmes avec disjonction ordonnee originales comme a ete presente pour

Brewka dans [7], et nous l’appellerons programme avec disjonction ordonnee standard.

Rappelons que les programmes avec disjonction ordonnee standard de Brewka utilisent

le connectif pour la negation forte.

36

Page 53: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Nous considerons ici seulement un type de negation (negation par echec) mais ceci

n’affecte pas les resultats donnes dans [7]. Si n = 0 la regle est en plus une restriction,

c’est a dire, ⊥ ← g. Si n = 1 est une regle etendue et si g = > la regle est un fait

et peut s’ecrire comme f1 × . . . × fn. Nous presentons maintenant la semantique des

programmes avec disjonction ordonnee etendue. La majorite des definitions presentees

ici on ete definies dans [7, 9].

Definition 2.6. [7] Etant donne r := f1 × . . . × fn ← g une regle avec disjonction

ordonnee etendue. Pour 1 ≤ k ≤ n la k-th option de r est definie comme suit: rk :=

fk ← g,¬f1, . . .¬fk−1

Definition 2.7. [7] Etant donne P un programme avec disjonction ordonnee etendue.

P ′ est un programme partage de P s’il est obtenu par le remplacement de chaque regle

r := f1 × . . .× fn ← g dans P pour une de ses options r1, . . . , rk. M est un answer set

de P si et seulement si est un answer set7 d’un programme partage P ′ de P .

Definition 2.8. [7] Etant donne M un answer set d’un programme avec disjonction

ordonnee etendue P et etant donne r := f1 × . . . × fn ← g une regle de P . Nous

definissons le degre de satisfaction de r relative a M, indique par degM(r), comme suit:

—si M ∪ ¬(LP \M) 6`I g, alors degM(r) = 1.

— si M ∪ ¬(LP \M) `I g alors degM(r) = min1≤i≤n {i | M ∪ ¬(LP \M) `I fi}.

Le theoreme suivant indique la relation entre les answer sets d’un programme avec

disjonction ordonnee etendue et le degre de satisfaction de chaque regle dans le pro-

gramme.

Theorem 2.2. [7] Etant donne P un programme avec disjonction ordonnee etendue.

Si M est un answer set de P alors M satisfait toutes les regles dans P a un certain

7 notons que du fait que nous considerons une negation forte, il est impossible d’avoir des answersets inconsistants.

37

Page 54: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

degre.

Definition 2.9. [9] Etant donne P un programme avec disjonction ordonnee etendue

et M un ensemble de litterals. Nous definissons SiM(P ) = {r ∈ P | degM(r) = i}.

Grace aux definitions presentees, nous allons introduire deux types differents de

relations de preference entre les answer sets d’un programme avec disjonction ordonnee

etendue: la preference basee sur l’inclusion d’ensembles et la preference basee sur la

cardinalite des ensembles.

Definition 2.10. [9] Etant donne M et N answer sets d’un programme avec disjonction

ordonnee etendue P . Alors nous disons que M est prefere par inclusion a N , indique

comme M >i N , si et seulement si il y a un i tel que SiN(P ) ⊂ Si

M(P ) et pour tout

j < i, SjM(P ) = Sj

N(P ). Nous disons que M est prefere par cardinalite a N , indique

comme M >c N , si et seulement si il y a un i tel que |SiM(P )| > |Si

N(P )| et pour tout

j < i,∣∣Sj

M(P )∣∣ =

∣∣SjN(P )

∣∣.

Definition 2.11. [9] Etant donne M un answer set d’un programme avec disjonction

ordonnee etendue P . M est un answer set prefere par inclusion de P s’il n’y a aucun

answer set M ′ de P , M 6= M ′, tel que M ′ >i M . M est un answer set prefere par

cardinalite de P s’il n’y a pas M ′ answer set de P , M 6= M ′, tel que M ′ >c M .

2.3.2 Answer Set Minimum Generalise et Disjonction ordonnee

Nous proposons maintenant une caracterisation des answer sets minimums generalises

d’un programme en terme de programme avec disjonction ordonnee standard. Ce

resultat theorique prouve que les deux programmes abductifs et les programmes avec

CR-regles peuvent etre representes correctement en utilisant la disjonction ordonnee.

38

Page 55: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Definition 2.12. Etant donne < P, A > un programme logique abductif. Alors, nous

definissons une traduction a un programme avec disjonction ordonnee standard, indique

par ord(P, A), comme suit : D’abord pour un litteral a ∈ A la regle ra est definie

comme a• × a, ou a• est un litteral qui n’apparaıt pas dans le programme original.

Nous definissons ord(P, A) = P ∪ {ra | a ∈ A}.

Lemma 2.1. M ∩ LP est un answer set generalise du programme logique abductif

< P, A > si et seulement si M est un answer set de ord(P, A).

Le theoreme suivant prouve la validite de notre traduction pour la semantique de

programmes logiques abductifs.

Theorem 2.3. Etant donne < P, A > un programme logique abductif et M un ensemble

d’atomes. M ∩LP est un answer set minime ou generalise de < P,A > si et seulement

si M est un answer set prefere par inclusion de ord(P, A).

2.3.3 Preferences en termes de programme avec Disjonction

Ordonnee Etendue

Nous pouvons specifier un ordre entre les answer sets d’un programme avec disjonction

ordonnee etendue relative a une liste d’atomes.

Definition 2.13. Etant donne P un programme normal. Etant donne M et N deux

answer sets de P . Etant donne C = [c1, c2, . . . , cn] un ensemble ordonne de formules.

L’answer set M est prefere a l’answer set N respectivement a C ∪ P (indique comme

M <C∪P N) s’il existe i = min(1 ≤ k ≤ n) tel que M ∪ ¬(LP \ M) `I ci et N ∪¬(LP \ N) 6`I ci; et pour tout j < i, M ∪ ¬(LP \M) `I cj et N ∪ ¬(LP \ N) `I cj ou

M ∪ ¬(LP \M) 6`I cj et N ∪ ¬(LP \N) 6`I cj.

39

Page 56: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Proposition 2.1. Etant donne C = [c1, c2, . . . , cn] un ensemble ordonne de formules;

alors <C∪P est un ordre partiel.

Un answer set M d’un programme normal P est preferable s’il n’y a pas d’autre

answer set N de P qui soit prefere a M .

Example 2.3. Etant donne C = [b, c] un ensemble ordonne d’atomes. Etant donne P

le programme suivant normal: {a ← . c ← ¬b. b ← ¬c.}. Nous pouvons verifier que P

a deux answer sets, {a, b} et {a, c}. Et egalement que l’ answer set {a, b} est prefere a

l’answer set {a, c} relative a C, i.e., {a, b} <C∪P {a, c} et que {a, b} est aussi l’ answer

set prefere.

Definition 2.14. Etant donne P un programme normal et C = [c1, c2, . . . , cn] un

ensemble ordonne d’atomes tel que C ⊆ LP . Nous definissons une regle avec disjonction

ordonnee etendue definie par C, indique comme rC , comme suit: rC := ¬¬c1׬¬c2×. . .× ¬¬cn × all pref tel que all pref /∈ LP .

Lemma 2.2. Etant donne P un programme normal et C = [c1, c2, . . . , cn] un ensemble

ordonne d’atomes tel que C ⊆ LP . Etant donne rC la regle avec disjonction ordonnee

etendue definie par C. Alors M est un answer set prefere par inclusion de P ∪ rC si et

seulement si (M ∩ LP ) est l’answer set prefere respectivement a C ∪ P .

Example 2.4. Nous considerons encore une fois le programme P de l’Exemple 2.3

et l’ensemble ordonne d’atomes C = [b, c]. Alors, P ∪ rC est le programme suivant

{a ← . c ← ¬b. b ← ¬c. ¬¬b × ¬¬c × all pref.}. Nous pouvons verifier que {a, b}est l’answer set prefere respectivement a C ∪P et que c’est aussi un answer set prefere

par inclusion de P ∪ rC .

Il vaut la peine de mentionner que aucun de deux: lxecution de PSMODELS8 [9]

ou l’utilisation de la definition donee par Brewka (disjonction ordonnee) permettent

8 http://www.tcs.hut.fi/Software/smodels/priority/

40

Page 57: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

d’obtenir les answer sets preferes par inclusion d’ensembles pour des programmes avec

disjonction ordonnee etendue. La raison en est que la definition donnee par Brewka

pour la disjonction ordonnee a des restrictions syntaxiques.

Pourtant, en particulier quand le programme a des regles de disjonction ordonnee

etendue qui utilisent des litterales nies, nous pouvons facilement traduire ce programme

a un programme avec disjonction ordonnee etendue standard et donc utiliser PSMOD-

ELS pour obtenir les answer sets preferes [46]. Dans la definition et le lemme suivants,

les atomes a•, a◦, sont des atomes qui n’apparaissent pas dans le programme original

P .

Definition 2.15. Etant donne ¬¬a un litteral nie. Nous definissons l’ensemble des

regles avec disjonction ordonnee associe a ¬¬a comme suit:

R(¬¬a) := { ← ¬a, a•. a• ← ¬a◦. a◦ ← ¬a. ← a, a◦. }.

Lemma 2.3. Etant donne P un programme normal et etant donne C = [c1, c2, . . . , cn]

un ensemble ordonne d’atomes tel que C ⊆ LP . Etant donne C• = [c•1, c•2, . . . , c

•n]

un ensemble ordonne d’atomes tel que {c•i ∈ C | 1 ≤ i ≤ n} ∩ LP = ∅. Etant

donne rC la regle avec disjonction ordonnee etendue definie de C•. Etant donne

A =⋃

ci∈C and 1≤i≤n R(¬¬ci). Alors M est un answer set prefere par inclusion de

P ∪ r•C ∪ A si et seulement si M ∩ LP est un answer set prefere par inclusion de

P ∪ rC.

2.3.4 Information geographique

La majorite des informations necessaires pour modeler le probleme de l’evacuation doit

s’obtenir des donnees geographiques. Nous proposons un procedure pour construire la

connaissance de la region de danger a partir de l’information geographique. Ce procede

est le resultat de notre propre experience de travail avec ce type de donnees. Il vaut la

41

Page 58: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

peine de mentionner que nous prouvons dans ce travail tous nos resultats avec une petite

partie des donnees geographiques reels de la zone de danger du volcan Popocatepetl,

puisque les donnees reelles totales de cette zone ont ete obtenues pratiquement a la

fin de ce travail. Le procede peut etre decrit dans les termes suivant: Extraction

de l’information descriptive [1] qui fait partie de l’information geographique, a l’aide

d’outils qui traitent ce type de donnees, reparation d’inconsistances, et finalement ajout

de l’information descriptive additionnelle.

2.3.5 Probleme de plan d’evacuation

Pour obtenir les plans de l’evacuation, nous commencons par modeler le probleme des

plans d’evacuation en utilisant Answer Set Planning.

Normalement, dans une zone de risque, les autorites definissent des voies d’evacuation.

Chaque voie d’evacuation commence dans la zone a risque, traverse d’autres lieux ou le

risque est moins important et arrive finalement dans une zone hors de danger. Parfois,

le lieu hors de danger correspond a un refuge. Chaque refuge contient des provisions

suffisantes pour la population. Pourtant, certains dangers qui peuvent accompagner

un desastre resultent du blocage d’une partie des voies d’evacuation predefinies. Il est

donc necessaire de definir des plans alternatifs d’evacuation. Le probleme pour definir

des plans d’evacuation alternatifs (AEP-probleme) peut etre enonce comme suit:

Il existe un ensemble de voies d’evacuation pour les gens qui vivent dans lazone a risque. Chaque voie d’evacuation predefinie peut avoir differents pointsde depart mais un seul point d’arrivee. Dans le cas ou une partie d’une voied’evacuation predefinie est inaccessible, les evacues doivent alors chercher unetrajectoire alternative. Cette trajectoire alternative peut appartenir ou non aune autre voie d’evacuation. Si elle n’appartient pas a une voie d’evacuation,il est alors preferable, dans un ordre decroissant, de rejoindre un endroitfaisant partie d’une voie d’evacuation ou un refuge ou un lieu hors de la zonede danger.

42

Page 59: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Nous presentons deux solutions au probleme de la definition de plans d’evacuation

alternatifs, les deux utilisent Answer Set Planning et certaines approches dans Answer

Sets pour les preferences. Appliquer des preferences se revele une maniere simple et

efficace d’obtenir une solution appropriee a un probleme donne. Par exemple, dans le

cas ou nous avons un ensemble de desirs pour un plan d’evacuation que nous voudri-

ons satisfaire, mais qu’en meme temps, ils ne peuvent pas etre satisfaits tous simul-

tanement, on pourrait appliquer des preferences. Un autre exemple est quand, face a

un probleme donne de planification, on pourrait obtenir un nombre eleve de solutions.

Pour cela, il est necessaire d’exprimer des preferences pour choisir l’un des plans pos-

sibles d’evacuation. Les solutions presentees dans ce travail veillent a la specification

de telles preferences parmi les plans eventuels. Nous avons etudie deux approches dans

answer sets: CR-regles et le Langage PP .

En utilisant les CR-regles

Nous proposons d’elargir un probleme de planification modelee en utilisant Answer

Set Planning et en lui ajoutant les CR-regles [47, 50]. L’idee est d’obtenir les plans

d’evacuation en profitant de la definition d’une CR-regle et d’utiliser ces regles seule-

ment s’il n’y a pas moyen d’obtenir un plan d’evacuation quand une partie de la voie

predefinie est bloquee. Pour cela, les CR-regles sont definies sur les actions utilisees

pour modeler un probleme. Dans le cas ou une CR-regle s’applique, la consistance est

restauree, ce qui permet d’obtenir des plans d’evacuation alternatifs. En particulier, la

CR-regle que nous proposons d’ajouter est la suivante:

r2 : action(travel(B, P,Q, R′))+← bus(B), road(P,Q, R′).

L’idee de la CR-regle r2 est qu’il est possible de voyager de P a Q s’il y a un segment de

chemin de P a Q. En contraste avec l’action normale travel definie dans π(D, O, G, l),

43

Page 60: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

cette CR-regle ne verifie pas si le chemin de P a Q fait partie d’une voie d’evacuation,

c’est a dire, cela n’est pas important si R′ est egal a zero ou pas. De cette maniere,

r2 nous permet de trouver les plans d’evacuation alternatifs. Voir les Exemples B.1,

B.2, et B.3 dans l’Appendice B qui montrent comment nous pouvons utiliser les CR-

regles pour obtenir des plans d’evacuation alternatifs. Nous soulignons que dans un

programme donne avec CR-regles qui obtient des plans d’evacuation alternatifs, nous

pouvons traduire le CR-regles en accord avec la Definition 2.12 pour obtenir un pro-

gramme avec disjonction ordonnee standard et donc utiliser PSMODELS9 . Pour obtenir

les answer sets preferes qui correspondent aux plans d’evacuation alternatifs.

En utilisant le Langage PP

Comme nous l’avons vu, l’utilisation des CR-regles permet d’obtenir des plans d’evacuation

alternatifs, pourtant, ces plans alternatifs ne considerent aucune autre caracteristique

de la trajectoire qu’ils suivent. Pour cela, nous considerons le langage PP pour ex-

primer des preferences de plans alternatifs a divers niveaux. Nous decidons d’utiliser

PP parce qu’il nous permet d’exprimer des preferences pour les plans ou la satisfaction

de ces preferences depend du temps. Nous considerons que particulierement dans la

definition des plans d’evacuation, il est tres utile d’exprimer des preferences en termes

de temps. Par exemple, toujours on a prefere evacuer les gens en danger en suivant

les voies d’evacuation predefinies. Pourtant, si eventuellement une partie des voies

d’evacuation est bloquee, alors les evacues se deplaceraient hors de la zone de danger

jusqu’a arriver a un refuge. Nous demontrons aussi que les regles disjonctives etendues

avec des litterales nies pourraient etre utiles pour permettre une codification plus simple

afin d’obtenir les plans preferes relatives a une preference exprimee dans langage PP .

L’Exemple B.4 dans l’Appendice B montre l’usage du langage PP pour exprimer les

9 http://www.tcs.hut.fi/Software/smodels/priority/

44

Page 61: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

preferences parmi les plans d’evacuation.

2.3.6 En etendant le Langage PP

Lors de l’utilisation de PP pour exprimer des preferences, nous avons realise que cer-

taines preferences ne peuvent s’exprimer d’une maniere simple et naturelle puisque ces

preferences s’averent etre tres grandes. Pour cette raison, pour avoir une representation

plus naturelle de cette classe de preferences, nous definissons que le langage PPpar

PPpar est une extension du langage PP dont les connectifs proportionnels et tem-

porels permettent de representer de maniere compacte les preferences qui ont une car-

acteristique commune en particulier. Voir l’Exemple B.5 de l’Appendice B.

Nous avons egalement pris en consideration le fait que le langage PP pourrait etre

avantage pour tout le deroulement theorique de la Logique Propositionnelle Lineale

Temporelle (LTL) pour exprimer des preferences. Pour cela, nous avons analyse com-

ment on pourrait etablir la relation entre le langage PP et LTL.

2.3.7 Contenu Semantique

Nous avons presente la notion de Contenu Semantique d’un programme comme point de

vue alternatif pour obtenir differentes semantiques dans answer sets d’un programme.

Nous montrons en particulier comment obtenir les answer sets standard, les answer sets

generalises, les answer sets minimums generalises et une nouvelle semantique que nous

nommons answer sets partiels. Finalement, nous proposons d’utiliser les answer sets

partiels pour obtenir des plans partiels d’evacuation.

45

Page 62: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

2.4 Conclusions

Dans cette these, nous avons propose d’etudier Answer Set Programming et d’evaluer

ses capacites a representer des situations de desastre dans le but d’aider a definir des

plans d’evacuation. Nous sommes arrives a la conclusion qu’en utilisant Answer Set

Programming il est possible de representer des situations de desastre et surtout de

profiter de ses capacites, des diverses approches qui existent maintenant pour obtenir

des plans d’evacuation. Pour finir, nous allons presenter quelques desaventages des

approches dont nous essayons d’ameliorer dans ce travail.

Un fait interessant pour la recherche dans le futur est l’utilisation de certaines

approches Answer Sets destinees a devenir la generation la plus efficace des answer sets

dans la generation des plans d’evacuation. Par exemple, relativement aux conditions

de la memoire, on pourrait utiliser des mecanismes plus efficaces comme il est propose

dans [5]. Une autre direction que pourraient prendre les recherches serait de modeler

des domaines dynamiques en utilisant Answer Sets pour generer les plans d’evacuation

ou les caracteristiques eminentes des evenements exogenes (par exemple une explosion

ou la coulee de la lave) qui apparaissent dans la zone de danger et l’information sur

cette zone seraient considerees. Les approches dans Answer Sets utilisees dans [3]

pour modeler des systemes dynamiques et dans [10] pour modeler des coulees de lave

pourraient nous aider dans ce sens. Enfin, il serait interessant d’elargir notre utilisation

du Contenu Semantique pour trouver d’autres variantes de la semantique de Answer

Sets, tel que les programmes avec disjonction ordonnee et alors, analyser leur utilisation

pour obtenir les plans d’evacuation. Par exemple, dans [48] quelques cas sont illustres

en utilisant les Anwer Sets partiels definis en termes de leur contenu semantique.

46

Page 63: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Introduction

In 1985, the United Nations Disaster Relief Coordinator (UNDRO) and United Nations

Educational Scientific and Cultural Organization (UNESCO) remarked that through-

out the world has been growing steadily the awareness of being prepared for disaster

situations and to provide protection against them, rather than simply to await and

endure them [30].

Currently, Geographical Information Systems (GISs)—computer systems that man-

age, display, and support analysis of geographical reference data— are increasingly

being used to fill many crisis management needs [23, 42]. All phases of crisis man-

agement deal with many location-specific details, drawn from sources including remote

sensing and Global Positioning System (GPS) data on the region of an event and its

effects. A GIS assists in managing such information by associating related geographic

information and integrating multiple geographic information elements during a crisis.

In particular, a GIS can update its database during the course of a disaster to reflect

what is known about the environment and situation during the response efforts; the

spatial data of the GIS can be reproduced electronically for distribution and access;

and a GIS provides ways to combine many types of data of value for crisis management

[23].

However, once the data about a disaster situation are updated, transmitted, dis-

played or combined by a GIS, people involved in protection against disaster situations

47

Page 64: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

must make the decisions about preparing and executing evacuation plans for potential

causes of disaster. Hence, it would be desirable to develop an “intelligent GIS” capable

of obtaining and analyzing evacuation plans based on knowledge about their partic-

ular environment, the geographic data and their own capabilities, and of exchanging

information and services with similar systems as well as with humans. Specifically, an

“intelligent GIS” should has the following capabilities:

• Consider geographic data. The geographic data used in a crisis varies according

to location. Some states have extensive GISs of their own with up-to-date details.

These systems include information on evacuation routes and location of emergency

shelters and estimates of populations-at-risk at various times of the day. Other

considered sources include background GIS maps, including roads and locations

of industry; census data and some commercially available data sets; and aerial

photographs for the area.

• Model evacuation plan problems. In order to model evacuation plan problems, the

system should be able to represent different initial scenarios, the possible actions

with their executability conditions and effects, the different evacuation plan goals,

and restrictions of time on all possible plans.

• Consider dynamic environments. Based on the kind of disaster, it may happen that

the topography itself changes or the built environment, including, roads, buildings,

and utility services, is affected. As we mentioned, a GIS is able to update its

database during the course of a disaster to reflect what is known about the envi-

ronment. Additionally, if the current evacuation plan cannot be performed due to

the changes such as damaged roads, then the plan also has to be updated.

• Expressing exceptions. It is necessary to express all possible exceptions when a

plan is prepared or executed, for instance we could express that “Normally, a car

48

Page 65: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

travels by predefined evacuation routes but exceptionally, if some segment of roads

are blocked, it may travel by other roads”.

• Incomplete knowledge. It is normal that humans and machines get conclusions

under incomplete knowledge. In a similar way, it is necessary to define evacuation

plans under incomplete knowledge. For instance, a car can travel by a segment of

road if we do not have the explicit information that it is blocked.

• Expressing preferences. Applying preferences result to be a very natural and ef-

fective way to obtain an appropriate solution for some problems. For instance,

in situations where we have a set of desiderata about an evacuation plan that we

would like to satisfy and not all of them can be simultaneously satisfied. Another

example is when given a planning problem, we may obtain a high number of so-

lutions. Then it is necessary to express preferences to choose some of the possible

evacuation plans.

• Simple to specify planning problems. People that make the decisions about prepar-

ing and executing evacuation plans do not have to worry about the way to deal

with the system that should help them define the evacuation plan. Then the system

should allow define evacuation plans using a simple English-like syntax to specify

the planning problems.

• Efficiency. If the system is used to define evacuation plans in real time, then the

system should be efficient to generate the plans. If the system is used in pre-defining

planning, then it is not necessary to have a very efficient system.

• Express restrictions. All evacuation plans have different kinds of restrictions de-

pending on the region and service facilities. For instance, if a segment of road have

a capacity of a number of vehicles by unit of time then the system should be able

to consider this kind of restrictions in order to define the evacuation plans.

49

Page 66: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

• Consider generality. If some changes in the geographic data, preferences, restric-

tions occur then, the way in that the system obtains the evacuation plan does not

have to change.

We think that a good formalism to explore to develop such “intelligent GISs” is a

logical approach. Currently, one of these formalisms is a declarative knowledge repre-

sentation and logic programming language called Answer Set Programming [14]. The

original definition of answer sets was given by Gelfond and Lifschitz in 1988 [14]. An-

swer Set Programming is the realization of much theoretical work on Non-monotonic

Reasoning and AI applications. It represents a new paradigm for logic programming

that allows, using the concept of negation as failure, to handle problems with default

knowledge and produce non-monotonic reasoning. Two popular software implemen-

tations to compute answer sets are DLV10 and SMODELS11 . The efficiency of such

programs allowed to increase the list of practical applications in the areas of planning,

logical agents and artificial intelligence.

Hence, the motivation of our work is to contribute towards the development of such

“intelligent GISs”. Specifically, the objective of our work is to investigate and evaluate

the capabilities of Answer Set Programming (ASP) to represent disaster situations in

order to give support in defining evacuation plans.

Moreover, the motivation of our work is based on the idea that Answer Set Program-

ming presents most of the capabilities that we mentioned above about an “intelligent

GIS” should have. Specifically,

• It is possible that Answer Set Programming considers geographic information. Of

course, geographic information should be translated into a format that answer sets

can understand. In particular in this work we propose a procedure to translate

10 http://www.dbai.tuwien.ac.at/proj/dlv/11 http://www.tcs.hut.fi/Software/smodels/

50

Page 67: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

geographic information and to construct the hazard zone background knowledge

from this information.

• Currently there exists Answer Set Planning that provides a natural and elegant

way to model planning problems [16]. Answer Set Planning allows us to represent

states, initial states, actions, executability conditions and effects of actions, and

goals in order to obtain the feasible plans. The key element of answer set planning

is the representation of a dynamic domain in the form of a “history program”—

a program whose answer sets represent possible “histories”, or evolutions of the

system, over a fixed time interval.

• Answer Set Programming and Answer Set Planning use the concept of negation as

failure that allows us to express exceptions and represent incomplete knowledge.

• Currently there exist different approaches to express preferences in answer sets. In

particular in this work we studied and used two of them.

• Answer Set Planning is based on different action languages that are formal models

of parts of the natural language used for describing the effects of actions [16, 4].

Then, specifying a planning problem could result easy and natural for people in-

volved in defining evacuation plans.

• Answer Set Programming allows to express restrictions. In particular Answer Set

Planning allows express restrictions about the executability of actions.

• Finally, given a planning problem specified in an action language, it is possible to

define a general way to obtain its respective answer set encoding. In Answer Set

Planning is proposed to divided the encoding in two parts: the domain dependent

part, and the domain independent part. The former is a direct translation of the

domain description in the action language and the latter is independent of the

domain and may be used for planning with other domains. In this way, depending

51

Page 68: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

on the problem we only have to define the domain dependent part and add the

domain independent part in order to obtain the feasible plans.

In the contribution of this work we present different practical and theoretical results

related to the capabilities of Answer Set Programming (ASP) to represent disaster

situations in order to give support in defining evacuation plans.

This thesis is divided into two parts respectively describing its background and its

contributions.

The Background have the following chapters:

Chapter 3 presents a synthesis of information related to Volcanic emergency man-

agement recommended by the UNESCO and in particular the volcano Popocatepetl

case.

Chapter 4 presents a synthesis of the theoretical results needed to understand the

contribution of our work. It presents the Answer set programming framework, CR-

Programs and Abductive logic programs, and Ordered Disjunction programs.

Chapter 5 starts presenting an overview about one of the AI planning approaches

to model and solve planning problems in a natural and elegant way is Answer Set

Planning [16]. It also presents an abstract from [19] about the analysis of a general

transportation problem that generalizes planning in several classical domains since,

some of the evacuation planning problems can be similar cases of this family of problems.

Finally, this chapter presents a brief overview of Language PP for planning preferences.

The Contribution starts with a discussion about some lacks in existing work that this

work want to address. Then this part continues by presenting the following chapters:

Chapter 6 introduces extended ordered disjunction programs such that ordered dis-

junctions is extended to wider classes of logic programs. A characterization of minimal

generalized answer sets in terms of ordered disjunction programs is also proposed. This

52

Page 69: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

theoretical result proves that both abductive programs and programs with CR-rules

can be properly represented using ordered disjunction. This chapter also proposes to

specify and compute a preference ordering among the answer sets of a program with

respect to an ordered list of atoms using a extended ordered disjunction programs with

double negation [46]. In this chapter is also proposed a second application of extended

ordered disjunction programs with double default negation to obtain the maximal an-

swer set of a program. Finally, we show how to compute the preferred answer sets for

extended ordered programs using PSMODELS.

Chapter 7 analyzes the information which would be ideal to have to model an evac-

uation plan problem and in particular a volcano evacuation plan problem is reviewed.

The complexity of evacuation plan problems is also considered. We give a procedure to

construct the hazard zone background knowledge needed for reasoning about evacuation

planning. Finally, this work is illustrated on the Popocatepetl case.

Chapter 8 presents the use of preferences in answer sets. It starts defining the prob-

lem of finding alternative evacuation plans in case part of the predefined evacuation

plan becomes blocked. Then we show how this problem can be solved using two dif-

ferent approaches, i.e., CR-programs and PP language. This chapter also proposes an

extension of PP language where propositional connectives and temporal connectives

allow us to represent compactly preferences having a particular property. This chap-

ter concludes with the presentation of a brief overview about the relationship between

language PP and propositional Linear Temporal Logic (LTL) [21, 40]. The idea is

that language PP could take advantage of the working framework of LTL to express

preferences.

Chapter 9 introduces the notion of Semantic Contents of a program as an alternative

point of view to obtain different answer set semantics of a program. In particular, we

show how to obtain the standard answer sets, the generalized answer sets, the minimal

53

Page 70: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

generalized answer sets and new answer set semantics introduced in this chapter called

partial answer sets.

Finally the conclusions of this work are presented.

54

Page 71: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Part I

Background

55

Page 72: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Chapter 3

Evacuation Planning

This chapter presents a synthesis of information related to evacuation planning. In

particular, we present the information related to volcanic emergency management. We

are interested in volcanic emergency plans because we have information about the

Popocatepetl volcano and we have tested some of our results using this information.

Then, we present a list of desired elements to develop volcanic emergency plans. This

list of elements is recommended by the UNESCO and published in 1985. Finally, we

present the information about the Popocatepetl volcano that we have.

3.1 Volcanic emergency management

The UNESCO presented in [30] the development of volcanic emergency plans. The

purpose of the information in [30] is to distill from past experience in various parts of the

world some general principles of organization and practice which, hopefully, may prove

to be of universal validity. [30] also mentioned that mass evacuation and other protective

measures are more effective if they are planned and organized before an emergency

arises. The UNESCO assumes that in any community exposed to volcanic hazards

there is a general awareness of the hazard and a general desire to take collective action

56

Page 73: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 3. EVACUATION PLANNING 57

to reduce these risks; that a legislative framework exists within which it is possible to

plan, organize, and put into effect, at the national and at the local level, the appropriate

protective measures; that scientific knowledge of the potentially dangerous volcanoes

is sufficiently advanced to permit the elaboration of “scenarios” of possible eruptions,

their destructive effects and their social and economic consequences; that it will be

possible to have some warning about eruptions, and that this warning will be given

in time for appropriate actions to be taken; that, if the above conditions are fulfilled,

an emergency plan of action in case of eruption will be prepared for each potentially

dangerous volcano.

The main elements of pre-emergency planning are identified and discussed in [30]

and they are the following:

• Identification and mapping of the hazard zones;

• Register of valuable movable property (excluding easily portable personal effects);

• Identification of safe refuge zones to which the population will be evacuated in case

of a dangerous eruption;

• Identification of evacuation routes, their maintenance and clearance;

• Identification of assembly points for persons awaiting transport for evacuation;

• Means of transport, traffic control;

• Shelter and accommodation in the refuge zones;

• Inventory of personnel and equipment for search and rescue;

• Hospital and medical services for treatment of injured persons;

• Security in evacuated areas;

• Alert procedures;

• Formulation and communication of public warnings; procedures for communication

in emergencies;

Page 74: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 3. EVACUATION PLANNING 58

• Provisions for updating the plan;

• Time scales: The interval between the onset of an eruption, or of significant pre-

cursory phenomena, and a violent climax, eruption, may range from a few hours

to several days, weeks or months. In practice, it will usually be appropriate to

plan for two types of action: (1) Phased response to a gradually developing vol-

canic crisis, during which one may expect to have warning of potentially dangerous

volcanic events at least 24 hours before they occur; (2) Immediate response to a

situation calling for the fastest possible evacuation of people by whatever means

are immediately available.

3.2 Emergency management in the Popocatepetl vol-

cano

In this work, we have tested part of our results using fragments of the information

about the Popocatepetl volcano risk zone. Hence, in this section we present a short

overview about the current evacuation planning problem in the Popocatepetl volcano.

Popocatepetl (smoking mountain in nahuatl language) stands at the Southern end

of an 80 km-long chain that trends North-South and divides the basin of Mexico to

the West from the basin of Puebla to the East. Popocatepetl is only 60 km Southeast

of Mexico City and 40 km West of the city of Puebla. The combined population of

these two metropolitan areas exceeds 30 million inhabitants. This volcano covers three

different states: Estado de Mexico, Morelos and Puebla. There are several cities that

are under risk. Printed maps indicate the danger around the volcano. We have some of

the maps of Puebla. They have been provided to us by CENAPRED, (National Center

for disaster’s prediction) the organism which is responsible of monitoring the volcano

Page 75: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 3. EVACUATION PLANNING 59

[42].

Puebla’s government works based on the Plan Operativo Popocatepetl office to

coordinate the actions of evacuation in case of danger.

Nowadays, Plan Operativo Popocatepetl office in Mexico has defined ten evacuation

routes in Puebla. Each evacuation route starts in a set of towns in risk, traverses other

towns in risk and arrives to a town where a shelter is located.

3.3 Conclusion

In this chapter we presented a synthesis of information related to evacuation planning.

In particular, we presented a list of desired elements to develop volcanic emergency

plans. This list of elements is recommended by the UNESCO and published in 1985.

Finally, we presented the information about the Popocatepetl volcano that we have. In

Chapter 7 we are going to preset how we can combine the information related to evac-

uation planning presented in this chapter, in order to model evacuation plan problems

and in particular for volcanic emergency plans.

Page 76: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Chapter 4

Answer Set Programming

Using Answer Set Programming (ASP) makes it possible to describe a computational

problem as a logic program whose answer sets correspond to the solutions of the given

problem. In this chapter we define the syntax of an Answer Set program and the related

notations that will be used in this work. We also present an answer set approach used

to restore consistency called CR-Programs.

In situations where we have a set of desiderata that we would like to satisfy and

not all of them can be simultaneously satisfied, the use of preferences to resolve those

indeterminate situations results very natural and effective. Then applying preferences

among desiderata we may obtain an appropriate solution. Currently, there are a large

number of approaches dealing with preferences [12]. In this chapter we studied Logic

Programs with Ordered Disjunction [7]. The intuition behind Logic Programs with

Ordered Disjunction is to express default knowledge with knowledge about preferences.

4.1 Answer Set Programming framework

We want to stress the fact that in our approach, a program is interpreted as a propo-

sitional theory and that the only negation used is default negation. For readers not

60

Page 77: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 61

familiar with this approach, we recommend [38, 33] for further reading. Hence, we will

restrict our discussion to propositional programs.

We shall use the language of propositional logic in the usual way, using:

• propositional symbols: p, q, . . . ,

• propositional connectives: ∧,∨,→,⊥, and

• auxiliary symbols: (, ).

A well formed propositional formula is inductively defined as follows: A propositional

symbol is a well formed propositional formula. If f and g are well formed propositional

formulas, then so are ¬f , f ∧ g, f ∨ g, f → g. A well formed propositional formula can

be just called formula.

An atom is a propositional symbol.

Given any well formed propositional formula f , we assume that ¬f is just an ab-

breviation of f → ⊥ and > is an abbreviation of ⊥ → ⊥. We remark that the only

negation used in this work is default negation and it is represented by the symbol ¬. It

is worth mentioning that we always can handle the other negation called classical or

even strong negation, denoted by −, by transforming the atoms with classical negation

[15]. Each atoms with classical negation, −a, that occurs in a formula is replaced by a

new atom, a◦, and the rule ¬(a ∧ a◦) is added. Rule ¬(a ∧ a◦) can also be written as

(a ∧ a◦) → ⊥ based on the assumption that ¬f is just an abbreviation of f → ⊥.

Example 4.1. Let P be the following program:

buyBanana ← ¬− eatBanana.

−eatBanana ← bananaIsRotten.

Page 78: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 62

Then, transforming the atoms with classical negation the program P is the following:

buyBanana ← ¬eatBanana◦.

eatBanana◦ ← bananaIsRotten.

← eatBanana◦, eatBanana.

A signature L is a finite set of atoms. The signature of a program P , denoted as

LP , is the set of atoms that occur in P .

Example 4.2. Let P1 be the following program:

p ← ¬q.

q.

Then LP1 = {p, q}.

A literal is either an atom p (a positive literal) or the negation of an atom ¬p (a

negative literal).

A negated literal is the negation sign ¬ followed by any literal, i.e. ¬p or ¬¬p.

In particular, f → ⊥ is called constraint and it is also denoted as ← f .

A regular theory or logic program is just a finite set of clauses, it can be called just

theory or program where no ambiguity arises.

4.2 Answer sets in terms of Intuitionistic Logic

In some definitions we use Heyting’s intuitionistic logic [45], which will be denoted by

the subscript I.

For a given set of atoms M and a program P , we will write P `I M to abbreviate

P `I a for all a ∈ M .

For a given set of atoms M and a program P , we will write P °I M to denote that:

Page 79: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 63

1. P `I M , and

2. P is consistent w.r.t. logic I (i.e. there is no formula A such that P `I A and

P `I ¬A).

Sometimes we will write ` instead of `I when no ambiguity arises.

Now we define answer sets (or stable models) of logic programs. The stable model

semantics was first defined in terms of the so called Gelfond-Lifschitz reduction [14] and

it is usually studied in the context of syntax dependent transformations on programs.

We follow an alternative approach started by Pearce [38] and also studied by Osorio

et.al. [33]. This approach characterizes the answer sets of a propositional theory in

terms of intuitionistic logic and it is presented in the following theorem. The notation

is based on [33].

Theorem 4.1. Let P be any theory and M a set of atoms. M is an answer set for P

iff P ∪ ¬(LP \M) ∪ ¬¬M °I M .

For instance, if we consider the program P1 = { p ← ¬q. q. } from Example 4.2 then

we can verify that M = {q} is an answer set of P1 and that P1 ∪ {¬p} ∪ {¬¬q} °I {q}.

4.3 Additional Notation

We present a list of additional notations that will be used in the rest of this work.

• The formula f ← g is just another way of writing g → f .

• The formula (g ← f) ∧ (f ← g) can be abbreviated as g ↔ f .

• Given a set of formulas F , we define ¬F = {¬f | f ∈ F}. For instance, if F =

{¬p, q} then ¬F = {¬¬p,¬q}.

• Following the traditional notation of logic programming, we may use not instead

of ¬ and we also may use a, b instead of a ∧ b.

Page 80: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 64

• Given a set of formulas F , we write literals(F ) to denote the set of literals in F .

• Given a set of literals L, pos(L) denotes the set of positive literals in L and neg(L)

denotes the set of negative literals in L.

• Given a program P . The set of theorems of P , denoted as th(P ), can be defined

as follows: th(P ) = {α | α is a formula over LP and P ` α}. For instance, if

P = {a ← b, b} then th(P ) = {b, a, a ∧ a, a ∧ b, a → a, a → (b → a), . . .}.

• For a given set of sets of formulas R, we write K(R) to denote the set of formulas

that belong to every set in R, i.e., K(R) =⋂

S∈R S. For instance, if R = { {b, a, a∧a}, {a ∧ b, b} } then K(R) = {b}.

• A finite set of formulas P is consistent [27] if there is no formula A such that both

A and ¬A are theorems of P .

• A finite set of formulas P is complete [27] if, for any formula A of P , either P ` A

or P ` ¬A.

• A finite set of formulas P ′ is an extension of a finite set of formulas P [27] if every

theorem of P is a theorem of P ′.

• Given two sets X and Y , we write X ⊂ Y to denote that X ⊆ Y and X 6= Y .

4.4 Programs with predicate symbols and variables

As usual in answer set programming, we take for granted that a program with predicate

symbols is only an abbreviation of the ground program, denoted as ground(P ). Hence,

we are going to present the definition of predicate symbols, ground program and some

other definitions needed.

In a program we also can find an atom of the form p(a1, . . . , an) where p is an n-ary

predicate symbol and a1, . . . , an (n ≥ 0) are terms. A term may be either a variable or

Page 81: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 65

a constant. An atom with no variables is called a ground atom. Then a ground literal

is either a ground atom or its negation. The Herbrand Universe of a program is the set

of constants in the program. The Herbrand Base of a program is the set of all ground

atoms that can be constructed using the predicates in the program and the Herbrand

Universe.

Example 4.3. Let P2 be the following program:

alive(X) ← ¬death(X).

death(X) ← ¬alive(X).

object(a). object(b).

Then the Herbrand Universe is {a, b}, and the Herbrand Base is {alive(a), alive(b),

death(a), death(b)}. LP2 = {p, q}.

An instance of an atom, a literal or a formula is constructed by replacing all variables

in it by ground terms. The grounding of a program, also called the ground program, is

the set of all ground instances of the formulas of the program that may be constructed

using terms in the Herbrand Universe of the program.

Example 4.4. The grounding of the program P2, ground(P2), from Example 4.3 is :

alive(a) ← ¬death(a).

alive(b) ← ¬death(b).

death(a) ← ¬alive(a).

death(b) ← ¬alive(b).

object(a). object(b)

We recall that in fact P2 is the abbreviation of the ground program ground(P2)

Another example is the following:

Page 82: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 66

Example 4.5. Let P3 be a program with two predicate symbols, s(X) and p(X), as

follows:

p(X) ← s(X).

s(a).

s(b).

Then, P3 is only an abbreviation of the ground program ground(P3), such that ground(P3)

is the following program:

p(a) ← s(a).

p(b) ← s(b).

s(a).

s(b).

then LP3 = Lground(P3) = {s(a), s(b), p(a), p(b)}.

4.5 Adding sorts to Answer Set Programming frame-

work

In some cases, we need to model some problems using predicate symbols with variables

where these variables must be only instantiated using a subset of the Herbrand Universe

of the program. This kind of programs are called sorted programs with predicate symbols

[4]. For instance, we will use sorted programs with predicate symbols when we study the

encoding of a planning problem in Section 5.2.

Then, to define a sorted programs with predicate symbols it is necessary to specify

a nonempty set I whose members are called sorts, and asort specification for constants

and variables appearing in a predicate [4]. The sort specification assigns each predicate

symbols, variable and constant to a sort in I. Each n-ary predicate symbol is assigned

an n-tuple (si, . . . , sn), where for each i, 1 ≤ i ≤ n, si ∈ I [4]. In addition it is

Page 83: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 67

stipulated that there must be at least one constant symbol of each sort in I. The atoms,

and literals are defined as before except that they must respect the sort specifications

[4].

Example 4.6. Let P3 be the following sorted program with predicate symbols.

p(X, Y ) ← r(X),¬q(X, Y ).

r(a).

q(a, 0).

The set of sorts I is {letter, number}. The sort specifications are as follows:

sort(a) = letter, sort(0) = sort(1) = sort(2) = number; and

sort(p) = (letter, number), sort(q) = (letter, number);

sort(r) = letter.

The ground program ground(P3) is

p(a, 0) ← r(a),¬q(a, 0).

p(a, 1) ← r(a),¬q(a, 1).

p(a, 2) ← r(a),¬q(a, 2).

r(a).

q(a, 0).

The above program has the unique answer set {r(a), q(a, 0), p(a, 1), p(a, 2)}.

4.6 Answer Set Solvers and systems used in this

work

Currently, there are several answer set solvers. In this work we have used DLV1

and SMODELS2 . In particular for modeling planning problems there exist a frontend

1 http://www.dbai.tuwien.ac.at/proj/dlv/2 http://www.tcs.hut.fi/Software/smodels/

Page 84: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 68

to the DLV system called DLVK3 . Also we have used PSMODELS, a modification

of SMODELS, that can be used to compute preferred answer sets under the ordered

disjunction semantics.

In particular, in this work we used mainly SMODELS for several reasons:

—SMODELS compared with DLV allows nested predicates in a program which

results very useful when we want to express planning problems (see Section 5.2). We

recall that a program with predicate symbols is only an abbreviation of the ground

program.

—In spite of DLVK needs less time to generate the plans than SMODELS, the

second one results to be more flexible. Using SMODELS we could test consistency

restoring rules in planning problems (see Chapter 8), which it is not possible using

DLVK. Additionally, using SMODELS is possible to change in an easy way the inde-

pendent part definition of planning problems (see Subsection 5.2.2). For instance, we

could change the definition of concurrency depending of the domain description of a

planning problem.

—In this work we studied the ordered disjunction semantics (see Section 4.8) and

we proposed an extension of it. SMODELS has a modification called PSMODELS

that compute the preferred answer sets under the ordered disjunction semantics. Then

once we had the planning problem modeled using SMODELS we easily extended these

programs with ordered disjunction or extended ordered disjunction to compute the

preferred answer sets (see Chapter 6).

In this work we also worked with The Logics Workbench(LWB) 4 that offers the

possibility to work in a user-friendly way in among other logics in Intuitionistic Logic.

3 http://www.dbai.tuwien.ac.at/proj/dlv/K/4 http://www.lwb.unibe.ch/about/index.html

Page 85: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 69

4.7 CR-Programs and Abductive Logic Programs

Consistency Restoring Rules (CR-rules) are rules that are added to standard disjunctive

logic programs, but they are only applied when the standard rules in the program lead

to inconsistency. A CR-rule is written α+← β, which is intuitively read as: If the

program is inconsistent, then assume α ← β. Otherwise, ignore the rule. We recall the

following example presented in [3], since it illustrates clearly the use of CR-rules. In

this example r1 denotes the name of the CR-rule.

a ← ¬b.

¬ a.

r1 : b+← .

The first two rules are regular rules and the third rule is a CR-rule. This kind

of programs will be called CR-programs. We can see that the program without the

CR-rule is inconsistent. However, if the CR-rule is used then consistency is restored,

thus the answer set {¬a, b} is obtained.

The semantics of CR-programs are defined in terms of minimal generalized answer

sets. In [3] the authors give a translation of CR-programs into abductive logic programs,

which they call hard reduct, and the semantics are defined as the minimal generalized

answer sets of the hard reduct of the program.

The following definitions are found in [3]:

Definition 4.1. [3] An abductive logic program is a pair 〈P,A〉 where P is an arbitrary

program and A a set of atoms, called abducibles.

Page 86: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 70

Example 4.7. Let P1 be the program from Example 4 introduced in [3]:

p ← ¬q.

r ← ¬s.

q ← t.

s ← t.

← p, r.

Then, we can define 〈P1, A〉, an abductive logic program, where the set of abducibles is

A = {q, s, t, p}.

Definition 4.2. [3] Let 〈P, A〉 be an abductive logic program and ∆ ⊆ A. We say that

M(∆) is a generalized answer set of P w.r.t. A iff M(∆) is an answer set of P ∪∆.

Example 4.8. Let 〈P1, A〉 be the abductive logic program from Example 4.7 where P1

is the following program

p ← ¬q.

r ← ¬s.

q ← t.

s ← t.

← p, r.

and the set of abducibles is A = {q, s, t, p}. In Table 4.1 we present different generalized

answer sets of P1 with their corresponding subset of abducibles denoted by ∆.

Definition 4.3. [3] Let M(∆1) and M(∆2) be two generalized answer sets of P w.r.t.

A. We define M(∆1) < M(∆2) iff ∆1 ⊂ ∆2 (set inclusion order).

Example 4.9. If we consider the different generalized answer sets of program P1 from

the abductive logic program of Example 4.7 showed in Table 4.1 then, we can verify

that if M({q}) = {q, r} and M({t, q}) = {t, q, s} then M({q}) < M({t, q}) since

Page 87: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 71

∆ Generalized answer set{q} {q, r}{s} {s, p}{s, p} {s, p}{t} {t, q, s}{t, q} {t, q, s}{t, q, s} {t, q, s}

Table 4.1: Generalized answer sets of P1 with different ∆ ⊆ A.

{q} ⊂ {t, q}; or that if M({t, q}) = {t, q, r} and M({t, q, s}) = {t, q, s} then M({t, q}) <

M({t, q, r}) since {t, q} ⊂ {t, q, r}. Moreover, we can say nothing about M({q}) =

{q, r} and M({s}) = {s, p} then since {q} is not comparable with {s} w.r.t. set

inclusion and viceversa.

Definition 4.4. Let P be a program and let A be a set of atoms. M(∆) is a minimal

generalized answer set of P w.r.t. A and the ordering < iff M(∆) is a generalized

answer set of P and it is minimal w.r.t. set inclusion order.

Example 4.10. If we consider the different generalized answer sets of program P1 from

the abductive logic program of Example 4.7 showed in Table 4.1 then, we can verify

that the minimal generalized answer sets of P1 are {q, r}, {s, p} and {t, q, s}.

Finally, the following example illustrates how the semantics of CR-programs are

defined in terms of minimal generalized answer sets. As we mentioned, in [3] the

authors give a translation of CR-programs into abductive logic programs, which they

call hard reduct, and the semantics are defined as the minimal generalized answer sets

of the hard reduct of the program.

Example 4.11. Let P1 be the program from Example 4 introduced in [3] and also the

Page 88: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 72

program presented in the previous Example 4.7:

p ← ¬q.

r ← ¬s.

q ← t.

s ← t.

← p, r.

We can see that program P1 does not have answer sets. However, in order to restore

consistency, we can define a CR-Program adding some CR-rules. For instance, let us

define the CR-Program P ′1 = P1 ∪ CR1 where CR1 = {r1 : q

+←, r2 : s+←, r3 : t

+←}

p ← ¬q.

r ← ¬s.

q ← t.

s ← t.

← p, r.

r1 : q+← .

r2 : s+← .

r3 : t+← .

As we mentioned, the semantics of P ′1 is defined in terms of minimal generalized answer

sets. Then, translating P ′1 into an abductive logic program we obtain the following:

〈P1, A〉 where the set of abducibles is A = {q, s, t}. As we presented in Example 4.10

we can verify that the minimal generalized answer sets of P1 are {q, r}, {s, p} and

{t, q, s}.

Page 89: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 73

4.8 Logic Programs with Ordered Disjunction

In [7], Brewka introduced Logic Programs with Ordered Disjunction, abbreviated as

LPODs. In order to define standard ordered disjunction programs, the connective ×is added, called ordered disjunction, to the set of connectives of propositional formulas

presented in Section 4.6. The intuition behind LPODs is to express default knowledge

with knowledge about preferences in a simple and elegant way [9]. As we have mentioned

in Section 4.6, in this work we will consider only one type of negation,default negation,

but this does not affect the validity of the results as given in [7].

Example 4.12. Let us consider the following situation: A person should travel from

his/her home to school, and this person prefers to travel by bus to travel by bicycle

and prefers to travel by bicycle to walk. This person also should consider that part of

the path from his/her home to school can become blocked by snow in Winter. Then

we can model this situation considering the following ordered disjunction rule:

travelBus× travelBicycle× walk ← winter,¬pathBlocked

travelBicycle× walk ← ¬winter

Formally, an ordered disjunction program is a set of rules of the form 5 :

C1 × . . .× Cn ← A1, . . . , Am,¬B1, . . . ,¬Bk (4.1)

where Ci, Aj and Bl are all ground atoms. C1 . . . Cn are usually called the choices of

a rule and their intuitive reading is as follows: If the body is true and C1 is possible,

then C1; if Ci is not possible, then C2; . . . ; if none of C1, . . . , Cn−1 is possible then Cn.

Some special cases can be pointed out, namely n = 0 (constraints), n = 1 (extended

programs), m = k = 0 (facts).

5 Recall that ¬ represents default negation.

Page 90: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 4. ANSWER SET PROGRAMMING 74

The semantics of standard ordered disjunction programs will be presented in Section

6 where an extension of standard ordered disjunction programs is presented. In Section

6 we present the semantics of extended ordered disjunction programs and we show

that standard ordered disjunction programs are particular cases of extended ordered

disjunction programs. In this work, we will call the ordered disjunction programs

defined by Brewka [7] as standard ordered disjunction programs in order to make a

difference when we present the extended version of these programs.

Currently, there is a modification of SMODELS 6 that can be used to compute

preferred answer sets under the ordered disjunction semantics called PSMODELS7 [9].

4.9 Conclusion

In this chapter we presented a synthesis about Answer set programming framework and

its related notation that we will use in this work. We also presented a brief overview

about CR-Programs and Abductive logic programs. We studied that the semantics of a

CR-program is defined in terms of the minimal generalized answer sets of a particular

abductive logic program.

We are interested in CR-Programs since they are used as a possible solution to find

alternative evacuation problems, as we propose in Chapter 8. Additionally, in Chapter

6 we propose a characterization of minimal generalized answer sets in terms of ordered

disjunction programs. We also presented a brief overview of Logic Programs with

Ordered Disjunction introduced in [7]. In Contribution Part of this work we present

how to extended Ordered Disjunction programs and we show some of their possible

applications to real problems.

6 http://www.tcs.hut.fi/Software/smodels/7 http://www.tcs.hut.fi/Software/smodels/priority/

Page 91: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Chapter 5

Planning problems

Currently, we can find different definitions for Planning. For instance, McCarthy defines

planning in [25] as the restricted problem of finding a finite sequence of actions that

will achieve a goal, where goal is usually specified as one or a set of world states. In this

work we are interested in some formulations that attempt to solve the planning problem

based on Logic-based approaches. In this chapter we start presenting an overview about

the Logic-based Planning approaches. Then, we present an overview about one of the

AI planning approaches to model and solve planning problems in a natural and elegant

way is Answer Set Planning.

In this chapter we also study Language PP [43] that allows one to specify preferences

among feasible plans and temporal preferences over plans too. Moreover in Contribution

Part of this work we present an extension for Language PP and we show how this

language and its extension can be applied to obtain the preferred evacuation plans.

For more information about planning, [11] outlines some more classical planning

work, [41] covers most of the advances in the last 15 years in planning, and [29] presents

a summary of classical planning techniques. Finally, it is important to mention that

planning is deciding what to do, while scheduling is deciding when to do it.

75

Page 92: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 76

5.1 Planning

Logic-based Planning is also sometimes categorized as change-based planning. It is

based on an initial state, a set of actions, a goal, a planner and an executor [17]. Then

according to the initial state, the planner will try to generate a plan such that when

this plan is executed by the executor will result in the state g satisfying the goal state

description.

This definition of Logic-based Planning lead us into the definition of Situation Cal-

culus introduced in [26]. Situation Calculus is the most studied formalism for doing

causal reasoning. A situation is in principle a snapshot of the world at an instant.

One never knows a situation —one only knows facts about a situation. Events occur

in situations and give rise to new situations. There are many variants of situation

calculus, and none of them has come to dominate. Functions of situations in situation

calculus are defined in terms of fluents [25]. The simplest fluents are propositional and

have truth values. There are also fluents with values in numerical or symbolic domains.

Situational fluents take on situations as values.

Some of the different planning problems are the following:

—Frame Problem[25]. This is the problem of how to express the facts about the

effects of actions and other events in such a way that it is not necessary to explicitly

state for every event, the fluents it does not affect. For instance, traveling from Mexico

to Lyon does not affect the number of arms I have.

—Qualification Problem [25]. This concerns how to express preconditions for actions

and other events. For instance, it is necessary to have a ticket to fly on a commercial

airplane and it is also necessary to have money to buy the ticket, etc.

—Ramification Problem[25]. Events often have other effects than those we are

immediately inclined to put in the axioms concerned with the particular kind of event.

Page 93: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 77

For instance, if I travel from Mexico to Lyon, then as a result each part of the airplane

is now at Lyon, so the airplane captain, etc.

It is worth mentioning at this point, that planning is a key ability for intelligent

systems, increasing their autonomy and flexibility through the construction of sequences

of actions to achieve their goals. Planning has been an area of research in artificial

intelligence for over three decades and it is called AI planning. Planning techniques

have been applied in a variety of tasks including robotics, process planning, web-based

information gathering, autonomous agents and spacecraft mission control. AI planning

is action-based where a declarative description of actions is used. Additionally, AI

planning specifies declaratively what the operators are able to do and it is not prescribed

how to perform complex tasks, since the planner must infer that, using trial-and-error

search.

Currently, one of the AI planning approaches to model and solve planning problems

in a natural and elegant way is Answer Set Planning. We will study this approach in

the following Section.

5.2 Answer Set Planning

In a planning problem, we are interested in looking for a sequence of actions that

leads from a given initial state to a given goal state. To specify a planning problem

completely, we need to explicit which actions are allowed in a plan. The key element of

answer set planning is the representation of a dynamic domain in the form of a “history

program”—a program whose answer sets represent possible “histories”, or evolutions

of the system, over a fixed time interval.

Currently, there exist different action languages that are formal models of parts

of the natural language that are used for talking about the effects of actions and in

Page 94: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 78

particular they are used to to model planning problems [16]. Some of these action

languages are A,B, and C [16]. Moreover, a planning problem specified in these kinds

of languages has a natural and easy encoding in Answer Set Programming. In this

Section we shall present a brief overview extracted from [4] about language A and B,

the use of these languages to specify planning problems and the encoding of planning

problems in Answer Set Programming.

5.2.1 Language A

The alphabet of the language A consists of two nonempty disjoint sets of symbols F

and A. They are called the set of fluents, and the set of actions. Intuitively, a fluent

expresses the property of an object in a world, and forms part of the description of

states of the world. A fluent literal is a fluent or a fluent preceded by ∼. A state σ

is a set of fluents. We say a fluent f holds in a state σ if f ∈ σ. We say a fluent

literal ∼ f holds in σ if f 6∈ σ. Actions when successfully executed change the state

of the world. Situations are representations of the history of action execution. In the

initial situation [an, . . . , a1] corresponds to the history where action a1 is executed in the

initial situation, followed by a2, and so on until an. There is a simple relation between

situations and states. In each situation s some fluents are true and some others are

false, and this ‘state of the world’ is the state corresponding to s.

The language A can be divided in three sub-languages: Domain description lan-

guage, Observation language, and Query language. We are going to present an overview

about these sublanguages, the details can be founded in [16, 4].

• Domain description language. It is used to express the transition between states

due to actions. The domain description D consists of effect propositions of the

Page 95: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 79

following form:

a causes f if p1, . . . , pn,∼ q1, . . . ,∼ qr (5.1)

where a is an action, f is a fluent literal, and p1, . . . , pn, q1, . . . , qr are fluents.

Intuitively, the above effect proposition means that if the fluent literals p1, . . . , pn,

∼ q1, . . . ,∼ qr hold in the state corresponding to a situation s then in the state

corresponding to the situation reached by executing a in s the fluent literal f must

hold. The role of effect propositions is to define a transition function from states

and actions to states. Given a domain description D, such a transition function Φ

should satisfy the following properties. For all actions a, fluents g, and states σ:

– if D includes an effect proposition of form (5.1) where f is the fluent g and

p1, . . . , pn,∼ q1, . . . ,∼ qr hold in σ then g ∈ Φ(a, σ);

– if D includes an effect proposition of form (5.1) where f is a negative fluent

literal ∼ g and p1, . . . , pn,∼ q1, . . . ,∼ qr hold in σ then g 6∈ Φ(a, σ); and

– if D does not include such effect proposition, then g ∈ Φ(a, σ) iff g ∈ σ.

• Observation language. A set of observations O consists of value propositions of the

following form:

f after a1, . . . , am (5.2)

where f is a fluent literal and a1, . . . , am are actions. Intuitively, the above value

proposition means that if a1, . . . , am would be executed in the initial situation then

in the state corresponding to the situation [am, . . . , a1], f would hold.

When a1, . . . , am is an empty sequence, we write the above as follows:

initially f (5.3)

In this case the intuitive meaning is that f holds in the state corresponding to the

initial situation. Given a consistent domain description D the set of observations

Page 96: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 80

O is used to determine the states corresponding to the initial situation, referred to

as initial states and denoted by σ0.

• Query language. Queries also consist of value propositions of the form (5.2). We

say a consistent domain description D in the presence of a set of observations O

entails a query Q of the form (5.2) if for all initial states σ0 corresponding to (D,O),

the fluent literal f holds in the state [am, . . . , a1]σ0. We denote this as D |=O Q.

Language A also can be extended to allow executability conditions and static causal

propositions in the domain description part. Intuitively they indicate if an action is

executable in a given state. An executability condition has the following form:

executable a if p1, . . . , pn,∼ q1, . . . ,∼ qr (5.4)

where a is an action and, p1, . . . , pn, q1, . . . , qr are fluents. Intuitively, the above exe-

cutability condition means that if the fluent literals p1, . . . , pn,∼ q1, . . . ,∼ qr hold in

the state σ of a situation s, then the action a is executable in s.

In particular, the language A can be used to model planning problems. In planning

a domain description D, a set of observations about the initial state O, and a collection

of fluent literals G = {g1, . . . , gl}, which we will refer to as a goal are given. We are

required to find a sequence of actions a1, . . . , an such that for all 1 ≤ i ≤ l, D |=O

gi after a1, . . . , an. We then say that a1, . . . , an is a plan for goal G (or achieves

goal G) with respect to (D, O). Given a plan a1, . . . , an for a goal G with respect to

(D, O), we also say that the sequence σ0, a1, σ1, . . . , an, σn where σ0 is the initial state

and σi = ΦD(ai, σi−1) with 1 ≤ i ≤ n is a history of the transition function ΦD.

The following example shows how to specify the simple blocks world planning prob-

lem in language A that it is presented in [4].

Example 5.1. The simple blocks world planning problem in language A:

Page 97: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 81

1. Sort: block(X). In the rest of this example, X and Y range over the sort block.

2. Fluents: on(X,Y ), ontable(X), clear(X), holding(X), handempty

3. actions: pick up(X), put down(X), stack(X, Y ), unstack(X,Y )

4. Executability conditions, denoted by D:

executable pick up(X) if clear(X), ontable(X), handempty.

executable put down(X) if holding(X).

executable stack(X, Y ) if holding(X), clear(Y ).

executable unstack(X,Y ) if clear(X), on(X, Y ), handempty.

5. Effect propositions.

pick up(X) causes ∼ ontable(X),∼ clear(X), holding(X),∼ handempty.

put down(X) causes ontable(X), clear(X),∼ holding(X), handempty.

stack(X, Y ) causes ∼ holding(X),∼ clear(Y ), clear(X), handempty, on(X,Y ).

unstack(X, Y ) causes holding(X), clear(Y ),∼ clear(X),∼ handempty,∼ on(X, Y ).

6. Considering that the sort blocks as {a, b, c, d} the initial conditions, denoted by I,

are described as:

initially(clear(a)).

initially(clear(c)).

initially(clear(d)).

initially(ontable(c)).

initially(ontable(b)).

initially(on(a, b)).

initially(on(d, c)).

initially(handempty).

7. The goal conditions, denoted by G, are the set of literals {on(a, c), on(c, b), ontable(d)}.

Page 98: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 82

5.2.2 Answer set encoding of planning problems modeled in

language A

Given a planning problem expressed in an action language by means of a triple (D, O, G)

such that D is a domain description, O is a set of observations and G is the set of goal

conditions, it is possible to define different answer set encodings of it. In this section

we present one of them that it is described in [4], denoted as π(D, O, G, l) where l is

a positive integer corresponding to the length of the plan, i.e., the number of actions

that must be performed to achieve the goal. Then, it is possible to obtain the solution

of the planning problem (the plans) from the answer sets of π(D, O,G, l). The basic

idea is that we decide on a plan length l to enumerate action occurrences up to time

points corresponding to that length, and to encode goals as constraints about the time

point l + 1, such that possible answer sets that encode action occurrences that do not

satisfy the goal at time point l + 1 are eliminated. Thus each of the answer sets which

survived the constraints encodes a plan. Then, given a domain description D, a set of

observations O, a plan length l, and the goal conditions G, we construct the following

program π(D, O,G, l). The encoding π(D,O,G, l) is divided in two parts: the domain

dependent part, denoted as πdep(D, O, G, l), and the domain independent part, denoted

as πindep(D,O,G, l). The former is a direct translation of the domain description in

language A. The latter is independent of the domain and may be used for planning

with other domains.

It is important to mention that we have two sorts (see Section 4.1): fluents and

actions, and variables of these sorts are denoted by A,A′, . . ., F, F ′, . . . respectively. The

sorts of the arguments of function symbols and predicates are clear from the context.

We are going to present the answer set encoding given in [4] about the simple blocks

world planning problem from Example 5.1 expressed in an action language A.

Page 99: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 83

It is important to mention that in the answer set encodings of planning problems

expressed in action language A that we present in this work, if f is a negative fluent

literal ∼ g then f will be encoded as neg(g). Moreover, neg(g) corresponds to the

strong or classical negation as we will see in the complete encoding when we present

the set of axioms that define neg(g).

The answer set encoding is defined as follows:

1. The Domain dependent part πdep(D, O, G, l): This consists of five parts, defining

the domain, the executability conditions, the dynamic causal laws, the initial state,

and the goal condition.

(a) The domain πdep.dom(D): This part defines the objects in the world, the fluents

and the actions.

For instance:

block(a). block(b). block(c). block(d).

f luent(on(X, Y )) ← block(X), block(Y ).

f luent(ontable(X)) ← block(X).

fluent(clear(X)) ← block(X).

f luent(holding(X)) ← block(X).

fluent(handempty).

action(pickup(X)) ← block(X).

action(putdown(X)) ← block(X).

action(stack(X, Y )) ← block(X), block(Y ).

action(unstack(X,Y )) ← block(X), block(Y ).

(b) Translating executability conditions πdep.exec(D): Here, exec(a, p) means that p

is among the executability conditions of a, and intuitively, a is executable in a

state if all its executability conditions hold in that state. The later part will be

Page 100: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 84

encoded as a domain independent rule. Hence, for every executability condition

of the form (5.4), i.e., executable a if p1, . . . , pn,∼ q1, . . . ,∼ qr πdep.exec(D)

contains a the following set of rules:

exec(a, p1).

exec(a, p1)

...

exec(a, pn).

exec(a, neg(q1)).

...

exec(a, neg(qr)).

For instance:

exec(pick up(X), clear(X)).

exec(pick up(X), ontable(X)).

exec(pick up(X), handempty).

exec(put down(X), holding(X)).

exec(stack(X, Y ), holding(X)).

exec(stack(X, Y ), clear(Y )).

exec(unstack(X, Y ), clear(X)).

exec(unstack(X, Y ), on(X, Y )).

exec(unstack(X, Y ), handempty).

(c) Translating effect propositions πdep.dyn(D): The effect propositions in D are

translated as follows. For every effect proposition of the form (5.1), i.e.,

a causes f if p1, . . . , pn,∼ q1, . . . ,∼ qr if f is a fluent then πdep.dyn(D) contains

the following rule:

causes(a, f).

Page 101: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 85

else, if f is the negative fluent literal ∼ g then πdep.dyn(D) contains the following

rule:

causes(a, neg(g)).

For instance:

causes(pick up(X), neg(ontable(X))).

causes(pick up(X), neg(clear(X))).

causes(pick up(X), holding(X)).

causes(pick up(X), neg(handempty)).

causes(put down(X), ontable(X)).

causes(put down(X), clear(X)).

causes(put down(X), neg(holding(X))).

causes(put down(X), handempty).

causes(stack(X,Y ), neg(holding(X))).

causes(stack(X,Y ), neg(clear(Y ))).

causes(stack(X,Y ), clear(X)).

causes(stack(X,Y ), handempty).

causes(stack(X,Y ), on(X, Y )).

causes(unstack(X,Y ), holding(X)).

causes(unstack(X,Y ), clear(Y )).

causes(unstack(X,Y ), neg(clear(X))).

causes(unstack(X,Y ), neg(handempty)).

causes(unstack(X,Y ), neg(on(X, Y ))).

(d) Translating observations πdep.init(O): This part defines the initial state by ex-

plicitly listing which fluents are true in the initial state. It is assumed that the

fluents not explicitly listed to be true are false in the initial state. Thus the

Page 102: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 86

knowledge about the initial state is assumed to be complete. For every value

proposition of the form (5.2), i.e., initially f if f is a fluent then πdep.init(O)

contains the following rule:

initially(f).

else, if f is the negative fluent literal ∼ g then πdep.init(O) contains the following

rule:

initially(neg(g)).

For instance:

initially(handempty).

initially(clear(a)).

initially(clear(d)).

initially(ontable(c)).

initially(ontable(b)).

initially(on(a, b)).

initially(on(d, c)).

(e) Goal conditions πdep.goal(G): This part lists the fluent literals that must hold

in a goal state. For every fluent literal in G, if f is a fluent then πdep.goal(G)

contains the following rule:

finally(g).

else, if f is the negative fluent literal ∼ g then πdep.goal(G) contains the following

rule:

finally(neg(g)).

For instance:

finally(on(a, c)).

f inally(on(c, b)).

Page 103: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 87

finally(ontable(d)).

2. The domain independent part πindep(D, O, G, l): This part is independent from the

content of particular domain.

(a) Defining time: In answer set planning, we need to give either the exact bound

or at least an upper bound of the plan lengths that we want to consider. This is

what makes each answer set finite. The encoding πindep depends on a constant

referred to as length which is the upper bound of the length of plans that we

intend to consider. Using this length we define a predicate time which specifies

the times points of our interest.

time(1). . . . time(length).

(b) Defining goal(T ): The following rules define when all the goal conditions are

satisfied.

not goal(T ) ← time(T ), f inally(X),¬holds(X,T ).

goal(T ) ← time(T ),¬not goal(T ).

(c) Eliminating possible answer sets which do not have a plan of the given length:

The following constraint eliminates possible answer sets where the goal is not

satisfied in the last time point of interest.

← ¬ goal(length).

(d) Defining contrary : The following facts define when a fluent literal is the nega-

tion of the other.

contrary(F, neg(F )).

contrary(neg(F ), F ).

(e) Defining executability : The following two rules use the executability conditions

to define when an action A is executable in a time T . Note that we are only

interested in times before the time point denoted by length, as no actions are

Page 104: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 88

supposed to occur after that.

not executable(A, T ) ← exec(A,F ),¬holds(F, T ).

executable(A, T ) ← T < length,¬not executable(A, T ).

(f) Fluent values at time point 1:

holds(F, 1) ← initially(F ).

(g) Effect axiom: The following rule describes the change in fluent values due to

the execution of an action.

holds(F, T + 1) ← T < length, executable(A, T ), occurs(A, T ), causes(A,F ).

(h) Inertia: The following rule describes which fluents do not change there values

after an action is executed. In the literature, this is referred to as the frame

axiom.

holds(F, T + 1) ←contrary(F, G), T < length, holds(F, T ),¬holds(G, T + 1).

(i) Occurrences of actions : The following rules enumerate action occurrences.

They encode that in each answer set at each time point only one of the ex-

ecutable actions occurred. Also, for each action that is executable in an answer

set at a time point, there is an answer set where this action occurs at that time

point.

occurs(A, T ) ← action(A), time(T ),¬goal(T ),¬not occurs(A, T ).

not occurs(A, T ) ← action(A), action(AA), time(T ), occurs(AA, T ), A 6= AA.

← action(A), time(T ), occurs(A, T ),¬executable(A, T ).

5.2.3 Language B

Language B results when Language A is extended to allow static causal propositions.

Using static causal propositions we can express knowledge about the states directly in

Page 105: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 89

terms of what are possible or valid states and this knowledge can be used to indirectly

infer effects of actions, executability of actions, or both. A static causal proposition is

of the form

p1, . . . , pn,∼ q1, . . . ,∼ qr causes f (5.5)

where p1, . . . , pn, q1, . . . , qr are fluents and f is either fluent literal, or a special symbol

false.

We say a state σ satisfies a static causal proposition of the form 5.5 if: (i) f is a

literal and p1, . . . , pn,∼ q1, . . . ,∼ qr hold in σ implies that f holds in σ; or (ii) f is

false and at least one of p1, . . . , pn,∼ q1, . . . ,∼ qr does not hold in σ. Two examples

of static causal propositions are position(X) causes ∼ position(Y ) ifX 6= Y and

married to(X)∧married to(Y )∧X 6= Y causes false. In particular, the static causal

proposition in the second example expresses a constraint since the fluent corresponds

to false.

Given a domain description D consisting of effect propositions, executability con-

ditions, and static causal propositions, and a set of observations O about the initial

situation we say σ0 is an initial state corresponding to D and O if (i) for all the ob-

servations of the form initially f in O, f holds in σ0 , and (ii) σ0 satisfies the static

causal propositions in D.

We say σ0, a1, σ1, a2, σ2 . . . an, σn is a valid trajectory of (D,O), if (a) σ0 is an initial

state corresponding to (D, O), (b) for 1 ≤ i ≤ n, ai is executable in σi−1, and (c) for

1 ≤ i ≤ n, σi ∈ ΦD(ai, σi−1).

More details about static causal propositions, answer set encoding od of planning

problems expressed in Language B can be found in [4].

Page 106: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 90

5.3 A language for Planning Preferences: PP Lan-

guage

Language PP [43] is a language for the specification of user preferences with a logic

programming implementation of it, based on answer set programming. Language PPallows someone to specify preferences among feasible plans and temporal preferences

over plans too. The preferences representing time are expressed using the temporal

connectives next, always, until and eventually. There are three different classes of

preferences in PP [43] basic desires, atomic preferences and general preferences. In this

work we studied the two first classes of preferences because seems that they are useful

to express preferences in evacuation plans.

A basic desire, denoted as ϕ, is a PP formula expressing a preference about a

trajectory with respect to the execution of some specific action or with respect to the

states that the trajectory gets when an action is executed. In particular, PP defines

goal preferences to define preferences in the final state.

The set of basic desires of language PP can be defined inductively by the fol-

lowing context-free grammar GPP := (N, Σ, P, S), such that N := {S} is the fi-

nite set of non terminals; Σ := A ∪ FF is the finite set of terminals (N ∩ Σ = ∅)where A and FF represent the set of actions of the problem and the set of all flu-

ent formulas (propositional formulas based on fluent literals) respectively; S ∈ N

is the initial symbol of the grammar; and P := {S → p|goal(p)|occ(a)|S ∧ S|S ∨S|¬S|next(S)|until(S, S)|always(S)|eventually(S)} is the finite set of productions

or rules where p ∈ FF and a ∈ A.

The following definition from [43] allows one to check whether a trajectory satisfies

a basic desire formula where, given a trajectory α = s0a1s1a2s2 . . . ansn the notation

α[i] denotes the trajectory siai+1si+1 . . . ansn.

Page 107: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 91

Definition 5.1. [43] Let α = s0a1s1a2s2 . . . ansn be a trajectory, and let ϕ be a basic

desire formula. α satisfies ϕ (written as α |= ϕ) iff

• ϕ = goal(ψ) and sn |= ψ

• ϕ = ψ ∈ FF and s0 |= ψ

• ϕ = occ(a), a1 = a, and n ≥ 1

• ϕ = ψ1 ∧ ψ2, α |= ψ1 and α |= ψ2

• ϕ = ψ1 ∨ ψ2, α |= ψ1 or α |= ψ2

• ϕ = ¬ψ and α 6|= ψ

• ϕ = next(ψ), α[1] |= ψ, and n ≥ 1

• ϕ = always(ψ) and ∀(0 ≤ i ≤ n) we have that α[i] |= ψ

• ϕ = eventually(ψ) and ∃(0 ≤ i ≤ n) such that α[i] |= ψ

• ϕ = until(ψ1, ψ2) and ∃(0 ≤ i ≤ n) such that ∀(0 ≤ j < i) we have that α[j] |= ψ1

and α[i] |= ψ2.

Definition 5.1 will also allow one to compare trajectories.

Definition 5.2. [43] Let ϕ be a basic desire formula and let α and β be two trajectories.

The trajectory α is preferred to the trajectory β (denoted as α ≺ϕ β) if α |= ϕ and

β 6|= ϕ.

We say that α and β are indistinguishable (denoted as α ≈ϕ β) if one of the two

following cases occur: (i) α |= ϕ and β |= ϕ, or (ii) α 6|= ϕ and β 6|= ϕ.

Whenever it is clear from the context, we will omit ϕ from ≺ϕ and ≈ϕ.

Definition 5.3. [43] Let ϕ be a basic desire formula. A trajectory α is said to be a

most preferred trajectory w.r.t. ϕ, if there is no trajectory β such that β ≺ϕ α.

Page 108: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 92

Example 5.2. [43] Let us considering example given in Subsection 5.2.2 about the

blocks world domain where there are four blocks a, b, c, d on a table and the goal is

to have block a on block c and block c on block b. We also presented the three feasible

plans p1, p2 and p3:

1. p1 = unstack(a, b) put down(a) unstack(d, c) put down(d) pick up(c) stack(c, b)

pick up(a) stack(a, c).

2. p2 = unstack(d, c) put down(d) unstack(a, b) put down(a) pick up(c) stack(c, b)

pick up(a) stack(a, c).

3. p3 = unstack(d, c) put down(d) unstack(a, b) stack(a, d) pick up(c) stack(c, b)

unstack(a, d) stack(a, c).

To express that we would like to stack a on top of d and unstack a from the top of

d, we can write the following basic desire:

ϕ1 = eventually(occ(stack(a, d) ∧ occ(stack(a, d))

If we do not desire to have a on the table, we can write the basic desire:

ϕ2 = always(¬ontable(a)).

Moreover if α1, α2 and α3 are the trajectories corresponding to plans p1, p2 and p3

respectively then α3 ≺ϕ1 α2 (α3 is preferred to the trajectory α2) and α3 ≺ϕ1 α2 (α3 is

preferred to the trajectory α2).

An atomic preference represents an ordering between basic desire formulas. It in-

dicates that trajectories that satisfy ϕ1 are preferable to those that satisfy ϕ2, etc.

Clearly, basic desire formulas are special cases of atomic preferences.

Definition 5.4. [43] An atomic preference formula is defined as a formula of the type

ϕ1 C ϕ2 C . . . C ϕn (n ≥ 1) where ϕ1, ϕ2, . . . , ϕn are basic desire formulas.

Then the definition to compare trajectories w.r.t. atomic preferences is the following:

Page 109: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 93

Definition 5.5. [43] Let α, β be two trajectories, and let Ψ = ϕ1 C ϕ2 C . . . C ϕn be

an atomic preference formula.

— α, β are indistinguishable w.r.t. Ψ (written as α ≈Ψ β) if ∀i.[1 ≤ i ≤ n ⇒ α ≈ϕiβ].

— α is preferred to β w.r.t. Ψ (written as α ≺Ψ β) if ∃(1 ≤ i ≤ n) such that (a)

∀(1 ≤ j < i) we have that α ≈ϕjβ, and (b) α ≺ϕi

β. We will say that α ¹Ψ β if either

α ≺Ψ β or α ≈Ψ β.

5.3.1 Computing answer sets of planning problems with pref-

erences

In order to compute the preferred trajectories of a planning problem expressed in an

action language w.r.t. ψ a preference of any of the three classes, in [43] is defined the

answer set encoding Π(D, O, G, l, ψ) as π(D, O, G, l) ∪Πψ ∪Πsat where π(D,O,G, l) is

the answer set encoding of the planning problem as defined in [4], Πψ is the encoding

of the preference formula ψ and Πsat are the set of rules for checking of basic desire

formula satisfaction. Moreover, if M is an answer set of π(D,O,G, l), then αM denotes

the plan achieving the goal G represented by M .

It is worth mentioning that in particular [43] shows how we can obtain the most

preferred trajectory with respect to a basic desire or an atomic preference. It is assigned

a weight to each component of the preference formula, then the weight of each trajectory

is obtained based on the weight of each component of the preference formula satisfied by

the trajectory. Finally, in order to obtain the most preferred trajectory, i.e., the answer

sets with maximal weight it is used the maximize construct in SMODELS. In [43] it

is recommended to use jsmodels since SMODELS has some restrictions on using the

maximize construct. Moreover, in [43] it is showed how an atomic preference of PPcan be mapped to a collection of standard ordered rules as defined by Brewka in order

Page 110: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 94

to obtain the most preferred trajectory. However, the use of weights or the mapping

results in a complicated encoding. In Subsection 8.3.1 we show that extended ordered

rules with negated negative literals allows a simpler and easier encoding.

5.4 Conclusion

In this chapter we presented an overview about the Logic-based Planning approaches, in

particular we presented an overview about one of the AI planning approaches to model

and solve planning problems in a natural and elegant way is Answer Set Planning.

In the contribution part of this work we shall use Answer Set Planning to specify

and encode the evacuation planning problems.

In this chapter we also studied Language PP [43] that allows one to specify pref-

erences among feasible plans and temporal preferences over plans too. Moreover in

Contribution Part of this work we shall present an extension for Language PP and we

shall show how this language and its extension can be applied to obtain the preferred

evacuation plans.

Page 111: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Part II

Contribution

95

Page 112: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Introduction

We recall that the objective of our work is to investigate and evaluate the capabilities

of Answer Set Programming to represent disaster situations to give support in defining

evacuation plans. Then we started analyzing how geographic information about the dis-

aster zone can be translated into a format that Answer Sets is capable to understand.

We continued studying and applying different Answer Set approaches that are useful

to define the evacuation plans, such as, Answer Set Planning, CR-rules, Ordered Dis-

junction programs, Language PP for planning preferences, and Minimal Generalized

Answer Sets.

In the Contribution part of this work we show how and why the Answer Set ap-

proaches mentioned above were applied to define evacuation plans and we also present

some lacks of them that this work want to address.

First at all, we have to mention that we start this part proposing a procedure to

construct the hazard zone background knowledge from geographic information. This

procedure is result of our own experience dealing with this kind of data. It is worth

to mention that in this work we tested all of our results with a short part of the real

geographic data about Volcano Popocatepetl hazard zone, since the total real data of

this zone were obtained almost at the end of this work.

In order to obtain the evacuation plans, we started modeling the evacuation planning

problem using Answer Set Planning. As we know, normally in a zone of risk there is

96

Page 113: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 97

a set of pre-defined evacuation routes. However, in a real case is possible that part

of the pre-defined evacuation routes become blocked, then generation of alternative

evacuation plans is necessary. Then, the model that we propose in this work considers

this possible scenario.

At the beginning, we tried to specify this problem using only Answer Set Planning

where a set of actions were defined in order to travel by the different possible paths

in the risk zone. However after different intents, we realized that using only Answer

Set Planning to specify this problem does not result in a natural way. Hence we

proposed to extend our model of evacuation plans adding CR-rules. The idea is to

obtain the alternative evacuation plans taking advantage of the definition of a CR-

rule and use it only if there is no way to obtain an evacuation plan when part of

the pre-defined evacuation route is blocked. Additionally, since the semantics of a

CR-program is defined in terms of the minimal generalized answer sets, we propose a

characterization of them in terms of ordered disjunction programs. This result proves

that both abductive programs and programs with CR-rules can be properly represented

using ordered disjunction.

Using CR-rules makes it possible to obtain the alternative evacuation plans but

the problem now is that these alternative evacuation plans do not consider any other

characteristic of the path that they follow. Then, we realized that we needed to apply

the concept of preference to obtain an appropriate evacuation plan. For instance, we

would like to express that it is preferred that in an alternative evacuation route buses

travel only by roads belonging to some evacuation route and it is not important if they

travel or not by its assigned evacuation route. Hence, we propose to use language PPin order to express preferences at different levels over the alternative plans and because

it allows us to express preferences over plans where the satisfaction of these preferences

depends on time and on their temporal relationships.

Page 114: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 5. PLANNING PROBLEMS 98

While we used PP to express preferences we realized that there are some preferences

that cannot be expressed in a simple and natural way since they result very large. Then,

in order to have a natural representation of these kind of preferences we define PPpar

language. PPpar is an extension of PP language where propositional connectives and

temporal connectives allow us to represent compactly preferences having a particular

property. Since we consider that language PP could take advantage of the working

framework of propositional Linear Temporal Logic LTL to express preferences, we also

present a brief overview about the relationship between language PP and LTL.

We also studied ordered disjunction programs since they can be used to express

preferences. We proposed an extension of them to a wider class of logic programs that

we called extended ordered disjunction programs. Moreover, we shown that in particular

extended ordered rules with negated negative literals could be useful to allow a simpler

and easier encoding to obtain the preferred plans with respect to a preference expressed

in language PP . We also considered them to obtain the maximal answer sets of a

program characterizing an Argumentation Framework such that these maximal answer

sets correspond to the preferred extensions of it.

Finally, we introduce the notion of Semantic Contents of a program as an alternative

point of view to obtain different answer set semantics of a program. In particular, we

show how to obtain the standard answer sets, the generalized answer sets, the minimal

generalized answer sets and a new answer set semantic introduced in this section called

partial answer sets. In particular we present an example in a planning domain where

partial answer sets could be useful.

Page 115: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Chapter 6

Extended ordered disjunctionprograms

As we have described in Section 4.8, Brewka introduced in [9] the connective ×, called

ordered disjunction, to express default knowledge with knowledge about preferences in

a simple and elegant way. While the disjunctive clause a∨b is satisfied equally by either

a or b, to satisfy the ordered disjunctive clause a × b, a will be preferred to b, i.e. a

model containing a will have a better satisfaction degree than a model that contains b

but does not contain a. For example, the natural language statement “I prefer travel by

bus to walk” can be expressed as travelBus×walk and a model containing travelBus

will be preferred to a model that contains walk.

In this chapter we introduce extended ordered disjunction programs. The definition

presented here extends ordered disjunction programs to a wider class of logic programs1

[35].

We saw (in Section 4.7) that the semantics of a CR-program is defined in terms

of the minimal generalized answer sets of a particular abductive logic program. This

abductive logic program is based on the original program and a set of abducibles which

1 Moreover, while the extension introduced in [35] is in the context of Answer Sets, the extensionintroduced in [8] for the operator × is in a different context.

99

Page 116: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 100

corresponds to a subset of the signature of this original program. In this chapter, we

also propose a characterization of minimal generalized answer sets in terms of ordered

disjunction programs.

In this chapter we also propose to specify a preference ordering among the answer

sets of a program with respect to an ordered list of atoms using a particular set of

extended ordered disjunction programs [46]. We propose to use double default negation

in each atom of the ordered rule that represents the mentioned list of atoms. We also

mention a second application of extended ordered disjunction programs with double

default negation to obtain the maximal answer set of a program. Finally, we show how

to compute the preferred answer sets for extended ordered programs using PSMODELS.

6.1 Definition of extended ordered disjunction pro-

grams

In [7] the head of ordered disjunction rules is defined in terms of ground literals, now in

this chapter, the head and the body of extended ordered disjunction rules are defined in

terms of well formed propositional formulas. We think that a broader syntax for rules

could give us some benefits. For example, the use of nested expressions could simplify

the task of writing logic programs and improve their readability since, it could allows

us to write more concise rules and in a more natural way. Another example is presented

in [22] where the authors discuss that for some knowledge representation problems, an

extension to the answer set semantics is needed. They introduce parametric connectives

and present the solution to some problems using this extension. Another alternative

that has been recognized lately as an extension that allows more natural problem solving

is the use of implication in the body of rules, since it would provide a more uniform and

Page 117: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 101

natural encoding. The need of it arises both while modeling real applications as well

as for research purposes. In [31] an application is shown where embedded implication

gives a natural representation to a real problem. Hence, we believe that it is worth

it to present a generalization of ordered disjunctions to more general theories. We

present a simple example that uses an extended ordered disjunction program in order to

illustrate how modeling a problem using a broader syntaxis results more natural, direct

and intuitive: I prefer travel by airplane to either travel by bus other travel by train,

but between travel by bus and travel by train I don’t have any particular preference.

Then, using an extended ordered program we could just write travelByAirplan ×(travelByBus ∨ travelByTrain).

Definition 6.1. An extended ordered disjunction rule is either a well formed proposi-

tional formula as defined in Section 4.6, or a formula of the form:

f1 × . . .× fn ← g (6.1)

where f1, . . . , fn, g are well formed propositional formulas. An extended ordered dis-

junction program is a finite set of extended ordered disjunction rules.

The formulas f1 . . . fn are usually called the choices of a rule and their intuitive

reading is as follows: if the body is true and f1 is possible, then f1; if f1 is not possible,

then f2; . . . ; if none of f1, . . . , fn−1 is possible then fn.

The particular case where all fi are literals and g is a conjunction of literals cor-

responds to the original ordered disjunction programs as presented by Brewka in [7],

and as we indicated before we call them standard ordered disjunction programs. We

recall that Brewka’s ordered disjunction programs use the strong negation connective.

Here we will consider only one type of negation (default negation) but this does not

affect the results given in [7]. If additionally n = 0 the rule is a constraint, i.e, ⊥ ← g.

Page 118: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 102

If n = 1 it is an extended rule and if g = > the rule is a fact and can be written as

f1 × . . .× fn.

An extended ordered disjunction program and a standard ordered disjunction program

can be called just extended ordered program and standard ordered program respectively

where no ambiguity arises.

Example 6.1. A person should travel from his/her home to school in winter. This

person prefers to travel by bus and to drink tea inside the bus rather than travel by

bicycle. Additionally, he/she prefers to travel by bicycle rather than walk. This person

also should consider that part of the path from his/her home to school can become

blocked by snow in winter. Then, we can model this situation considering the following

extended ordered disjunction program P :

winter.

(travelBus ∧ drinkTea)× travelBicycle× walk ← winter,¬pathBlocked.

Now, we present the semantics of extended ordered disjunction programs. Most

of the definitions presented here are taken from [7, 9]. The relevant difference is the

satisfaction degree. The reader may see that the satisfaction degree as defined here

is just a straightforward generalization of Brewka’s definition [7, 9], according to our

notation and Theorem 4.1 (see Section 4.2). Hence, standard ordered programs are

special cases of extended ordered programs, thus all results hold for this restricted class

as well.

Definition 6.2. [7]Let r := f1 × . . . × fn ← g be an extended ordered rule. For

1 ≤ k ≤ n the k-th option of r is defined as follows:

rk := fk ← g,¬f1, . . .¬fk−1

Page 119: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 103

Definition 6.3. [7] Let P be an extended ordered program. P ′ is a split program of P

if it is obtained by replacing each rule r := f1× . . .× fn ← g in P by one of its options

r1, . . . , rk.

Definition 6.4. [9] Let P be an extended ordered program. M is an answer set of P

iff it is an answer set2 of a split program P ′ of P .

Definition 6.5. [7]Let M be an answer set of an extended ordered program P and let

r := f1× . . .× fn ← g be a rule of P . We define the satisfaction degree of r with respect

to M, denoted by degM(r), as follows:

• if M ∪ ¬(LP \M) 6`I g, then degM(r) = 1.

• if M ∪ ¬(LP \M) `I g then degM(r) = min1≤i≤n {i | M ∪ ¬(LP \M) `I fi}.

Example 6.2. If we consider the extended ordered program P of Example 6.1 then we

2 Note that since we are not considering strong negation, there is no possibility of having inconsistentanswer sets.

Page 120: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 104

can obtain the following split programs from it:

P ′ :

winter.

(travelBus ∧ drinkTea) ← winter,¬pathBlocked.

P ′′ :

winter.

travelBicycle ← winter,¬pathBlocked,¬(travelBus ∧ drinkTea).

P ′′′ :

winter.

walk ← winter,¬pathBlocked,¬(travelBus ∧ drinkTea),¬travelBicycle.

Moreover, M1 = {winter, (travelBus∧drinkTea)}, M2 = {winter, travelBicycle} and

M3 = {winter, walk} are answer sets of P since they are the answer sets of each split

program respectively.

Finally, if r1 denotes the rule winter of program P and r2 denotes the rule (travelBus∧drinkTea) × travelBicycle × walk ← winter,¬pathBlocked of program P , then the

satisfaction degrees of each rule according to answer sets M1, M2 and M3 are the fol-

lowing:

degM1(r1) = 1, degM1(r2) = 1.

degM2(r1) = 1, degM2(r2) = 2.

degM3(r1) = 1, degM3(r2) = 3.

The following theorem states the relationship between the answer sets of an extended

ordered program and the satisfaction degree of each rule in the program.

Page 121: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 105

Theorem 6.1. [7] Let P be an extended ordered program. If M is an answer set of P

then M satisfies all the rules in P to some degree.

Proof. The key issue is to observe that given a model M then ²M f iff M∪¬(LP \M) `I

f , since M ∪¬(LP \M) is complete then M ∪ ¬(LP \M) defines a theory that proves

f (See [32]). The rest of the proof follows from the proof in [9], generalized according

to Definition 6.5.

Definition 6.6. [9] Let P be an extended ordered program and M a set of literals. We

define:

SiM(P ) = {r ∈ P | degM(r) = i} (6.2)

Example 6.3. If we consider the extended ordered program P from Example 6.1 and

the satisfaction degrees of rules r1 and r2 according to answer sets M1, M2 and M3 from

Example 6.2 then we can obtain the following:

S1M1

(P ) = {r1, r2} . S2M1

(P ) = {} . S3M1

(P ) = {}

S1M2

(P ) = {r1} . S2M2

(P ) = {r2} . S3M2

(P ) = {}

S1M3

(P ) = {r1} . S2M3

(P ) = {} . S3M3

(P ) = {r2}

With the definitions presented, we now introduce two different types of preference

relations among the answer sets of an extended ordered program: inclusion based pref-

erence and cardinality based preference.

Definition 6.7. [9] Let M and N be answer sets of an extended ordered program P .

Then we say that M is inclusion preferred to N , denoted as M >i N , iff there is an i

such that SiN(P ) ⊂ Si

M(P ) and for all j < i, SjM(P ) = Sj

N(P ).

Page 122: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 106

Example 6.4. If we consider the extended ordered program P from Example 6.1 and

the results from Example 6.3, then we can verify that M1 is inclusion preferred to M2 and

to M3, i.e., M1 >i M2 and M1 >i M3 since S1M2

(P ) ⊂ S1M1

(P ) and S1M3

(P ) ⊂ S1M1

(P ).

Definition 6.8. [9] Let M and N be answer sets of an extended ordered program P .

Then we say that M is cardinality preferred to N , denoted as M >c N , iff there is an

i such that |SiM(P )| > |Si

N(P )| and for all j < i,∣∣Sj

M(P )∣∣ =

∣∣SjN(P )

∣∣.

Example 6.5. If we consider the extended ordered program P from Example 6.1 and

the results from Example 6.3, then we can verify that M2 is cardinality preferred to

M3, i.e., M2 >c M3 since |S2M2

(P )| > |S2M3

(P )| and |S1M2

(P )| = |S1M3

(P )|.We also can verify that M1 is cardinality preferred to M2 and to M3, i.e., M1 >c M2

and M1 >c M3 since |S1M1

(P )| > |S1M2

(P )| and |S1M1

(P )| > |S1M3

(P )|.

Definition 6.9. [9] Let M be an answer set of an extended ordered program P . M is

an inclusion preferred answer set of P if there is no answer set M ′ of P , M 6= M ′, such

that M ′ >i M .

Definition 6.10. [9] Let M be an answer set of an extended ordered program P . M

is a cardinality preferred answer set of P if there is no M ′ answer set of P , M 6= M ′,

such that M ′ >c M .

Example 6.6. If we consider the extended ordered program P from Example 6.1, the

results from Example 6.3, Example 6.4 and Example 6.5 then we can verify that M1

is the inclusion preferred answer set of P and the cardinality preferred answer set of

P .

Page 123: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 107

6.2 Translation from an abductive logic program to

a standard ordered disjunction program

In Section 4.7 we reviewed CR-programs. We saw that the semantics of a CR-program

is defined in terms of the minimal generalized answer sets of a particular abductive

logic program. This abductive logic program is based on the original program and a set

of abducibles which corresponds to a subset of the signature of this original program.

In this section, we propose a characterization of minimal generalized answer sets

in terms of ordered disjunction programs. This theoretical result proves that both

abductive programs and programs with CR-rules can be properly represented using

ordered disjunction.

Definition 6.11. Let < P,A > be an abductive logic program. Then we define a

translation into a standard ordered program, denoted by ord(P, A), as follows: First,

for any literal a ∈ A the clause ra is defined as a• × a, where a• is a literal that does

not occur in the original program. We define ord(P, A) = P ∪ {ra | a ∈ A}.

Lemma 6.1. M∩LP is a generalized answer set of the abductive logic program < P, A >

iff M is an answer set of ord(P,A).

Sketch. Let P(A) be all subsets of A and RP(A) := {r1l | l ∈ A \ P(A)}∪{r2

l | l ∈ P(A)}.Let us recall that rl = l• × l so that r1

l = l• and r2l = l ← ¬l•. The proof follows from

the fact that all P ∪RP(A) correspond exactly to the split programs of ord(P,A).

The next theorem proves the validity of our ordered translation for the semantics

of abductive logic programs when it uses set inclusion.

Theorem 6.2. Let < P,A > be an abductive program and M a set of atoms. M ∩ LP

is a minimal generalized answer set of < P, A > iff M is an inclusion preferred answer

set of ord(P, A).

Page 124: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 108

Sketch. It is only needed to prove that M ∩ LP is minimal w.r.t. abductive inclu-

sion/cardinality order iff M is minimal w.r.t. inclusion/cardinality preferred order.

The proof is straightforward using the fact that for all rules in ord(P, A), which are in

the form rules in Definition 6.1, n ≤ 2 implies that g = >.

Example 6.7. This example shows how our ordered translation works. It is based on

the CR-program P ′1 from Example 4.11 of Section 4.7. In particular we consider the

abductive logic program 〈P1, A〉 used to obtain the semantics of the CR-program P ′1,

where P1 is the following program:

p ← ¬q.

r ← ¬s.

q ← t.

s ← t.

← p, r.

and A = {q, s, t}. According to the translation defined in 6.11 we have that ord(P,A)

is the following program:

p ← ¬q.

r ← ¬s.

q ← t.

s ← t.

← p, r.

q• × q

s• × s

t• × t

Moreover we can verify that the inclusion preferred answer sets o f ord(P,A) are

M1 = {q•, q, r}, M2 = {s•, s, p} and M3 = {q•, s•, t•, t, q, s}. Hence, the minimal

Page 125: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 109

generalized answer sets of 〈P1, A〉 are M1 = {q, r}, M2 = {s, p} and M3 = {t, q, s} since

LP1 = {p, q, r, s, t} as in Example 4.11.

6.3 Preferences in terms of extended ordered pro-

grams with double negation

Preferences are useful when the space of feasible solutions of a given problem is dense

but not all these solutions are equivalent w.r.t. some additional requirements. In this

case, the goal is to find feasible solutions that most satisfy these additional require-

ments. In [9] Brewka introduced logic programs with ordered disjunction (LPODs)

where the connective ×, called ordered disjunction, allows to express default knowledge

with knowledge about preferences in a simple and elegant way. However, if we only

want to specify a preference ordering among the answer sets of a program with respect

to an ordered set of atoms by means of adding a standard ordered disjunction rule to

the original program then, ordered disjunction as defined by Brewka does not work

since it corresponds to a disjunction where an ordering is defined. For instance, if P is

the following program

a ← .

b ← ¬c.

c ← ¬b.

d ← ¬a.

f ← c,¬a.

e ← b,¬a.

then the answer sets of this program are {a, b} and {a, c}.Now, if we want to specify a preference ordering among the answer sets of a pro-

gram with respect to the ordered set of atoms [f, c] then we could consider to add to

Page 126: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 110

the program P the standard ordered disjunction rule {f × c} that stands for “if f is

possible then f otherwise c” (see [7]). Then, thinking in a preference sense, the intu-

ition indicates that the inclusion-preferred answer sets of P ∪ {f × c} should be {a, c}.However, we obtain two inclusion-preferred answer sets {a, b, f} and {a, c, f}.

Therefore, in order to specify a preference ordering among the answer sets of a

program with respect to an ordered set of atoms, in this section we propose to use a

particular set of extended ordered disjunction programs [46]. Specifically, we propose

to add to the original program an extended ordered rule such that this rule is defined

using the ordered set of atoms and each atom has double default negation.

We are going to explain way we propose to use atoms with double default negation.

Let us consider ¬¬a where a is an atom. Since ¬¬a is equivalent to the restriction

← ¬a, the intuition behind ¬¬a is to indicate that it is desirable that a holds in the

model of a program. Formally, as we defined in Background Section, an atom with

double negation corresponds to a negated negative literal where the only negation used

is default negation.

Hence, if we consider again the previous program P and we want to to specify a

preference ordering among the answer sets of P with respect to an ordered set of atoms

[f, c] we have to do the following: First we define the extended ordered disjunction rule

using the ordered set of atoms [f, c] such that each atom has double default negation,

i.e, we define {¬¬f׬¬c}. Then, we add this extended ordered disjunction rule to the

original program P , i.e., we define the following extended ordered disjunction program:

P ∪ {¬¬f × ¬¬c}. As we will prove in the following subsection, we obtain the desired

inclusion-preferred answer set {a, c} from this extended ordered disjunction program.

We explained that the intuition behind an extended ordered rule using negated

negative literals is to indicate that we want to specify a preference ordering among the

answer sets of a program with respect to an ordered set of atoms. However, in case that

Page 127: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 111

the answer sets of the program do not contain any of the atoms in the given ordered

set of atoms then the extended ordered rule must allow to obtain all the answer sets

of the program. In order to obtain all the answer sets of the program we propose to

add a positive literal to the end of the extended ordered rule that we defined as we

explained above. This positive literal must be an atom that does not occur in the

original program, for instance the atom all pref . For instance,let us consider again the

program P that has the answer sets {a, b} and {a, c}. If we want to specify a preference

ordering among the answer sets of this program with respect to the ordered set of atoms

C = [f, e] then we define the extended ordered rule as we explained above but we add

the atom all pref at the end of the rule, i.e., ¬¬f ׬¬e×all pref . The new extended

ordered rule indicates that we prefer the answer sets where f holds to the answer sets

where e holds and if there is no answer sets of the program where f or e holds then

all answer sets are preferable. It is worth to mentioning that in case that there is no

answer sets of the program where f or e holds then all the answer sets will contain the

atom all pref . Hence, the extended ordered program is as follows:

a ← .

b ← ¬c.

c ← ¬b.

d ← ¬a.

f ← c,¬a.

e ← b,¬a.

¬¬f × ¬¬e× all pref.

As we expected, we obtain the inclusion-preferred answer sets: {a, c, all pref} and

{a, b, all pref} since there is no answer sets of the program containing f or e.

The following short examples also show the role of negated negative literals in an

extended ordered program.

Page 128: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 112

Example 6.8. If consider the following standard ordered program

a× b

we can verify that the inclusion preferred answer set of it is {a} since ordered disjunction

corresponds to a disjunction where an ordering is defined.

However, the following extended ordered program

¬¬a× ¬¬b

has no answer sets since the extended ordered rule only indicates that we prefer the

answer sets containing a to the answer sets containing b but there is no answer sets.

Example 6.9. We also can consider the following standard ordered program,

a× b.

b ← ¬a

we can verify that the inclusion preferred answer set of it is {a} since ordered disjunction

corresponds to a disjunction where an ordering is defined.

However, the following extended ordered program

¬¬a× ¬¬b

b ← ¬a

only has {b} as its inclusion preferred answer set, since the extended ordered rule only

indicates that we prefer the answer sets containing a to the answer sets containing b

and program b ← ¬a has only the answer set {b} .

In order to formalize our previous discussion about the specification of an ordering

among the answer sets of a normal program with respect to an ordered set of atoms

using an extended ordered program, we are going to introduce Lemma 6.7. This lemma

Page 129: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 113

allows us to obtain the most preferred answer set of a normal program with respect

to an ordered set of formulas in terms of a particular extended ordered program. This

particular extended ordered program results from joining the original normal program

and a particular ordered disjunction rule that is defined in terms of the ordered set of

atoms. It is worth mentioning that the proof of Lemma 6.7 uses other auxiliary lemmas

that we are going to present before we present Lemma 6.7. Additionally, we have to

mention that most of these auxiliary lemmas are for general purpose.

We start introducing a definition and a proposition that allows us to define the most

preferred answer set with respect to a program and an ordered set of formulas.

Definition 6.12. Let P be a normal program and let M and N be two answer sets of

P . Let C = [c1, c2, . . . , cn] be an ordered set of formulas. The answer set M is preferred

to the answer set N with respect to C ∪ P (denoted as M <C∪P N) if

1. there exists i = min(1 ≤ k ≤ n) such that M∪¬(LP \M) `I ci and N∪¬(LP \N) 6`I

ci, and

2. for all j < i, M ∪ ¬(LP \M) `I cj and N ∪ ¬(LP \N) `I cj or

M ∪ ¬(LP \M) 6`I cj and N ∪ ¬(LP \N) 6`I cj.

Proposition 6.1. Let C be an ordered set of formulas; then <C∪P is a partial order.

Given an ordered list of formulas C, an answer set M of a normal program P is

most preferred with respect to C ∪ P if there is no other answer set N of P that is

preferred to M with respect to C ∪ P .

Example 6.10. Let C = [b, c] be an ordered list of atoms. Let P be the following

normal program:

a ← .

c ← ¬b.

b ← ¬c.

Page 130: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 114

We can verify that P has two answer sets, {a, b} and {a, c}. We also can verify that the

answer set {a, b} is preferred to the answer set {a, c} with respect to C, i.e., {a, b} <C∪P

{a, c} and that {a, b} is also the most preferred answer set.

Now, we define the extended ordered rule that we shall join to the original normal

program in order to obtain an extended ordered program that we shall use to obtain

the most preferred answer sets of the normal program with respect to the ordered set

of atoms C in terms.

Definition 6.13. Let P be a normal program and C = [c1, c2, . . . , cn] be an ordered

set of atoms such that C ⊆ LP . We define an extended ordered rule defined from

C, denoted as rC , as follows: rC := ¬¬c1 × ¬¬c2 × . . . × ¬¬cn × all pref such that

all pref /∈ LP .

Example 6.11. Let us consider again program P from Example 6.10, and also the

ordered set of atoms C = [b, c]. Then, the extended ordered rule defined from C,

denoted as rC is the following: rC := ¬¬b× ¬¬c× all pref .

The following lemmas are the auxiliary lemmas that we shall use to prove Lemma

6.7. We shall see that some of these auxiliary lemmas are for general purpose, then we

could used them not only to prove Lemma 6.7.

The following lemma indicates that given two normal programs and an extended

ordered rule, if we add this extended ordered rule to both programs and we assume

that the answer sets of one of them are subsets of the answers sets of the other program

then the preferred answer sets of one of them are also subsets of the preferred answer

sets of the other.

Lemma 6.2. Let P1 and P2 be two normal programs such that LP2 ⊆ LP1. Let r =

f1 × . . . × fi × . . . × fn ← g be an extended ordered rule such that Lr ⊆ (LP1 ∩ LP2).

Page 131: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 115

We assume that, M is an answer set of P1 ∪ {r} iff M ∩ LP2∪{r} is an answer set of

P2 ∪ {r}. Then, M is an inclusion preferred answer set of P1 ∪ {r} iff M ∩ LP2∪{r} is

an inclusion preferred answer set of P2 ∪ {r}.

Proof of Lemma 6.2 (Sketch).

By hypothesis we know that we can obtain the answer sets of P2 ∪ {r} from the

answer sets of P1∪{r}, since M is an answer set of P1∪{r} iff M ∩LP2∪{r} is an answer

set of P2 ∪ {r}.We also know that P1∪{r} and P2∪{r} have r as their only one ordered disjunction

rule. Then, both programs use the same preference criterion over the answer sets of

their respective split programs.

Hence, M is an inclusion preferred answer set of P1 ∪ {r} iff M ∩ LP2∪{r} is an

inclusion preferred answer set of P2 ∪ {r}.

The following is a corollary of Lemma 6.2. It indicates that given two normal

programs and an extended ordered rule, if we add this extended ordered rule to both

programs and we assume that the answer sets of one of them are also the answers sets of

the other program then the preferred answer sets of one of them are also the preferred

answer sets of the other.

Corollary 6.1. Let P1 and P2 be two normal programs such that LP1 = LP2. Let

r = f1× . . .× fi× . . .× fn ← g be an extended ordered rule such that Lr ⊆ (LP1 ∩LP2).

We assume that, M is an answer set of P1 ∪ {r} iff M is an answer set of P2 ∪ {r}.Then, M is an inclusion preferred answer set of P1∪{r} iff M is an inclusion preferred

answer set of P2 ∪ {r}.

Proof of Corollary 6.1 (Sketch).

We have to prove two things:

— M is an inclusion preferred answer set of P1 ∪ {r} if M is an inclusion preferred

Page 132: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 116

answer set of P2 ∪ {r}, and

— M is an inclusion preferred answer set of P2 ∪ {r} if M is an inclusion preferred

answer set of P1 ∪ {r}.By hypothesis, LP2 ⊆ LP1 and M is an answer set of P1 ∪ {r} if M ∩ LP2∪{r} is an

answer set of P2 ∪ {r}. Then by Lemma 6.2, M is an inclusion preferred answer set of

P1 ∪ {r} if M ∩ LP2∪{r} is an inclusion preferred answer set of P2 ∪ {r}.By hypothesis, LP1 ⊆ LP2 and M is an answer set of P2 ∪ {r} if M ∩ LP1∪{r} is an

answer set of P1 ∪ {r}. Then by Lemma 6.2, M is an inclusion preferred answer set of

P2 ∪ {r} if M ∩ LP1∪{r} is an inclusion preferred answer set of P1 ∪ {r}. The

following lemma indicates that if a normal program is added a particular restriction

then the answer sets of this new program are also answer sets of the program without

the restriction.

Lemma 6.3. Let P be a normal program and let C be an ordered set of atoms such

that C ⊆ LP . If M is an answer set of P ∪ {¬(¬c1 ∧ ¬c2 ∧ · · · ∧ ¬cn)} then M is an

answer set of P .

Proof of Lemma 6.3 (Sketch).

By [34] we know that {¬(¬c1∧ · · · ∧¬cn)} is strongly equivalent to ← ¬c1, . . . ,¬cn.

Then, {¬(¬c1 ∧ · · · ∧ ¬cn)} corresponds to a constraint. Hence, if M is an answer set

of P ∪ {¬(¬c1 ∧ · · · ∧ ¬cn)} then M is an answer set of the program P .

The following lemma indicates that given a normal program, an extended ordered

rule defined in terms of an ordered set of atoms, and a particular rule, then two thing

hold:

—the answer sets of the normal program joined with the extended ordered rule

defined in terms of an ordered set of atoms are also, the answer sets of the the normal

Page 133: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 117

program joined with the extended ordered rule defined in terms of an ordered set of

atoms and joined with the particular rule; and

—the answer sets of the the normal program joined with the extended ordered rule

defined in terms of an ordered set of atoms and joined with the particular rule are also,

the answer sets of the normal program joined only with the particular rule.

We have to mention that the proof of the following lemma uses the previous lemma,

i.e., Lemma 6.3.

Lemma 6.4. Let P be a normal program and let C = [c1, c2, . . . , cn] be an ordered set

of atoms such that C ⊆ LP . Let rC be the extended ordered rule defined from C. Let r

be the following normal rule all pref ← ¬c1, . . . ,¬cn. Then the following holds:

1. M is an answer set of P ∪ {rC} iff M is an answer set of P ∪ {rC} ∪ {r}.

2. M is an answer set of P ∪ {rC} ∪ {r} iff M is an answer set of P ∪ {r}.

Proof of Lemma 6.4.

Before we present the proof of this lemma, it is important to recall that by Definition

6.4, M is an answer set of an extended ordered disjunction program iff M is an answer

set of one of its split programs. Then, in this proof we are going to consider the split

programs of programs P ∪ {rC} and P ∪ {rC} ∪ {r}. We point out that both programs

have only one ordered disjunction rule with at least two choices3 and at the same time

it is the same ordered disjunction rule rC . Then, both programs have n split programs

since they are obtained by replacing rC by one of its options riC , 1 ≤ i ≤ n. In general,

each option riC with 1 ≤ i ≤ n− 1 of rC has the following form:

¬¬ci ← ¬¬¬c1, . . . ,¬¬¬ci−1

3 We recall that if f1 × . . . × fn ← g is an extended ordered rule then, the formulas f1 . . . fn areusually called the choices of a rule (see Definition 6.1).

Page 134: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 118

Additionally, we know by [34] that riC with 1 ≤ i ≤ n− 1 is strongly equivalent to

← ¬c1, . . . ,¬ci. And, in particular the option rnC has the following form:

all pref ← ¬¬¬c1, . . . ,¬¬¬cn

which is strongly equivalent to all pref ← ¬c1, . . . ,¬cn.

Then, the split programs of P ∪ {rC} have the form: P ∪ {riC} with 1 ≤ i ≤ n and

the split programs of P ∪ {rC} ∪ {r} have the form: P ∪ {riC} ∪ {r} with 1 ≤ i ≤ n.

Now we are ready to present the proof of both parts.

Proof of (1):

In order to prove this part, we have to prove that M is an answer set of a split program

of P ∪ {rC} iff M is an answer set of a split program of P ∪ {rC} ∪ {r}.First, let us consider the n−1 split programs P ∪{ri

C} and the n−1 split programs

P ∪ {riC} ∪ {r} with 1 ≤ i ≤ n − 1 since each of them includes the constraint ri

C , i.e.,

← ¬c1, . . . ,¬ci.

We know by [13] that for each 1 ≤ i ≤ n − 1, P ∪ {riC} ∪ {r} is a conservative

extension of P ∪{riC}, i.e., for each 1 ≤ i ≤ n− 1, M is an answer set of P ∪{ri

C}∪{r}iff M ∩ LP is an answer set of P ∪ {ri

C}. Let us recall that in each P ∪ {riC} ∪ {r}

with 1 ≤ i ≤ n − 1 the constraint riC :=← ¬c1, . . . ,¬ci, is included. This implies

that the atom all pref does not occur in any of the answers set of the split programs

P ∪ {riC} ∪ {r} with 1 ≤ i ≤ n − 1 since the only possibility to infer all pref is that

the body of rule r holds in any of the answer sets of these split programs, however the

constraint riC avoids this possibility. Hence, we can infer that for each 1 ≤ i ≤ n − 1,

M is an answer set of P ∪ {riC} ∪ {r} iff M is an answer set of P ∪ {ri

C}.However, in order to finish with this proof, we also have to consider the split pro-

grams P ∪ {rnC} ∪ {r} and P ∪ {rn

C}. It is very easy to see that P ∪ {rnC} ∪ {r} and

P ∪ {rnC} are equivalent, since {rn

C} and {r} are the same rule. Hence, M is an answer

Page 135: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 119

set of P ∪ {rnC} ∪ {r} iff M is an answer set of P ∪ {rn

C}.Proof of (2):

In order to prove this part we have to prove two things:

— if M is an answer set of a split program of P ∪ {rC} ∪ {r} then M is an answer set

of P ∪ {r}, and

— if M is an answer set of P ∪ {r} then M is an answer set of a split program of

P ∪ {rC} ∪ {r}.To prove the first part, let us consider the n− 1 split programs P ∪{ri

C}∪ {r} with

1 ≤ i ≤ n− 1 that include the constraint riC , i.e., ← ¬c1, . . . ,¬ci. We know that each

constraint riC with 1 ≤ i ≤ n− 1 is strongly equivalent to {¬(¬c1 ∧ · · · ∧ ¬ci−1)}. Then

according to Lemma 6.3, if M is an answer set of some P ∪ {riC} ∪ {r}, 1 ≤ i ≤ n− 1

then M is an answer set of P ∪ {r}. However, in order to finish with the proof of this

part, we also have to consider the split program P ∪ {rnC} ∪ {r}. It is very easy to see

that P ∪ {rnC} ∪ {r} and P ∪ {r} are equivalent, since {rn

C} and {r} are the same rule.

Hence, M is an answer set of P ∪ {rnC} ∪ {r} iff M is an answer set of P ∪ {r}.

Now, we have to prove the second part. If M is an answer set of P ∪ {r} then M is

an answer set of a split program of P ∪ {rC} ∪ {r}. Let us consider the split program

P ∪ {rnC} ∪ {r}. As we mentioned previously, it is very easy to see that P ∪ {rn

C} ∪ {r}and P ∪ {r} are equivalent, since {rn

C} and {r} are the same rule.

Thanks to the previous lemma, Lemma 6.4, we know that a normal program joined

with a particular extended ordered rule and a particular rule has the same answer sets

that the normal program joined only with the extended ordered rule. Now the following

lemma indicates that they also have the same inclusion preferred answer sets.

Lemma 6.5. Let P be a normal program and let C = [c1, c2, . . . , cn] be an ordered set of

atoms such that C ⊆ LP . Let rC be the extended ordered rule defined from C. Let r be

Page 136: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 120

the following normal rule all pref ← ¬c1, . . . ,¬cn. Then M is an inclusion preferred

answer set of P ∪{rC} iff M is an inclusion preferred answer set of P ∪{rC}∪{r}.

Proof of Lemma 6.5.

By Lemma 6.4 we know that M is an answer set of P ∪ {rC} iff M is an answer set

of P ∪ {rC} ∪ {r}, i.e., both programs have the same answer sets. We also know that

P ∪ {rC} and P ∪ {rC} ∪ {r} have rC as their only one ordered disjunction rule that

has al least two choices. Then, by Corollary 6.1 M is an inclusion preferred answer set

of P ∪ {rC} iff M is an inclusion preferred answer set of P ∪ {rC} ∪ {r}.

The following lemma allows one to obtain the most preferred answer sets of a normal

program joined with a particular rule with respect to an ordered set of atoms in terms of

the inclusion preferred answer sets of a particular extended ordered disjunction program.

This particular extended ordered disjunction program is defined in terms of the original

normal program joined with the extended ordered rule defined with respect to the

ordered set of atoms and the particular rule. Then the proof of this lemma uses Lemma

6.4.

Lemma 6.6. Let P be a normal program and let C = [c1, c2, . . . , cn] be an ordered set of

atoms such that C ⊆ LP . Let rC be the extended ordered rule defined from C. Let r be

the following normal rule all pref ← ¬c1, . . . ,¬cn. Then M is an inclusion preferred

answer set of P ∪ {rC} ∪ {r} iff M is the most preferred answer set with respect to

C ∪ (P ∪ {r}).

Proof of Lemma 6.6 (Sketch).

By Lemma 6.4 we know that M is an answer set of P ∪{rC}∪{r} iff M is an answer

set of P ∪ {r}, i.e., P ∪ {rC} ∪ {r} and P ∪ {r} have the same answer sets.

Then, in order to obtain the inclusion preferred answer set of P ∪{rC}∪{r}, we can

only consider the answer sets of program P∪{r} and then apply the inclusion preference

Page 137: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 121

criterion to them. Additionally, in order to obtain the most preferred answer set with

respect to C ∪ (P ∪ {r}), first we have to obtain the answers sets of P ∪ {r} and then

we have to apply a preference criterion based on the ordered set of atoms C.

We can verify that the preference criterion to obtain the most preferred answer set

with respect to C∪(P ∪{r}) corresponds to a particular case of the preference criterion

to obtain the inclusion preferred answer sets of an extended ordered disjunction pro-

gram. Specifically, this particular case corresponds to an extended ordered disjunction

program that has rC as its only one extended ordered rule. Then, in this particular

case the preference criterion to obtain the inclusion preferred answer sets is reduced

exactly to the preference criterion to obtain the most preferred answer set with respect

to C ∪ (P ∪ {r}).Hence, M is an inclusion preferred answer set of P ∪ {rC} ∪ {r} iff M is one of the

most preferred answer set with respect to C∪ (P ∪{r}), since we are applying the same

preference criterion.

Finally, we present Lemma 6.7 that allows us to obtain the most preferred answer set

of a normal program with respect to an ordered set of formulas in terms of a particular

extended ordered program. This particular extended ordered program results from

joining the original normal program and a particular ordered disjunction rule that is

defined in terms of the ordered set of atoms. The proof of this lemma uses the previous

Lemmas 6.5 and 6.6.

Lemma 6.7. Let P be a normal program and let C = [c1, c2, . . . , cn] be an ordered list

of atoms such that C ⊆ LP . Let rC be the extended ordered rule defined from C. Then

M is an inclusion preferred answer set of P ∪ rC iff (M ∩ LP ) is the most preferred

answer set with respect to C ∪ P .

Page 138: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 122

Proof of Lemma 6.7 (Sketch).

By Lemma 6.5, M is an inclusion preferred answer set of P ∪ {rC} iff M is an

inclusion preferred answer set of P ∪ {rC} ∪ {r}.By Lemma 6.6, M is an inclusion preferred answer set of P ∪ {rC} ∪ {r} iff M is

the most preferred answer set with respect to C ∪ (P ∪ r).

Finally by [13], we can verify that C ∪ (P ∪ r) is a conservative extension of C ∪P ,

i.e., M is the most preferred answer set with respect to C ∪ (P ∪ r) iff (M ∩LP ) is the

most preferred answer set with respect to C ∪ P .

Example 6.12. Let us consider again program P from Example 6.10:

a ← .

c ← ¬b.

b ← ¬c.

and also the ordered list of atoms C = [b, c]. Then, P ∪ rC is the following program:

a ← .

c ← ¬b.

b ← ¬c.

¬¬b× ¬¬c× all pref.

We can verify that {a, b} is the most preferred answer set with respect to C ∪ P and

that is also an inclusion preferred answer set of P ∪ rC .

In the following subsection we shall show how a program with extended ordered

rules using negated negative literals can be easily translated into a standard ordered

program. Then using PSMODELS we can obtain the preferred answer sets [46].

Page 139: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 123

6.3.1 Computing preferred answer sets for extended ordered

programs

It is worth mentioning that neither running PSMODELS 4 [9] nor following the defini-

tion given by Brewka [7] for ordered disjunction we can obtain the inclusion preferred

answer sets for extended ordered programs. The reason is that the definition given

by Brewka for ordered disjunction has syntactical restrictions. However, in particular

when this program has extended ordered rules using negated negative literals, we can

use Lemma 6.15 that allows us to translate easily this program to a standard ordered

program and then use PSMODELS to obtain the preferred answer sets [46]. The proof

of Lemma 6.15 uses other auxiliary lemmas that we introduce before we introduce

Lemma 6.15. We have to mention that most of these auxiliary lemmas are for general

purpose.

The following lemma indicates that the answers sets of a given normal program

joined to an extended ordered rule are subsets of the answers sets of the same normal

program joined to the same extended ordered rule and to a formula a′i ↔ fi such that

a′i is an atom that does not appear in the original program and fi is a choice in the

extended ordered rule.

Lemma 6.8. Let P be a normal program. Let r = f1 × . . . × fi × . . . × fn ← g be an

extended ordered rule. Let r′ be the rule a′i ↔ fi such that a′i is an atom and a′i /∈ LP∪{r}.

Then M is an answer set of P∪{r}∪{r′} iff M∩LP∪{r} is an answer set of P∪{r}.

Proof of Lemma 6.8.

Since, P ∪ {r} ∪ {r′} and P ∪ {r} are extended ordered disjunction programs, then

in order to prove this lemma we have to consider the split programs of both programs

and verify the following: M is an answer set of a split program of P ∪ {r} ∪ {r′} iff

4 http://www.tcs.hut.fi/Software/smodels/priority/

Page 140: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 124

M ∩ LP∪{r} is an answer set of a split program of P ∪ {r}, i.e., M is an answer set of

the split program P ∪ {ri} ∪ {r′} iff M ∩ LP∪{r} is an answer set of the split program

P ∪ {ri} where ri is an option of r.

By [13], we can verify that P ∪ {ri} ∪ {r′} is a conservative extension of P ∪ {ri},i.e., M is an answer set of P ∪{ri}∪{r′} iff M ∩LP∪{r} is an answer set of P ∪{ri}.

Thanks to the previous lemma, Lemma 6.8, we know that the answers sets of a given

normal program joined to an extended ordered rule are subsets of the answers sets of

the same normal program joined to the same extended ordered rule and to a formula

a′i ↔ fi such that a′i is an atom that does not appear in the original program and fi

is a choice in the extended ordered rule. Now the following lemma indicates that they

also have the same inclusion preferred answer sets.

Lemma 6.9. Let P be a normal program. Let r = f1 × . . . × fi × . . . × fn ← g be an

extended ordered rule. Let r′ be the rule a′i ↔ fi such that a′i is an atom and a′i /∈ LP∪{r}.

Then M is an an inclusion preferred answer set of P ∪ {r} ∪ {r′} iff M ∩LP∪{r} is an

inclusion preferred answer set of P ∪ {r}.

Proof of Lemma 6.9.

By Lemma 6.8 we know that M is an answer set of P ∪ {r} ∪ {r′} iff M ∩ LP∪{r}

is an answer set of P ∪ {r}. We also know that P ∪ {r} ∪ {r′} and P ∪ {r} have r as

their only one ordered disjunction rule that has al least two choices. Then, by Lemma

6.2 M is an an inclusion preferred answer set of P ∪ {r} ∪ {r′} iff M ∩ LP∪{r} is an

inclusion preferred answer set of P ∪ {r}.

Now, we define the replacement of a choice in an extended ordered rule by an atom

that does not appear in the original extended ordered rule.

Definition 6.14. Let r = f1× . . .× fi× . . .× fn ← g be an extended ordered rule. Let

a be an atom such that a /∈ L{r}. Given a choice fi, 1 ≤ i ≤ n of rule r, the replacement

Page 141: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 125

of fi for a, denoted as r[fi/a], corresponds to the following extended ordered rule:

f1 × . . .× a× . . .× fn ← g.

For instance, if we consider r as the following extended ordered rule a × (a ∧ b) ׬¬a× c ← e,¬f then r[¬¬a/a′] = a× (a ∧ b)× a′ × c ← e,¬f .

The following lemma, Lemma 6.10, indicates that the answers sets of a given normal

program joined to an extended ordered rule and to a formula a′i ↔ fi such that a′i is an

atom that does not appear in the original program and fi is a choice in the extended

ordered rule, are also answer sets of the same ordered program but replacing the choice

fi for the atom a′i. Additionally, Lemma 6.11 indicates that these programs have the

same inclusion preferred answer sets.

Lemma 6.10. Let P be a normal program. Let r = f1 × . . . × fi × . . . × fn ← g

be an extended ordered rule. Let r′ be the rule a′i ↔ fi such that a′i is an atom and

a′i /∈ LP∪{r}. Then M is an answer set of P ∪ {r} ∪ {r′} iff M is an answer set of

P ∪ {r[fi/a′i]} ∪ {r′}.

Proof of Lemma 6.10.

Since, P ∪ {r} ∪ {r′} and P ∪ {r[fi/a′i]} ∪ {r′} are extended ordered disjunction

programs, then in order to prove this lemma we have to consider the split programs

of both programs and verify the following: M is an answer set of a split program of

P ∪ {r} ∪ {r′} iff M is an answer set of a split program of P ∪ {r[fi/a′i]} ∪ {r′}, i.e., M

is an answer set of the split program P ∪ {ri} ∪ {r′} iff M is an answer set of the split

program P ∪ {ri[fi/a′i]} ∪ {r′} where ri and ri[fi/a

′i] are the options of r and r[fi/a

′i].

By [34], we can verify that P ∪{ri}∪{r′} is equivalent to P ∪{ri[fi/a′i]}∪{r′}, i.e.,

M is an answer set of P ∪{ri}∪{r′} iff M is an answer set of P ∪{ri[fi/a′i]}∪{r′}.

Lemma 6.11. Let P be a normal program. Let r = f1 × . . . × fi × . . . × fn ← g

be an extended ordered rule. Let r′ be the rule a′i ↔ fi such that a′i is an atom and

Page 142: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 126

a′i /∈ LP∪{r}. Then M is an inclusion preferred answer set of P ∪{r}∪ {r′} iff M is an

inclusion preferred answer set of P ∪ {r[fi/a′i]} ∪ {r′}.

Proof of Lemma 6.11.

By Lemma 6.10 we know that M is an answer set of P ∪{r}∪{r′} iff M is an answer

set of P ∪ {r[fi/a′i]} ∪ {r′}. We also know that P ∪ {r} ∪ {r′} and P ∪ {r[fi/a

′i]} ∪ {r′}

have r and r[fi/a′i] as their respective ordered disjunction rules. Then, both programs

use the same preference criterion over the answer sets of their respective split programs,

except for fi and ai.

We have to recall that the criterion to obtain the inclusion preferred answer sets

of an extended ordered disjunction program is based on the satisfaction degree of each

extended ordered disjunction rule, f1× . . .× fi× . . .× fn ← g, w.r.t. the answer sets of

this program. Additionally, the satisfaction degree is defined in terms of the inference

of the choice fi by an answer set of the program (see Definition 6.5, Definition 6.9,

Definition 6.7 and Definition 6.6).

Then, it is enough to mention that the satisfaction degree of r is the same for

r[fi/a′i], since each answer set of P ∪ {r} ∪ {r′} that infers fi also infers ai.

Hence, M is an inclusion preferred answer set of P ∪{r}∪{r′} iff M is an inclusion

preferred answer set of P ∪ {r[fi/a′i]} ∪ {r′}.

The following lemma, Lemma 6.12, indicates that the answers sets of a given normal

program joined to an extended ordered rule are subsets of the answer sets of the same

normal program joined to the same extended ordered rule where one of its choices fi is

replaced by an atom a′i and also joined to the formula a′i ↔ fi. Additionally, Lemma

6.13 indicates that we can obtain the inclusion preferred answer sets of the second

program from the inclusion preferred answer sets of the first one. The proof of Lemma

6.12 uses Lemma 6.10 and Lemma 6.8.

Page 143: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 127

Lemma 6.12. Let P be a normal program. Let r = f1 × . . . × fi × . . . × fn ← g

be an extended ordered rule. Let r′ be the rule a′i ↔ fi such that a′i is an atom and

a′i /∈ LP∪{r}. Then M is an answer set of P ∪ {r[fi/a′i]} ∪ {r′} iff M ∩ LP∪{r} is an

answer set of P ∪ {r}.

Proof of Lemma 6.12 (Sketch).

By Lemma 6.10 we know that M is an answer set of P ∪ {r[fi/a′i]} ∪ {r′} iff M is

an answer set of P ∪ {r} ∪ {r′}. Then, we have to prove that M is an answer set of

P ∪ {r} ∪ {r′} iff M ∩LP∪{r} is an answer set of P ∪ {r}. By Lemma 6.8, it holds.

Lemma 6.13. Let P be a normal program. Let r = f1 × . . . × fi × . . . × fn ← g

be an extended ordered rule. Let r′ be the rule a′i ↔ fi such that a′i is an atom and

a′i /∈ LP∪{r}. Then M is an an inclusion preferred answer set of P ∪ {r[fi/a′i]} ∪ {r′}

iff M ∩ LP∪{r} is an inclusion preferred answer set of P ∪ {r}.

Proof of Lemma 6.13.

By Lemma 6.12 we know that M is an answer set of P ∪ {r} ∪ {r′} iff M ∩ LP∪{r}

is an answer set of P ∪ {r}.We also know that P ∪ {r} ∪ {r′} and P ∪ {r[fi/a

′i]} ∪ {r′} have r as their only one

ordered disjunction rule.

We also know that P ∪ {r} ∪ {r′} and P ∪ {r[fi/a′i]} ∪ {r′} have r and r[fi/a

′i] as

their respective ordered disjunction rules. Then, both programs use the same preference

criterion over the answer sets of their respective split programs, except for fi and ai.

We have to recall that the criterion to obtain the inclusion preferred answer sets

of an extended ordered disjunction program is based on the satisfaction degree of each

extended ordered disjunction rule, f1× . . .× fi× . . .× fn ← g, w.r.t. the answer sets of

this program. Additionally, the satisfaction degree is defined in terms of the inference

Page 144: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 128

of the choice fi by an answer set of the program (see Definition 6.5, Definition 6.9,

Definition 6.7 and Definition 6.6).

Then, it is enough to mention that the satisfaction degree of r is the same for

r[fi/a′i], since each answer set of P ∪ {r} ∪ {r′} that infers fi also infers ai.

Hence, M is an inclusion preferred answer set of P ∪{r}∪{r′} iff M is an inclusion

preferred answer set of P ∪ {r[fi/a′i]} ∪ {r′}.

Given an extended ordered rule r = f1 × . . .× fi × . . .× fn ← g and an ordered set

of atoms A = [a1, . . . , an] such that Lr ∩A = ∅. We define the ordered replacements of

each fi, 1 ≤ i ≤ n for atoms in A, denoted as r[A]n, are defined inductively as follows:

r[A]1 = r[f1/a1],

r[A]n+1 = r[A]n[fn+1/an+1]

For instance, if we consider r as the following extended ordered rule a×(a∧b)׬¬a×c ←e,¬f and the ordered set of atoms A = [a1, a2, a3, a4] then

r[A]1 = r[f1/a1] = a1 × (a ∧ b)× ¬¬a× c ← e,¬f,

r[A]2 = r[A]1[f2/a2] = a1 × a2 × ¬¬a× c ← e,¬f,

r[A]3 = r[A]2[f3/a3] = a1 × a2 × a3 × c ← e,¬f,

r[A]4 = r[A]3[f4/a4] = a1 × a2 × a3 × a4 ← e,¬f.

The following lemma is a generalization on Lemma 6.13 where instead of replace

only one choice in the extended ordered rule, we propose an ordered replacement of the

choices of this extended ordered rule.

Lemma 6.14. Let P be a normal program. Let r = f1 × . . . × fi × . . . × fn ← g be

an extended ordered rule. Let A = [a1, . . . , an] be an ordered set of atoms such that

LP∪{r} ∩ A = ∅. Let k ≤ n and Dk = {ai ↔ fi, 1 ≤ i ≤ k | fi is a choice of r and ai ∈A}. Then M is an inclusion preferred answer set of P ∪ {r[A]k} ∪Dk iff M ∩ LP∪{r}

is an inclusion preferred answer set of P ∪ {r}.

Page 145: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 129

Proof of Lemma 6.14 (Sketch).

This proof is straightforward by induction on k, using the extended ordered program

that results from the ordered replacements of choices of r for atoms in A and Lemma

6.13 in each step.

Finally, we present Lemma 6.15 that allows us to translate an extended ordered pro-

gram that results from joining a normal program with an extended ordered disjunction

rule with negated negative literals to a standard ordered program. The proof of this

lemma uses Lemma 6.14.

In the following definition and lemma the atoms a•, a◦, are atoms that do not occur

in the original program P .

Definition 6.15. Let ¬¬a be a negated negative literal. We define the associated set

of ¬¬a as follows:

R(¬¬a) := { ← ¬a, a• , a• ← ¬a◦ , a◦ ← ¬a , ← a, a◦ }.

Lemma 6.15. Let P be a normal program and let C = [c1, c2, . . . , cn] be an ordered

set of atoms such that C ⊆ LP . Let C• = {c•1, c•2, . . . , c•n} be a set of atoms such that

C•∩LP = ∅. Let rC be the extended ordered rule defined from C. Let r•C be the following

ordered rule c•1× c•2× . . .× c•n× all pref . Let A =⋃

ci∈C and 1≤i≤n R(¬¬ci). Then M is

an inclusion preferred answer set of P ∪ {r•C} ∪A iff M ∩ LP is an inclusion preferred

answer set of P ∪ {rC}.

Proof of Lemma 6.15 (Sketch).

This proof is straightforward using Lemma 6.14 and Definition 6.15.

Page 146: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 130

Example 6.13. Let us consider again the program P at the beginning of this Section

a ← .

b ← ¬c.

c ← ¬b.

d ← ¬a.

f ← c,¬a.

e ← b,¬a.

and the set of atoms C = [f, c] then rC = ¬¬f × ¬¬c× all pref ,

A = {← ¬f, f •. f • ← ¬f ◦. f ◦ ← ¬f. ← f, f ◦.

← ¬c, c•. c• ← ¬c◦. c◦ ← ¬c. ← c, c◦. } and

r•C = {f • × c• × all pref}.Then, by running PSMODELS we obtain the following inclusion preferred answer

set of the standard ordered program P ∪ r•C ∪A: {a, c, c•, f ◦}. Finally, we can see that

the intersection of the answer set with LP corresponds to the inclusion preferred answer

sets of the original extended ordered program P ∪rC as we described before: {a, c}.

6.3.2 Obtaining the maximal answer sets of a program with

respect to a set of atoms

Additionally, in this section we show how we can also use extended ordered disjunction

programs with negated negative literals to obtain the maximal answer sets of a program

w.r.t. a set of atoms. For instance, if the answer sets of a program P are {b, c, e},{b, c, d} {f, e} and {e, a, c} then {b, c, d} and {f, e} are the maximal answer sets with

respect the set of atoms A = {b, d, f}. A possible real application of this is described in

[28]. In [28] there is a description of a real application using ASP to perform decision

making based on an Argument Framework (AF) in the domain of organ transplantation.

Page 147: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 131

Then, as a second possible application of extended ordered disjunction programs with

negated negative literals we proposed to use them to obtain the maximal answer sets

of a program characterizing an AF such that these maximal answer sets correspond to

the preferred extensions of the AF.

The formal definition of a maximal answer set with respect to a set of atoms is

based on the definition of maximal set with respect to a set.

Definition 6.16 (Maximal set w.r.t. a set A). [28] Let {Si : i ∈ I} be a collection

of subsets of U such that⋃

i∈I Si = U and A ⊆ U . We say that Si is a maximal set

w.r.t. A among the collection {Si : i ∈ I} iff there is no Sj with j 6= i such that

(Si ∩ A) ⊂ (Sj ∩ A).

Definition 6.17 (Maximal answer set w.r.t. a set A). [28] Let P be a consistent

program and {Mi : i ∈ I} be the collection of answer sets of P . Let A ⊆ LP . We say

that Mi is a maximal answer set w.r.t. A iff Mi is an answer set of P such that Mi is

a maximal set w.r.t. A among the collection of answer sets of P .

In order to obtain the maximal answer sets with respect to a set of atoms, the

original program P is extended with a set of extended ordered rules using negated

negative literals. Each extended ordered rule is defined from an atom in the given set

of atoms A. For instance, in the previous example the set of extended ordered rules is

the following: {¬¬b× b•. ¬¬d×d•. ¬¬f × f •.} where b•, d• and f • are atoms that do

not occur in the original program. Then the extended ordered program is the following:

P ∪ {¬¬b× b•. ¬¬d× d•. ¬¬f × f •.}The following Lemma formalizes our previous discussion about the use of negated

negative literals in an extended ordered program to obtain the maximal answer sets of

a program w.r.t. a set of atoms.

Page 148: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 6. EXTENDED ORDERED DISJUNCTION PROGRAMS 132

Definition 6.18. Let P be a program and S ⊆ LP . We define a translations of P

w.r.t. S into an ordered program, denoted by ordset(P, S): First, we define a set of

ordered clauses w.r.t. S as follows: CS = {¬¬a × a• | a ∈ S and a• 6∈ LP}. Then,

ordset(P, S) = P ∪ CS.

Lemma 6.16. Let P be a program and M be an answer set of P . Let S ⊆ LP . Then

M is an inclusion preferred answer set of ordset(P, S) iff M ∩LP is a maximal answer

set of P w.r.t. S.

6.4 Conclusion

In this chapter we introduced extended ordered disjunction programs. The definition

presented here extends ordered disjunction programs to a wider class of logic programs

[35]. We also proposed a characterization of minimal generalized answer sets in terms

of ordered disjunction programs.

In this chapter we also proposed to use extended ordered disjunction programs with

double default negation in each atom to define preferences and to find the maximal

answer set of a program. We will see that preferences defined in this way will help us

to find the preferred evacuation plans using language PP . Additionally, we propose

to use the definition of the maximal answer set of a program to obtain the preferred

extensions of an Argumentation Framework.

Finally, we shown how to compute the preferred answer sets for extended ordered

programs with double negation using PSMODELS.

Page 149: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Chapter 7

Modeling evacuation plan problems

In Section 3.1 we reviewed the recommendations that the UNESCO presented in [30]

to develop volcanic emergency plans.

In [18] is presented the state of art of models and algorithms for evacuation planning.

Then, in this chapter we combine the recommendations in [30] with the information

which would be ideal to have in evacuation planning extracted from [18] in order to

model evacuation plan problems and in particular for volcanic emergency plans.

We define a formal representation of the information using structural relationships

of UML [6] corresponding to Figure 7.1.

In this chapter, we also propose a procedure to construct the hazard zone background

knowledge needed for reasoning about evacuation planning as part of the contribution

of this work.

Finally, in this chapter we present the geographic information about the Popocatepetl

volcano.

It is worth mentioning that in this work we tested our results using only part of

the information needed to model evacuation plan problems presented in this chapter

since we did not get the complete real information on time. As we have mentioned

the information used in this work corresponds to the volcano Popocatepetl risk zone,

133

Page 150: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 7. MODELING EVACUATION PLAN PROBLEMS 134

however we obtained the complete real information of this zone almost at the end of

this work. Then, based on part of the geographic information that we had about this

zone, we defined our data to test our results. Specifically, we only consider part of the

geographic information about towns, roads, roads defining evacuation routes, towns in

risk and towns where are the shelters.

7.1 Evacuation plan problem information

We start presenting the information which would be ideal to have in order to model an

evacuation plan problem and in particular a volcano evacuation plan problem. Table

7.1 presents the lists of information needed to model the Transport problem obtained

from [19], the Evacuation plan problem, and the Volcano evacuation plan problem. At

the same time, Table 7.1 allows us to compare these lists of information. The list of

information for transport problems was obtained from [19] where is analyzed a general

transportation problem that generalizes planning in several classical domains such as

Logistics. We are interested in information for transport problems, since evacuation

planning problems may be similar cases of this family of problems. The list of informa-

tion for Evacuation plan problems and Volcano Evacuation problems is a combination

of the information that we presented in Sections 3.1 with the information which would

be ideal to have in evacuation planning extracted from [18]. We considered [18] since

in this reference is presented the state of art of models and algorithms for evacuation

planning.

In an Evacuation plan problem it is important to know the kind of place where

the evacuation has to be planned (that may be a a building, towns or regions, train,

airplanes, etc.), since it defines the network of roads where evacuees will travel. Also,

in this kind of problems there are a number of locations in the hazard zone. However,

Page 151: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 7. MODELING EVACUATION PLAN PROBLEMS 135

Transport Evacuation Volcano Evacuationproblem Plan problem Plan problemLocations. Locations in hazard zone. Towns in hazard zone.Initial location. Locations in risk. Towns in risk.Goal location. Safe destinations. Shelters.— Source and location of hazards. Hazard zones.Mobiles. Means of transport. Means of transport.Capacity of mobiles. Capacity of means of transport. Capacity of means of transport.Initial fuel. Initial fuel. Initial of fuel.Portables. People in hazard zone. People in hazard zone.Goal portables. People that must be evacuated. People that must be evacuated.Roadmap Network of roads. Network of roads.— Evacuation routes. Roads in some evacuation route.— Availability of emergency services Availability of emergency services— facilities and personnel. facilities and personnel.— Alert procedures. Alert procedures.

Table 7.1: Comparison of the information needed in three different kinds of problems

depending on the source and location of hazard(s), part of these locations are in risk, in

some cases all the locations could be in risk. It is necessary to define evacuation routes

from locations in the hazard zone to safe destinations. In some cases will be necessary

to use means of transport that have a capacity and need resources (such as fuel) to

travel. Some persons have their own means of transport hence only part of them must

be evacuated by government. Additionally, it is important to know the availability of

emergency services facilities and personnel, i.e., personnel and equipment for search and

rescue, hospitals and medical services. Finally it is important to have alert procedures

and communication of public warning.

We have to mention that the list of information for Volcano Evacuation prob-

lems takes advantage of discussions with researchers in volcanology of “Laboratoire

de Geophysique Interne et Tectonophysique” of Universite de Savoie. They remarked

that in order to define effective evacuation routes, it is necessary to consider the differ-

ent scenarios at a moment of volcanic eruption and consider the different hazards that

may accompany volcanoes. In particular, they recommended to take into account the

Page 152: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 7. MODELING EVACUATION PLAN PROBLEMS 136

hazard map at Popocatepetl [24].

As result of comparing the three lists, we can see that Evacuation plan problems and

Volcano Evacuation problems consider the same information than transport problems

and some information else.

We define a formal representation of the information needed to model Evacuation

plan problems using structural relationships of UML [6] corresponding to Figure 7.1.

In this figure, we can find the set of classes, the class Location represents a location.

There is an association between road and Location, specifying one or more roads

joins to any location and every location have one or more roads that joins to it. The

relationship between Hazard zone and the classes Road and Location are similar. A

hazard zone has one or more roads, each road should be in a hazard zone, a hazard zone

has one or more locations, each location belongs to exactly one hazard zone. There is

an association between Road and itself. A path may be part of an evacuation route and

an evacuation route is formed by some paths. We can also see that there is another

association between Hazard zone and Hazard, specifying that a hazard zone has one

or more hazards and each hazard belongs to exactly one hazard zone.

7.2 Procedure to construct the hazard zone back-

ground knowledge

In this section we give a procedure to construct the hazard zone background knowledge

needed for reasoning about evacuation planning as part of the contribution of this work.

It is important to mention that this procedure resulted from our direct work over the

geographic information that we have about the volcano Popocatepetls risk zone that

we have. We had to extract descriptive information from geographic information, to

Page 153: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 7. MODELING EVACUATION PLAN PROBLEMS 137

Figure 7.1: Structural relationships for evacuation plans in a volcano

repair inconsistencies, to represent the network of roads, and to add new descriptive

information.

Most of the information needed to model an evacuation plan problem (see previous

section) corresponds to geographic information, sometimes abbreviated as GIS infor-

mation. Geographic information follows some of the standard formats (shapefile [1] or

OpenGIS [2]). In general these formats of GIS information divide the data into two

parts [23]. The first part contains spatial data, and the second part contains non spa-

tial data or descriptive information. The spatial data manage the position of geometric

objects within an area where the basic objects are: points, lines and polygons. The non

spatial data describe what is at a point, along a line or in a polygon, and contains the

socio-economic characteristics, such as demographic data, occupation data for a village,

or traffic volume for roads.

The following Procedure indicates how we can construct the hazard zone background

knowledge from geographic information and other kinds of files formats with useful

Page 154: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 7. MODELING EVACUATION PLAN PROBLEMS 138

information.

1. Extraction of descriptive information from geographic information. In order to con-

struct the hazard zone background knowledge needed for reasoning about evacua-

tion planning we use the descriptive information of geographic information. Then,

we need to convert descriptive information into a format useful for the kind of pro-

grams that an Answer Set solver can read. Using a GIS tool [1], it is possible to save

non-spatial data in text files. In particular, each line of the text file corresponds

to the descriptive information of one segment of road. It includes the identifier of

initial node, the identifier of final node, the number of lines, length, etc. And each

line of the text file corresponding to the descriptive information about towns in the

hazard zone includes the identifier of town, the municipality, number of habitants,

identifier of hazard zone, etc.

2. Repairing inconsistencies. Once we have the text files corresponding to the descrip-

tive information we have to repair the inconsistencies that this information have.

For instance, some times the identifiers of nodes are repeated, or some segments

that are contiguous when they are visualized have not identifiers of nodes that are

contiguous, etc. Repairing inconsistencies appears to be a long work since it is done

in a semi-automatic way or sometimes data by data.

3. Representation of the network of roads. As soon as we have the text files with the

consistent descriptive information, we can use the information about towns and

roads to define the network of roads in the hazard zone. The network of roads is

represented as an undirected graph where its set of edges and the set of descriptive

information about roads should be in one-to-one correspondence. Moreover, we

know that locations are connected with other locations by roads and each road is

made up by segments then some nodes of the set of directed graph edges have a

Page 155: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 7. MODELING EVACUATION PLAN PROBLEMS 139

relationship with identifiers of towns. An evacuation route is a path on this directed

graph.

4. Adding more descriptive information. Part of the information used to model the

hazard zone could be in a format different to geographic information. For instance

statistical information about the number of buses and fuel liters needed to evacuate

the hazard zone or the information about shelters such as, capacity, number of liters

of water. Hence, we have to translate this information into text files and define

the relationships between roads and towns in the undirected graph and the new

information.

7.3 Popocatepetl volcano information

In the particular case of Popocatepetl volcano we have geographic information about

roads, evacuation routes and towns. Additionally we have partial information about

shelters, buses, quantity of fuel needed, and number of habitants in each town.

In particular geographic information about the Popocatepetl volcano uses:

• polylines to represent segments of road with the following descriptive information

associated: segment ID, name, initial node, final node, number of lanes, speed limit,

kind of pavement, length and route ID ; and

• polygons to represent towns with the following descriptive information associated:

town ID, Municipality ID, route ID, risk zone ID, number of habitants, number

of people with their own vehicle to evacuate the zone in risk, number of people

that government must evacuate, number of vehicles needed, number of kilometers

to travel, quantity of combustible needed and shelter ID assigned to the town.

Table 7.2 shows the quantity of information about the hazard zone of Volcano

Popocatepetl corresponding to Puebla state. This geographic information was pro-

Page 156: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 7. MODELING EVACUATION PLAN PROBLEMS 140

Volcano PopocatepetlInformation about QuantityHazard zones 3 (high, medium, and low)Towns in hazard zones 37Towns in high risk 16Towns in medium risk 2Towns in low risk 19Shelters 63Shelters Capacity 60751Means of transport 2098 busesCapacity of means of transport unknownGasoline 32650 litersDiesel 53150 litersPeople in hazard zones 92123People that must be evacuated 58678Network of roads 510Roads in some evacuation route 109 (segments of roads)Availability of emergency servicesfacilities and personnel unknownAlert procedures four stages of danger(see Section 3.2)

Table 7.2: Information about the hazard zone of Popocatepetl (only Puebla state)

vided by Plan Operativo Popocatepetl Office and by INEGI (Instituto Nacional de

Estadıstica, Geografıa e Informatica).

7.4 Example: Background knowledge of a hazard

zone

As mentioned, we represent the network of roads between towns in the hazard zone as

a directed graph. We define a directed graph where some nodes represent towns, and

evacuation routes are paths in the graph. Each segment is represented by road(P,Q,R)

where P and Q are nodes and R is the route number. Segments with route number

different to zero belong to some evacuation route. Some nodes correspond to a refuge

or a position out of risk.

Example 7.1. For instance, let the directed graph in Figure 7.2 be a short represen-

Page 157: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 7. MODELING EVACUATION PLAN PROBLEMS 141

tation of three evacuation routes in a particular zone. Therefore, we shall define the

directed graph as follows:

route(2). route(1). route(0). risk(0). risk(1). risk(2). risk(3).

% node(point,route,risk)

node(1,1,3). node(2,0,3). node(2,1,3). node(4,0,2). node(5,0,1).

node(11,0,2). node(8,1,1). node(9,1,0). node(12,0,3).

node(12,2,3). node(15,0,2). node(16,0,1). node(16,0,1).

node(13,0,3). node(13,2,3). node(17,2,2). node(19,2,0).

% segment (initial,ending,route)

segment(1,2,1). segment(2,11,0). segment(2,4,0). segment(4,5,0).

segment(4,9,0). segment(2,8,1). segment(8,9,1). segment(12,15,0).

segment(12,17,2). segment(15,16,0). segment(16,19,0).

segment(13,15,0). segment(13,17,2). segment(17,19,2).

% townAt(town, node)

townAt(p1,1). townInRisk(p1). townAt(p2,12). townInRisk(p2).

townAt(p3,13). townInRisk(p3).

% busIniAt(bus,point).

bus(b1). busIniAt(b1,p1). bus(b2). busIniAt(b2,p2). bus(b3).

busIniAt(b3,p3).

7.5 Complexity of evacuation plan problems

The specification of an evacuation problem can vary from country to country according

to political, social, legal and economic conditions and to the level of technological

Page 158: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 7. MODELING EVACUATION PLAN PROBLEMS 142

Figure 7.2: Two evacuation routes: A short example.

development. Additionally, an evacuation problem also depends on the cause of the

evacuation (fire alarm in a building, volcano eruption, etc.) Then is possible that some

evacuation plan problems in a given domain have polynomial complexity and some

others result to be NP-complete.

In this subsection we describe a simple example that results to be NP-complete.

This problem is particularized in order to see their connection with the problem of

find a Hamiltonian path. However we can define a generalization of problems where a

particular case would be this problem.

Let us suppose that in a particular hazard zone there are a set of locations V that

should be evacuated. Each location have an average of forty habitants. Each location

has assigned a different location out of risk where people in risk should be moved, i.e.,

for each v ∈ V there are one v′ (location out of risk). Additionally, there are roads

between v and v′ for all v ∈ V and between each v′ to each location v. Since the

economical conditions and service facilities are very limited, there is only one bus with

a capacity of forty persons used to evacuate people and this bus has only |2V | units of

Page 159: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 7. MODELING EVACUATION PLAN PROBLEMS 143

fuel to travel among these locations. Finally, it is known that at the beginning of the

disaster the bus is always parked at one of the locations, for instance v0.

Then, the decision problem about if there exist an evacuation plan to take all people

to their respective location out of risk results to be NP-complete.

The proof of this is based on a reduction to the problem of find a hamiltonian

path and also is similar the proof of the plan existence problem for the problem called

Transport111 in [19].

7.6 Conclusion

In this chapter we proposed a way to model evacuation plan problems and in particular

for volcanic emergency plans. We proposed a procedure to construct the hazard zone

background knowledge needed for reasoning about evacuation planning as part of the

contribution of this work, specifically when we define and give solution to the alternative

evacuation plan problem (see Chapter 8). Finally, in this chapter we presented the

geographic information about the Popocatepetl volcano.

Page 160: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Chapter 8

Alternative evacuation planproblem

Normally, in a risk zone evacuation routes are defined. Each evacuation route starts in

a set of places in risk, traverses other places in risk and arrives to a place out of risk.

Some times the place out of risk corresponds to a shelter. Each shelter has enough

provisions and drinkable water for people. However, some hazards that can accompany

a disaster can result on the blocking of the predefined evacuation routes. Normally,

these predefined evacuation routes are defined by the authorities in the risk zone. Then

it is necessary to define alternative evacuation plans. The alternative evacuation plan

problem (AEP-problem) can be stated as follows:

There is a set of predefined evacuation routes for people living in the hazardzone. Each predefined evacuation route may have several initial points, butone single final point. In case part of a predefined evacuation route is inacces-sible, then evacuees should search an alternative path. This alternative pathcan belong or not to another evacuation route. If it does not belong to anevacuation route then it is preferred, in decreasing order, to arrive to somepoint belonging to an evacuation route or to some shelter or to some place outof risk.

In this chapter we present two solutions to the alternative evacuation plan problem,

both of them using Answer Set Programming and preferences. Applying preferences

result to be a very natural and effective way to obtain an appropriate solution for

144

Page 161: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 145

some problems. For instance, in situations where we have a set of desiderata about an

evacuation plan that we would like to satisfy and not all of them can be simultaneously

satisfied. Another example is when given a planning problem, we may obtain a high

number of solutions. Then it is necessary to express preferences to choose some of the

possible evacuation plans. Then the solutions presented in this chapter are aimed at the

specification of such preferences among feasible plans. We have explored two approaches

in answer sets: consistency restoring rules (see Section 4.7) and PP language (see

Section 5.3). Then, in the following sections we are going to present our results.

We point out that when we present the use of consistency restoring rules to solve the

alternative evacuation plan problem, we are going to present how programs with con-

sistency restoring rules can be properly represented using ordered disjunction. Hence,

we apply both approaches to obtain the alternative evacuation plans. The idea is that

given the CR-program used to obtain the alternative evacuation plans, we translate

it following Definition 6.11 of Section 6.2 to obtain an standard ordered disjunction

program. Finally, we can use PSMODELS1 to compute preferred answer sets under

the ordered disjunction semantics.

Additionally, we point out that when we present the use of PP language to solve

the alternative evacuation plan problem, we are going to show how we can consider

the characteristic of the feasible alternative evacuation routes in order to prefer one of

them. For instance, we would like to express that it is preferred that in an alternative

evacuation route buses travel only by roads belonging to some evacuation route and it

is not important if they travel or not by its assigned evacuation route.

There are some problems that cannot be expressed in PP in a simple and natural

manner. In order to have a natural representation of these kind of preferences and

inspired in [22], in this chapter we also propose an extension of PP language where

1 http://www.tcs.hut.fi/Software/smodels/priority/

Page 162: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 146

propositional connectives and temporal connectives allow us to represent compactly

preferences having a particular property.

At the end of this chapter, we present a brief overview about the relationship between

language PP and propositional Linear Temporal Logic (LTL) [21, 40]. The idea is

that language PP could take advantage of the working framework of LTL to express

preferences.

8.1 Alternative evacuation plan problem assump-

tions

In this chapter we assume three things:

1. The background knowledge corresponding to the network of roads has the same

representation described in Chapter 7 where the network of roads between towns

in a hazard zone is a directed graph. In this directed graph some nodes represent

towns and evacuation routes are paths in the graph. Each segment is represented

by road(P,Q,R) where P and Q are nodes and R is the route number. Segments

with route number different to zero belong to some evacuation route. Some nodes

correspond to a shelter or a position out of risk. In order to illustrate the background

knowledge, we can consider again the Example 7.1 given in Chapter 7, where the

knowledge background corresponds to Figure 7.2. Since we are going to illustrate

some of our results using this example, we present a copy of Example 7.1 and Figure

7.2 in order to make an easier lecture of the current Chapter.

Example 8.1. Figure 8.1 shows a directed graph that corresponds to a short rep-

resentation of three evacuation routes in a particular zone. Then we can define the

following background knowledge corresponding to this directed graph as follows:

Page 163: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 147

route(2). route(1). route(0). risk(0). risk(1). risk(2). risk(3).

% node(point,route,risk)

node(1,1,3). node(2,0,3). node(2,1,3). node(4,0,2). node(5,0,1).

node(11,0,2). node(8,1,1). node(9,1,0). node(12,0,3).

node(12,2,3). node(15,0,2). node(16,0,1). node(16,0,1).

node(13,0,3). node(13,2,3). node(17,2,2). node(19,2,0).

% segment (ini,fin,route)

segment(1,2,1). segment(2,11,0). segment(2,4,0). segment(4,5,0).

segment(4,9,0). segment(2,8,1). segment(8,9,1). segment(12,15,0).

segment(12,17,2). segment(15,16,0). segment(16,19,0).

segment(13,15,0). segment(13,17,2). segment(17,19,2).

% townAt(town, node)

townAt(p1,1). townInRisk(p1). townAt(p2,12). townInRisk(p2).

townAt(p3,13). townInRisk(p3).

% busIniAt(bus,point).

bus(b1). busIniAt(b1,p1). bus(b2). busIniAt(b2,p2). bus(b3).

busIniAt(b3,p3).

shelther(9). shelter(19).

2. Based on the background knowledge, we are going to consider the following sorts:

Evacuation Route and variables of these sorts are denoted by R,R′, . . .,

Risk and variables of these sorts are denoted by Ri,Ri′, . . .,

Node and variables of these sorts are denoted by N,P,Q, N ′, P ′, Q′ . . .,

Page 164: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 148

Figure 8.1: Two evacuation routes: A short example.

Town and variables of these sorts are denoted by T, T ′, . . .,

Bus and variables of these sorts are denoted by B, B′, . . ..

3. We consider the alternative evacuation planning problem (D, I,G) specified in Lan-

guageA, denoted as aEvplan, where the domain has only one action, travel(B,P,Q,R),

and three fluents: position(B,Q,R), blocked(P,Q,R), and end(N).

The fluent position(B,Q,R) indicates that bus B is at position Q of evacuation route

R. The fluent blocked(P,Q,R) indicates that the segment of road from P to Q of

route R is blocked. The fluent end(B) indicates that bus B is in a position that

corresponds to a refuge.

The action travel(B,P,Q,R) allows bus B to travel from P to Q if the three following

executability conditions hold:

(a) There is an unblocked segment of road from P to Q such that this segment belong

to an evacuation route, i.e., there exist a segment(P,Q, R) with R different to

zero.

Page 165: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 149

(b) Bus B is at position P , i.e., position(B, Q, R) is true.

(c) Nodes P and Q belong to the same evacuation route R, i.e., there exist node(P, R)

and node(Q,R) with R different to zero.

Then effects of action travel(B,P,Q,R) can be expressed as the three following rules:

travel(B,P,Q, R) causes position(B,Q, R) if

position(B, P, R),∼ blocked(P,Q, R), node(P,R), node(Q,R), R <> 0.

travel(B,P,Q, R) causes ∼ position(B, P, R).

bus(B), refuge(N), node(N, R), position(B, N,R) causes end(B).

We can see that the first two rules are dynamic causal rules and the third one is a

static causal rule.

Example 8.2. Let us consider the specification of the alternative evacuation plan-

ning problem aEvplan; the background knowledge corresponding to the directed

graph of Example 8.1 and Figure 8.1; the set of observations about the initial state

O = {initially position(b1, 9, 1); initially position(b2, 12, 2);

initially position(b3, 13, 2)}; and the goal G = {end(b1). end(b2). end(b3).}. Then

a possible encoding π(D, O, G, l) in Answer Set Programming for aEvplan is the

following:

route(2). route(1). route(0). risk(0). risk(1). risk(2). risk(3).

% node(point,route,risk)

node(1,1,3). node(2,0,3). node(2,1,3). node(4,0,2). node(5,0,1).

node(11,0,2). node(8,1,1). node(9,1,0). node(12,0,3).

node(12,2,3). node(15,0,2). node(16,0,1). node(16,0,1).

node(13,0,3). node(13,2,3). node(17,2,2). node(19,2,0).

Page 166: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 150

% segment (ini,fin,route)

segment(1,2,1). segment(2,11,0). segment(2,4,0). segment(4,5,0).

segment(4,9,0). segment(2,8,1). segment(8,9,1). segment(12,15,0).

segment(12,17,2). segment(15,16,0). segment(16,19,0).

segment(13,15,0). segment(13,17,2). segment(17,19,2).

% townAt(town, node)

townAt(p1,1). townInRisk(p1). townAt(p2,12). townInRisk(p2).

townAt(p3,13). townInRisk(p3).

% busIniAt(bus,point).

bus(b1). busIniAt(b1,p1). bus(b2). busIniAt(b2,p2). bus(b3).

busIniAt(b3,p3).

shelther(9). shelter(19).

% initially bus B is at node N of route R.

initially(position(B, N, R)).

% goal: finally bus B at an end-node.

finally(end(B)).

% fluents:

% position of bus B is at node Q of route R.

fluent(position(B,Q,R)).

% road from node P to node Q of route R is blocked.

fluent(blocked (P,Q,R)).

% bus B at an end-node.

fluent(end(B)):- shelter(B).

Page 167: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 151

% action travel:

% bus B travels by the road from node P to node Q of route R,

% where R<>0, i.e, buses only travel by an evacuation route.

action(travel(B,P,Q,R)).

% Dynamic causal rules:

% if bus B travels by the road from node P to node Q

% of route R with R<>0, then B is at position Q of route R.

caused(position(B,Q,R),travel(B,P,Q,R)) .

% if bus B travels by the road from node P to node Q of route R,

% then B is not at position P of route R.

caused(neg(position(B,P,R)),travel(B,P,Q,R)).

% Static causal rule:

% if bus B is at position P of route R such that

% in node P there is a shelter, then B is at an end-position.

caused(end(B), position(B,P,R)).

% Executability Conditions:

% bus B cannot travel by the road from node P to node Q of route R,

% if B is not at position P of route R.

noaction_if(travel(B,P,Q,R),neg(position(B,P,R))).

% bus B cannot travel by the road from node P to node Q of route R,

% if the road from node P to node Q of route R is blocked.

noaction_if(travel(B,P,Q,R),blocked(P,Q,R)).

Then, the plans that correspond to the answer sets of π(D, O, G, l) with l = 3 are

Page 168: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 152

the following:

time 0 time 1 time 2

travel(b1,1,2,1) travel(b1,2,8,1) travel(b1,8,9,1)

travel(b2,12,17,2) travel(b2,17,19,2) —

travel(b3,13,17,2) travel(b3,17,19,2) —

The encoding π(D, O, G, l) obtains all possible paths of buses from their initial

positions to their final positions. In this example, all buses should follow their

pre-defined evacuation route, exactly as it is expected when there are predefined

evacuation routes. In the plan we assumed that each action take one unit of time.

8.2 Using Consistency Restoring Programs

Let us suppose that part of a pre-defined evacuation route is blocked. If the action

travel allows buses to travel only by an evacuation route then it is not possible to

define an evacuation plan. For instance, if we consider Example 8.2 and we suppose

that part of the evacuation route 2 is blocked because road(12, 17, 2) is blocked. Then

the encoding π(D,O,G, l) of Example 8.2 is inconsistent and it is not possible to obtain

the evacuation plans.

Hence, we propose to extend a planning problem modeled using Answer Set Plan-

ning adding CR-Rules (see Section 4.7) [47, 50]. The idea is to obtain the alternative

evacuation plans taking advantage of the definition of a CR-rule and use it only if there

is no way to obtain a plan when part of the pre-defined evacuation route is blocked.

Hence, the CR-rules are defined over the actions that are part of the planning problem

modeled. In case that a CR-rule is applied then it restores consistency and allows to

obtain the alternative evacuation plans.

Page 169: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 153

In particular, the CR-rule that we propose to add is the following:

r2 : action(travel(B, P,Q, R′)) +← bus(B), road(P,Q, R′).

The intuition of the CR-rule r2 is that it is possible to travel from P to Q if there

is a segment of road from P to Q. In contrast to the regular action travel defined in

π(D, O, G, l), this CR-rule does not check if the road from node P to node Q belongs

to an evacuation route, i.e, it is not important whether R′ is equal to zero or not. In

this way, r2 allows us to find the alternative evacuation plans. The following example

shows how we can use CR-rules to obtain the alternative evacuation plans.

Example 8.3. Going back to our Example 8.2, let us suppose that part of the evac-

uation route 2 is blocked because road(12, 17, 2) is blocked, i.e, we add initially

blocked(12, 17) to π(D, O, G, l). Since, it is not possible that bus b2 follows the pre-

defined evacuation route, then π(D,O,G, l) is inconsistent. In order to restore consis-

tency and obtain an alternative plan we add to the program π(D,O, G, l) the following

CR-rule:

r2 : action(travel(B, P,Q, R′)) +← bus(B), road(P,Q, R′).

As we described in in Section 4.7, this CR-rule should be used only if there is no way

to obtain a plan when part of the evacuation route is blocked.

Then, we can rewrite the program as follows:

% initially bus B is at node N of route R.

initially(position(B, N, R)).

% goal: finally bus B at an end-node.

finally(end(B)).

% fluents:

Page 170: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 154

% position of bus B is at node Q of route R.

fluent(position(B,Q,R)).

% road from node P to node Q of route R is blocked.

fluent(blocked (P,Q,R)).

% bus B at an end-node.

fluent(end(B)).

% REGULAR action travel:

% bus B travels by the road from node P to node Q of route R,

% where R<>0, i.e, buses only travel by an evacuation route.

action(travel(B,P,Q,R)).

% CR-rule where R’ can be or not zero,

r_2: action(travel(B,P,Q,R’)) :- + bus(B), road(P,Q,R’).

% Dynamic causal rules:

% if bus B travels by the road from node P to node Q

% of route R with R<>0, then B is at position Q of route R.

caused(position(B,Q,R),travel(B,P,Q,R)) .

% if bus B travels by the road from node P to node Q of route R,

% then B is not at position P of route R.

caused(neg(position(B,P,R)),travel(B,P,Q,R)).

% Static causal rule:

% if bus B is at position P of route R such that

% in node P there is a shelter, then B is at an end-position.

caused(end(B), position(B,P,R)).

Page 171: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 155

% Executability Conditions:

% bus B can not travel by the road from node P to node Q of route R,

% if B is not at position P of route R.

noaction_if(travel(B,P,Q,R),neg(position(B,P,R))).

% bus B can not travel by the road from node P to node Q of route R,

% if the road from node P to node Q of route R is blocked.

noaction_if(travel(B,P,Q,R),blocked(P,Q,R)).

Then, we obtain four alternative evacuation plans, i.e., four answer sets:

Plan1:

time 0 time 1 time 2

travel(b1,1,2,1) travel(b1,2,4,0) travel(b1,4,9,0)

travel(b2,12,15,2) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,15,2) travel(b3,15,16,0) travel(b3,16,19,0)

Plan2:

time 0 time 1 time 2

travel(b1,1,2,1) travel(b1,2,8,1) travel(b1,8,9,1)

travel(b2,12,15,0) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,15,0) travel(b3,15,16,0) travel(b3,16,19,0)

Plan3:

time 0 time 1 time 2

travel(b1,1,2,1) travel(b1,2,8,1) travel(b1,8,9,1)

travel(b2,12,15,0) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,17,2) travel(b3,17,19,2) —

Page 172: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 156

Plan4:

time 0 time 1 time 2

travel(b1,1,2,1) travel(b1,2,4,0) travel(b1,4,9,0)

travel(b2,12,15,0) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,17,2) travel(b3,17,19,2) —

The encoding π(D,O,G, l) in Example 8.3 obtains all possible paths of buses from their

initial positions to their final positions. For instance, Plan 3 says that bus b1 and bus

b3 should follow their pre-defined evacuation routes while bus b2 should travel by nodes

out of an evacuation route.

8.2.1 Using standard ordered disjunction programs to com-

pute the alternative evacuation plans from a CR-Program

In Section 4.7 we reviewed CR-programs. We saw that the semantics of a CR-program

is defined in terms of the minimal generalized answer sets of a particular abductive

logic program. This abductive logic program is based on the original program and a set

of abducibles which corresponds to a subset of the signature of this original program.

Additionally, in Section 6.2, we proposed a characterization of minimal generalized

answer sets in terms of ordered disjunction programs. This theoretical result proves that

both abductive programs and programs with CR-rules can be properly represented using

ordered disjunction. Hence, we can apply both approaches to obtain the alternative

evacuation plans. The idea is that given the CR-program used to obtain the alternative

evacuation plans, we translate it following the Definition 6.11 of Section 6.2 to obtain an

standard ordered disjunction program. Finally, we can use PSMODELS2 to compute

preferred answer sets under the ordered disjunction semantics. The following example

illustrates this idea.

2 http://www.tcs.hut.fi/Software/smodels/priority/

Page 173: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 157

Example 8.4. Using the ordered translation presented in Section 6.2 Definition 6.11,

we can rewrite the program in Example 8.3 where the CR-rules have been translated

into ordered rules.

% initially bus B is at node N of route R.

initially(position(B, N, R)).

% goal: finally bus B at an end-node.

finally(end(B)).

% fluents:

% position of bus B is at node Q of route R.

fluent(position(B,Q,R)).

% road from node P to node Q of route R is blocked.

fluent(blocked (P,Q,R)).

% bus B at an end-node.

fluent(end(B)).

% actions travel:

% bus B travels by the road from node P to node Q of route R,

% where R<>0, i.e, buses only travel by an evacuation route.

action(travel(B,P,Q,R)).

% The CR-rule r_2: action(travel(B,P,Q,R’)) :- + bus(B), road(P,Q,R’).

% where R’ can be or not zero,

% is rewritten as follows:

aux_travel(B,P,Q,R’) x action(travel(B,P,Q,R’)).

% Dynamic causal rules:

% if bus B travels by the road from node P to node Q

Page 174: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 158

% of route R with R<>0, then B is at position Q of route R.

caused(position(B,Q,R),travel(B,P,Q,R)) .

% if bus B travels by the road from node P to node Q of route R,

% then B is not at position P of route R.

caused(neg(position(B,P,R)),travel(B,P,Q,R)).

% Static causal rule:

% if bus B is at position P of route R such that

% in node P there is a shelter, then B is at an end-position.

caused(end(B), position(B,P,R)).

% Executability Conditions:

% bus B can not travel by the road from node P to node Q of route R,

% if B is not at position P of route R.

noaction_if(travel(B,P,Q,R),neg(position(B,P,R))).

% bus B can not travel by the road from node P to node Q of route R,

% if the road from node P to node Q of route R is blocked.

noaction_if(travel(B,P,Q,R),blocked(P,Q,R)).

Running this program in PSMODELS [9], we obtain the same alternative evacuation

plans presented in Example 8.3.

8.3 Using PP Language

As we have seen, by using CR-rules makes it possible to obtain the alternative evac-

uation plans however, these alternative evacuation plans do not consider any other

characteristic of the path that they follow. For instance, we would like to express that

it is preferred that in an alternative evacuation route buses travel only by roads be-

Page 175: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 159

longing to some evacuation route and it is not important if they travel or not by its

assigned evacuation route. Hence in this section, we consider language PP in order to

express preferences at different levels over the alternative plans that we are interested.

Then in this section we give an overview of a more complete solution of the problem

about finding alternative evacuation routes using language PP . We considered to use

PP because it allows us to express preferences over plans where the satisfaction of these

preferences depends on time and on their temporal relationships as we saw in Section

8.3.1. We think that in particular in evacuation planning it is very useful to express

preferences in terms of time. For instance, it is always preferred to evacuate people form

a place in risk following the defined evacuation routes. However, if eventually part of

the evacuation route is blocked then evacuees will travel out of some evacuation route

until they arrive to some shelter. The following example shows the use of language PPto express preferences among evacuation plans.

Figure 8.2: Three evacuation routes: A short example.

Example 8.5. Let us consider the specification of the alternative evacuation planning

problem aEvplan from Section 8 but now action travel allows buses to travel by segments

that are or not part of an evacuation route , i.e., action travel(B,P,Q,R) allows bus B

Page 176: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 160

to travel from P to Q if the three following executability conditions hold:

1. There is an unblocked segment of road from P to Q such that this segment belong

or not to an evacuation route, i.e., there exist a segment(P, Q,R) with R different

or equal to zero.

2. Bus B is at position P , i.e., fluent position(B, Q, R) is true.

3. Nodes P and Q belong or not to the same evacuation route R, i.e., there exist

node(P, R) and node(Q,R) with R different to zero.

We also consider the background knowledge corresponding to the directed graph of

Figure 8.2, the set of observations about the initial state O = {initially position(busA, 1, 2);

initially position(busB, 12, 3); initially position(busC, 14, 2)}; and the goal

G = {end(busA). end(busB). end(busC).}. Then a possible encoding π1(D, O,G, l) in

Answer Set Programming is the following:

route(3). route(2). route(1). route(0).

risk(0). risk(1). risk(2). risk(3).

% node(point,route,risk)

node(1,3,2). node(2,3,1). node(3,3,0). node(4,0,1). node(5,0,1).

node(12,2,3). node(13,2,2). node(8,2,2). node(9,0,1). node(11,2,0).

node(14,1,2). node(16,1,0). node(18,0,2). node(19,0,1).

% segment (ini,fin,route)

segment(1,2,1). segment(2,3,3). segment(2,4,0). segment(1,14,0).

segment(14,11,0). segment(13,14,0). segment(13,18,0).

segment(18,19,0). segment(12,13,2). segment(13,8,2). segment(8,9,2).

segment(9,11,2). segment(14,16,1).

% townAt(town, node)

townAt(p1,1). townInRisk(p1).

Page 177: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 161

townAt(p2,12). townInRisk(p2).

townAt(p3,14). townInRisk(p3).

% busIniAt(bus,point).

bus(busA). busIniAt(busA,p1).

bus(busB). busIniAt(busB,p2).

bus(busC). busIniAt(busC,p3).

shelter(16). shelter(11). shelter(3).

% initially bus B is at node N of route R.

initially(position(B, N, R)).

% goal: finally bus B at an end-node.

finally(end(B)).

% fluents:

% position of bus B is at node Q of route R.

fluent(position(B,Q,R)).

% road from node P to node Q of route R is blocked.

fluent(blocked (P,Q,R)).

% bus B at an end-node.

fluent(end(B)):- shelter(B).

% action travel:

% bus B travels by the road from node P to node Q of route R,

% where R is equal to 0, 1, 2 or 3, i.e, buses may travel by

% an evacuation route or not.

action(travel(B,P,Q,R)).

Page 178: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 162

% Dynamic causal rules:

% if bus B travels by the road from node P to node Q

% of route R with R<>0, then B is at position Q of route R.

caused(position(B,Q,R),travel(B,P,Q,R)) .

% if bus B travels by the road from node P to node Q of route R,

% then B is not at position P of route R.

caused(neg(position(B,P,R)),travel(B,P,Q,R)).

% Static causal rule:

% if bus B is at position P of route R such that

% in node P there is a shelter, then B is at an end-position.

caused(end(B), position(B,P,R)):- shelter(P).

% Executability Conditions:

% bus B cannot travel by the road from node P to node Q of route R,

% if B is not at position P of route R.

noaction_if(travel(B,P,Q,R),neg(position(B,P,R))).

% bus B cannot travel by the road from node P to node Q of route R,

% if the road from node P to node Q of route R is blocked.

noaction_if(travel(B,P,Q,R),blocked(P,Q,R)).

In particular, if we consider the directed graph in Figure 8.2 we could define have

the following basic desires:

—travelERass to express that it is preferred that buses travel by the evacuation

route assigned by the government until they arrive to the refuge, i.e., it is preferred

that busB travels by segments in route 2 until it arrives to position 11 where it is

located its assigned shelter, busC travels by segments in route 1 until it arrives to

Page 179: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 163

position 16 where it is located its assigned shelter, and busA travels by segments in

route 3 until it arrives to position 3 where it is located its assigned shelter.

travelERass :=

until(occ(travel(busB, 12, 13, 2)) ∨ occ(travel(busB, 13, 8, 2))∨occ(travel(busB, 8, 9, 2)) ∨ occ(travel(busB, 9, 11, 2)) , position(busB, 11, 2)) ∧

until(occ(travel(busC, 14, 16, 1)) , position(busC, 16, 1)) ∧until(occ(travel(busA, 1, 2, 3)) ∨ occ(travel(busA, 2, 3, 3)) , position(busA, 3, 3))

—travelER to express that it is preferred that buses travel by roads belonging to

some evacuation route and it is not important if they travel or not by its assigned

evacuation route, i.e., it is preferred that busA, busB and busC could travel by segments

belonging to evacuation route 1, 2 or 3 until they arrive to their assigned shelter:

travelER :=

until(

occ(travel(busB, 12, 13, 2)) ∨ occ(travel(busB, 13, 8, 2)) ∨ occ(travel(busB, 8, 9, 2))∨occ(travel(busB, 9, 11, 2)) ∨ occ(travel(busB, 14, 16, 1)) ∨ occ(travel(busB, 1, 2, 3))∨occ(travel(busB, 2, 3, 3)) ∨ occ(travel(busC, 12, 13, 2)) ∨ occ(travel(busC, 13, 8, 2))∨occ(travel(busC, 8, 9, 2)) ∨ occ(travel(busC, 9, 11, 2)) ∨ occ(travel(busC, 14, 16, 1))∨occ(travel(busC, 1, 2, 3)) ∨ occ(travel(busC, 2, 3, 3)) ∨ occ(travel(busA, 12, 13, 2))∨occ(travel(busA, 13, 8, 2)) ∨ occ(travel(busA, 8, 9, 2)) ∨ occ(travel(busA, 9, 11, 2))∨occ(travel(busA, 14, 16, 1)) ∨ occ(travel(busA, 1, 2, 3)) ∨ occ(travel(busA, 2, 3, 3)) ,

position(busC, 16, 1) ∧ position(busB, 11, 2) ∧ position(busA, 3, 3) )

—travelBlSh to express that it is preferred that buses travel by its assigned evacua-

tion route until eventually part of its evacuation route is blocked and then they travel

out of some evacuation route until they arrive at its assigned shelter, i.e., it is preferred

that busB travels by segments in route 2 until eventually some of these segments are

Page 180: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 164

blocked and then busB travels by segments out of some evacuation route until it arrives

to position 11 where it is located its assigned shelter, and a similar situation for busC

and busA with routes 1 and 3 respectively:

travelBlSh :=

until(occ(travel(busB, 12, 13, 2)) ∨ occ(travel(busB, 13, 8, 2))∨occ(travel(busB, 8, 9, 2)) ∨ occ(travel(busB, 9, 11, 2)) ,

until( eventually(blocked(12, 13, 2) ∨ blocked(13, 8, 2)) ∨ blocked(8, 9, 2) ∨ blocked(9, 11, 2)),

travel(busB, 13, 18, 0)) ∨ travel(busB, 18, 19, 0)) ∨ travel(busB, 13, 14, 2))∨travel(busB, 14, 11, 2)) ∨ travel(busB, 1, 14, 2)) ∨ position(busB, 11, 2) ) )

∧until(occ(travel(busC, 14, 16, 1)) ,

until( eventually(blocked(14, 16, 1)),

travel(busC, 13, 18, 0)) ∨ travel(busC, 18, 19, 0)) ∨ travel(busC, 13, 14, 2))∨travel(busC, 14, 11, 2)) ∨ travel(busC, 1, 14, 2)) ∨ position(busC, 16, 1) ) )

∧until(occ(travel(busA, 1, 2, 3)) ∨ occ(travel(busA, 2, 3, 3)) ,

until( eventually(blocked(1, 2, 3) ∨ blocked(2, 3, 3))),

travel(busA, 13, 18, 0)) ∨ travel(busA, 18, 19, 0)) ∨ travel(busA, 13, 14, 2))∨travel(busA, 14, 11, 2)) ∨ travel(busA, 1, 14, 2)) ∨ position(busA, 3, 3) ) )

In a similar way we could express any other parametric basic desire.

A possible atomic preference ψ indicating the order in which the set of basic desires

formulas should be satisfied is the following:

ψ = travelERass / travelER / travelBlSh

The atomic preference ψ says that plans satisfying travelERass are preferred, but oth-

erwise plans satisfying travelER are preferred, but otherwise plans satisfying travelBlSh

are preferred.

Page 181: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 165

8.3.1 Computing answer sets of planning problems with pref-

erences using extended ordered disjunction programs

At the end of Subsection 5.3.1 we present a brief overview from [43] about how to com-

pute the preferred trajectories of a planning problem expressed in an action language

w.r.t. ψ an atomic preference (see Definition 5.5).

First, in [43] is defined the answer set encoding of a planning program with respect

to a preference formula Π(D, O,G, l, ψ) as π(D, O, G, l)∪Πψ ∪Πsat where π(D, O, G, l)

is the answer set encoding of the planning problem as defined in Subsection 5.2.2, Πψ

is the encoding of the preference formula ψ and Πsat are the set of rules for checking

of basic desire formula satisfaction. It is important to mention that if the preference

formula corresponds to a basic desire formula ϕ then, in the encoding Πψ ϕ is associated

with a unique name nϕ. Moreover, if the preference formula corresponds to an atomic

preference formula ψ = ϕ1 / ϕ2 / . . . / ϕn then, in the encoding Πψ each ϕi, 1 ≤ i ≤ n

is associated with a unique name nϕi, 1 ≤ i ≤ n. In [43] also is mentioned that if M

is an answer set of π(D,O, G, l), then αM = s0a0 . . . an−1sn denotes the plan achieving

the goal G represented by M , where occurs(ai, i) ∈ M for i ∈ {0, . . . , n − 1} and

si = {f | holds(f, i) ∈ M} for i ∈ {0, . . . , n}. Then, [43] shows how to obtain the

most preferred trajectory with respect to a basic desire or an atomic preference. A

weight is assigned to each component of the preference formula, then the weight of each

trajectory is obtained based on the weight of each component of the preference formula

satisfied by the trajectory. Finally, in order to obtain the most preferred trajectory, i.e.,

the answer sets with maximal weight is used the maximize construct in SMODELS.

In [43] it is recommended to use jsmodels since SMODELS has some restrictions on

using the maximize construct. Moreover, in [43] it is shown how an atomic preference

of PP can be mapped to a collection of standard ordered rules as defined by Brewka

Page 182: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 166

[7] in order to obtain the most preferred trajectory.

We noticed that the use of weights or the mapping results in a complicated encoding.

Then in order to allow a simpler and easier encoding, we propose to use extended

ordered rules with negated negative literals to compute the preferred trajectories of a

planning problem expressed in an action language w.r.t. ψ an atomic preference [46].

This encoding is based on Definition 8.1 and Corollary 8.1 of Lemma 6.7 (see below).

We recall that Lemma 6.7 allows us to obtain the most preferred answer set of

a program P with respect to an ordered list of atoms in LP by means of a particular

extended ordered disjunction program. Hence, the idea of the Corollary 8.1 is to replace

in Lemma 6.7 the program P with the encoding of a planning problem with respect a

preference formula Π(D, O,G, l, ψ) and use the ordered list of unique names of in the

encoding of the preference formula Πψ as the ordered list of atoms, and then obtaining

the most preferred trajectory with respect to ψ by means of a particular extended

ordered disjunction program.

Definition 8.1. Let P = Π(D, O, G, l, ψ) be an answer set encoding of a planning

program with respect to an atomic preference formula ψ = ϕ1 / ϕ2 / . . . / ϕn as defined

in [43]. Then, we define the extended ordered rule defined from ψ, denoted by rψ, as

follows: rψ = ¬¬nϕ1 × nϕ2 . . .׬¬nϕn × no pref , where nϕi, 1 ≤ i ≤ n is the unique

name of each ϕi, 1 ≤ i ≤ n in P and no pref is an atom that does not occur in P .

Corollary 8.1. Let P = Π(D, O, G, l, ψ) be an answer set encoding of a planning

program with respect to an atomic preference formula ψ = ϕ1 / ϕ2 / . . . / ϕn as defined

in [43]. Let rψ be the extended ordered rule defined from ψ. Then M is an inclusion-

preferred answer set of P ∪ rψ iff αM∩LPis a most preferred trajectory w.r.t. ψ.

Obviously, the most preferred trajectory w.r.t. a basic desire is a particular case of

an atomic preference. Hence, Corollary 8.1 works in order to obtain the most preferred

Page 183: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 167

trajectory w.r.t. a basic desire too.

In the following example is illustrated how to obtain the most preferred trajectory

w.r.t. an atomic preference using Corollary 8.1.

Example 8.6. Let P = Π(D,O,G, l, ψ) be the answer set encoding of the planning

program with respect to an atomic preference formula ψ = travelERass / travelER /

travelBlSh from Example 8.5.

Let rψ be the extended ordered rule defined from ψ, i.e., rψ = ¬¬ntravelERass ×ntravelER × ¬¬ntravelBlSh × no pref

Now, we apply Corollary 8.1 to obtain the most preferred trajectories w.r.t. ψ from

the inclusion-preferred answer sets of P ∪ rψ, i.e., if M is an inclusion-preferred answer

set of P ∪ rψ then αM∩LPis a most preferred trajectory w.r.t. ψ.

At this point, it is worth recalling that we can easily translate the extended ordered

program P ∪ rψ to a standard ordered program and then use Psmodels to obtain the

preferred answer sets (see Definition 6.14 and Lemma 6.15).

In particular, if we consider the set of segments of the directed graph in Figure 8.2

with no blocked segments then the most preferred trajectory w.r.t. ψ is:

time 1 time 2 time 3 time 4

travel(busB,12,13) travel(busB,13,8) travel(busB,8,9) travel(busB,9,11)

travel(busC,14,16) — — —

travel(busA,1,2) travel(busA,2,3) — —

We can see that this most preferred trajectory satisfies the travelERass basic desire

of the atomic preference ψ since all the buses travel by the evacuation route assigned

exactly as it was expected. Now, if we consider the set of segments of the directed graph

in Figure 8.2 with segment from node 1 to node 2 blocked, i.e., if we add the initial

condition initially(blocked(1, 2)) to the program P then the most preferred trajectory

Page 184: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 168

w.r.t. ψ is:

time 1 time 2 time 3 time 4

travel(busB,12,13) travel(busB,13,8) travel(busB,8,9) travel(busB,9,11)

travel(busC,14,16) — — —

travel(busA,1,14) travel(busA,14,16) — —

Now, the most preferred trajectory satisfies the travelER basic desire of the atomic

preference ψ since busA travels by a road out of the evacuation route assigned by the

government until it arrives to node 14 of evacuation route 1.

8.4 Extending PP language with parametric basic

desires

Let us notice that the basic desire travelER of Example 8.5 is specifying a disjunction

consisting of the different options that buses have to travel by arcs belonging to some

predefined evacuation route, i.e,

travelER :=

until(

occ(travel(busB, 12, 13, 2)) ∨ occ(travel(busB, 13, 8, 2)) ∨ occ(travel(busB, 8, 9, 2))∨occ(travel(busB, 9, 11, 2)) ∨ occ(travel(busB, 14, 16, 1)) ∨ occ(travel(busB, 1, 2, 3))∨occ(travel(busB, 2, 3, 3)) ∨ occ(travel(busC, 12, 13, 2)) ∨ occ(travel(busC, 13, 8, 2))∨occ(travel(busC, 8, 9, 2)) ∨ occ(travel(busC, 9, 11, 2)) ∨ occ(travel(busC, 14, 16, 1))∨occ(travel(busC, 1, 2, 3)) ∨ occ(travel(busC, 2, 3, 3)) ∨ occ(travel(busA, 12, 13, 2))∨occ(travel(busA, 13, 8, 2)) ∨ occ(travel(busA, 8, 9, 2)) ∨ occ(travel(busA, 9, 11, 2))∨occ(travel(busA, 14, 16, 1)) ∨ occ(travel(busA, 1, 2, 3)) ∨ occ(travel(busA, 2, 3, 3)) ,

position(busC, 16, 1) ∧ position(busB, 11, 2) ∧ position(busA, 3, 3) )

However, let us suppose evacuation routes have a higher number of arcs. Then, in order

to express travelER in a similar way we would have to specify a long disjunction con-

Page 185: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 169

sisting of all arcs in the new evacuation routes. Despite in [43] is indicated that in PPfluents and actions with variables are shorthand representing the set of their ground in-

stantiations, the idea of using fluents and actions with variables is not enough to express

this type of problems. Hence, there are some preferences that cannot be expressed in

PP in a simple and natural manner. In order to have a natural representation of these

kind of preferences and inspired in [22], in this subsection we define PPpar language an

extension of PP language where propositional connectives and temporal connectives

allow us to represent compactly preferences having a particular property. For instance,

a natural and compact representation of preference travelER of Example 8.5 using a

parametric or would be:

until(∨{occ(travel(B, I, F, R)) : bus(B), road(I, F, R), neq(R, 0)},

∧{position(B,F i, R) : bus(B), shelter(Fi), route(R), neq(R, 0)})

In PP fluents and actions with variables are shorthand representing the set of their

ground instantiations. However, we need to specify when an action or fluent have

variables. Let Fvc be the set of fluents with variables and/or constants. Let Avc be the

set of actions with variables and/or constants. A desire set B is {D : t1, . . . , tn} where

D [49]:

1. a fluent f ∈ Fvc or

2. a formula of the form occ(a) where a ∈ Avc or

3. a formula of the form goal(p) where p ∈ Fvc and t1, . . . , tn is a conjunction of

literals 3 .

3 A variable or a constant is a term. An atom is p(t1, . . . , tn) where p is a predicate of arity n andt1, . . . , tn are terms. A literal is either an atom a or the negation of an atom not a.

Page 186: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 170

Let B be the set of desire sets. A parametric and is∧

B where B is a desire set

[49]. A parametric or is∨

B where B is a desire set [49]. Gpar := (Npar, Σpar, P par, S)

is the context-free grammar [49] that defines the set of parametric basic desires where

Npar := {S}; Σpar := Avc ∪ Fvc ∪ B; S ∈ Npar is the initial symbol of the gram-

mar; and the finite set of productions or rules is P par such that P par := {S −→p | goal(p) | occ(a) | ∧

B | ∨B | S∧S | S∨S | ¬S |next(S) | until(S, S) | always(S) |

eventually(S)} where p ∈ FF , a ∈ A as in language PP and B ∈ B.

Example 8.7. A parametric basic desire is the following :

until(∨{occ(travel(busB, I, F, 1)) : road(I, F, 1)} , position(busB, 19) ) where the

desire set is {occ(travel(busB, I, F, 1)) : road(I, F, 1)}.

Given a parametric basic desire ϕ of a planning problem P = 〈D, I, G〉, let C denote

the set of constants appearing in P ; let Ac denote the set of ground instantiations of

actions of P ; and let Fc denote the set of ground instantiations of fluents of P . A

substitution s is a mapping from a set of variables to the set C. Given a desire set

B = {D : t1, . . . , tn}, the instantiation of set B is the following ground set B′ =

{{s(D) : s(t1) . . . s(tn)}|s is a substitution}; B′ is called ground desire set. A ground

instance of a parametric basic desire ϕ is obtained if every desire set B in ϕ is replaced

by its instantiation B′.

Example 8.8. For instance, let us consider the parametric basic desire ϕ described in

Example 8.7 and the directed graph in Figure 7.2. Then, the ground instance of ϕ is

the following:

until ( occ (travel(b2, 12, 17, 1))∨ occ(travel(b2, 17, 19, 1)), position(b2, 19)).

Given a history α = s0a1s1a2s2 . . . ansn of a planning problem and ϕ a basic desire

formula, in [43] is defined when α satisfies ϕ (written as α |= ϕ). Since a parametric

Page 187: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 171

basic desire works as an abbreviation of a basic desire, given a parametric basic desire

ϕ′ and a history α it is enough to apply over the ground instance of ϕ′ the definition

of satisfaction for basic desires given in [43] to check whether α satisfies ϕ′ .

Example 8.9. If we consider the Example 8.5 then we can rewrite the basic desires

using PPpar as follows:

—travelERass to express that it is preferred that buses travel by the evacuation

route assigned by the government until they arrive to the refuge, i.e., it is preferred

that busB travels by segments in route 2 until it arrives to position 11 where it is

located its assigned shelter, busC travels by segments in route 1 until it arrives to

position 16 where it is located its assigned shelter, and busA travels by segments in

route 3 until it arrives to position 3 where it is located its assigned shelter.

travelERass :=

until(∨{occ(travel(busB, I, F, 2)) : segment(I, F, 2)},position(busB, 11, 2))∧

until(∨{occ(travel(busC, I, F, 1)) : segment(I, F, 1)},position(busC, 16, 1))∧

until(∨{occ(travel(busA, I, F, 3)) : segment(I, F, 3)},position(busA, 3, 3))

——travelER to express that it is preferred that buses travel by roads belonging

to some evacuation route and it is not important if they travel or not by its assigned

evacuation route, i.e., it is preferred that busA, busB and busC could travel by segments

belonging to evacuation route 1, 2 or 3 until they arrive to their assigned shelter:

travelER :=

until(∨{occ(travel(B, I, F, R)) : bus(B), segment(I, F, R), neq(R, 0)},

∧{position(B,F i, R) : bus(B), shelter(Fi), route(R)})

Page 188: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 172

——travelBlSh to express that it is preferred that buses travel by its assigned evacu-

ation route until eventually part of its evacuation route is blocked and then they travel

out of some evacuation route until they arrive at its assigned shelter, i.e., it is preferred

that busB travels by segments in route 2 until eventually some of these segments are

blocked and then busB travels by segments out of some evacuation route until it arrives

to position 11 where it is located its assigned shelter, and a similar situation for busC

and busA with routes 1 and 3 respectively:

travelBlSh :=

until(∨{occ(travel(busB, I, F, 2)) : segment(I, F, 1)},

until( eventually(∨{blocked(I, F, 2) : segment(I, F, 2)} ) ∧

∨{occ(travel(busB, I, F, 0)) : segment(I, F, 0)} , position(busB, 11, 2) ) )

until(∨{occ(travel(busC, I, F, 1)) : segment(I, F, 1)},

until( eventually(∨{blocked(I, F, 1) : segment(I, F, 1)} ) ∧

∨{occ(travel(busC, I, F, 0)) : segment(I, F, 0)} , position(busC, 16, 1) ) )

until(∨{occ(travel(busA, I, F, 3)) : segment(I, F, 3)},

until( eventually(∨{blocked(I, F, 3) : segment(I, F, 3)} ) ∧

∨{occ(travel(busA, I, F, 0)) : segment(I, F, 0)} , position(busA, 3, 3) ) )

Page 189: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 173

8.5 Language PP and Temporal Logic

Since PP is useful to express preferences over plans where the satisfaction of these

preferences depends on time, in this section we present a brief overview about the

relationship between language PP and propositional Linear Temporal Logic (LTL)

[21, 40]. Then language PP could take advantage of the working framework of LTL to

express preferences.

8.5.1 Inheriting the LTL framework to PP

In LTL all temporal operators are future time operators, meaning that at a given state

one can only reason about the present and future states. Normally, in LTL is assumed

that the set of time points is infinite, discrete and linearly ordered with a smallest

element. However, we are interested in a LTL where the set of time points is finite,

denoted as FLTL, since plans of planning problems are finite.

The language of FLTL [21, 40] is given by the context-free grammar GT := (N, Σ, P, S)

where N := {S} is the finite set of non terminals; Σ := V ∪{⊥,→,©,∧,U} is the finite

set of terminals such that V is the set of atomic formulas and (N ∩ Σ 6= ∅); S ∈ N is

the initial symbol of the grammar; and P := {S −→ p|S ∧ S|S → S| © S|S U S} is

the finite set of productions or rules where p ∈ Σ.

In order to omit superfluous parentheses, the priority order of the operators is es-

tablished as usually. FLTL formulas are denoted as A,A1, . . . , B,B1, . . .. The operator

©A, called nexttime operator, reads “A holds at time point immediately after the ref-

erence point (the present time)”. The operator A U B, called until operator, reads

“A holds until B is true”. Other operators can be introduced as abbreviations, e.g.,

∧, ∨, ↔, true, false as in classical logic; ¬A for A → ⊥; ♦A for true U A; ¤A for

¬♦¬A. The operator ♦A, called eventually operator, reads “There is a time point after

Page 190: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 174

a reference point at which A holds”. The operator ¤A, called always operator, reads

“A holds at all time points after the reference point”.

The semantics of FLTL is based on a temporal structure K that consists of a finite

sequence {η0, . . . ηn} of mappings ηi : V → {f, t}, the ηi are called states. η0 is the

initial state. The finite sequence of states formalizes the informal time scale; a state is

a “time point”. Every state is a valuation in the classical sense. For every temporal

structure K, every i ∈ N0 and every formula F , the truth value Ki(F ) ∈ {f, t} is

inductively defined , informally meaning the “truth value of F in state ηi ” [21, 40]:

1. Ki(v) = ηi(v) for v ∈ V .

2. Ki(A ∧B) = t iff Ki(A) = t and Ki(B) = t.

3. Ki(A → B) = t iff Ki(A) = f or Ki(B) = t.

4. Ki(©A) = t iff i = n or Ki+1(A) = t.

5. Ki(A U B) = t iff Kj(B) = t for some i < j ≤ n and Kk(A) = t for every k,

i ≤ k < j.

In order to inherit all the FLTL framework to language PP we propose to do the

following:

1. We transform each history α of a planning problem into a finite temporal structure

Kα: Let P be a planning problem and α = s0a1s1a2s2 . . . ansn a history of P . Let F

be the set of fluents of P and A be the set of actions of P . Let S be the set of states

in α, i.e., S= {s0, s1, . . . , sn}. The transformation of the history α into a finite

temporal structure Kα is described as follows: First, we define a transformation

function T of an action a ∈ A as T (a) := fa where fa is a fluent and fa 6∈ F. Also,

we define a straightforward generalization of T over A as T (A) = {T (a)|a ∈ A}.

Page 191: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 175

Then, the finite temporal structure Kα consists of a finite sequence {η0, . . . ηn} of

mappings ηi : S ∪ T (A) → {f, t}. Every ηi is a valuation defined as ηi(fai) = t iff

ai ∈ α and ηi(si) = t iff si ∈ α.

2. Then, we transform the basic desire formula ϕ into a temporal formula Fϕ: In order

to transform a basic desire formula ϕ into a temporal formula Fϕ, we only replace

each occurrence of occ(a) in ϕ for the fluent obtained from T (a).

3. Finally, we obtain the truth value of Ki(Fϕ): for every history α = s0a1s1a2s2 . . . ansn

and its finite temporal structure Kα, every i ∈ N0 and every temporal formula Fϕ

obtained from the basic desire formula ϕ, the truth value Kαi(Fϕ) ∈ {f, t} is in-

ductively defined in the same way as it is defined for a formula in FLTL.

8.5.2 Taking advantage of the working framework of LTL

Once we have transformed each history α of a planning problem into a finite temporal

structure Kα and transformed the basic desire formula ϕ into a temporal formula Fϕ

then, language PP could take advantage of the working framework of LTL to express

preferences. One example of this is the following.

In the axiomatization of temporal logic over finite sequences it is important to rec-

ognize the final state of the sequence. Moreover, for preferences about evacuation plans

it is important to recognize the state where the goal is achieved. Then, the semantics

for ©A that we presented in the previous Subsection has the property that ©false is

true at the final state since Ki(©A) = t iff i = n [40]. However, we can define two

other alternative semantics for ©A [49]:

• Ki(©A) = t iff Ki+1(A) = t. This semantics has the property that ¬ © true is

Page 192: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 8. ALTERNATIVE EVACUATION PLAN PROBLEM 176

true only at the final state. Also, this semantics is similar to the semantics of the

operator next(ψ) of language PP .

• Ki(©A) = t iff Ki+1(A) = t for 0 ≤ i < n and Kn(©A) = ηn(A). In this

semantics the truth value for ©A at the final state depends on the true value of

formula A. Then, the semantics of ©A has the property that the final state of

the plan is infinitely repeated. Using this semantics for ©A we could abbreviate

the operator goal(A) of language PP that reads “A holds at the final state” as

follows: A ∧ ¬ © true. Moreover, we think that this semantics for ©A could be

the most suitable for evacuation planning, because of the fact that once we are in

the final state this state remains without changes. For instance, once the evacuees

have achieved the shelter assigned they will remain there.

8.6 Conclusion

In this chapter we presented two solutions to the alternative evacuation plan problem

using two approaches for preferences in Answer Set Programming. In particular we

explored two approaches in answer sets: consistency restoring rules and PP language.

In this chapter we also proposed an extension of PP language where propositional

connectives and temporal connectives allow us to represent compactly preferences hav-

ing a particular property.

Finally, we presented a brief overview about the relationship between language PPand propositional Linear Temporal Logic (LTL) [21, 40].

Page 193: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Chapter 9

Semantic Contents

In this chapter, we introduce the notion of Semantic Contents of a program [47, 37, 48]

as an alternative point of view to obtain different answer set semantics of a program.

With the aim of having a mathematical structure that may express in a uniform

way different answer sets semantics, we introduce the notion of Semantic Contents of

a program. Given two set of formulas called hypotheses and scenario, the intuition

behind the Semantic Contents of a program can be divided into two parts: The former

aims at obtaining an infinite set of scenarios using a logic framework such that, the

original program and a different set of hypotheses entail each scenario. Additionally,

each scenario satisfies certain properties with respect to the original program and the

hypotheses. The latter aims at obtaining different answer set semantics of the program

by applying filters and/or orders over the set of scenarios. It is worth mentioning that

this second part does not needs of a logic framework since only filters and/or orders

over the set of scenarios are used. Then, since the point of view of Semantic Contents

we could define Answer Set semantics as follows:

Answer Set Semantics = Logic + Filters and/or Orders.

In particular, in this chapter, we show how to obtain the standard answer sets (see

Theorem 4.1), the generalized answer sets (see Definition 4.2), the minimal generalized

177

Page 194: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 178

answer sets (see Definition 4.4) and a new answer set semantic introduced in this section

called partial answer sets. In particular we present an example in a planning domain

where partial answer sets could be useful.

Finally, one of our theorems says that we can have compositionality in answer sets

via its semantic contents.

9.1 Semantic Contents definition

The Semantic Contents of a program could be described as a mathematical structure

useful to express in a uniform way different semantics of the program. Informally, the

Semantic Contents of a program is the set of pairs such that:

(1) the first entry corresponds to a set of formulas that should be added to the

original program in order to entail a set of formulas corresponding to the second entry

of the pair, and

(2) the second entry of the pair is a consistent extension of the original program.1

Definition 9.1. Let P be a program with a finite set of formulas. We define the

semantic contents of P , denoted by SC(P ), as the set of all pairs 〈S, T 〉 satisfying the

following properties:

1. S is a set of formulas such that T := {X| P ∪ S ` X}, and

2. P ∪ S is consistent.

For instance, Table 9.1 considers program P = {¬b → a,¬a → b} and shows some of

the scenarios entailed by the program P together with a different set of hypotheses. Let

1 The following definitions were given in the Background Section, however we repeat them here inorder to make an easier lecture of this document: A set of formulas P is consistent [27] if there is not aformula A such that both A and ¬A are theorems of P . A set of formulas P ′ is said to be an extensionof a set of formulas P [27] if every theorem of P is a theorem of P ′.

Page 195: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 179

S T(hypotheses) (Scenarios)

{ } {a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}{¬b} {¬b, a, a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}{¬b, a} {¬b, a, a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}{¬a} {¬a, b, a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}{¬a, b} {¬a, b, a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}{a, b} {a, b, a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}

......

Table 9.1: Some hypotheses and scenarios of program P = {¬b → a,¬a → b}.

us remark that the three dots (. . .) represent the rest of the formulas in each scenario,

including the program P itself and the rest of theorems that P entails. We also can see

that if we consider the set of hypotheses {¬b} then a subset of its scenario coincides

with one of the answer sets of P : {a}. Additionally, if we consider the set of hypotheses

{¬a} then a subset of its scenario coincides with the other answer sets of P : {b}. Let

us notice that if we consider the set of hypotheses equal to the empty set then the

scenario corresponds to the original program together with the set of theorems that the

program entails.

The set S is called an abductive and the set T is called a scenario. If SC(P )

is a semantic contents of program P , then SCS(P ) := {S |〈S, T 〉 ∈ SC(P )} and

SCT (P ) := {T |〈S, T 〉 ∈ SC(P )}. Note that if P is inconsistent then SC(P ) is the

empty contents. Sometimes, when no ambiguity arises, we will write SCS to denote

SCS(P ) and SCT to denote SCT (P ).

9.2 Some properties of the semantic contents

In this section we introduce some properties about the semantic contents.

The following lemma shows that if the union of two programs entail a set of scenarios

Page 196: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 180

then, this set of scenarios is the same set of scenarios that we get as result of intersect

the sets of scenarios that each program entails.

Lemma 9.1. Let P1 and P2 be two programs over a signature L. Then SCT (P1∪P2) :=

SCT (P1) ∩ SCT (P2).

Proof of Lemma 9.1.

We preset this proof in two parts:

1. We start proving that SCT (P1 ∪ P2) ⊆ SCT (P1) ∩ SCT (P2).

Let T ∈ SCT (P1 ∪ P2). Then by definition of semantic contents of (P1 ∪ P2), ∃Ssuch that 〈S, T 〉 ∈ SC(P1 ∪ P2), i.e., ∃S such that

T := {X|P2 ∪ P1 ∪ S ` X} (9.1)

We have to prove that ∃S1, S2 such that 〈S1, T 〉 ∈ SC(P1) and 〈S2, T 〉 ∈ SC(P2).

Let S1 = (P2 ∪ S) and S2 = (P1 ∪ S) then by the associative property of set theory

we can rewrite (9.1) as T := {X|P1∪(P2∪S) ` X} and T := {X|P2∪(P1∪S) ` X}.Hence 〈S1, T 〉 ∈ SC(P1) and 〈S2, T 〉 ∈ SC(P2).

2. Now we are going to prove that SCT (P1) ∩ SCT (P2) ⊆ SCT (P1 ∪ P2).

Let T ∈ (SCT (P1) ∩ SCT (P2)), i.e., ∃S1 such that 〈S1, T 〉 ∈ SC(P1) and ∃S2 such

that 〈S2, T 〉 ∈ SC(P2). We have to prove that ∃S such that 〈S, T 〉 ∈ SC(P1 ∪ P2),

i.e., T := {X|P2 ∪ P1 ∪ S ` X}.

By definition of semantic contents of P1 and P2 we have that T := {X|P1∪S1 ` X}and T := {X|P2 ∪ S2 ` X}. If S = (S1 ∪ S2) then T := {X|P2 ∪ P1 ∪ S ` X}.Hence, 〈S, T 〉 ∈ SCT (P1 ∪ P2).

Page 197: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 181

S T(hypotheses) (Scenarios)

{ } {a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}{¬b} {¬b, a, a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}{¬b, a} {¬b, a, a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}

......

Table 9.2: Some hypotheses and scenarios of program P1 = {¬b → a}.S T

(hypotheses) (Scenarios){ } {a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}{¬a} {¬a, b, a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}{¬a, b} {¬a, b, a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a, . . .}

......

Table 9.3: Some hypotheses and scenarios of program P2 = {¬a → b}.

Example 9.1. Let us consider P1 = {¬b → a} and P1 = {¬a → b}. Table 9.2

shows some of the entries of the semantic contents of P1, and Table 9.3 shows some of

the entries of the semantic contents of P2. Additionally, Table 9.1 shows some of the

entries of the semantic contents of P1 ∪ P2. Then, we can see that SCT (P1 ∪ P2) =

SCT (P1) ∩ SCT (P2) = {{a ∧ a, a → a, b → b, a → (b → a), (a ∧ a) → a . . .}, . . .}.

Following the definition of the semantic contents of a program, SC(P ) (Definition

9.1), we can verify that the entry 〈∅, th(P )〉 is one of the entries of SC(P ).

Lemma 9.2. Let P be a program over a signature L. If SC(P ) is the semantic contents

of P then 〈∅, th(P )〉 ∈ SC(P ).

Proof of Lemma 9.2.

If SC(P ) is the semantic contents of P then SC(P ) = {〈S, T 〉|S is a set of formulas

such that T := {X|P ∪S ` X} and (P ∪S) is consistent}. In particular, if S = ∅ then

T = {X|P ` X}. We know that th(P ) = {X|P ` X}. Hence, 〈∅, th(P )〉 ∈ SC(P ).

Page 198: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 182

It is easy verify that if 〈∅, th(P )〉 is an entry of the semantic contents of a program

then th(P ) is the minimal scenario w.r.t. set inclusion among the set of scenarios of

SC(P ).

Lemma 9.3. Let P be a program over a signature L. If SC(P ) is the semantic contents

of P then th(P ) is the minimal set (w.r.t. set inclusion) in SCT (P ).

The following lemma describes the relationship between two entries of the semantic

contents of a program. This lemma shows that if the set of hypotheses of one of the

entries is a subset of the set of hypotheses of the other entry then the scenario of the

first entry is a subset of the scenario of the second entry.

Lemma 9.4. Let P be a program over a signature L. If 〈S1, T1〉 ∈ SC(P ) and 〈S2, T2〉 ∈SC(P ) such that S1 ⊆ S2 then T1 ⊆ T2.

Proof of Lemma 9.4.

Let 〈S1, T1〉 ∈ SC(P ) and 〈S2, T2〉 ∈ SC(P ) such that S1 ⊆ S2, i.e., T1 = {X|P ∪S1 ` X} and T2 = {X|P ∪ S2 ` X} such that S1 ⊆ S2.

We have to prove that T1 ⊆ T2, i.e., if X ∈ T1 then X ∈ T1.

By hypothesis, if X in T1 then P ∪ S1 ` X. By monotonicity, P ∪ S2 ` X since

S1 ⊆ S2. Hence, X ∈ T1.

Corolary 1. Let P be a program over a signature L. If 〈∅, T1〉 ∈ SC(P ) and 〈S2, T2〉 ∈SC(P ) then T1 ⊆ T2.

Example 9.2. Let 〈S1, T1〉 = 〈{ }, {a∧ a, a → a, b → b, a → (b → a), (a∧ a) → a, . . .}〉and 〈S2, T2〉 = 〈{¬b}, {¬b, a, a∧ a, a → a, b → b, a → (b → a), (a∧ a) → a, . . .}〉 be two

entries of the semantic contents of program P1 of Example 9.1 such that S1 ⊆ S2. We

can see in Table 9.2 that T1 ⊆ T2.

Page 199: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 183

The following two lemmas describe the relationship between the semantic contents of

a program and the set of theorems of the same program. These lemmas use definitions

of th(P ) and K(R) that where given in Section 4.3. However we recall them here:

th(P ) = {α | α is a formula over LP and P ` α} and K(R) =⋂

S∈R S for a given set

of sets of formulas R.

Lemma 9.5. Let P be a program over a signature L. Then th(P ) = K(SCT (P )) =

⋂T∈SCT (P ) T .

Proof of Lemma 9.5.

We know that K(R) =⋂

S∈R S then K(SCT (P )) =⋂

S∈SCT (P ) S = th(P ) since

th(P ) is the minimal set contained in each set of SCT (P ) (see Lemma 9.3).

Example 9.3. Let us consider P1 of Example 9.1. We can see in Table 9.2 that th(P1) =

K(SCT (P1)) =⋂

T∈SCT (P1) T = {a∧a, a → a, b → b, a → (b → a), (a∧a) → a, . . .}.

Lemma 9.6. Let P1 and P2 be two programs over a signature L. Then th(P1 ∪ P2) :=

K(SCT (P1) ∩ SCT (P2)) =⋂

T∈SCT (P1)∩SCT (P2) T .

Proof of Lemma 9.6.

By Lemma 9.5, th(P1∪P2) = K(SCT (P1∪P2)). However, by Lemma 9.1, SCT (P1∪P2) = SCT (P1)∩SCT (P2), then by substitution, th(P1∪P2) = K(SCT (P1)∩SCT (P2)).

Example 9.4. Let us consider Example 9.1. We can verify that th(P1 ∪ P2) =

K(SCT (P1) ∩ SCT (P2)) =⋂

T∈SCT (P1)∩SCT (P2) T = {a ∧ a, a → a, b → b, a → (b →a), (a ∧ a) → a, . . .}.

Page 200: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 184

9.3 Finding variants of answer sets from semantic

contents

In order to find some variants of answer sets from the semantic contents of a program,

SC(P ), we consider a particular subset of entries of SC(P ), denoted by SC(P )R. The

pairs of this particular subset are selected from SC(P ) based on a subset R of LP

together with the sets ¬LP and ¬¬LP . Then, the first entry of each pair in SC(P )R

should be a subset of (R∪¬LP ∪¬¬LP ) and the second entry corresponds to the set of

literals in the second entry of the original entry in SC(P ). Additionally, this particular

subset, SC(P )R, will be called restricted semantic contents of a program P w.r.t. the

set R.

Definition 9.2. Let P be a program. Let SC(P ) be the semantic contents of P and

R ⊆ LP . We define the restricted semantic contents of a program P w.r.t. the set

R, denoted as SC(P )R, as follows: SC(P )R = {〈S, L〉 | 〈S, T 〉 ∈ SC(P ) ∧ S ⊆(R ∪ ¬LP ∪ ¬¬LP ) ∧ L = literals(T )}.

Example 9.5. Let P be the program:

e ← ¬d.

d ← ¬e.

a ← ¬b.

Then LP = {a, b, d, e} and we are going to consider R = ∅. Then SC(P )∅ =

{〈S, L〉 | 〈S, T 〉 ∈ SC(P ) ∧ S ⊆ {¬a,¬b,¬d,¬e,¬¬a,¬¬b,¬¬d,¬¬e} ∧ L =

literals(T )}. Table 9.4 shows some of the entries of the pairs of SC(P )∅.

Based on the restricted semantic contents of a program P w.r.t. the set R, SC(P )R,

we introduce the definitions of partial pair, partial model, model pair and model. Then,

we shall show how to obtain some answer set semantics based on these definitions.

Page 201: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 185

S L{¬b,¬e} {¬b,¬e, a, d}{¬b,¬d} {¬b,¬d, a, e}{¬b} {¬b, a}

{¬a,¬e} {¬a,¬e, d}{¬a,¬d} {¬a,¬d, e}{¬d} {¬d, e}{¬e} {¬e, d}{¬a} {¬a}

Table 9.4: SC(P )∅ of program P = {a ← ¬b, e ← ¬d, d ← ¬e}.

Definition 9.3. Let P be a program, R ⊆ LP and SC(P )R be the restricted semantic

contents of a program P w.r.t. the set R. We define the following:

1. 〈S, M〉 is a partialPair(R) of P if 〈S,M〉 ∈ SC(P )R.

2. M is a partialModel(R) of P if 〈S, M〉 ∈ SC(P )R.

3. 〈S, M〉 is a modelPair(R) of P if 〈S,M〉 ∈ SC(P )R such that M is complete.2

4. M is a model(R) of P if 〈S, M〉 ∈ SC(P )R and M is complete.

5. A semantics of a program P , denoted as SEM(P ), is a set of partiaModel(R) of

P

Example 9.6. We can verify from Table 9.4 of Example 9.5 that,

1. some of the partialPair(∅)’s of P are : 〈{¬b,¬e}, {¬b,¬e, a, d}〉, 〈{¬b}, {¬b, a}〉〈{¬a,¬e}, {¬a,¬e, d}〉,

2. the partialModel(∅)’s of P are: {¬b,¬e, a, d}, {¬b,¬d, a, e}, {¬b, a}, {¬a,¬e, d},{¬a,¬d, e}, {¬d, e}, {¬e, d}, {¬a},

3. the modelPair(∅)’s of P are: 〈{¬b,¬e}, {¬b,¬e, a, d}〉 and 〈{¬b,¬d}, {¬b,¬d, a, e}〉,2 A finite set of formulas P is said to be complete [27] if, for any formula A of P , either P ` A or

P ` ¬A.

Page 202: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 186

4. the model(∅)’s of P are: {¬b,¬e, a, d} and {¬b,¬d, a, e}.

Now, in the following subsections we are going to show how to obtain some answer

set semantics based on Definition 9.3.

9.3.1 Answer sets

If a program has at least one answer set then, in order to obtain the answer sets of a

program, we shall use the definition of model(R) given in Definition 9.3 such that the

set R is equal to the empty set.

Lemma 9.7. Let P be a stable consistent program (P has at least one answer set) and

M ⊆ LP . Then M is an answer set of P iff there exists M ′, a model(∅) of P , such

that M = pos(M ′).

Proof of Lemma 9.7.

We split the proof into two parts:

1. Let P be a stable consistent program (P has at least one answer set) and M ⊆ LP .

If M is an answer set of P then there exists M ′, a model(∅) of P , such that

M = pos(M ′).

2. Let P be a stable consistent program (P has at least one answer set) and M ⊆ LP .

If there exists M ′, a model(∅) of P , then pos(M ′) is an answer set of P .

We start proving (1):

Let P be a stable consistent program (P has at least one answer set) and M ⊆ LP .

Let M an answer set of P (see Theorem 4.1), i.e.,

P ∪ ¬(LP \M) ∪ ¬¬M °I M (9.2)

Page 203: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 187

Then by definition of model(∅) of P (Definition 9.3) we have to prove that ∃〈S, M ′〉 ∈SC(P )∅ such that M ′ is complete and M = pos(M ′),

i.e., by definition of SC(P )∅ (Definition 9.2) we have to prove that ∃〈S, M ′〉 such

that ∃〈S, T 〉 ∈ SC(P ) where S ⊆ (¬LP ∪ ¬¬LP ), M ′ = literals(T ), M ′ is complete

and M = pos(M ′),

i.e., by definition of SC(P ) (Definition 9.1) we have to prove that ∃〈S, M ′〉 such

that ∃T = {X|P ∪ S ` X} where S ⊆ (¬LP ∪ ¬¬LP ), M ′ = literals(T ), P ∪ S is

consistent, M ′ is complete and M = pos(M ′).

Since M = pos(M) and ¬(LP \M) = neg(M) then we can rewrite (9.2) as follows:

P ∪ neg(M) ∪ ¬¬pos(M) °I pos(M)

By monotonicity, we can have

P ∪ neg(M) ∪ ¬¬pos(M) °I pos(M) ∪ neg(M) (9.3)

Let S = neg(M) ∪ ¬¬pos(M) and M ′ = pos(M) ∪ neg(M) then we can rewrite (9.3)

as follows

P ∪ S °I M ′ (9.4)

Let T = {X|P ∪ S ` X}, then by (9.4) M ′ ⊆ T . Additionally, by construction

S ⊆ (¬LP ∪ ¬¬LP ), M ′ = literals(T ), M ′ is complete and pos(M ′) = M . Finally, by

definition of °I, P ∪ S is consistent.

Now, we prove (2):

Let P be a stable consistent program (P has at least one answer set) and M ⊆ LP .

Let M ′ a model(∅) of P , i.e., by definition of model(∅) of P (Definition 9.3) ∃〈S, M ′〉 ∈SC(P )∅ such that M ′ is complete,

i.e., by definition of SC(P )∅ (Definition 9.2) ∃〈S, M ′〉 such that ∃〈S, T 〉 ∈ SC(P )

with S ⊆ (¬LP ∪ ¬¬LP ), M ′ = literals(T ), and M ′ complete,

Page 204: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 188

i.e., by definition of SC(P ) (Definition 9.1) ∃〈S,M ′〉 such that ∃T = {X|P ∪S ` X}with S ⊆ (¬LP ∪ ¬¬LP ), M ′ = literals(T ), P ∪ S consistent, and M ′ complete.

Then, by definition of answer set of P (see Theorem 4.1) we have to prove that

P ∪ ¬(LP \ pos(M ′)) ∪ ¬¬pos(M ′) °I pos(M ′)

By hypothesis ∃〈S,M ′〉 such that ∃T = {X|P ∪ S ` X} with S ⊆ (¬LP ∪ ¬¬LP ),

M ′ = literals(T ), P ∪ S consistent, and M ′ complete. Then in particular, P ∪ S ` M ′

with S ⊆ (¬LP ∪ ¬¬LP ), M ′ = literals(T ), P ∪ S consistent, and M ′ complete.

Since pos(M ′) ⊆ (M ′), then P ∪ S ` pos(M ′) with S ⊆ (¬LP ∪ ¬¬LP ), M ′ =

literals(T ), P ∪ S consistent, and M ′ complete.

Clearly, P∪¬(LP \pos(M))∪¬¬pos(M) ` pos(M ′). Finally, since P∪S is consistent

we have that P ∪ ¬(LP \ pos(M ′)) ∪ ¬¬pos(M ′) °I pos(M ′).

For instance, in Example 9.6 the model(∅)’s of P are {¬b,¬e, a, d} and {¬b,¬d, a, e}then the answer sets of P are {a, d} and {a, e}.

9.3.2 Partial answer sets

We know that some programs do not have answer sets. However, we would like to know

at least “the greatest amount of information about the literals” that this program entail.

For this reason, we introduce the partial answer sets of a program. The partial answer

sets of a program are based on the partial model(R)’s of the program such that the

set R is equal to the empty set. Moreover, partial answer sets capture the idea of

“the greatest amount of information about the literals” by using the concept of set

cardinality. Hence, a partial answer set of a program P will be a partialModel(∅) of P

with maximum cardinality among the partialModel(∅)’s of P .

Page 205: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 189

S L{¬b} {¬b, a}{¬a} {¬a}

Table 9.5: SC(P )∅ of program P = {a ← ¬b, c ← ¬c}.

Definition 9.4. Let P be a program and M a partialModel(∅) of P . Then pos(M)

is a partial answer set of P iff there does not exists a partialModel(∅) of P , such that

|M ′| > |M |.

Example 9.7. Let P be the program:

a ← ¬b.

c ← ¬c.

We can see that LP = {a, b, c} and that program P does not have answer sets.

However, we will obtain its partial answer sets in order to know at least “the greatest

amount of information about the literals” that program P entail. Table 9.5 shows the

entries for some pairs of SC(P )∅. We can verify from Table 9.5 that {¬a} and {¬b, a}are the partialModel(∅)’s of P but the only partial answer set of P is {a} since it

corresponds to the partialModel(∅) {¬b, a} and |{¬b, a}| > |{¬a}|. As the intuition

about partial answer sets suggest, {¬b, a} gives us more information about the literals

of the program than the rest of partialModel(∅)’s.

Another example about partial answer sets results if we consider again Example

9.5. We can see that the partialModel(∅)’s with maximum cardinality are {¬b,¬e, a, d}and {¬b,¬d, a, e}, hence {a, d} and {a, e} are the partial answer sets of program P .

As we mentioned before, we are using the concept of set cardinality to select which

partialModel(∅) corresponds to a partial answer set. We also could suggest to use

the concept of set inclusion to obtain the partial answer sets. However, since we are

interested in the greatest amount of information about the literals, set inclusion does

Page 206: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 190

not work as we would expect. For instance, the partialModel(∅) {¬b,¬e, a, d} (one

of the partial answer sets) is not comparable to the partialModel(∅) {¬a,¬e, d} when

we use set inclusion. Then {a, d} and {d} would be partial answer sets. However, the

second one gives less information about the literals of the program than the first one.

We also can see that the partial answer sets of P in Example 9.5 correspond to the

answers sets of P . Then this example shows how our definition of partial answer sets

agrees with the definition of answer sets when the program has at least one answer set.

The following lemma shows that our definition of partial answer sets reflects naturally

its relationship with the definition of answer sets.

Lemma 9.8. Let P be a stable consistent program (P has at least one answer set) and

M ⊆ LP . If M is an answer set of P then M is a partial answer set of P .

Proof of Lemma 9.8.

Let P be a stable consistent program (P has at least one answer set) and M ⊆ LP .

Let M an answer set of P , i.e., by Lemma 9.7 exists M ′ a model(∅) of P such that M =

pos(M ′), i.e., by definition of model(∅) of P (Definition 9.3) exists 〈S,M ′〉 ∈ SC(P )∅

with M ′ complete such that M = pos(M ′).

By definition of partial answer set of P (Definition 9.4), we have to prove that

∃M ′ a partialModel(∅) of P such that M = pos(M ′), and

@ a M ′′, a partialModel(∅) of P , such that |M ′′| > |M ′|, i.e.,

by definition of partialModel(∅) of P (Definition 9.3), we have to prove that

∃〈S, M ′〉 ∈ SC(P )∅ such that M = pos(M ′), and

@ a M ′′, a partialModel(∅) of P , such that |M ′′| > |M ′|.By hypothesis, we have seen that exists 〈S, M ′〉 ∈ SC(P )∅ such that M = pos(M ′).

We are going to prove by contradiction that @ a M ′′, a partialModel(∅) of P , such

that |M ′′| > |M ′|. Let M ′′ be a partialModel(∅) of P , such that |M ′′| > |M ′|. Then

Page 207: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 191

|M ′′| > |LP | since by hypothesis M ′ is complete, a contradiction.

We also want to remark that our definition of partial answer sets is different from

the definition of partial stable model semantics introduced in [39] and it is also different

from the definition of partial models given in [44].

Using Partial answer sets to restore consistency

Now we want to present an example in a planning domain where partial answer sets

can be useful. We think that in case that a program has no answer sets, partial answer

sets could help to detect the cause of inconsistency. In particular, in planning domains

partial answer sets could correspond to partial plans. Then, the idea is to analyze the

partial plans and review the possible causes of inconsistency. The following example

illustrates this idea presenting a short planing problem.

Example 9.8. Somebody plans to submit his/her paper to a congress and present

it. Additionally, this person receives an invitation to present his/her paper. Then

we can express this problem as a planning problem where there are three fluents:

noMoneyProblems, invitedPaper and inCongress; there are only one action:

makeInscription; and the goal is that the person assists to the congress, i. e., the

fluent inCongress holds. Then a brief description of the planning problem could be

the following:

Page 208: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 192

% If it is an invitedPaper at time 1 then inCongress holds at time 2

holds(inCongress, 2) ← holds(invitedPaper, 1).

%When action payInscription occurs at time 1 causes inCongress at time 2.

holds(inCongress, 2) ← occurs(makeInscription, 1).

%Normally, if there is not evidence about action makeInscription

%occurs at time 1 then inCongress does not holds at time 2.

holds(neg(inCongress), 2) ← ¬occurs(makeInscription, 1).

%InvitedPaper holds at time 1.

holds(invitedPaper, 1).

%If there is no money problems then action makeInscription is possible.

occurs(makeInscription, 1) ← holds(noMoneyProblems, 1).

We can verify that the program does not has answer sets, i.e., there is an inconsis-

tency. In order to detect the inconsistency we could analyze the partial answer sets of

this program:

{holds(invitedPaper, 1), holds(inCongress, 2)}

The partial answer set could suggest that there is a contradiction with

holds(invitedPaper, 1) or holds(inCongress, 2).

Then, in order to detect the possible causes of contradiction we could review the pro-

gram and see that normally, if there is not evidence about action makeInscription oc-

curs at time 1 then inCongress does not hold at time 2. Moreover, since invitedPaper

Page 209: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 193

holds at time 1 then inCongress also holds at time 2. Hence, we can see that there is

an inconsistency with holds(neg(inCongress), 2) and holds(inCongress, 2).

Then we could add new information to the program about noMoneyProblems since

we know that a person who has an invited paper does not have to pay inscription and

his/her inscription is generated automatically. Then, the program is the following:

holds(inCongress, 2) ← holds(invitedPaper, 1).

holds(inCongress, 2) ← occurs(makeInscription, 1).

−holds(inCongress, 2) ← ¬occurs(makeInscription, 1).

holds(invitedPaper, 1).

occurs(makeInscription, 1) ← holds(noMoneyProblems, 1).

holds(noMoneyProblems, 1).

This new program has an answer set that corresponds to the desired plan:

{holds(noMoneyProblems, 1). holds(invitedPaper, 1). occurs(makeInscription, 1).

holds(inCongress, 2)}

9.3.3 Generalized answer sets

We have presented in the Background section the Definition of Generalized Answer Sets

(see Definition 4.2). As we have described, a generalized answer sets of a program is

the answer set obtained by adding a set of atoms to the program.

Now, we are going to show how to obtain the generalized answer sets of a program

in terms of the generalized answer set pair’s of the program. The intuition behind a

generalized answer set pair of a program is to denote explicitly the set of abducible

atoms added to the program and the generalized answer set of the program as a pair.

Moreover, a generalized answer set pair of a program P is based on a modelPair(R) of

P where the set R includes a subset of LP . We denote this subset of LP as EA and we

Page 210: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 194

call it the explicit abducibles.

Definition 9.5. Let P be a program, M ⊆ LP and EA ⊆ LP . Then 〈S, M〉 is a

generalized answer set pair of P w.r.t. EA if 〈S,M〉 is a modelPair(EA) of P .

In Example 4.11 of Section 4.7 we presented the program P1 to illustrate the ab-

ductive logic programs and the minimal generalized answer sets. Now in this example,

we consider again program P1 in order to see if the results using the semantic contents

of the program agree with the results of Example 4.11.

Example 9.9. Let P1 be the program:

p ← ¬q.

r ← ¬s.

q ← t.

s ← t.

← p, r.

We can see that program P1 does not have answer sets. However, if we consider

EA = LP1 = {p, q, r, s, t} then Table 9.6 shows some of the entries of SC(P1)EA.

Additionally, all of these pairs correspond to modelPair(EA)’s of P1. Hence, all of

them are generalized answer set pair’s of P w.r.t. EA.

Then, it is possible to use Definition 9.5 to obtain the generalized answer sets of a

program.

Lemma 9.9. Let P be a program, M ⊆ LP and EA ⊆ LP . Then M is a generalized

answer set of P w.r.t. EA iff there exists 〈S, M ′〉, a generalized answer set pair of P

w.r.t. EA, such that M = pos(M ′).

Proof of Lemma 9.9.

We split the proof into two parts:

Page 211: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 195

1. Let P be program, M ⊆ LP and EA ⊆ LP . If M is a generalized answer set of P

w.r.t. EA then there exists 〈S, M ′〉, a generalized answer set pair of P w.r.t. EA,

such that M = pos(M ′).

2. Let P be program, M ⊆ LP and EA ⊆ LP . If 〈S, M ′〉 is a generalized answer set

pair of P w.r.t. EA then pos(M ′) is a generalized answer set of P w.r.t. EA.

We start proving (1):

Let P be a program, M ⊆ LP and EA ⊆ LP . Let M a generalized answer set of P

w.r.t. EA, i.e., by definition of generalized answer set of P w.r.t. EA (see Definition

4.2), ∃∆ ⊆ EA such that M is an answer set of P ∪∆, i.e., by definition of answer set

of P (see Theorem 4.1), ∃∆ ⊆ EA such that

P ∪∆ ∪ ¬(LP \M) ∪ ¬¬M °I M (9.5)

We have to prove that there exists 〈S, M ′〉, a generalized answer set pair of P w.r.t.

EA, such that M = pos(M ′), i.e.,

by definition of generalized answer set pair of P w.r.t. EA (Definition 9.5), we have

to prove that exists 〈S, M ′〉, a modelPair(EA) of P , such that M = pos(M ′), i.e.,

by definition of modelPair(EA) of P w.r.t. EA (Definition 9.3), we have to prove

that ∃〈S, M ′〉 ∈ SC(P )EA such that M ′ is complete and M = pos(M ′),

i.e., by definition of SC(P )EA (Definition 9.2) we have to prove that ∃〈S, M ′〉 such

that ∃〈S, T 〉 ∈ SC(P ) where S ⊆ (EA ∪ ¬LP ∪ ¬¬LP ), M ′ = literals(T ), M ′ is

complete and M = pos(M ′),

i.e., by definition of SC(P ) (Definition 9.1) we have to prove that ∃〈S, M ′〉 such

that ∃T = {X|P ∪ S ` X} where S ⊆ (EA ∪ ¬LP ∪ ¬¬LP ), M ′ = literals(T ), P ∪ S

is consistent, M ′ is complete and M = pos(M ′).

Page 212: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 196

Since M = pos(M) and ¬(LP \M) = neg(M) then we can rewrite (9.5) as follows:

P ∪∆ ∪ neg(M) ∪ ¬¬pos(M) °I pos(M)

By monotonicity, we can have

P ∪∆ ∪ neg(M) ∪ ¬¬pos(M) °I pos(M) ∪ neg(M) (9.6)

Let S = ∆ ∪ neg(M) ∪ ¬¬pos(M) and M ′ = pos(M) ∪ neg(M) then we can rewrite

(9.6) as follows

P ∪ S °I M ′ (9.7)

Let T = {X|P ∪ S ` X}, then by (9.7) M ′ ⊆ T . Additionally, by construction

S ⊆ (∆∪¬LP ∪¬¬LP ), M ′ = literals(T ), M ′ is complete and pos(M ′) = M . Finally,

by definition of °I, P ∪ S is consistent.

Now, we prove (2):

Let P be program, M ⊆ LP and EA ⊆ LP . Let 〈S, M ′〉 a generalized answer set

pair of P w.r.t. EA,

i.e., by definition of generalized answer set pair of P w.r.t. EA (Definition 9.5)

exists 〈S, M ′〉, a modelPair(EA) of P ,

i.e., by definition of modelPair(EA) of P w.r.t. EA (Definition 9.3), ∃〈S, M ′〉 ∈SC(P )EA such that M ′ is complete,

i.e., by definition of SC(P )EA (Definition 9.2), ∃〈S, M ′〉 such that ∃〈S, T 〉 ∈ SC(P )

where S ⊆ (EA ∪ ¬LP ∪ ¬¬LP ), M ′ = literals(T ) and M ′ is complete,

i.e., by definition of SC(P ) (Definition 9.1), ∃〈S, M ′〉 such that ∃T = {X|P∪S ` X}where S ⊆ (EA∪¬LP ∪¬¬LP ), M ′ = literals(T ), P ∪S consistent and M ′ complete.

Then by definition of generalized answer set of P w.r.t. EA (see Definition 4.2), we

have to prove that ∃∆ ⊆ EA such that pos(M ′) is an answer set of P ∪∆,

Page 213: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 197

〈S , L〉 pos(L)〈{q,¬s} , {q,¬s, r,¬t,¬p}〉, {q, r}〈{s,¬q} , {s,¬q, p,¬r,¬t}〉, {s, p}〈{p, s,¬q} , {s,¬q, p,¬r,¬t}〉, {s, p}〈{t,¬r,¬p} , {t,¬r,¬p, s, q}〉, {t, s, q}

Table 9.6: Some entries of SC(P1)EA of program P1 with EA = LP1 .

i.e., by definition of answer set of P (see Theorem 4.1), we have to prove that

∃∆ ⊆ EA such that

P ∪∆ ∪ ¬(LP \ pos(M ′)) ∪ ¬¬pos(M ′) °I pos(M ′)

By hypothesis, ∃〈S, M ′〉 such that ∃T = {X|P ∪S ` X} with S ⊆ (EA∪¬LP ∪¬¬LP ),

M ′ = literals(T ), P ∪ S consistent, and M ′ complete. Then in particular, P ∪ S ` M ′

with S ⊆ (EA ∪ ¬LP ∪ ¬¬LP ), M ′ = literals(T ), P ∪ S consistent, and M ′ complete.

Since pos(M ′) ⊆ (M ′) then P ∪ S ` pos(M ′) with S ⊆ (EA ∪ ¬LP ∪ ¬¬LP ),

M ′ = literals(T ), P ∪ S in consistent, and M ′ complete.

Let ∆ ⊆ EA be the minimal set such that P ∪ ∆ ∪ S ′ ` pos(M ′) with S ′ ⊆(¬LP ∪ ¬¬LP ), M ′ = literals(T ), P ∪ S in consistent, and M ′ complete.

Clearly, P ∪∆ ∪ ¬(LP \ pos(M ′)) ∪ ¬¬pos(M ′) ` pos(M ′). Finally, since P ∪ S is

consistent then whe have P ∪∆ ∪ ¬(LP \ pos(M ′)) ∪ ¬¬pos(M ′) °I pos(M ′).

For instance, if we consider again the program of Example 9.9, we can verify for

each entry in Table 9.6 that pos(L) is a generalized answer sets of program P1.

9.3.4 Minimal generalized answer sets

We have presented in the Background section the Definition of Minimal Generalized

Answer Sets (see Definition 4.4). Now, we are going to show how we can obtain the

minimal generalized answer sets in terms of the generalized answer set pairs of a program

Page 214: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 198

w.r.t. the set EA.

First, we introduce an order among the generalized answer set pairs of a program

w.r.t. the set EA, denoted as <EA. Then, we show how to obtain the minimal gener-

alized answers sets of the program using this order.

Definition 9.6. Let P be a program and EA ⊆ L. Let 〈S, L〉 and 〈S ′, L′〉 be two

generalized answer set pairs of P w.r.t. EA. Then, we define 〈S, L〉 <EA 〈S ′, L′〉 if

pos(S) ⊂ pos(S ′).

Note that <EA is a strict order over SC.

Lemma 9.10. Let P be a program, M ⊆ LP and EA ⊆ LP . Then M is a minimal

generalized answer set of P w.r.t. EA iff there exists 〈S, M ′〉, a minimal generalized

answer set pair of P w.r.t. the ordering <EA, such that M = pos(M ′).

Proof of Lemma 9.10.

We split the proof into two parts:

1. Let P be a program, M ⊆ LP and EA ⊆ LP . Let M be a minimal generalized

answer set of P w.r.t. EA then exists 〈S,M ′〉 a minimal generalized answer set pair

of P w.r.t. the ordering <EA such that M = pos(M ′).

2. Let P be a program, M ⊆ LP and EA ⊆ LP . Let 〈S,M ′〉 be a minimal generalized

answer set pair of P w.r.t. EA and minimal w.r.t. the ordering <EA then pos(M ′)

is a minimal generalized answer set of P w.r.t. EA.

We start proving (1):

Let P be a program, M ⊆ LP and EA ⊆ LP . Let M be a minimal generalized

answer set of P w.r.t. EA,

Page 215: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 199

i.e, by definition of minimal generalized answer sets (see Definition 4.4), ∃∆ ⊆ EA

such that M is an answer set of P ∪∆ and @∆′ ⊂ ∆ such that P ∪∆′ has an answer

set of P ∪∆′,

i.e., by definition of answer set of P ∪∆ (see Theorem 4.1),

∃∆ ⊆ EA such that P ∪∆ ∪ ¬(LP \ pos(M)) ∪ ¬¬pos(M) °I pos(M)

and

@∆′ ⊆ ∆ such that P ∪∆′ ∪ ¬(LP \ pos(M ′′)) ∪ ¬¬pos(M ′′) °I pos(M ′′).

By definition of minimal generalized answer set pair (Definition 9.6), we have to

prove two things:

• (a) exists 〈S, M ′〉, a generalized answer set pair of P w.r.t. EA, such that pos(M ′)

is a generalized answer set of P w.r.t. EA, and

• (b) @〈S ′,M ′′〉, a generalized answer set pair of P w.r.t. EA, such that pos(S ′) ⊂pos(S).

In order to prove (a), we know by hypothesis that M is a generalized answer set of P

w.r.t. EA. Then by Lemma 9.9, M is a generalized answer set of P w.r.t. EA iff there

exists 〈S, M ′〉, a generalized answer set pair of P w.r.t. EA, such that M = pos(M ′).

We are going to prove (b) by contradiction. Let 〈S,M ′〉 be a generalized answer set

pair of P w.r.t. EA, such that pos(M ′) is a generalized answer set of P w.r.t. EA, and

let 〈S ′,M ′′〉 be a generalized answer set pair of P w.r.t. EA, such that pos(S ′) ⊂ pos(S).

Then by definition of generalized answer set pair of P w.r.t. EA (Definition 9.5):

〈S,M ′〉 is a modelPair(EA) of P and 〈S ′,M ′′〉 is a modelPair(EA) of P such that

pos(S ′) ⊂ pos(S).

Then by definition of modelPair(EA) of P (Definition 9.3): 〈S,M ′〉 ∈ SC(P )EA

such that M ′ is complete and 〈S ′,M ′′〉 ∈ SC(P )EA such that M ′′ is complete and

pos(S ′) ⊂ pos(S).

Page 216: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 200

Then by definition of SC(P )EA (Definition 9.2):

∃〈S, T 〉 ∈ SC(P ) where S ⊆ (EA ∪ ¬LP ∪ ¬¬LP ), M ′ = literals(T ), M ′ is complete,

and

∃〈S ′, T ′〉 ∈ SC(P ) where S ′ ⊆ (EA∪¬LP ∪¬¬LP ), M ′′ = literals(T ′), M ′′ is complete,

and pos(S ′) ⊂ pos(S).

Then by definition of SC(P ) (Definition 9.1):

∃T = {X|P ∪ S ` X} where S ⊆ (EA ∪ ¬LP ∪ ¬¬LP ), M ′ = literals(T ), P ∪ S

consistent, M ′ is complete, and

∃T ′ = {X|P ∪ S ′ ` X} where S ′ ⊆ (EA ∪ ¬LP ∪ ¬¬LP ), M ′′ = literals(T ′), P ∪ S

consistent, M ′′ is complete, and pos(S ′) ⊂ pos(S).

In particular:

P ∪ S ` M ′ where S ⊆ (EA ∪ ¬LP ∪ ¬¬LP ), M ′ = literals(T ), P ∪ S consistent, M ′

is complete, and

P ∪ S ′ ` M ′′ where S ′ ⊆ (EA ∪ ¬LP ∪ ¬¬LP ), M ′′ = literals(T ′), P ∪ S consistent,

M ′′ is complete, and pos(S ′) ⊂ pos(S).

Let ∆ = pos(S) and ∆′ = pos(S ′) then:

P ∪∆ ∪R ` M ′ where R ⊆ (¬LP ∪ ¬¬LP ), M ′ = literals(T ), P ∪ S consistent, M ′ is

complete, and

P ∪∆′∪R′ ` M ′′ where R′ ⊆ (¬LP ∪¬¬LP ), M ′′ = literals(T ′), P ∪S consistent, M ′′

is complete, and ∆′ ⊂ ∆.

Clearly, P ∪∆ ∪ ¬(LP \ pos(M)) ∪ ¬¬pos(M) °I pos(M) and

P ∪∆′ ∪¬(LP \ pos(M ′′))∪¬¬pos(M ′′) °I pos(M ′′) such that ∆′ ⊂ ∆, a contradiction

of hypothesis.

Now, we prove (2):

Let P be a program, M ⊆ LP and EA ⊆ LP . Let 〈S,M ′〉 be a minimal generalized

answer set pair of P w.r.t. EA and the ordering <EA.

Page 217: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 201

By definition of minimal generalized answer set of P (Definition 4.4), we have to

prove two things:

• (a) ∃∆ ⊆ EA such that P ∪ ∆ ∪ ¬(LP \ pos(M)) ∪ ¬¬pos(M) °I pos(M), i.e.

pos(M) is an answer set of P ∪∆,

• (b) @∆′ ⊆ ∆ such that P ∪∆′ ∪ ¬(LP \ pos(M ′′)) ∪ ¬¬pos(M ′′) °I pos(M ′′).

In order to prove (a), we know by hypothesis that 〈S, M ′〉 is a minimal generalized

answer set pair of P w.r.t. EA and the ordering <EA. Then by Lemma 9.9, pos(M ′) is

a generalized answer set of P .

We are going to prove (b).

By hypothesis and definition of order <EA (Definition 9.6), if 〈S, M ′〉 is a minimal

generalized answer set pair of P w.r.t. EA and the ordering <EA then 〈S, M ′〉 is a

generalized answer set pair of P w.r.t. EA, and @〈S ′, M ′′〉 generalized answer set pair

of P w.r.t. EA, such that pos(S ′) ⊂ pos(S),

i.e., if 〈S, M ′〉 is a minimal generalized answer set pair of P w.r.t. EA and the

ordering <EA then 〈S, M ′〉 is a generalized answer set pair of P w.r.t. EA, and if exists

〈S ′,M ′′〉 a generalized answer set pair of P w.r.t. EA, then pos(S) ⊂ pos(S ′),

i.e., by definition of generalized answer set pair of P w.r.t. EA (Definition 9.5),

〈S,M ′〉 is a modelPair(EA) of P and if exists 〈S ′,M ′′〉 is a modelPair(EA) of P then

pos(S) ⊂ pos(S ′),

i.e., by definition of modelPair(EA) of P (Definition 9.3), 〈S, M ′〉 ∈ SC(P )EA such

that M ′ is complete and if exists 〈S ′,M ′′〉 ∈ SC(P )EA such that M ′′ is complete then

pos(S) ⊂ pos(S ′),

i.e., by definition of SC(P )EA (Definition 9.2), exists 〈S, T 〉 ∈ SC(P ) where S ⊆(EA ∪ ¬LP ∪ ¬¬LP ), M ′ = literals(T ), M ′ is complete, and

Page 218: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 202

if exists 〈S ′, T ′〉 ∈ SC(P ) where S ′ ⊆ (EA ∪ ¬LP ∪ ¬¬LP ), M ′′ = literals(T ′), M ′′ is

complete, then pos(S) ⊂ pos(S ′),

i.e., by definition of SC(P ) (Definition 9.1), exists T = {X|P ∪ S ` X} where

S ⊆ (EA ∪ ¬LP ∪ ¬¬LP ), M ′ = literals(T ), P ∪ S consistent, M ′ is complete, and if

exists T ′ = {X|P ∪S ′ ` X} where S ′ ⊆ (EA∪¬LP ∪¬¬LP ), M ′′ = literals(T ′), P ∪S

consistent, M ′′ is complete, then pos(S) ⊂ pos(S ′).

Then, in particular:

P ∪S ` M ′ where S ⊆ (EA∪¬LP ∪¬¬LP ), M ′ = literals(T ), P ∪S consistent, M ′ is

complete, and if exists P ∪S ′ ` M ′′ where S ′ ⊆ (EA∪¬LP ∪¬¬LP ), M ′′ = literals(T ′),

P ∪ S consistent, M ′′ is complete, then pos(S) ⊂ pos(S ′).

Let ∆ = pos(S) and ∆′ = pos(S ′) then:

P ∪∆ ∪R ` M ′ where R ⊆ (¬LP ∪ ¬¬LP ), M ′ = literals(T ), P ∪ S consistent, M ′ is

complete, and

if exists P ∪ ∆′ ∪ R′ ` M ′′ where R′ ⊆ (¬LP ∪ ¬¬LP ), M ′′ = literals(T ′), P ∪ S

consistent, M ′′ is complete, then ∆ ⊂ ∆′.

Clearly, P ∪∆ ∪ ¬(LP \ pos(M)) ∪ ¬¬pos(M) °I pos(M) and

if exists P ∪∆′ ∪ ¬(LP \ pos(M ′′)) ∪ ¬¬pos(M ′′) °I pos(M ′′) then ∆ ⊂ ∆′,

i.e., P ∪∆ ∪ ¬(LP \ pos(M)) ∪ ¬¬pos(M) °I pos(M) and

@∆′ ⊂ ∆ such that P ∪∆′ ∪ ¬(LP \ pos(M ′′)) ∪ ¬¬pos(M ′′) °I pos(M ′′).

For instance, {s} is a minimal generalized answer set of program P1 in Example 9.9

since {s,¬q} is a minimal entry.

9.3.5 Compositionality of programs

In this section we introduce compositionality of programs in terms of their Semantic

Contents. The idea is to combine the knowledge represented in two diferents programs

Page 219: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 9. SEMANTIC CONTENTS 203

to make conclusions of it. This result is not fundamental for this work and we can see

it in detail in [47, 37, 48].

9.4 Conclusions

In order to have a mathematical structure useful to express from it in a uniform way

the different answer set semantics, in this chapter we introduced the notion of Semantic

Contents of a program. Once we have constructed the Semantic Contents of a program

we show how to find from it in a uniform way the standard definition of answer sets and

some of the variants of answer sets such as generalized answer sets, minimal generalized

answer sets, and an answer set semantics introduced in this section called partial answer

sets.

Future work could be about how to use the semantics contents to obtain other

answer set semantics such as preferred answers sets in terms of ordered disjunction

programs.

Page 220: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Chapter 10

Conclusions

In this thesis we have proposed to investigate and evaluate the capabilities of Answer

Set Programming to represent disaster situations in order to give support in defining

evacuation plans.

We have come to the conclusion that using Answer Sets is possible to represent

disaster situations and overall to take advantage of the capabilities of Answer Sets and

of the different Answer Set approaches that currently exist to obtain the alternative

evacuation plans. In this work we studied some of these approaches in order to define

the evacuation plans. Additionally, we shown how and why the Answer Set approaches

studied were useful to define evacuation plans. Finally, we presented some lacks of these

Answer Set approaches that we addressed in this work.

Since most of the information needed to model an evacuation plan problem cor-

responds to geographic information, we analyzed how geographic information about

the disaster zone can be translated into a format that Answer Sets is capable to under-

stand. In particular, we proposed a procedure to construct the hazard zone background

knowledge from geographic information. This procedure was a direct result of our own

experience dealing with this kind of data. We also presented the information which

would be ideal to have in order to model an evacuation plan problem and in partic-

204

Page 221: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 10. CONCLUSIONS 205

ular a volcano evacuation plan problem. It is worth to mention that in this work we

tested all of our results with a short part of the real geographic data about Volcano

Popocatepetl hazard zone, and with part of the information that would be ideal to have

to model an evacuation plan, since the total real data of this zone were obtained almost

at the end of this work.

The scenario that we considered in this work models a hazard zone where towns, in

risk, roads and shelters are defined. Moreover, some of the roads are part of a set of

pre-defined evacuation routes. Our scenario, also considers that in a real case is possible

that part of the pre-defined evacuation routes become blocked, and then generation of

alternative evacuation plans is necessary.

In our first attempt to model the alternative evacuation plan problem we used An-

swer Set Planning [16] since it provides a natural and elegant way to model planning

problems where it is possible to represent states, initial states, actions, executability

conditions and effects of actions, and goals in order to obtain the feasible plans. How-

ever, we realized that using only Answer Set Planning to specify these kind of planning

problems does not result in a natural way. Hence, we studied and applied different

Answer Set approaches that were useful to obtain the evacuation plans, such as, CR-

rules, Minimal Generalized Answer Sets, Ordered Disjunction programs and Language

PP for planning preferences.

We proposed to extend our model of evacuation plans adding CR-rules. Then,

taking advantage of the definition of a CR-rule we use it only if there is no way to

obtain an evacuation plan when part of the pre-defined evacuation route is blocked.

Additionally, since the semantics of a CR-program is defined in terms of the minimal

generalized answer sets, we proposed a characterization of them in terms of ordered

disjunction programs.

However, the alternative evacuation plans obtained adding CR-rules to the Answer

Page 222: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 10. CONCLUSIONS 206

Set Planning problem specification do not consider any other characteristic of the path

that they follow. Then, we realized that we needed to apply the concept of preference

to obtain an appropriate evacuation plan. Currently, in Answer Sets there are a lot of

approaches dealing with preferences. In particular, we studied and analyzed language

PP since, it allows to express preferences at different levels over the alternative plans

and because it allows us to express preferences over plans where the satisfaction of these

preferences depends on time and on their temporal relationships.

While we used PP to express preferences we realized that there are some preferences

that cannot be expressed in a simple and natural way since they result very large. Then,

in order to have a natural representation of these kind of preferences we defined PPpar

language. PPpar is an extension of PP language where propositional connectives and

temporal connectives allow us to represent compactly preferences having a particular

property. Since we consider that language PP could take advantage of the working

framework of propositional Linear Temporal Logic LTL to express preferences, we also

presented a brief overview about the relationship between language PP and LTL.

We also studied ordered disjunction programs since they allows us to represent

alternative, ranked options for problem solutions. We proposed an extension of them

to a wider class of logic programs that we called extended ordered disjunction programs.

Moreover, we shown that in particular extended ordered rules with negated negative

literals could be useful to allow a simpler and easier encoding to obtain the preferred

plans with respect to a preference expressed in language PP . We also considered

them to obtain the maximal answer sets of a program characterizing an Argumentation

Framework such that these maximal answer sets correspond to the preferred extensions

of it.

Finally in this work, we introduced the notion of Semantic Contents of a program

as an alternative point of view to obtain different answer set semantics of a program.

Page 223: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

CHAPTER 10. CONCLUSIONS 207

In particular, we show how to obtain the standard answer sets, the generalized answer

sets, the minimal generalized answer sets and a new answer set semantic introduced

in this section called partial answer sets. In particular we presented an example in a

planning domain where partial answer sets could be useful.

An interesting topic to future research is the application of some Answer Sets ap-

proaches aimed to make the generation of answer sets more effective in the generation

of Evacuation plans. For instance with respect to their memory requirements such as

in [5].

Another research direction is about modeling dynamic domains using Answer Sets

to generate evacuation plans where all characteristics of relevant exogenous events (for

instance an explosion or lava flows) occurring in a hazard zone and the complete in-

formation about a hazard zone can be considered. The Answer Set approaches used

in [3] for model dynamic systems and in [10] to model lava flows could help us in this

research direction.

Finally, it would be interesting to extend our use of Semantic Contents to find some

other answer set variants, such as preferred answer sets for Ordered Disjunction Logic

Programs and then, analyze their use to obtain the evacuation plans. For instance in [48]

some short examples using partial answer sets from Semantic Contents are illustrated.

Page 224: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Appendix A

Ejemplos

Example A.1. La Figura A.1 muestra un grafo dirigido que corresponde a una repre-

sentacion pequena de tres rutas de evacuacion en una zona de riesgo. Podemos definir

el siguiente conocimiento asociado a este grafo de la manera siguiente:

route(2). route(1). route(0). risk(0). risk(1). risk(2). risk(3).

% nodo(punto,ruta,riesgo)

node(1,1,3). node(2,0,3). node(2,1,3). node(4,0,2). node(5,0,1).

node(11,0,2). node(8,1,1). node(9,1,0). node(12,0,3).

node(12,2,3). node(15,0,2). node(16,0,1). node(16,0,1).

node(13,0,3). node(13,2,3). node(17,2,2). node(19,2,0).

% segment (ini,fin,routa)

segment(1,2,1). segment(2,11,0). segment(2,4,0). segment(4,5,0).

segment(4,9,0). segment(2,8,1). segment(8,9,1). segment(12,15,0).

segment(12,17,2). segment(15,16,0). segment(16,19,0).

segment(13,15,0). segment(13,17,2). segment(17,19,2).

% townAt(pueblo, nodo)

townAt(p1,1). townInRisk(p1). townAt(p2,12). townInRisk(p2).

townAt(p3,13). townInRisk(p3).

208

Page 225: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX A. EJEMPLOS 209

% busIniAt(autobus,punto).

bus(b1). busIniAt(b1,p1). bus(b2). busIniAt(b2,p2). bus(b3).

busIniAt(b3,p3).

shelther(9). shelter(19).

Figure A.1: Dos rutas de evacuacion

Example A.2. Consideremos el Ejemplo A.1, la Figura A.1 y el conjunto de observa-

ciones acerca del estado inicial O = {initially position(b1, 9, 1); initially position(b2, 12, 2);

initially position(b3, 13, 2)}; y la meta G = {end(b1). end(b2). end(b3).}. Entonces

una posible codificacion π(D, O, G, l) en Answer Set Programming para el problema de

las rutas de evacuacion es el siguiente:

% inicialmente el autobus B esta en el nodo N de la ruta R.

initially(position(B, N, R)).

% meta: finalmente del autobus B en un nodo final.

Page 226: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX A. EJEMPLOS 210

finally(end(B)).

% fluentes:

% posicion del autobus B es en el nodo Q de la ruta R.

fluent(position(B,Q,R)).

% camino del nodo P al nodo Q de la ruta R esta bloqueado.

fluent(blocked (P,Q,R)).

% autobus B en un nodo final.

fluent(end(B)):- shelter(B).

% accion travel:

% autobus B viaja por el camino del nodo P al nodo Q de la ruta R,

% donde R<>0, es decir, los autobuses solo viajan por la ruta de evacuaci\’on.

action(travel(B,P,Q,R)).

% Reglas de cause dinamicas:

% si el autobus B viaja por el camino del nodo P al nodo Q

% de la ruta R con R<>0, entonces B esta en la posicion Q de la ruta R.

caused(position(B,Q,R),travel(B,P,Q,R)) .

% si el autobus B viaja por el camino del nodo P al nodo Q

% de la ruta R entonces B no esta en la posicion P de la ruta R.

caused(neg(position(B,P,R)),travel(B,P,Q,R)).

% Reglas de causa estaticas:

% si el autobus B esta en la posicion P de la ruta R tal que

% en el nodo P hay un refugio, entonces B esta en una posicion final.

caused(end(B), position(B,P,R)).

Page 227: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX A. EJEMPLOS 211

% Condiciones de ejecutabilidad:

% autobus B no puede viajara por un camino del nodo P al nodo Q de la ruta R,

% si B no esta en la posicion P de la ruta R.

noaction_if(travel(B,P,Q,R),neg(position(B,P,R))).

% autobus B no puede viajara por el camino del nodo P al nodo Q de la ruta R,

% si el camino esta bloqueado.

noaction_if(travel(B,P,Q,R),blocked(P,Q,R)).

Entonces, los planes que corresponden a los answer sets de π(D,O,G, l) con l = 3

son los siguientes:

time 0 time 1 time 2

travel(b1,1,2,1) travel(b1,2,8,1) travel(b1,8,9,1)

travel(b2,12,17,2) travel(b2,17,19,2) —

travel(b3,13,17,2) travel(b3,17,19,2) —

La codificacion π(D, O, G, l) obtiene todos los caminos posibles para los autobuses

desde su posicion inicial a su posicion final. En este ejemplo todos los autobuses deben

seguir sus rutas de evacuacion predefinidas, exactamente como se espera cuando dichas

rutas son definidas. En los planes se asume que cada accion emplea una unidad de

tiempo.

Example A.3. Consederemos nuevamente el Ejemplo A.2, supongamos que parte de la

ruta 2 de evacuacion esta bloqueada porque se bloqueo road(12, 17, 2), es decir, agreg-

amos initially blocked(12, 17) a π(D, O,G, l). Puesto que no es posible que el autobus

b2 sigua la ruta predefinida de evacuacion, entonces π(D,O,G, l) es inconsistente y no

se pueden definir planes de evacuacion. Para restaurar consistencia y obtener un plan

alternativo agregamos al programa π(D,O,G, l) la CR-regla:

r2 : action(travel(B, P,Q, R′)) +← bus(B), road(P,Q, R′).

Page 228: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX A. EJEMPLOS 212

Esta CR-regla debe ser utilizada solamente si no hay manera de obtener un plan cuando

parte de la ruta de la evacuacion se bloquea. Entonces, podemos reescribir el programa

π(D, O, G, l) como sigue:

% inicialmente el autobus B esta en el nodo N de la ruta R.

initially(position(B, N, R)).

% meta: finalmente del autobus B en un nodo final.

finally(end(B)).

% fluentes:

% posicion del autobus B es en el nodo Q de la ruta R.

fluent(position(B,Q,R)).

% camino del nodo P al nodo Q de la ruta R esta bloqueado.

fluent(blocked (P,Q,R)).

% autobus B en un nodo final.

fluent(end(B)):- shelter(B).

% Accion REGULAR travel:

% accion travel:

% autobus B viaja por el camino del nodo P al nodo Q de la ruta R,

% donde R<>0, es decir, los autobuses solo viajan por la

% ruta de evacuacion.

action(travel(B,P,Q,R)).

% CR-regla donde R’ puede ser cero o no,

r_2: action(travel(B,P,Q,R’)) :- + bus(B), road(P,Q,R’).

% Reglas de cause dinamicas:

Page 229: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX A. EJEMPLOS 213

% si el autobus B viaja por el camino del nodo P al nodo Q

% de la ruta R con R<>0, entonces B esta en la posicion Q de la ruta R.

caused(position(B,Q,R),travel(B,P,Q,R)) .

% si el autobus B viaja por el camino del nodo P al nodo Q

% de la ruta R entonces B no esta en la posicion P de la ruta R.

caused(neg(position(B,P,R)),travel(B,P,Q,R)).

% Reglas de causa estaticas:

% si el autobus B esta en la posicion P de la ruta R tal que

% en el nodo P hay un refugio, entonces B esta en una posicion final.

caused(end(B), position(B,P,R)).

% Condiciones de ejecutabilidad:

% autobus B no puede viajara por un camino del nodo P al nodo Q de la ruta R,

% si B no esta en la posicion P de la ruta R.

noaction_if(travel(B,P,Q,R),neg(position(B,P,R))).

% autobus B no puede viajara por el camino del nodo P al nodo Q de la ruta R,

% si el camino esta bloqueado.

noaction_if(travel(B,P,Q,R),blocked(P,Q,R)).

Entonces, obtenemos cuatro planes de evacuacion alternativos, es decir, cuatro an-

swer sets:

Plan1:

tiempo 0 tiempo 1 tiempo 2

travel(b1,1,2,1) travel(b1,2,4,0) travel(b1,4,9,0)

travel(b2,12,15,2) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,15,2) travel(b3,15,16,0) travel(b3,16,19,0)

Page 230: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX A. EJEMPLOS 214

Plan2:

tiempo 0 tiempo 1 tiempo 2

travel(b1,1,2,1) travel(b1,2,8,1) travel(b1,8,9,1)

travel(b2,12,15,0) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,15,0) travel(b3,15,16,0) travel(b3,16,19,0)

Plan3:

tiempo 0 tiempo 1 tiempo 2

travel(b1,1,2,1) travel(b1,2,8,1) travel(b1,8,9,1)

travel(b2,12,15,0) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,17,2) travel(b3,17,19,2) —

Plan4:

tiempo 0 tiempo 1 tiempo 2

travel(b1,1,2,1) travel(b1,2,4,0) travel(b1,4,9,0)

travel(b2,12,15,0) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,17,2) travel(b3,17,19,2) —

La codificacion π(D, O, G, l) en el Ejemplo A.3 obtiene todos los posibles caminos de los

autobuses desde sus posiciones inicial hasta sus posiciones finales. Por ejemplo, el Plan 3

dice que el autobus b1 y el autobus b3 deben seguir sus rutas de evacuacion predefinidas

mientras el autobus b2 debe viajar por caminos fuera de la ruta de evacuacion.

Figure A.2: Tres rutas de evacuacion.

Page 231: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX A. EJEMPLOS 215

Example A.4. Consideremos el ejemplo A.2 pero ahora la accion de viajar permite

viajar por segmentos que son o no parte de una ruta de evacuacion, es decir, la accion

travel(B,P,Q,R) ahora es como sigue:

% action travel:

% autobus B viaja por el camino del nodo P al nodo Q de la ruta R,

% donde R es igual a 0, 1, 2 o 3, es decir, los autobuses pueden

% viajar por ruta de evacuacion o no:

action(travel(B,P,Q,R)).

Consideremos en este ejemplo el grafo dirigido de la Figura A.2 podiramos definir

los siguientes deseos basicos:

—travelERass para expresar que se prefiere que los autobuses viajan por la ruta de

evacuacion asignada por el gobierno hasta que ellos lleguen al refugio.

travelERass :=

until(occ(travel(busB, 12, 13, 2)) ∨ occ(travel(busB, 13, 8, 2))∨occ(travel(busB, 8, 9, 2)) ∨ occ(travel(busB, 9, 11, 2)) , position(busB, 11, 2)) ∧

until(occ(travel(busC, 14, 16, 1)) , position(busC, 16, 1)) ∧until(occ(travel(busA, 1, 2, 3)) ∨ occ(travel(busA, 2, 3, 3)) , position(busA, 3, 3))

—travelER para expresar que es preferido que los autobuses viajen por caminos que

pertenecen a alguna ruta de evacuacion y no es importante si ellos viajan o no por su

Page 232: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX A. EJEMPLOS 216

ruta de evacuacion asignada hasta que lleguen a su refugio asignado.

travelER :=

until(

occ(travel(busB, 12, 13, 2)) ∨ occ(travel(busB, 13, 8, 2)) ∨ occ(travel(busB, 8, 9, 2))∨occ(travel(busB, 9, 11, 2)) ∨ occ(travel(busB, 14, 16, 1)) ∨ occ(travel(busB, 1, 2, 3))∨occ(travel(busB, 2, 3, 3)) ∨ occ(travel(busC, 12, 13, 2)) ∨ occ(travel(busC, 13, 8, 2))∨occ(travel(busC, 8, 9, 2)) ∨ occ(travel(busC, 9, 11, 2)) ∨ occ(travel(busC, 14, 16, 1))∨occ(travel(busC, 1, 2, 3)) ∨ occ(travel(busC, 2, 3, 3)) ∨ occ(travel(busA, 12, 13, 2))∨occ(travel(busA, 13, 8, 2)) ∨ occ(travel(busA, 8, 9, 2)) ∨ occ(travel(busA, 9, 11, 2))∨occ(travel(busA, 14, 16, 1)) ∨ occ(travel(busA, 1, 2, 3)) ∨ occ(travel(busA, 2, 3, 3)) ,

position(busC, 16, 1) ∧ position(busB, 11, 2) ∧ position(busA, 3, 3) )

—travelBlSh para expresar que los autobuses viajen por su ruta de evacuacion asignada

hasta que eventualmente parte de su ruta de evacuacion este bloqueda y entonces ellos

viajen fuera de la ruta de evacuacion hasta que ellos lleguen a sus refugios asignados.

travelBlSh :=

until(occ(travel(busB, 12, 13, 2)) ∨ occ(travel(busB, 13, 8, 2))∨occ(travel(busB, 8, 9, 2)) ∨ occ(travel(busB, 9, 11, 2)) ,

until( eventually(blocked(12, 13, 2) ∨ blocked(13, 8, 2)) ∨ blocked(8, 9, 2) ∨ blocked(9, 11, 2)),

travel(busB, 13, 18, 0)) ∨ travel(busB, 18, 19, 0)) ∨ travel(busB, 13, 14, 2))∨travel(busB, 14, 11, 2)) ∨ travel(busB, 1, 14, 2)) ∨ position(busB, 11, 2) ) )

until(occ(travel(busC, 14, 16, 1)) ,

until( eventually(blocked(14, 16, 1)),

travel(busC, 13, 18, 0)) ∨ travel(busC, 18, 19, 0)) ∨ travel(busC, 13, 14, 2))∨travel(busC, 14, 11, 2)) ∨ travel(busC, 1, 14, 2)) ∨ position(busC, 16, 1) ) )

∧until(occ(travel(busA, 1, 2, 3)) ∨ occ(travel(busA, 2, 3, 3)) ,

until( eventually(blocked(1, 2, 3) ∨ blocked(2, 3, 3))),

travel(busA, 13, 18, 0)) ∨ travel(busA, 18, 19, 0)) ∨ travel(busA, 13, 14, 2))∨travel(busA, 14, 11, 2)) ∨ travel(busA, 1, 14, 2)) ∨ position(busA, 3, 3) ) )

Page 233: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX A. EJEMPLOS 217

De manera similar podiramos expresar otros deseos basicos. Una preferencia atomica

posible ψ indicando el orden en el cual el conjunto de deseos basicos deben ser satisfechos

es la siguiente: ψ = travelERass / travelER / travelBlSh

La preferencia atomica ψ dice que los planes satisfaciendo travelERass son preferidos,

en otro caso los planes que satisfacen travelER son preferidos, y finalmente se prefieren

los planes que satisfacen travelBlSh.

Example A.5. Notemos que el deseo basico travelER del Ejemplo A.4 esta especif-

icando una disjuncion consistente de las diferentes opciones que los autobuses tienen

para viajar por los arcos que pertenecen a alguna ruta de evacuacion predefinida. Sin

embargo, supongamos que las rutas de evacuacion tienen un numero mas grande de

arcos. Entonces, para expresar travelER de una manera similar tendrıamos que especi-

ficar una disyuncion mas grande consistente de todos los arcos en las rutas nuevas de

evacuacion. A pesar de que en [43] se indica que los fluentes y las acciones en PPcon variables eson una abreviacion representando el conjunto de todas sus instancias

ground, la idea de usar fluentes y acciones con variables no es suficiente para expresar

este tipo de problemas. Por lo tanto, hay algunas preferencias que no se pueden ex-

presar en PP de una manera simple y natural. Para tener una representacion natural

de esta clase de preferencias definimos el lenguaje PPpar inspirados en [22]. PPpar

es una extension del lenguaje de PP donde los conectivos propositionales y tempo-

rales permiten que representemos de manera compacta las preferencias que tienen una

caracterıstica particular. Por ejemplo, una representacion natural y compacta de la

preferencia travelER del ejemplo A.4 que usa un o parametrico serıa:

until(∨{occ(travel(B, I, F, R)) : bus(B), road(I, F, R), neq(R, 0)},

∧{position(B,F i, R) : bus(B), shelter(Fi), route(R), neq(R, 0)})

Page 234: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Appendix B

Exemples

Example B.1. La figure 8.1 montre un graphique dirige qui correspond a une petite

representation de trois voies d’evacuation dans une zone a risque. Nous pouvons definir

la connaissance suivante associee a ce graphique de telle maniere :

route(2). route(1). route(0). risk(0). risk(1). risk(2). risk(3).

% node(point,voie,riesgo)

node(1,1,3). node(2,0,3). node(2,1,3). node(4,0,2). node(5,0,1).

node(11,0,2). node(8,1,1). node(9,1,0). node(12,0,3).

node(12,2,3). node(15,0,2). node(16,0,1). node(16,0,1).

node(13,0,3). node(13,2,3). node(17,2,2). node(19,2,0).

% segment (ini,fin,voie)

segment(1,2,1). segment(2,11,0). segment(2,4,0). segment(4,5,0).

segment(4,9,0). segment(2,8,1). segment(8,9,1). segment(12,15,0).

segment(12,17,2). segment(15,16,0). segment(16,19,0).

segment(13,15,0). segment(13,17,2). segment(17,19,2).

% townAt(ville, nodo)

townAt(p1,1). townInRisk(p1). townAt(p2,12). townInRisk(p2).

townAt(p3,13). townInRisk(p3).

218

Page 235: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX B. EXEMPLES 219

% busIniAt(autobus,point).

bus(b1). busIniAt(b1,p1). bus(b2). busIniAt(b2,p2). bus(b3).

busIniAt(b3,p3).

shelther(9). shelter(19).

Figure B.1: Deux routes d’evacuation

Example B.2. Nous considerons l’exemple B.1, la figure 8.1 et l’ensemble des observa-

tions au sujet de l’etat initial O = {initially position(b1, 9, 1); initially position(b2, 12, 2);

initially position(b3, 13, 2)}; et le but G = {end(b1). end(b2). end(b3).}. Alors une cod-

ification possible π(D, O,G, l) dans Answer Set Programming pour les problemes des

voies d’evacuation, est la suivante:

% Initialement, le bus B est au point N de la voie R.

initially(position(B, N, R)).

% but: finalement le bus B est \‘{a} un point final.

Page 236: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX B. EXEMPLES 220

finally(end(B)).

% fluentes:

% la position du bus B est au point Q de la voie R.

fluent(position(B,Q,R)).

% le chemin du point P au point Q de la voie R est bloqu\’e.

fluent(blocked (P,Q,R)).

% le bus B \‘{a} un point final.

fluent(end(B)):- shelter(B).

% Action travel:

% le bus B roule sur le chemin du point P au point Q de la voie R,

% o\‘{u} R<>0, c’est \‘{a} dire que les bus roulent

% seulement sur la voie d’\’evacuation.

action(travel(B,P,Q,R)).

% R\‘{e}gles de cause dynamiques:

% si le bus B roule sur le chemin du point P au point Q

% de la voie R avec R<>0, alors B est dans la position Q

% de la voie R.

caused(position(B,Q,R),travel(B,P,Q,R)) .

% si le bus B roule sur le chemin du point P au point Q

% de la voie R alors B n’est pas dans la position P de la voie R.

caused(neg(position(B,P,R)),travel(B,P,Q,R)).

% R\‘{e}gles de cause statiques:

% si le bus B est dans la position P de la voie R tel que

% au point P il y a un refuge, alors B est dans une position finale.

Page 237: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX B. EXEMPLES 221

caused(end(B), position(B,P,R)).

% Condicions d’application:

% le bus B ne peut pas rouler sur le chemin du point P au point Q de la voie R,

% si B n’est pas dans la position P de la voie R.

noaction_if(travel(B,P,Q,R),neg(position(B,P,R))).

% bus B ne peut pas rouler sur le chemin du point P au point Q de la voie R,

% si le chemin est bloqu\’e.

noaction_if(travel(B,P,Q,R),blocked(P,Q,R)).

Alors les plans qui correspondent aux answer sets de π(D, O,G, l) avec l = 3 sont

les suivants:

time 0 time 1 time 2

travel(b1,1,2,1) travel(b1,2,8,1) travel(b1,8,9,1)

travel(b2,12,17,2) travel(b2,17,19,2) —

travel(b3,13,17,2) travel(b3,17,19,2) —

La codification π(D,O,G, l) obtient tous les chemins pour les autobus de leurs

positions initiales a leur position finale. Dans cet exemple, tous les autobus doivent

suivre leur voie d’evacuation predefinie, exactement comme il est souhaite lors de la

definition de ces voies. Dans les plans, on assume que chaque action emploie une unite

de temps.

Example B.3. En revenant a notre exemple B.2, nous supposons qu’une partie de la

voie d’evacuation 2 est bloquee parce que s’est bloquee road(12, 17, 2), c’est a dire, nous

ajoutons initially blocked(12, 17) a π(D, O,G, l). Comme il n’est pas possible que le

bus b2 suive la voie d’evacuation predefinie, alors π(D,O, G, l) est inconsistant et on

ne peut pas definir de plans d ’evacuation. Pour restaurer la consistance et obtenir un

Page 238: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX B. EXEMPLES 222

plan alternatif, nous ajoutons au programme π(D,O, G, l) la CR-regle:

r2 : action(travel(B, P,Q, R′)) +← bus(B), road(P,Q, R′).

Cette CR-regle doit etre utilisee seulement s’il n’y a aucun moyen d’obtenir un plan

quand une partie de la voie d’evacuation est bloquee. Nous pouvons alors reecrire le

programme π(D,O, G, l) comme suit:

% Initialement, le bus B est au point N de la voie R.

initially(position(B, N, R)).

% but: finalement le bus B est \‘{a} un point final.

finally(end(B)).

% fluentes:

% la position du bus B est au point Q de la voie R.

fluent(position(B,Q,R)).

% le chemin du point P au point Q de la voie R est bloqu\’e.

fluent(blocked (P,Q,R)).

% le bus B \‘{a} un point final.

fluent(end(B)):- shelter(B).

% Action NORMALE travel:

% action travel:

% le bus B roule sur le chemin du point P au point Q de la voie R,

% o\‘{u} R<>0, c’est \‘{a} dire que les bus roulent seulement sur

% la voie d’\’evacuation.

action(travel(B,P,Q,R)).

% CR-r\‘{e}gle o\‘{u} R’ peut \^{e}tre z\’ero ou pas,

Page 239: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX B. EXEMPLES 223

r_2: action(travel(B,P,Q,R’)) :- + bus(B), road(P,Q,R’).

% R\‘{e}gles de cause dynamiques:

% si le bus B roule sur le chemin du point P au point Q

% de la voie R avec R<>0, alors B est dans la position Q

% de la voie R.

caused(position(B,Q,R),travel(B,P,Q,R)) .

% si le bus B roule sur le chemin du point P au point Q

% de la voie R alors B n’est pas dans la position P de la voie R.

caused(neg(position(B,P,R)),travel(B,P,Q,R)).

% R\‘{e}gles de cause statiques:

% si le bus B est dans la position P de la voie R tel que

% au point P il y a un refuge, alors B est dans une position finale.

caused(end(B), position(B,P,R)).

% Condicions d’application:

% le bus B ne peut pas rouler sur le chemin du point P au point Q de la voie R,

% si B n’est pas dans la position P de la voie R.

noaction_if(travel(B,P,Q,R),neg(position(B,P,R))).

% bus B ne peut pas rouler sur le chemin du point P au point Q de la voie R,

% si le chemin est bloqu\’e.

noaction_if(travel(B,P,Q,R),blocked(P,Q,R)).

Nous obtenons alors quatre plans d’evacuation alternatifs, c’est a dire quatre answer

sets:

Page 240: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX B. EXEMPLES 224

Plan1:

tiempo 0 tiempo 1 tiempo 2

travel(b1,1,2,1) travel(b1,2,4,0) travel(b1,4,9,0)

travel(b2,12,15,2) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,15,2) travel(b3,15,16,0) travel(b3,16,19,0)

Plan2:

tiempo 0 tiempo 1 tiempo 2

travel(b1,1,2,1) travel(b1,2,8,1) travel(b1,8,9,1)

travel(b2,12,15,0) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,15,0) travel(b3,15,16,0) travel(b3,16,19,0)

Plan3:

tiempo 0 tiempo 1 tiempo 2

travel(b1,1,2,1) travel(b1,2,8,1) travel(b1,8,9,1)

travel(b2,12,15,0) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,17,2) travel(b3,17,19,2) —

Plan4:

tiempo 0 tiempo 1 tiempo 2

travel(b1,1,2,1) travel(b1,2,4,0) travel(b1,4,9,0)

travel(b2,12,15,0) travel(b2,15,16,0) travel(b2,16,19,0)

travel(b3,13,17,2) travel(b3,17,19,2) —

La codification π(D,O,G, l) dans l’exemple B.3 obtient tous les chemins possibles des

bus depuis leurs positions initiales jusqu’a leurs positions finales . Par exemple, le Plan

3 indique que le bus b1 et le bus b3 doivent suivre leurs voies d’evacuation predefinies

alors que le bus b2 doit emprunter des chemins hors de la zone d’evacuation

Example B.4. Nous considerons l’exemple B.2 mais maintenant, l’action travel permet

de se deplacer sur des segments qui font partie ou non d’une voie d’evacuation, c’est a

dire que l’action travel(B,P,Q,R) est maintenant la suivante:

% action travel:

% le bus B roule sur le chemin du point P au point Q de la voie R,

Page 241: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX B. EXEMPLES 225

Figure B.2: Trois routes d’vacuation

% o\‘{u} R est \’egal \‘{a} 0, 1, 2 ou 3, c’est \‘{a} dire

% que les bus peuvent prendre la voie d’\’evacuation ou non:

action(travel(B,P,Q,R)).

Si nous considerons dans cet exemple le graphique dirige de la figure B.2, nous

pourrions definir les desirs basiques suivants :

—travelERass pour exprimer qu’on prefere que les bus prennent la voie d’evacuation

designee par le gouvernement jusqu’a ce qu’ils arrivent au refuge.

travelERass :=

until(occ(travel(busB, 12, 13, 2)) ∨ occ(travel(busB, 13, 8, 2))∨occ(travel(busB, 8, 9, 2)) ∨ occ(travel(busB, 9, 11, 2)) , position(busB, 11, 2)) ∧

until(occ(travel(busC, 14, 16, 1)) , position(busC, 16, 1)) ∧until(occ(travel(busA, 1, 2, 3)) ∨ occ(travel(busA, 2, 3, 3)) , position(busA, 3, 3))

—travelER pour exprimer qu’il est preferable que les bus prennent des chemins qui

font partie de l’une des voies d’evacuation et il n’est pas important qu’ils prennent ou

Page 242: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX B. EXEMPLES 226

non la voie d’evacuation designee, jusqu’a ce qu’ils arrivent a leurs refuges designes.

travelER :=

until(

occ(travel(busB, 12, 13, 2)) ∨ occ(travel(busB, 13, 8, 2)) ∨ occ(travel(busB, 8, 9, 2))∨occ(travel(busB, 9, 11, 2)) ∨ occ(travel(busB, 14, 16, 1)) ∨ occ(travel(busB, 1, 2, 3))∨occ(travel(busB, 2, 3, 3)) ∨ occ(travel(busC, 12, 13, 2)) ∨ occ(travel(busC, 13, 8, 2))∨occ(travel(busC, 8, 9, 2)) ∨ occ(travel(busC, 9, 11, 2)) ∨ occ(travel(busC, 14, 16, 1))∨occ(travel(busC, 1, 2, 3)) ∨ occ(travel(busC, 2, 3, 3)) ∨ occ(travel(busA, 12, 13, 2))∨occ(travel(busA, 13, 8, 2)) ∨ occ(travel(busA, 8, 9, 2)) ∨ occ(travel(busA, 9, 11, 2))∨occ(travel(busA, 14, 16, 1)) ∨ occ(travel(busA, 1, 2, 3)) ∨ occ(travel(busA, 2, 3, 3)) ,

position(busC, 16, 1) ∧ position(busB, 11, 2) ∧ position(busA, 3, 3) )

—travelBlSh pour exprimer que les bus empruntent leurs voies d’evacuation designee

jusqu’a ce qu’eventuellement une partie de leur voie d’evacuation soit bloquee et alors

ils se deplaceront hors de la zone d’evacuation jusqu’a ce qu’ils arrivent a leur refuge

designe.

travelBlSh :=

until(occ(travel(busB, 12, 13, 2)) ∨ occ(travel(busB, 13, 8, 2))∨occ(travel(busB, 8, 9, 2)) ∨ occ(travel(busB, 9, 11, 2)) ,

until( eventually(blocked(12, 13, 2) ∨ blocked(13, 8, 2)) ∨ blocked(8, 9, 2) ∨ blocked(9, 11, 2)),

travel(busB, 13, 18, 0)) ∨ travel(busB, 18, 19, 0)) ∨ travel(busB, 13, 14, 2))∨travel(busB, 14, 11, 2)) ∨ travel(busB, 1, 14, 2)) ∨ position(busB, 11, 2) ) )

Page 243: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX B. EXEMPLES 227

until(occ(travel(busC, 14, 16, 1)) ,

until( eventually(blocked(14, 16, 1)),

travel(busC, 13, 18, 0)) ∨ travel(busC, 18, 19, 0)) ∨ travel(busC, 13, 14, 2))∨travel(busC, 14, 11, 2)) ∨ travel(busC, 1, 14, 2)) ∨ position(busC, 16, 1) ) )

∧until(occ(travel(busA, 1, 2, 3)) ∨ occ(travel(busA, 2, 3, 3)) ,

until( eventually(blocked(1, 2, 3) ∨ blocked(2, 3, 3))),

travel(busA, 13, 18, 0)) ∨ travel(busA, 18, 19, 0)) ∨ travel(busA, 13, 14, 2))∨travel(busA, 14, 11, 2)) ∨ travel(busA, 1, 14, 2)) ∨ position(busA, 3, 3) ) )

De la meme maniere, nous pourrions exprimer d’autres desirs basiques. Une preference

atomique possible ψ indiquant l’ordre dans lequel l’ensemble des desirs basiques doit

etre satisfait est la suivante: ψ = travelERass / travelER / travelBlSh

La preference atomique ψ dit que les plans qui satisfont travelERass sont preferes,

mais dans d’autres cas les plans qui satisfont travelER sont preferes et dans d’autres

cas encore les plans satisfaisant travelBlSh sont preferes.

Example B.5. Notons que le desir basique travelER de l’exemple B.4 explique une

disjonction consistante des differentes options que les autobus ont pour voyager sur

les axes qui font partie de l’une des voies d’evacuation predefinies. Pourtant, nous

supposons que les voies d’evacuation ont un plus grand nombre d’axes, alors, pour

exprimer travelER d’une maniere similaire, nous aurions a specifier une disjonction plus

grande, definie a partir de tous les axes dans les nouvelles voies d’evacuation. Meme

si dans [43] on indique que les fluents et les actions dans PP avec variables sont une

abreviation representative de l’ensemble de toutes ses ground instances, l’idee etant que

l’utilisation des fluents et des actions avec variables n’est pas suffisant pour exprimer ce

type de problemes. Pour cela, il y a plusieurs preferences qui ne peuvent pas s’exprimer

dans PP d’une maniere simple et naturelle. Pour avoir une representation naturelle

Page 244: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

APPENDIX B. EXEMPLES 228

de cette classe de preferences, dont on s’inspire dans [22], nous definissons le langage

PPpour une extension du langage de PP ou les connectifs propositionnels et temporels

permettent que nous representions de maniere compacte les preferences qui ont une

caracteristique particuliere. Par exemple, une representation naturelle et compacte de

la preference travelER de l’exemple 8.5 qui utilise ou parametrique serait :

until(∨{occ(travel(B, I, F, R)) : bus(B), road(I, F, R), neq(R, 0)},

∧{position(B,F i, R) : bus(B), shelter(Fi), route(R), neq(R, 0)})

Page 245: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

Bibliography

[1] ESRI Shapefile Technical Description. An ESRI White Paper. Red-

lands : Environmental Systems Research Institute, Inc. 1988, [Online]:

http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf (consulted

8/10/05).

[2] Kurt Buehler Ed. OpenGIS Reference Model (ORM), Date: 2003-

03-04. Reference number: OGC 03-040. Version: 0.1.2. [Online]:

http://www.opengeospatial.org/docs/03-040.pdf (consulted 8/10/05).

[3] M. Balduccini and M. Gelfond. Logic Programs with Consistency-Restoring Rules.

In : Proceedings of the International Symposium on Logical Formalization of Com-

monsense Reasoning (AAAI 2003), pages 100-105, 2003.

[4] C. Baral. Knowledge representation, reasoning and declarative problem solving with

Answer Sets. Cambridge University Press, 2003. 544 pages. ISBN: 0521818028.

[5] S. Baselice, P.A. Bonatti, and M. Gelfond. Towards an Integration of Answer

Set and Constraint Solving. In : Proceedings of the Eleventh International Confer-

ence on Principles and Practice of Constraint Programming (CP 2005), Barcelona,

Spain, 2005.

229

Page 246: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

BIBLIOGRAPHY 230

[6] G. Booch, J. Rumbaugh, and I. Jacobson. The Unified Modeling Language User

Gide. Reading : Addison Wesley Longman, Inc, 1999. 482 pages. ISBN: 0-201-

57168-4.

[7] G. Brewka. Logic Programming with Ordered Disjunction. In Proceedings of

the 18th National Conference on Artificial Intelligence and 14th Conference on

Innovative Applications of Artificial Intelligence (AAAI/IAAI 2002), pages 100-

105, Edmonton, Alberta, Canada, 2002.

[8] G. Brewka, S. Benferhat, and D. Le Berre. Qualitative choice logic. Artificial

Intelligence, 2004, vol. 157, n◦ (1-2), pp. 203-237.

[9] G. Brewka, I. Niemela, and T. Syrjanen. Implementing Ordered Disjunction Using

Answer Set Solvers for Normal Programs. In Proceedings of the 8th European

Workshop Logic in Artificial Intelligence (JELIA 2002) , pages 444-455, Cosenza,

Italy, 2002.

[10] I. Cattinelli, M. L. Damiani, and A. Nucita Reasoning about Lava ef-

fusion: From Geographical Information Systems to Answer Set Program-

ming. In Proceedings of the 1st International Latin-American Workshop

on Non-Monotonic Reasoning (LA-NMR 2004), Mexico City, D.F, Mexico,

2004. [Online]: http://sunsite.informatik.rwth-aachen.de/Publications/CEUR-

WS//Vol-92/cattinelli.pdf (consulted 8/10/05).

[11] P. R. Cohen and E. J. Feigenbaum. The Handbook of Artificial Intelligence, vol.

3. Stanford, Calif.: HeurisTech Press, 1982. ISBN: 0865760071.

[12] J. Delgrande, T. Schaub, H. Tompits, and K. Wang. A Classification and Survey

of Preference Handling Approaches in Nonmonotonic Reasoning. Computational

Intelligence, 2004, vol. 20, n◦2, pp. 308–334.

Page 247: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

BIBLIOGRAPHY 231

[13] S. T. Erdogan and V. Lifschitz. Definitions in Answer Set Programming: (Ex-

tended Abstract). In : Proceedings of the 19th International Conference of Logic

Programming (ICLP 2003), Mumbai, India, 2003, pages 483-484.

[14] M. Gelfond and V. Lifschitz. The Stable Model Semantics for Logic Programming.

In : Proceedings of the 5th International Conference and Symposium of Logic Pro-

gramming (ICLP/SLP 1988), Seattle, Washington, USA, 1988, pages 1070-1080.

[15] M. Gelfond and V. Lifschitz. Logic Program with Classical Negation. In Proceed-

ings of the 7th International Conference on Logic Programming, Jerusalem, Israel,

1990, pages 579–597.

[16] M. Gelfond and V. Lifschitz. Action Languages. Electronic Transactions on Arti-

ficial Intelligence (ETAI), 1998, vol. 2 pp. 193-210.

[17] M. R. Genesereth and N. J. Nilsson. Logical Foundations of Artificial Intelligence.

Los Altos, Calif: Morgan Kaufmann Publishers. Inc, 1987. 407 pages. ISBN: 0-

934613-31-1.

[18] H. W. Hamacher and S. A. Tjandra. Mathematical Modelling of Evacuation Prob-

lems: A State of Art. Technical Report 24, Institut Techno-und Wirtschaftsmath-

ematik, 2001, 44 pages.

[19] M. Helmert. Complexity results for standard benchmark domains in planning.

Artificial Intelligence, 2003, vol. 143, n◦2, pp. 219-262.

[20] A. C. Kakas and P. Mancarella. Generalized Stable Models: A Semantics for Ab-

duction. In : Proceedings of the 9th European Conference on Artificial Intelligence

(ECAI 1990), Stockholm, Sweden, pages 385-391, 1990.

Page 248: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

BIBLIOGRAPHY 232

[21] F. Kroger. Temporal Logic of Programs. Springer Verlag, 1987. 148 pages. ISBN:

0387170308.

[22] N. Leone and S. Perri. Parametric connectives in disjunctive logic programming.

In: Proceedings of the 2nd Answer Set Programming, Advances in Theory and

Implementation, Workshop (ASP 2003), Messina, Italy, 2003. pages 124-135.

[23] P. A. Longley, M. F. Goodchild, D. J. Maguire, and D. W. Rhind. Geographic

Information Systems and Science. Chichester : John Wiley & Sons, Inc, 2001. 454

pages. ISBN: 0-471-89275-0.

[24] J.L. Macias, G. Carrasco-Nunez, H. Delgado, A.L. Martin, C. Siebe, and R.I.

Tilling. Mapa de peligros del volcan Popocatepetl. Mapa e informe tecnico al

comite cientıfico asesor de la Secretaria de Gobernacion. Universidad Nacional

Autonoma de Mexico & Centro Nacional de Prevencion de Desastres (UNAM-

CENAPRED), 1995, Map with explanation booklet, 14 pages.

[25] J. McCarthy. Concepts of logical Artificial Intelligence. Stanford University, 2000,

24 pages. [Online]: http://www-formal.stanford.edu/jmc/concepts-ai.html (con-

sulted 8/10/05).

[26] J. McCarthy and P. J. Hayes. Some philosophical problems from the standpoint of

artificial intelligence. In B. Meltzer and D. Michie, editors, Machine Intelligence

4, Edinburgh University Press, 1969, pages 463–502.

[27] E. Mendelson. Introduction to Mathematical Logic. 4th ed. London : Chapman &

Hall 1997, 440 pages. ISBN: 0-412-80830-7.

[28] J.C. Nieves, M. Osorio, C. Zepeda, and U. Cortes. Inferring acceptable arguments

with Answer Set Programming. In Proceedings of the 6th Mexican International

Page 249: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

BIBLIOGRAPHY 233

Conference on Computer Science (ENC 2005), Puebla, Mexico, 2005. pages 198–

205,

[29] N.J. Nilsson. Principles of Artificial Intelligence. Los Altos, Calif: Morgan Kauf-

mann Publishers. Inc., 1980. 476 pages. ISBN: 0-934613-10-9.

[30] Office of the United Nations Disaster Relief Coordinator (UNDRO) and

United Nations Educational Scientific Cultural Organization (UNESCO). Vol-

canic Emergency Management, United Nations, New York, 1985. [On-

line]: http://volcanoes.usgs.gov/About/What/Reduce/DevelopPlans.html (con-

sulted 8/10/05).

[31] M. Ortiz. ASP: from application development to syntax extensions. In

Proceedings of the 1st International Latin-American Workshop on Non-

Monotonic Reasoning (LA-NMR 2004), Mexico City, D.F, Mexico, 2004. [On-

line]: http://sunsite.informatik.rwth-aachen.de/Publications/CEUR-WS//Vol-

92/claudia.pdf (consulted 8/10/05).

[32] M. Osorio, J. A. Navarro, and J. Arrazola. A logical approach to A-Prolog. Elec-

tronic Notes in Theoretical Computer Science, 2002, vol. 67 pp. 265-275.

[33] M. Osorio, J. A. Navarro, and Jose Arrazola. Applications of intuitionistic logic

in answer set programming. Theory and Practice of Logic Programming (TPLP),

2004, vol.4, n◦3, pp.325-354.

[34] M. Osorio, J. A. Navarro, and Jose Arrazola. Safe beliefs for propositional theories.

Annals of Pure and Applied Logic, 2005, vol.134, n◦1, pp. 63-82.

Page 250: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

BIBLIOGRAPHY 234

[35] M. Osorio, M. Ortiz, and C. Zepeda. Using CR-rules for evacuation planning. In

Proceedings of the IX Ibero-american Workshops on Artificial Inteligence, Puebla,

Mexico, 2004, pages 56–63.

[36] M. Osorio and C. Zepeda. Towards the use of Semantic Contents in ASP for plan-

ning and diagnostic in GIS. In Proceedings of the 2nd Answer Set Programming,

Advances in Theory and Implementation, Workshop (ASP 2003), Messina, Italy,

2003, pages 345–355.

[37] M. Osorio, C. Zepeda, D. Sol, and G. Lazzeri. A decision support system for

disaster situations. In : Prastacos P,Murillo M. Eds., Research on Computing

Science e-Environment: Progress and Challenge. Mexico : IPN, Mexico, 2004,

volume 11, pages 97-116.

[38] D. Pearce. Stable inference as intuitionistic validity. Journal of Logic Programming

(JLP), 1999, vol.38, n◦1, pp. 79-91.

[39] T. C. Przymusinski. Stable semantics for disjunctive programs. Special issue of

the New Generation Computing Journal, 1991, vol. 9, n◦ 3/4, pp. 401-424.

[40] R. Pucella. Logic column 11: The finite and the infinite in temporal logic. ACM

SIGACT News, 2005, vol. 36, n◦ 1, pp.86–99.

[41] S. Russell and P. Norvig. Artificial Intelligence: A Modern Approach. . Englewood

cliffs: Prentice Hall, 1995. 932 pages. ISBN: 0-13-103805-2.

[42] D. Sol and A. Razo. Natural hazards in the Popocatepetl vol-

cano zone. In Proceedings of the 21st Annual ESRI Interna-

tional User Conference, San Diego, CA, USA, 2001. [Online]:

Page 251: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

BIBLIOGRAPHY 235

http://gis.esri.com/library/userconf/proc01/professional/abstracts/a660.html

(consulted 8/10/05).

[43] T. Cao Son and E. Pontelli. Planning with preferences using logic programming.

In Proceedings of the Logic Programming and Nonmonotonic Reasoning, 7th In-

ternational Conference (LPNMR 2004), Fort Lauderdale, FL, USA, 2004,pages

247–260.

[44] T. Syrjanen. Lparse 1.0. User’s Manual, Free Software Foundation, Inc. 1998. 95

pages. [Online]: http://www.tcs.hut.fi/Software/smodels/ (consulted 8/10/05).

[45] D. van Dalen. Logic and Structure. . Springer, 1980. 259 pages. ISBN: 3-540-

20879-8.

[46] C. Zepeda, M. Osorio, J.C. Nieves, C. Solnon, and D. Sol. Applications of prefer-

ences using Answer Set Programming. In Proceedings of the Answer Set Program-

ming: Advances in Theory and Implementation Workshop (ASP 2005), Bath, UK,

2005, pages 318–332.

[47] C. Zepeda, M. Osorio, and D. Sol. Towards the use of CR-rules and Semantic

Contents in ASP for planning in GIS. Technical Report RR-2004-010, Universite

Lyon I, 2004. 10 pages.

[48] C. Zepeda, M. Osorio, and D. Sol. Modeling evacuation planning using a-prolog. In

Proceedings of the 15th International Conference on Electronics, Communications,

and Computers (CONIELECOMP 2005), Puebla, Mexico, 2005, Pages 292–297.

[49] C. Zepeda, M. Osorio, D. Sol, and C. Solnon. Extending PP language: An answer

set planning problem language. In Proceedings of the Avances en la ciencia de

Page 252: Evacuation planning using Answer Set Programmingdocinsa.insa-lyon.fr/these/2005/zepeda_cortes/tesis.pdf · 2.2.5 Un langage pour des pr¶ef¶erences de plans: le Langage PP. . . 34

BIBLIOGRAPHY 236

la computacion Workshop, 6th Mexican International Conference on Computer

Science (ENC 2005), Puebla, Mexico, 2005, pages 57–62.

[50] C. Zepeda, C. Solnon, and D. Sol. Planning operation: An extension

of a Geographical Information System. In Proceedings of the 1st Interna-

tional Latin-American Workshop on Non-Monotonic Reasoning (LA-NMR 2004),

Mexico City, D.F., Mexico, 2004. [Online]: http://sunsite.informatik.rwth-

aachen.de/Publications/CEUR-WS//Vol-92/claudia.pdf (consulted 8/10/05).