Article View: comp.lang.prolog
Article #4364Re: Yap - insertion mode
From: Bart Demoen
Date: Wed, 03 Mar 2004 08:01
Date: Wed, 03 Mar 2004 08:01
37 lines
2310 bytes
2310 bytes
Per RοΏ½nne wrote:
> Yesterday, I downloaded yap, "Yet Another Prolog", and a pdf-based
> manual too.
>
> Nevertheless, I'm not satisfied with the manual. I had to use lot of
> time before I found out that if I typed ^C and then h, I could see the
> possible commands like the "e" which exits the system.
>
> However, I'm still not able to insert predicates into the database. How
> do I exit query mode to be able to insert predicates /without/ the use
> of predicates like assert(C)?
>
> I'm running yap from a bash shell in MacOS X 10.3.2, a BSD Unix.
Here is a session:
[ YAP version Yap-4.4.4 ]
?- [user].
| asd.
| qwe(9).
| yes
?- asd.
yes
?- qwe(X).
X = 9 ? ;
no
However, instead of consulting 'user', it is generally better to
put your clauses in a file named something.pl and then at the query toplevel
do
?- [something].
Cheers
Bart Demoen
Technical Details
Message-ID:
<1078300879.957971@seven.kulnet.kuleuven.ac.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!syros.belnet.be!ikaria.belnet.be!news.belnet.be!not-for-mailReferences:
<1ga2cfa.1p3qajl1tu539kN%per.ronne@doesnt.work.spam.filter.invalid>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-03 00:01:20 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!syros.belnet.be!ikaria.belnet.be!news.belnet.be!not-for-mail From: Bart Demoen <bmd@cs.kuleuven.ac.be> Newsgroups: comp.lang.prolog,gnu.misc Subject: Re: Yap - insertion mode Date: Wed, 03 Mar 2004 09:01:19 +0100 Organization: KULeuvenNet Lines: 37 Message-ID: <1078300879.957971@seven.kulnet.kuleuven.ac.be> References: <1ga2cfa.1p3qajl1tu539kN%per.ronne@doesnt.work.spam.filter.invalid> NNTP-Posting-Host: seven.kulnet.kuleuven.ac.be Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ikaria.belnet.be 1078300879 11180 134.58.127.12 (3 Mar 2004 08:01:19 GMT) X-Complaints-To: abuse@belnet.be NNTP-Posting-Date: Wed, 3 Mar 2004 08:01:19 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en In-Reply-To: <1ga2cfa.1p3qajl1tu539kN%per.ronne@doesnt.work.spam.filter.invalid> Cache-Post-Path: seven.kulnet.kuleuven.ac.be!unknown@hex.cs.kuleuven.ac.be X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/)