[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
PrologPredicate

(Prolog) Predicate

Defined in the PREDICATES section.

% Some predicates
predicates
  myFunction1()
  myFunction2(integer)- (i)
  myFunction3(integer,string)- (i,i)


Predicates can have different modes:

Comparison to other languages

A Prolog predicate is like a C declaratation/C++ declaration.

% Some predicates in Prolog
predicates
  myFunction1()
  myFunction2(string)- (i)
  myFunction3(string,string)- (i,o)


//Function declarations in C
  void myFunction1(void)
  void myFunction2(const char *); //'const' means 'read only', denoting input
  void myFunction3(const char *, char *); 


//Function declarations in C++
void myFunction1()
void myFunction2(const std::string&); //'const' means 'read only', 
                                      //denoting input
                                      //'&' means 'reference'
void myFunction3(const std::string&, std::string&); 




last edited (December 6, 2006) by bilderbikkel, Number of views: 1062, Current Rev: 4 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.