Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.862.741 Times

AI::Prolog::Builtins 0.739

  Date Added: September 21, 2010  |  Visits: 730

AI::Prolog::Builtins

Report Broken Link
Printer Friendly Version


Product Homepage
Download (78 downloads)



AI::Prolog::Builtins is a Perl module with builtin predicates that AI::Prolog supports. Comments Comments begin with a % and terminate at the end of the line or begin with /* and terminate with */. Variables As in Prolog, all variables begin with an upper-case letter and are not quoted. In the following example, STUFF is a variable. steals(badguy, STUFF, "Some rich person"). Constants Constants begin with lower-case letters. If you need a constant that begins with an upper-case letter or contains spaces or other non-alphanumeric characters, enclose the constant in single or double quotes The quotes will not be included in the constant. In the following example, badguy and Some rich person are both constants: steals(badguy, STUFF, "Some rich person"). Miscellaneous This will not work: p(X) :- X. /* does not work */ Use this instead: p(X) :- call(X). BUILTINS !/0 The "cut" operator. This is used when you wish to tell Prolog that you only need to satisfy a goal once. For example, if you wish to deny someone the right to rent videos if they have overdue videos, you might use the cut operator as soon as you see they have any overdue video. The fact that they have more than one overdue video doesnt matter. See the cut.pl program in the examples/ directory that comes with this distribution. assert/1 Add new facts to the database. Only facts can be added, not rules. This may change in the future. See retract(X). assert(loves(ovid,perl)). call/1 Invokes X as a goal. consult/1 Supplied the name of a file containing Prolog code, this will consult the Prolog code in the file and add its contents to the current knowledgebase. Will warn if the file cannot be opened. div/2 Succeeds if both terms are bound. The value of the term is X / Y. Use with is(X,Y). is(X, div(N,3)). This is the internal form of the infix operator: N / 3. eq/2 Succeeds if X and Y are equal. This is the internal form of the infix operator: X == Y. fail/0 This goal always fails. Useful when youve reached a condition you know should not succeed. kill(Hero, Beast) :- not(has_weapon(Hero)), fail. ge/2 Succeeds if both terms are bound and X >= Y. This is the internal form of the infix operator: X >= Y. gt/2 Succeeds if both terms are bound and X > Y. This is the internal form of the infix operator: X > Y. halt/1 In the aiprolog shell, exist shell. Currently has no other effect. if/3 If X succeeds as a goal, try Y as a goal. Otherwise, try Z. thief(badguy). steals(PERP, X) :- if(thief(PERP), eq(X,rubies), eq(X,nothing)). is/2 If X is unbound and Y is bound to a number, the goal succeeds and X becomes bound to the value of Y. Otherwise, succeeds if both terms are bound, numbers, and equal. All other conditions result in failure. This is the internal form of the infix operator: X is Y. le/2 Succeeds if both terms are bound and X <= Y. This is the internal form of the infix operator: X <= Y. listing/0 Dumps a listing of all user-defined predicates and how they are defined. listing/1 Dumps a listing of the requested predicate. X must a variable or string instantiated in functor/arity) form. Note that, unlike most Prologs, this means that the followig will not work: listing(foo/2). Use this instead: listing(foo/2). lt/2 Succeeds if both terms are bound and X < Y. This is the internal form of the infix operator: X < Y. minus/2 Succeeds if both terms are bound. The value of the term is X - Y. Use with is(X,Y). is(X, minus(N,1)). This is the internal form of the infix operator: N - 1. mod/2 Succeeds if both terms are bound. The value of the term is X % Y. (modulus) Use with is(X,Y). is(X, mod(N,3)). This is the internal form of the infix operator: N % 3. mult/2 Succeeds if both terms are bound. The value of the term is X * Y. Use with is(X,Y). is(X, mult(N,3)). This is the internal form of the infix operator: N * 3. ne/2 Succeeds if X and Y cannot be proven to be equal. This is the internal form of the infix operator: X = Y. nl/0 Prints a newline. not/1 Succeeds if X cannot be proven. This is not negation as were used to seeing it in procedural languages. notrace/0 Turns off tracing of Prologs attempt to satisfy goals. once/1 Stop solving for X if X succeeds. Defined as: once(X) :- X, !; or/2 Succeeds as a goal if either X or Y succeeds. plus/2 Succeeds if both terms are bound. The value of the term is X + Y. Use with is(X,Y). is(X, plus(N,1)). print/1 Prints the current Term. If the term is an unbound variable, it will print the an underscore followed by the internal variable number (e.g., "_284"). print(ovid). % prints "ovid" print("Something"). % prints "Something" print(Something). % prints whatever variable Something is bound to println/1 Same as print(Term), but automatically prints a newline at the end. pow/2 Succeeds if both terms are bound. The value of the term is X ** Y (X raised to the Y power). Use with is(X,Y). retract/1 Remove facts from the database. You cannot remove rules. This may change in the future. See assert(X). retract(loves(ovid,java)). trace/0 Turns on tracing of Prologs attempt to satisfy goals. true/0 True goal. Automatically succeeds. var/1 Succeeds if X is an unbound variable. Otherwise, this goal fails. write/1 Prints the current Term. If the term is an unbound variable, it will print the an underscore followed by the internal variable number (e.g., "_284"). write(ovid). % prints "ovid" write("Something"). % prints "Something" write(Something). % prints whatever variable Something is bound to writeln/1 Same as write(Term), but automatically prints a newline at the end..

