osdir.com
mailing list archive

Subject: temporary op change - msg#00130

List: ai.prolog.swi

Date: Prev Next Index Thread: Prev Next Index
I have this code that works



:-op(900, xf, '?').
:-op(900, xf, '*').
:-op(900, xf, '+').
:-op(850, fy, '@').
:-op(950, xfy, '|').

readParsingRules(file(FileName)) :-
open(FileName, read, Stream),
readParsingRules(stream(Stream)),
close(Stream).

readParsingRules(stream(Stream)) :-
read_clause(Stream, Term),
Term \= end_of_file,
write_canonical(Term), nl,
readParsingRules(stream(Stream)).

readParsingRules(stream(Stream)) :-
at_end_of_stream(Stream).

:- readParsingRules(file('performative_module.xsd.pro')).





I would prefer to have the difenition of the op just when I'm reading
the clauses from the file and remove it after.


What is the best way to do it?

thanks
Marcos



Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

RE: Lists, sets and prolog syntax

>> This won't work, because it's sorting at *compile-time*, whereas the >> result needs to be sorted at *run-time*. >> >> Example: >> >> p(X, Y, {X,Y}). > True. I assumed the original poster was dealing with ground > sets, where this wasn't an issue. One other point: The > above rewrite *can* be used as a run-time transformation if > desired. Again, inputs must be ground. > I'd better correct my response. Richard is absolutely correct and the example call would be screwed up by my code, if such was ever plugged into a goal_expansion. Ground (at runtime) sets are not a sufficient basis for (compile-time) rewrites to a list notation.

Next Message by Date: click to view message preview

Re: temporary op change

On 2005/11/22, at 17:58, marcos rebelo wrote: I would prefer to have the difenition of the op just when I'm reading the clauses from the file and remove it after. Some hints: (1) op/3 is both a directive and a predicate; (2) setting the precedence/priority of an operator to zero effectively removes it from the operators table. Cheers, Paulo ----------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Informatics Office 4.3 Ext. 3257 University of Beira Interior Phone: +351 275319700 6201-001 Covilhã Fax: +351 275319899 Portugal <mailto:pmoura@xxxxxxxxx> <http://www.di.ubi.pt/~pmoura> <http://www.logtalk.org> -----------------------------------------------------------

Previous Message by Thread: click to view message preview

Re: Win32/Tufik Virus in w32pl547.exe download

Dear Wilam, [copied to the mailinglist to see if there are any other reports] On Monday 21 November 2005 14:44, you wrote: > Just tried to download file > w32pl547.exe swi_prolog/xpce for ms windows version 5.4.7 > > >From gollem.science.uva.nl > > My AVG anti virus tagged it up as containing the Win32/Tufik virus. 99.9% sure false alarm. This happened a couple of times before. If you have a support contract with AVG, please send them your findings. They'll probably acknowledge that their virus fingerprint was too general and the SWI-Prolog installer by accident holds the fingerprint. SWI-Prolog is built on Windows XP/SP2 running in a VMWARE virtual machine running on a Linux host. The machine cannot talk to the outside world and is only started to debug and compile Prolog. The server has not been compromised as far as I can tell. If you have an MD5 checksum program: the server checksum is d43e911a29c3b8c157909dbaad2aafd7 w32pl547.exe Of course, if there is really something wrong, please raise the flag again ASAP. > Many Thanks ?? lol Thanks for reporting. --- Jan

Next Message by Thread: click to view message preview

Re: temporary op change

On 2005/11/22, at 17:58, marcos rebelo wrote: I would prefer to have the difenition of the op just when I'm reading the clauses from the file and remove it after. Some hints: (1) op/3 is both a directive and a predicate; (2) setting the precedence/priority of an operator to zero effectively removes it from the operators table. Cheers, Paulo ----------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Informatics Office 4.3 Ext. 3257 University of Beira Interior Phone: +351 275319700 6201-001 Covilhã Fax: +351 275319899 Portugal <mailto:pmoura@xxxxxxxxx> <http://www.di.ubi.pt/~pmoura> <http://www.logtalk.org> -----------------------------------------------------------
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by