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
252
Embed
Evacuation planning using Answer Set Programmingtheses.insa-lyon.fr/publication/2005ISAL0117/these.pdfCONTENTS iii Usando el Lenguaje PP. . . . . . . . . . . . . . . . . . . . . .
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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
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.
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
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.
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
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
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
−, 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
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].
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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”
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
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
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
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
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
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
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
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
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
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:
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.
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
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
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}.
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 :
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)}.
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.
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
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).
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
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)).
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
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
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].
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.
CHAPTER 5. PLANNING PROBLEMS 91
Definition 5.1. [43] Let α = s0a1s1a2s2 . . . ansn be a trajectory, and let ϕ be a basic
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:
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
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.
Part II
Contribution
95
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
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.
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.
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.
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.
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
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
— 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
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).
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
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}
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.
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.
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
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,
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
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
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
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
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-
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-
CHAPTER 7. MODELING EVACUATION PLAN PROBLEMS 141
tation of three evacuation routes in a particular zone. Therefore, we shall define the
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
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
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.
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
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
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-
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
∧{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.
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) | ∧
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].
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
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 ′.
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
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).
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 ).
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.
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, . . .}.
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.
CHAPTER 9. SEMANTIC CONTENTS 185
S L{¬b,¬e} {¬b,¬e, a, d}{¬b,¬d} {¬b,¬d, a, e}{¬b} {¬b, 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.
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)
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,
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 .
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
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
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:
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.
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
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:
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 ′).
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 ∪∆,
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: