Code Comments
Programming Forum and web based access to our favorite programming groups.Hello. Is there a way to match sin(...) cos(...) etc. at this line: vereinfacht(T,T) :- atomic(T). I want to match all atomics and different predicates like my own pot(x,y) etc. and certainly the arithmetic things like cos(...) and that. I can use that: vereinfacht(T,T) :- atomic(T) | compound(T). But now was all accepted, all non atomic too... :-( By the way: ----------- What is the logical OR? OR --> | OR --> ; ??? I can't find this information on different Prolog-eBooks :-( Greetings, Thorsten
Post Follow-up to this messageThorsten <my@yahoo.com> writes: > Is there a way to match sin(...) cos(...) etc. at this line: > vereinfacht(T,T) :- atomic(T). > > I want to match all atomics and different predicates like > my own pot(x,y) etc. and certainly the arithmetic things > like cos(...) and that. > > I can use that: > vereinfacht(T,T) :- atomic(T) | compound(T). > > But now was all accepted, all non atomic too... :-( Try this: vereinfacht(T, T) :- atomic(T) ; member(T, [sin(_), cos(_), ...]). > By the way: > ----------- > What is the logical OR? > OR --> | > OR --> ; The standard is ;/2 for logical or; but older dialects had '|' as an alterna te syntax. For portability, always use ;/2. HTH, Jens.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.