Requirements: No special requirements
Platforms: Linux
Keyword: Ai Aiprologbuiltins Bound Goal Libraries Perl Module Programming Stuff Succeeds Terms
Users rating: 0/10

License: Freeware Size: 122.88 KB
USER REVIEWS
More Reviews or Write Review


AI::PROLOG::BUILTINS RELATED
Libraries  -  AI::NeuralNet::Kohonen 0.142
AI::NeuralNet::Kohonen is a Perl module with Kohonens Self-organising Maps. SYNOPSIS $_ = AI::NeuralNet::Kohonen->new( map_dim_x => 39, map_dim_y => 19, epochs => 100, table => "3 1 0 0 red 0 1 0 yellow 0 0 1 blue 0 1 1 cyan 1 1 0...
11.26 KB  
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Libraries  -  perlfaq3 5.8.8
perlfaq3 Perl module contains programming tools. How do I do (anything)? Have you looked at CPAN (see perlfaq2)? The chances are that someone has already written a module that can solve your problem. Have you read the appropriate manpages?...
12.2 MB  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 KB  
Libraries  -  AI::DecisionTree 0.08
AI::DecisionTree is Perl module for automatically Learns Decision Trees. SYNOPSIS use AI::DecisionTree; my $dtree = new AI::DecisionTree; # A set of training data for deciding whether to play tennis $dtree->add_instance (attributes =>...
25.6 KB  
Libraries  -  AI::FuzzyInference 0.05
AI::FuzzyInference is a Perl module to implement a Fuzzy Inference System. SYNOPSYS use AI::FuzzyInference; my $s = new AI::FuzzyInference; $s->inVar(service, 0, 10, poor => [0, 0, 2, 1, 4, 0], good => [2, 0, 4, 1, 6, 0], excellent...
10.24 KB  
Libraries  -  AI::FuzzyLogic 0.05
AI::FuzzyLogic is a Perl module for Fuzzy Set Operations and Tools. SYNOPSIS use AI::FuzzyLogic; $i = new AI::FuzzyLogic $unittype, @numbers; # new set with one subset $i = new AI::FuzzyLogic age, 0, 0.1, 0.2, 0.1, 0; # same thing $i =...
24.58 KB  
Libraries  -  Acme::EyeDrops 1.51
Acme::EyeDrops is a Perl module for visual programming in Perl. SYNOPSIS use Acme::EyeDrops qw(sightly); print sightly( { Shape => camel, SourceFile => eyesore.pl } ); Acme::EyeDrops converts a Perl program into an equivalent one, but...
102.4 KB  
Libraries  -  Myco::Devel 1.22
Myco::Devel is a Perl module for myco Developers Guide. This guide is intended for developers wanting to build applications with myco. You should have a decent grasp of the Perl programming language, or else a solid grasp of another programming...
102.4 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.11.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB