From scritch_mephisto@excite.com Mon Aug 13 20:38:08 2001
Received: from kuku.excite.com (kuku-rwcmta.excite.com [198.3.99.63])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f7DIc8b09529
	for <prolog@swi.psy.uva.nl>; Mon, 13 Aug 2001 20:38:08 +0200 (MET DST)
Received: from seamore.excite.com ([199.172.148.163]) by kuku.excite.com
          (InterMail vM.4.01.02.39 201-229-119-122) with ESMTP
          id <20010813183802.YVSM27768.kuku.excite.com@seamore.excite.com>
          for <prolog@swi.psy.uva.nl>; Mon, 13 Aug 2001 11:38:02 -0700
Message-ID: <17490245.997727882175.JavaMail.imail@seamore.excite.com>
Date: Mon, 13 Aug 2001 11:38:01 -0700 (PDT)
From: scritch mephisto <scritch_mephisto@excite.com>
To: prolog@swi.psy.uva.nl
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Excite Inbox
X-Sender-Ip: 130.80.28.26
Subject: [SWIPL] Help w/module loading

Howdy,

Brand new to Prolog, I need a little hand holding.  Basically, I
need the modulus operator (mod).  Can someone explain the following
interaction?

First of all, here is my .plrc (note, autloading is on and verbose).
:- set_prolog_flag(autoload, true).
:- set_prolog_flag(verbose_autoload, true).

And, here is some interactive Prolog:
?- help(mod).
%  library(helpidx) compiled into help_index 0.13 sec, 125,484 bytes
% /usr/lib/swi-prolog/library/help compiled into online_help
0.14 sec, 138,868 bytes
% /usr/lib/swi-prolog/library/backcomp compiled into backward_compatibility
0.00 sec, 3,812 bytes
% /usr/lib/swi-prolog/library/quintus compiled into quintus
0.02 sec, 11,772 bytes
+IntExpr1 mod +IntExpr2
[snipped]
Yes


?- 5 mod 2.
ERROR: Undefined procedure: mod/2


?- 2 = 17 mod 5.

No


?- 2 is 17 mod 5.

Yes


Commentary:
Ok, autoloading of help functions worked, so I know autload is on.
However, why didn't "5 mod 2" force an autoload?  The next two
lines is another area of confusion, but I would be grateful for
an explanation.  The first is a predicate, no?  The second is an
assignment?  To a constant?!

What module is "mod" in?  Given a function name, is there a
mechanism to return the path of a module in which it is defined?

Thanks, and sorry I couldn't find this in the manual on my own...


(Since the first draft of this message, I figured out:
X = 5 mod 2.

But then why does this similar example not work:
min(10, X).


Thanks





_______________________________________________________
Send a cool gift with your E-Card
http://www.bluemountain.com/giftcenter/


