Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

new to prolog

31 views
Skip to first unread message

Haris Bogdanovich

unread,
Nov 15, 2012, 9:55:30 AM11/15/12
to
Hi.

When I enter
factorial(0,1).
in Gnu prolog I get some error.
When I put the same line in
factorial.pl and do
consult factorial. I again get some error. Where is the problem ?

How prolog knows when I state a fact/rule or ask a question ?

Thanks


LudovicoVan

unread,
Nov 16, 2012, 10:42:29 AM11/16/12
to
"Haris Bogdanovich" <fbogd...@xnet.hr> wrote in message
news:k82vp3$avt$1...@gregory.bnet.hr...
> Hi.
>
> When I enter
> factorial(0,1).
> in Gnu prolog I get some error.

The error is that factorial/2 is not available (I guess).

> When I put the same line in
> factorial.pl and do
> consult factorial. I again get some error. Where is the problem ?

Which error? Plus, ideally, you would show your code.

> How prolog knows when I state a fact/rule or ask a question ?

I'd suggest you go through a Prolog tutorial, or even just the manual that
comes with GNU Prolog.

-LV


0 new messages