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

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

Serving Software Downloads in 956 Categories, Downloaded 50.258.668 Times

AI::Prolog::Builtins 0.739

  Date Added: September 21, 2010  |  Visits: 1.096

AI::Prolog::Builtins

Report Broken Link
Printer Friendly Version


Product Homepage
Download (102 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  -  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  -  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  -  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  
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  -  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  
Programming  -  Perl Module Manager 1.2.0.18
Perl Module Manager helps you to install, un-install and manage Perl modules from a CPAN site and other sources in an easy and intuitive way. Allows you to search through thousands of useful modules and libraries on a CPAN site and its mirrors....
1.44 MB  
Libraries  -  Scrape::USPS::ZipLookup Perl Module 2.4
The United States Postal Service (USPS) has on its web site an HTML form at http://www.usps.com/zip4/ for standardizing an address. Given a firm, urbanization, street address, city, state, and zip, it will put the address into standard form...
11.26 KB  
Science  -  Bio::Parse::SwissProt - perl module 0.5
A Perl module that provides methods for retrieving each and every field from a standard SwissProt file.
9.61 KB  
Benchmark Tools  -  Stopwatch Perl Module 0.10.3
Perf::Stopwatch is a Perl Module that can be quickly added and removed from any existing code to debug/optimize portions of code. Example of use are: database calls, loop efficiency, total script time, and webpage timeouts.
5.98 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  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.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...
3.88 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