Re: predicate in a predicate



On Dec 8, 9:10 pm, Jan Burse <janbu...@xxxxxxxxxxx> wrote:
Keenlearner schrieb:



Thank you Herbzet,
Now I know how to differentiate function and predicate.

Thanks to Jan Burse, that is a nice resource. I will allow time to
read at it.

I found a Prolog natural language program from
www.mtome.com/Publications/PNLA/prolog-digital.pdf
I have extend a little bit on it, for sentence input of "Every
student is on a table" it will generate the FOL

Let's say
A "Universal quantifier"
E "Existential quantifier"
and "conjunction"
or "disjunction"
=> "implication"

A x (student(x) => E y ( table(y) and on( x, y)))

is this correct ?

Whether it's correct or not, as you can see there is two conclusions
or literals.
Prolog is somehow from Horn Clauses, they can have at most one
positive literals.
In this case, how can I convert the FOL that have two positive
literals into Prolog ? Thank you.

Pure Prolog alone doesn't help. But with negation as failure
you can pretty well model a lot but not all of FOL logic
quite straight forward.

With negation as failure you can go beyond horn clauses. And
usually one does not talk about clauses anymore, but rather
about deductive rules and queries.

Negation as failure is syntactially in prolog the "\+" operator,
but semantically it can behave as "~exists x1, .., exists xn".

So a first step to arrive at a negation as failure simulation
of your formula is to replace all quantifiers "forall x"
by "~exists x~". Further you can move down negation and
also replace implication or biconditional.

When you have done all this you can sort out "~exists x1, .., $
exists xn" and see to it that the variables x1..xn are positively
bound. If this is the case then you are probably done.

I will try your example:

A x (student(x) => E y ( table(y) & on( x, y)))
<=> ~E x ~(~student(x) v E y(table(y) & on(x,y)))
<=> ~E x (student(x) & ~E y(table(y) & on(x,y)))
positivity check is ok, so this amounts to prolog as:
<=> \+ (student(x), \+ (table(y), on(x,y)))

The remaining issues are how student, table, on are defined.
But you can not solve all issues with this approach. FOL
is still a little bit more expressive in directly representing,
for example when it comes to disjunctive or existential
knowledge.

See also for example:
John W. Lloyd: Foundations of Logic Programming,
1st Edition Springer 1984

Thank you that is awesome, I have read a few articles on converting
FOL to clauses form but don't know exactly the use of it, but after
the example you showed me, I got it now. Hehe. I will lookup for the
book but I don't where to get it other than Amazon, but I think I
found something like it
www.cs.utexas.edu/users/vl/mypapers/flp.ps
.. Thanks anyway.
.



Relevant Pages

  • Re: predicate in a predicate
    ... Prolog is somehow from Horn Clauses, they can have at most one ... how can I convert the FOL that have two positive ... With negation as failure you can go beyond horn clauses. ... positivity check is ok, so this amounts to prolog as: ...
    (sci.logic)
  • Re: OT: Programming Careers
    ... A related problem is that, in prolog, you can define a "not" operator, ... but "failure is treated as negation", i.e. the way prolog works, if it ... "PRObably the Language Of God" ...
    (rec.arts.sf.composition)
  • Re: Negation In Prolog
    ... > a little about negation in Prolog. ... > finite universe of possible values, ... > Are they any examples you know of where an easy rewrite like this is ...
    (comp.lang.prolog)
  • Re: FOL, ZFC, NGB and Prolog
    ... > The issue here isn't about computational power but about expressiveness. ... there is no direct Prolog translation of this FOL: ... Thank you very much for another kind and meaningful comment, Ms Knox. ...
    (sci.logic)
  • Re: Negation In Prolog
    ... Negation is a dodgy subject. ... > a little about negation in Prolog. ... > finite universe of possible values, ... > Are they any examples you know of where an easy rewrite like this is ...
    (comp.lang.prolog)