LINUX CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>

7-DAY TOP DOWNLOAD

#
Program
BackTrack 3.0 / 4.0
Pre-Final

5,487
Ubuntu 9.10
4,487
VLC 1.0.3
3,388
Wine 1.0.1 / 1.1.32
2,824
Yahoo Messenger
1.0.4

2,483
Adobe Flash Player
for Linux 10.0.32.18

2,320
Thunderbird PST
Import plugin 1.2

2,290
Mandriva Linux
2010.0

1,992
Super Grub Disk
0.9799

1,577
Yellow Dog Linux 6.2
1,441

WEEK'S BEST

  • Ubuntu 9.10
  • Ubuntu Netbook Rem...
  • Pidgin 2.6.3
  • Wine 1.0.1 / 1.1.32
  • Linux Kernel 2.6.3...
  • Mozilla Firefox 3....
  • Fedora 11
  • OpenOffice.org 3.1.1
  • Firestarter 1.0.3
  • The Gimp 2.6.7 / 2...
  • FileZilla 3.2.8.1 ...
  • Transmission 1.76
  • Super Grub Disk 0....
  • Gufw 9.04.2
  • Skype 2.0.072 / 2....
  • openSUSE Linux 11....
  • Opera 10.01 / 10.1...
  • Adobe Flash Player...
  • wine-doors 0.1.3
  • Google Gadgets 0.1...
  • Home / Linux / Programming / Libraries

    AI::Prolog::Builtins 0.739

    Download button

    No screenshots available
    Downloads: 141  Add to download basket  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Curtis Poe | More programs
    Perl Artistic License / FREE
    June 22nd, 2007, 00:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Add a review  Refer to a friend  Subscribe

     

    AI::Prolog::Builtins description

     

    AI::Prolog::Builtins is a Perl module with builtin predicates that AI::Prolog supports.

    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 doesn't 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 you've 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

    Requirements:

    · Perl

      


    TAGS:

    builtin predicates | AI::Prolog predicates | Perl module | AI::Prolog::Builtins | builtin | AI::Prolog



    HTML code for linking to this page:


    Go to top

    Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM