home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Vectronix 2
/
VECTRONIX2.iso
/
FILES_01
/
X_PROLOG.LZH
/
X_PROLOG
/
SOURCES
/
BUILTIN.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-08-13
|
6KB
|
175 lines
/*
* X PROLOG Vers. 2.0
*
*
* Written by : Andreas Toenne
* CS Dept. , IRB
* University of Dortmund, W-Germany
* <at@unido.uucp>
* <....!seismo!unido!at>
* <at@unido.bitnet>
*
* Copyright : This software is copyrighted by Andreas Toenne.
* Permission is granted hereby to copy the entire
* package including this copyright notice without fee.
*
*/
/* extern built in's */
extern short bihalt(); /* stop the execution */
extern short bisee(); /* open a file for reading */
extern short biseeing(); /* test for open stream */
extern short biseen(); /* close stream */
extern short bitell(); /* open a file for writing */
extern short bitelling(); /* test for open stream */
extern short bitold(); /* close output stream */
extern short biclose(); /* close a stream */
extern short bifileerrors(); /* give signals */
extern short binofileerrors(); /* give no signals */
extern short biexists(); /* test if file is accessible */
extern short birename(); /* rename(delete) a file */
extern short binl(); /* tell a new-line */
extern short biget0(); /* see the next character */
extern short biget(); /* see the next printable character */
extern short biskip(); /* skip character */
extern short biput(); /* tell a character */
extern short bitab(); /* tell space chars */
extern short bivar(); /* test for variable */
extern short binonvar(); /* reverse */
extern short biatom(); /* test for atom */
extern short biinteger(); /* test for integer */
extern short biatomic(); /* test for atom or integer */
extern short bitrue(); /* true */
extern short bifail(); /* fails */
extern short bish(); /* fork a shell */
extern short bisystem(); /* execute a shell command */
extern short biop(); /* define an operator */
extern short biread(); /* read a term */
extern short biwrite(); /* write a term */
extern short bidisplay(); /* write term in prefix only */
extern short bistatistics(); /* return certain system statistics */
extern short biprompt(); /* read-change the prompt */
extern short bifunctor(); /* meta logic */
extern short biarg(); /* meta logic */
extern short biuniv(); /* meta logic */
extern short biname(); /* meta logic */
extern short biasserta(); /* add clause */
extern short biassertz(); /* add clause */
extern short bidollarclause(); /* find clause */
extern short bicut(); /* CUT */
extern short biwriteq(); /* write quoted */
extern short bidebug(); /* enable debug */
extern short binodebug(); /* disable debug */
extern short bidollarfunctor(); /* find functors */
extern short bidollargoalvars(); /* save goal's vars in a list */
extern short bidollarmore(); /* succeeds, if more solutions */
extern short biretract(); /* remove a clause */
extern short biabolish(); /* remove all clauses of 1 sort */
extern short biis(); /* evaluate an expression */
extern short bisucc(); /* return successor */
extern short bieq(); /* comparison with terms */
extern short bineq();
extern short biless();
extern short bigreat();
extern short bieqless();
extern short bigreateq();
extern short bieeq(); /* evaluates expression first */
extern short bieneq();
extern short bieless();
extern short biegreat();
extern short bieeqless();
extern short biegreateq();
extern short bicompare();
extern short bireconsulting(); /* sets reconsult mode */
extern short bidollarprompt(); /* show prompt */
extern short biprotect(); /* protect predicates */
extern short bihide(); /* hide predicates */
extern short biunprotect(); /* unprotect predicates */
extern short bireveal(); /* make predicates visible */
extern short bisave(); /* save all definitions */
/* the list of built in's */
bi bis[] =
{
/* Inline built ins */
{ "abort", NULL, 0},
{ "$call", NULL, 1},
/* 'normal' built ins */
{ "halt", bihalt, 0},
{ "see", bisee, 1},
{ "seeing", biseeing, 1},
{ "seen", biseen, 0},
{ "tell", bitell, 1},
{ "telling", bitelling, 1},
{ "told", bitold, 0},
{ "close", biclose, 1},
{ "fileerrors", bifileerrors, 0},
{ "nofileerrors", binofileerrors, 0},
{ "exists", biexists, 1},
{ "rename", birename, 2},
{ "nl", binl, 0},
{ "get0", biget0, 1},
{ "get", biget, 1},
{ "skip", biskip, 1},
{ "put", biput, 1},
{ "tab", bitab, 1},
{ "var", bivar, 1},
{ "nonvar", binonvar, 1},
{ "atom", biatom, 1},
{ "integer", biinteger, 1},
{ "atomic", biatomic, 1},
{ "true", bitrue, 0},
{ "fail", bifail, 0},
{ "sh", bish, 0},
{ "system", bisystem, 1},
{ "op", biop, 3},
{ "read", biread, 1},
{ "write", biwrite, 1},
{ "display", bidisplay, 1},
{ "statistics", bistatistics, 0},
{ "prompt", biprompt, 2},
{ "functor", bifunctor, 3},
{ "arg", biarg, 3},
{ "=..", biuniv, 2},
{ "name", biname, 2},
{ "assert", biassertz, 1},
{ "asserta", biasserta, 1},
{ "assertz", biassertz, 1},
{ "$clause", bidollarclause, 3},
{ "!", bicut, 0},
{ "writeq", biwriteq, 1},
{ "debug", bidebug, 0},
{ "nodebug", binodebug, 0},
{ "repeat", bitrue, 0},
{ "$functor", bidollarfunctor, 3},
{ "$goalvars", bidollargoalvars, 1},
{ "$more", bidollarmore, 1},
{ "retract", biretract, 1},
{ "abolish", biabolish, 2},
{ "is", biis, 2},
{ "succ", bisucc, 2},
{ "==", bieq, 2},
{ "\\==", bineq, 2},
{ "@<", biless, 2},
{ "@>", bigreat, 2},
{ "@=<", bieqless, 2},
{ "@>=", bigreateq, 2},
{ "=:=", bieeq, 2},
{ "=\\=", bieneq, 2},
{ "<", bieless, 2},
{ ">", biegreat, 2},
{ "=<", bieeqless, 2},
{ ">=", biegreateq, 2},
{ "compare", bicompare, 3},
{ "$reconsulting", bireconsulting, 1},
{ "$prompt", bidollarprompt, 1},
{ "protect", biprotect, 1},
{ "hide", bihide, 1},
{ "unprotect", biunprotect, 1},
{ "reveal", bireveal, 1},
{ "save", bisave, 1},
{ NULL, NULL, 0}
};