Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!gatech!news.sprintlink.net!noc.netcom.net!netcom.com!pgweiss
From: pgweiss@netcom.com
Subject: Re: Help : 'setof/3' in ARITY PROLOG
Message-ID: <pgweissD8r1J2.3AB@netcom.com>
Sender: pgweiss@netcom12.netcom.com
Reply-To: pgweiss@netcom.com
Organization: Arity Corporation
X-Newsreader: IBM NewsReader/2 v1.09
References: <3pcmt7$1lj@mis.cpc.ku.ac.th>
Date: Thu, 18 May 1995 01:01:49 GMT
Lines: 44

In <3pcmt7$1lj@mis.cpc.ku.ac.th>, s34ccd@cc2.cpe.ku.ac.th (Chatchada Kanokpruk) writes:
>Hi,
>   I have a problem with 'setof' in ARITY PROLOG for DOS. When I run my 
>program in ARITY PROLOG editer, it works well. But when I compile and link
>to .EXE , the program stops at the line containing 'setof' predicate.
>
>my exemple program :
>
>  :- public main/0.
>  main :-  write('hi prolog'),nl,
>           setof(X,man(X),L),
>           write(L).
>  man(a).
>  man(b).
>  man(c).
> 

(stuff deleted)

The solution is to include the declaration

	:- visible man/1.

in your source file.

Explanation:  in the interpreter all of the standard built-in predicates are
"visible", i.e. in the name space of the call/1 predicate, and predicates
that use call/1, such as setof/3.  However, in compiled programs, the
name space is by default empty.  Why?  So that compiled programs can
be smaller.

You add predicates to the name space individually, using a declaration
of the form:

	:- visible func/arity.

or you can add all the usual built-in predicates with the declaration

	:- visible all.

(If you do this, though, the size of your application will increase).

-Paul Weiss
-Arity
