Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

complete vs incomplete knowledge (was basic question from Tjitze Rienstra)
Hi,

Suppose you have a database

fact(john,mary).
fact(peter,martha).

and you want to express (derive) that also

fact(mary,john).
fact(matha,peter).

hold, then adding the following rule is insufficient, even incorrect:

fact(A,B) :- fact(B,A).

why?

You will obtain the program

fact(john,mary).
fact(peter,martha).
fact(A,B):-fact(B,A).

I will give you

a) as expected:

fact(john,mary)    --> yes
fact(peter,martha) --> yes
fact(mary,john)    --> yes (using rule 3 and then rule 1)
fact(martha,peter) --> yes (using rule 3 and then rule 2)

b) and as unexpected

an infinite loop.... (apply for ever the last rule)

More correct is the following definition:

fact_db(peter,martha).
fact_db(john,mary).

fact(A,B) :- fact_db(A,B).
fact(A,B) :- fact_db(B,A).


This still does not address the problem of you (in)completeness of
your database.
If you want to express that your knowledge the fact_db relation is
incomplete, you can''t do it in Prolog.
Prolog assumes that your knowledge about the world is fully complete.

For that reason, one has investigated other logics and reasoners.
To give you some hints:

*) abductive logic programming
This distinguishes between defined and abducible predicates. Abducible
predicates are predicates of which the user's knowledge is incomplete.

Such a program would look like this:

definied(fact(_,_)).
abducible(fact_db(_,_)).

fact_db(peter,martha).
fact_db(john,mary).

fact(A,B) :- fact_db(A,B).
fact(A,B) :- fact_db(B,A).

An abductive solver (e.g. the Asystem) will answer that apart from the
four fact instances, there might exists an instance

fact(sk1,sk2) provided that the instance fact_db(sk1,sk2) exists.

(sk1 and sk2 are two globally existentially quatified variables or
skolemconstants.)

*) Answer Set Programming
which is roughly stated Logic Programming under the Stable Model
semantics.

For this paradigm, one finds two related solvers sModels and DLV which
encode incompleteness in a slightly different manner.

sModels: by using negation

fact_db(X,Y) :- not fact_db_star(X,Y), rangex(X),rangey(Y).
fact_db_star(X,Y) :- not fact_db_star(X,Y), rangex(X),rangey(Y).

fact_db(peter,martha).
fact_db(john,mary).

The auxiliary predicates rangex and rangey are necessary in this
paradigm to limit the language to a finite number of symbols.

DLV: by using disjunction

fact_db(X,Y) v fact_db_star(X,Y) :- rangex(X),rangey(Y).

fact_db(peter,martha).
fact_db(john,mary).


More info on any of these systems, you find by googleing them ;-)

Bert

Report this thread to moderator Post Follow-up to this message
Old Post
Bert Van Nuffelen
10-05-04 02:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Prolog archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:52 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.