(last update: 04.04.2005)
|
|
This software implements the Refined Stable Models Semantics for
DyLPs. The output of the software is a file that can be parsed by
systems like DLV and smodel.
Syntax:
Rules are of the form: Head :- Body. where Head is a literal and Body a conjunction of t-literal separated by ,
To write facts, simply omit the body and the :-
A literal is either an atom 'A', or a default negated atom 'not A'.
One can use predicates with variable, the parser of the system.
The initial program is always empty. To consider an initial
program P simply update empty by P.
A file may contain several update programs separated by 'update.'
(see example).
Example:
a(X):- not b(d), c(1).
b(d).
not b(3).
d(X).
c(1).
update.
not a(X):- c(1).
c(2).
Usage:
WRITING DyLPs.
:- , . not -> This expressions have the same value that in Prolog:
:- separates the body and the head of a query,
, separates two literals in the body of a query,
. marks the end of a query,
not before a predicate represents the negation of that predicate.
It can be used either in the body or in the head of a rule.
Capitalized names represent variables, while non capitalized names
represent constants.
Examples: p(john):- borned(ohn,X), not female(john).
not d(G):- not a(J), b(Link,5).
update -> It marks the beginning of a new update in the
sequence.
MANIPULATING DyLPs.
clean -> resets the knowledge base (i.e retracts all updates made until the present
time, including the initial program).
updateF(FileName) -> It updates the current knowledge base (that may itself be the
result of several updates) with the update program(s) in the
file FileName.
updateL(List) -> It updates the current knowledge base with the list of rules List.
Here, each rule must be inside parenthesis.
One can have t-literals in the head, meaning that that rule is to be
added in the referred update level.
saveF(FileName) -> It saves the current knowledge base in the file FileName.
loadF(FileName) -> It loads the current knowledge base in the file FileName.
The knowledge base can than be either queried or further
updated and the result can be written in FileName or in another file
using the command saveF/1.
processF(FileName,N) -> It saves into a file FileName a transformed program
whose stable models are the refined stable models
of the current KB at the update N, if N is 'now'
the semantics is computed at the last update.
Consulting the semantics:
Use either DLV ot smodels on the file created with FilName.
Example: lparse FileName | smodels
current(N) -> Returns in N the level of the latest update + 1.
ENJOY :-)
Send your suggestions and comments to bantiAgmail.com (substitute the A with @ )