Re: How to convert a problem to prolog code



Dearl MoNa

I not very clear about prolog, but I have join a Logic and data
abstraction class, it is mainly about how to write a reasonable fact.

if X a human, then X will die one day.

H=>D


Bob is a human, then Bob will die one day.

human(bob),
die(X):-human(X).
-----
I think this is how to translate the problem into prolog according to
the logic way.

Phal

.



Relevant Pages

  • Re: Four Easy Question
    ... > 1- How can I create a file in prolog? ... > bob" ), from that file? ... Then assert the new fact, with "assert)". ... Assert any new facts you want, and retract any facts you want to delete. ...
    (comp.lang.prolog)
  • Re: Four Easy Question
    ... >I'm new in prolog and have some easy question: ... >1- How can I create a file in prolog? ... >bob" ), from that file? ... Jeff Gaines - Damerham Hampshire UK ...
    (comp.lang.prolog)
  • Four Easy Question
    ... I'm new in prolog and have some easy question: ... bob" ), from that file? ... 3- How can I write a new predicate in the created file ...
    (comp.lang.prolog)