Commit 25431c4d authored by Eric Würbel's avatar Eric Würbel
Browse files

Working version. Tests to be done

parent 715289cc
pasp V0.9
=========
(c) 2016-2017 Éric Würbel, LSIS-CNRS UMR7196
<eric.wurbel@lsis.org>
pasp is an application which implements Possibilistic Answer Set
Programming. The semantics are those found in Bauters & al. [1]
It comes with two prolog programs : `pasp` encodes the possibilistic
normal logic program given as input into a normal logic program, which
can be transmitted to an ASP grounder and solver (eg clingo,
gringo+clasp, dlv, lparse+smodels...)
The program `paspfilter` takes as input the output of a clingo solver
and outputs the possibilistic stable models of the original program.
Note that at this time, only normal or extended logic programs are
handled. There are plans to implement the handling of disjunctive
programs.
See the documentation in =doc= folder for further instructions.
Bibliography
============
- [1] :: Kim Bauters and Steven Schockaert and Martine De Cock and
Dirk Vermeir, "Characterizing and Extending Answer Set Semantics
using Possibility Theory", Theory and Practice of Logic Programming,
15(1), pp79-116, 2013
(TeX-add-style-hook
"manual"
(lambda ()
(LaTeX-add-bibitems
"DBLP:journals/corr/BautersSCV13")))
@article{DBLP:journals/corr/BautersSCV13,
author = {Kim Bauters and
Steven Schockaert and
Martine De Cock and
Dirk Vermeir},
title = {Characterizing and Extending Answer Set Semantics using Possibility
Theory},
journal = {CoRR},
volume = {abs/1312.0127},
year = {2013},
url = {http://arxiv.org/abs/1312.0127},
archivePrefix = {arXiv},
eprint = {1312.0127},
timestamp = {Wed, 07 Jun 2017 14:40:39 +0200},
biburl = {http://dblp.org/rec/bib/journals/corr/BautersSCV13},
bibsource = {dblp computer science bibliography, http://dblp.org}
}
#+TITLE: PASP V0.9
#+AUTHOR: Éric Würbel
#+DATE: <2018-01-19 ven.>
#+LATEX_CLASS: scrartcl
#+LATEX_CLASS_OPTIONS: [french,DIV15]
#+LANGUAGE: fr
#+LATEX_HEADER: \usepackage{lmodern}
#+LATEX_HEADER: \usepackage{listings}
#+LATEX_HEADER: \newcommand{\cad}{c.-à-d.{}}
* Introduction
(c) 2016-2017 Éric Würbel, LSIS-CNRS UMR7296
<eric.wurbel@lsis.org>
pasp is an application which implements Possibilistic Answer Set
Programming. The semantics are those found in Bauters & al
\cite{DBLP:journals/corr/BautersSCV13}.
It comes with two prolog programs : `pasp` encodes the possibilistic
normal logic program given as input into a normal logic program,
which can be transmitted to an ASP grounder and solver (eg clingo,
gringo+clasp, dlv, lparse+smodels...)
The program `paspfilter` takes as input the output of a clingo
solver and outputs the possibilistic stable models of the original
program.
Note that at this time, only normal or extended logic programs are
handled. There are plans to implement the handling of disjunctive
programs.
* Installation
PASP mainly consists in two prolog programs written for the
SWI-prolog compiler. It should not be complicated to port PASP to
other prolog systems. If you consider writing a port, please drop me a line.
At present, the installation instructions are directed toward
SWI-prolog installed on a linux system.
PASP consist in two different applications:
- =pasp= : a command line tool which, given an possibilistic normal
logic program as input, computes a corresponding normal nogic
program, which can be fed into an ASP grounder/solver.
- =paspfilter= : interprets the output of the ASP solver, and prints
the corresponding possibilistic answer sets.
** Building the executables
:PROPERTIES:
:CUSTOM_ID: build-exec
:END:
The script file =build-executable.sh= is provided to build both
programs =pasp= and =paspfilter=. It accepts one option =-e=, which
effect is to incorporate SWI-prolog runtime libraries in the final
executable. This is actually needed for 64 bits linux systems. You
can omit this option if you build on a 32 bit linux system, except
if you plan to copy the final executables on a machine on which
SWI-prolog is not installed.
** Installing the executables
At present there is no installation script. All you have to do is
to copy the executable files =pasp= and =paspfilter= in a directory
appearing in your =PATH=.
** External programs
You need to install the =clingo= grounder/solver (4.5 and 5.x has
been tested). It must be present somewhere in your path.
* Running pasp
** running the command line tool
The =pasp= command line tool syntax is as follows :
#+BEGIN_EXAMPLE
pasp files...
#+END_EXAMPLE
The files are read, and the resulting normal logic program is
printed on standard output.
The =paspfilter= command line tool reads the output of a clingo
solver on standard input and writes the corresponding possibilistic
answer sets on standard output.
The two programs are used in a pipeline. Suppose you want to compute
all the possibilistic stable models of a possibilistic normal logic
program contained in a file =f.pnpl=. You should run (provided that
the three needed programs are accessible in the PATH) :
#+BEGIN_EXAMPLE
pasp f.pnlp | clingo 0 | paspfilter
#+END_EXAMPLE
\bibliographystyle{plain}
\bibliography{manual}
......@@ -100,6 +100,11 @@ necessity((H:-B),(H:-NewB),N) :-
flatten_conjunction(B1,NewB)
.
%% is_necessity(?Atom1, ?Atom2)
%
% unifies Atom2 with true whenever Atom1 unifies with nec__/1.
% Otherwise unifies Atom1 with Atom2.
is_necessity(nec__(_),true) :- !.
is_necessity(A,A).
......
No preview for this file type
......@@ -35,7 +35,7 @@
go :-
current_prolog_flag(argv, [_|InputFiles]),
current_prolog_flag(argv, InputFiles),
( InputFiles = []
-> error("no input files")
; true
......@@ -54,3 +54,7 @@ test(Files) :-
write_conjunct(ASP,user_output)
.
No preview for this file type
......@@ -147,6 +147,9 @@ result_line(end) -->
result_line(end) -->
['S','A','T','I','S','F','I','A','B','L','E']
.
result_line(end) -->
['U','N','S','A','T','I','S','F','I','A','B','L','E']
.
result_line(as(AS)) -->
answer_set(AS)
.
......
a :- nec__(80).
-b :- a, nec__(80).
c :- a, -b, nec__(70).
d :- d, nec__(90).
\ No newline at end of file
a :- not a, nec__(100).
a :- not b, nec__(90).
b :- not c, nec__(20).
c :- not a, nec__(70).
b :- not c, nec__(90).
d :- nec__(80).
c :- not a, nec__(80).
e :- nec__(70).
a :- not b, nec__(100).
a :- b, nec__(50).
b :- a, nec__(50).
c :- nec__(60).
:- c, not a, nec__(100).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment