🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #4370

Re: Yap - insertion mode

#4370
From: Per Røn ne
Date: Thu, 04 Mar 2004 21:11
177 lines
8052 bytes
Bart Demoen <bmd@cs.kuleuven.ac.be> wrote:

> Per R�nne wrote:
> >
> > Maybe we're having different manuals. I don't see anything like that in
> > the manual [pdf-format] I've downloaded.
> > 
> section 4.2

Which says:

> 4.2 Changing the Compiler's Behavior
> This section presents a set of built-ins predicates designed to set the
> environment for the compiler.
> 
> source_mode(-O,+N)
> 
> The state of source mode can either be on or off. When the source mode
> is on, all clauses are kept both as compiled code and in a "hidden"
> database. O is unified with the previous state and the mode is set
> according to N. source After executing this goal, YAP keeps information
> on the source of the predicates that will be consulted. This enables the
> use of listing/0, listing/1 and clause/2 for those clauses.
> 
> The same as source_mode(_,on) or as declaring all newly defined static
> procedures as public.
> 
> no_source
> 
> The opposite to source.
> The same as source_mode(_,off).
> 
> compile_expressions
> 
> After a call to this predicate, arithmetical expressions will be
> compiled. (see example below). This is the default behavior.
> 
> do_not_compile_expressions
> 
> After a call to this predicate, arithmetical expressions will not be compiled.
> 
> ?- source, do_not_compile_expressions.
> yes
> ?- [user].
> | p(X) :- X is 2 * (3 + 8).
> | :- end_of_file.
> ?- compile_expressions.
> yes
> ?- [user].
> | q(X) :- X is 2 * (3 + 8).
> | :- end_of_file.

A clearcut error. It is "end_of_file.", without :-, or ^D.

And ^C with help and other stuff isn't mentioned at all. What I demand
in the beginning of any manual [how to exit a program] isn't mentioned
at all.

> :- listing.
> p(A):-
> A is 2 * (3 + 8).
> q(A):-
> A is 22.
> 
> hide(+Atom)
> 
> Make atom Atom invisible.
> 
> unhide(+Atom)
> 
> Make hidden atom Atom visible.
> 
> hide_predicate(+Pred)
> 
> Make predicate Pred invisible to current_predicate/2, listing, and friends.
> 
> expand_exprs(-O,+N)
> 
> Puts YAP in state N (on or off) and unify O with the previous state, where
> On is equivalent to compile_expressions and off is equivalent to do_not_
> compile_expressions. This predicate was kept to maintain compatibility
> with C-Prolog.
> 
> path(-D) Unifies D with the current directory search-path of YAP. Note
> that this searchpath is only used by YAP to find the files for consult/1,
> reconsult/1 and restore/1 and should not be taken for the system search
> path.
> 
> add_to_path(+D)
> 
> Adds D to the end of YAP's directory search path.
> 
> add_to_path(+D,+N)
> 
> Inserts D in the position, of the directory search path of YAP, specified
> by N. N must be either of first or last.
> 
> remove_from_path(+D)
> 
> Remove D from YAP's directory search path.
> 
> style_check(+X)
> 
> Turns on style checking according to the attribute specified by X, which
> must be one of the following:
> 
> single_var
> 
> Checks single occurrences of named variables in a clause. discontiguous
> Checks non-contiguous clauses for the same predicate in a file. multiple
> Checks the presence of clauses for the same predicate in more than one
> file when the predicate has not been declared as multifile all Performs
> style checking for all the cases mentioned above. By default, style
> checking is disabled in YAP unless we are in sicstus or iso language mode.
> The style_check/1 built-in is now deprecated. Please use the set_prolog_
> flag/1 instead.
> 
> no_style_check(+X)
> 
> Turns off style checking according to the attribute specified by X, which
> has the same meaning as in style_check/1. The no_style_check/1 built-in is
> now deprecated. Please use the set_prolog_ flag/1 instead.
> 
> multifile P [ISO]
> 
> Instructs the compiler about the declaration of a predicate P in more than
> one file. It must appear in the first of the loaded files where the
> predicate is declared, and before declaration of any of its clauses.
> Multifile declarations affect reconsult/1 and compile/1: when a multifile
> predicate is reconsulted, only the clauses from the same file are removed.
> Since Yap4.3.0 multifile procedures can be static or dynamic.
> 
> discontiguous(+G) [ISO]
> 
> Declare that the arguments are discontiguous procedures, that is, clauses
> for discontigous procedures may be separated by clauses from other
> procedures.
> 
> initialization(+G) [ISO]
> 
> The compiler will execute goals G after consulting the current file.
> library_directory(+D) Succeeds when D is a current library directory name.
> Library directories are the places where files specified in the form
> library(File) are searched by the predicates consult/1, reconsult/1,
> use_module/1 or ensure_loaded/1.
> 
> file_search_path(+NAME,-DIRECTORY)
> 
> Allows writing file names as compound terms. The NAME and DIRECTORY must
> be atoms. The predicate may generate multiple solutions. The predicate is
> originally defined as follows:
> 
> file_search_path(library,A) :- library_directory(A).
> file_search_path(system,A) :- prolog_flag(host_type,A).
> 
> Thus, [library(A)] will search for a file using library directory/1 to
> obtain the prefix.
> 
> library_directory(+D)
> 
> Succeeds when D is a current library directory name. Library directories
> are the places where files specified in the form library(File) are
> searched by the predicates consult/1, reconsult/1, use_module/1 or
> ensure_loaded/1. prolog_file_name(+Name,-FullPath) Unify FullPath with the
> absolute path YAP would use to consult file Name.
> 
> public P [ISO]
> 
> Instructs the compiler that the source of a predicate of a list of
> predicates P must be kept. This source is then accessible through the
> clause/2 procedure and through the listing family of built-ins. Note that
> all dynamic procedures are public. The source directive defines all new or
> redefined predicates to be public. Since Yap4.3.0 multifile procedures can
> be static or dynamic.

-- 
Per Erik R�nne
Technical Details
Message-ID: <1ga58s5.1hvfpqou52sdhN%per.ronne@doesnt.work.spam.filter.invalid>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!priapus.visi.com!orange.octanews.net!news.octanews.net!green.octanews.net!news-out.octanews.net!news.glorb.com!newsgate.cistron.nl!news2.euro.net!newsfeed.multikabel.nl!newsfeed.kabelfoon.nl!195.129.110.21.MISMATCH!bnewsfeed00.bru.ops.eu.uu.net!bnewsinpeer01.bru.ops.eu.uu.net!emea.uu.net!news.cybercity.dk!per.ronne
References: <1ga2cfa.1p3qajl1tu539kN%per.ronne@doesnt.work.spam.filter.invalid> <1078300879.957971@seven.kulnet.kuleuven.ac.be> <1ga3fsd.inncwg4mvay8N%per.ronne@doesnt.work.spam.filter.invalid> <1078352253.578789@seven.kulnet.kuleuven.ac.be> <1ga3xdp.14s882o1wq1e9N%per.ronne@doesnt.work.spam.filter.invalid> <1078401750.244213@seven.kulnet.kuleuven.ac.be>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 1033b0,271c09991fecbd9
X-Google-Attributes: gid1033b0,public
X-Google-Thread: f907c,271c09991fecbd9
X-Google-Attributes: gidf907c,public
X-Google-ArrivalTime: 2004-03-04 13:12:18 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!priapus.visi.com!orange.octanews.net!news.octanews.net!green.octanews.net!news-out.octanews.net!news.glorb.com!newsgate.cistron.nl!news2.euro.net!newsfeed.multikabel.nl!newsfeed.kabelfoon.nl!195.129.110.21.MISMATCH!bnewsfeed00.bru.ops.eu.uu.net!bnewsinpeer01.bru.ops.eu.uu.net!emea.uu.net!news.cybercity.dk!per.ronne
From: per.ronne@doesnt.work.spam.filter.invalid (Per Rønne)
Newsgroups: comp.lang.prolog,gnu.misc
Subject: Re: Yap - insertion mode
Date: Thu, 4 Mar 2004 22:11:59 +0100
Organization: Cybercity
Lines: 177
Message-ID: <1ga58s5.1hvfpqou52sdhN%per.ronne@doesnt.work.spam.filter.invalid>
References: <1ga2cfa.1p3qajl1tu539kN%per.ronne@doesnt.work.spam.filter.invalid> <1078300879.957971@seven.kulnet.kuleuven.ac.be> <1ga3fsd.inncwg4mvay8N%per.ronne@doesnt.work.spam.filter.invalid> <1078352253.578789@seven.kulnet.kuleuven.ac.be> <1ga3xdp.14s882o1wq1e9N%per.ronne@doesnt.work.spam.filter.invalid> <1078401750.244213@seven.kulnet.kuleuven.ac.be>
Reply-To: spam@husumtoften.dk (Per Rønne)
NNTP-Posting-Host: port199.ds1-brh.adsl.cybercity.dk
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.cybercity.dk 1078434719 94119 217.157.136.78 (4 Mar 2004 21:11:59 GMT)
X-Complaints-To: abuse@cybercity.dk
NNTP-Posting-Date: Thu, 4 Mar 2004 21:11:59 +0000 (UTC)
X-Face: -Ec]fH;)|5`=g?&$Zh-)dV|x:w#VG#S}<SEgcEV6v%v]1l'"v<nAf{BR\-}QF
        />C@|s&Og$a~PWByK#FcE"c1eV]<oBYWgsvFx)X.1IV=wcC9^!onQ4M8ewM
User-Agent: MacSOUP/2.6b2 (Mac OS X version 10.3.2)