Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Problem with matching sin(...) etc.
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

Report this thread to moderator Post Follow-up to this message
Old Post
Thorsten
09-09-04 08:59 PM


Re: Problem with matching sin(...) etc.
Thorsten <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.

Report this thread to moderator Post Follow-up to this message
Old Post
Jens Kilian
09-10-04 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Prolog archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:57 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.