@c -*-texinfo-*-
@node Low Level, PredicateIndex, Error Codes, Top
@comment  node-name,  next,  previous,  up
@appendix Low-level Primitives 
@example
noref                           % list undefined preds
debugicp                        % debug emulator
halt                            % exit emulator
'add%f'(N,M,Sum)                % add two integers
'sub%f'(N,M,Difference)         % subtract two integers
'mul%f'(N,M,Product)            % multiply two integers
'div%f'(N,M,Quotient)           % divide two integers
'mod%f'(N,M,Remainder)          % modulus
'cmp%f'(Order,term1,Term2)      % compare two terms
'int%f'(Int)                    % integer test
'atom%f'(Constant)              % atomic test
'var%f'(Var)                    % var test
'list%f'(List)                  % list test
'tpl%f'(Tuple)                  % tuple test
'arg%f'(N,Term,Element)         % extract from tuple
'univ%f'(Tuple,List)            % univ
'name%f'(Constant,List)         % print-names of terms
'o_stream%f'(Filename,Mode,Id)  % initialise stream I/O
'c_stream%f'(Id)                % finished with stream
'o_mem%f'(Initialiser,Mode,Id)  % initialise memory file
'c_mem%f'(Id)                   % finished with memory file
'set_in%f'(Type,Id)             % set current input stream
'set_out%f'(Type,Id)            % set current output stream
'increment%f'(N,OneMore)        % increment by 1
'put_q_atom%f'(Atom)            % write out a quoted atom
'get0%f'(Char)                  % input a character
'put%f'(Char)                   % output a character
'unget%f'(Char)                 % put back a character
'flush%f'(StreamId)             % flush output stream
'addr%f'(Var,Address)           % numerical address of var
'deepcut%f'(Cut)                % deep cut
'back%f'(ChoicePt)              % pick up cut label
'meta%f'(Goal)                  % meta-call
'eq%f'(Number,Number)           % equality test
'ne%f'(Number,Number)           % inequality test
'lt%f'(Number,Number)           % less than test
'le%f'(Number,Number)           % less than or equal test
'gt%f'(Number,Number)           % greater than test
'ge%f'(Number,Number)           % greater than or equal test
'syntax_error%f'(Errorcode)     % Syntax Error Handler
'assert%f'(Index,Mode)          % link clause of dynamic predicate
'retract%f'(Name,Arity,Index)   % retract dynamic clause
'dec%f'([N])                    % decrement N by 1 in [N]
'inc%f'([N])                    % increment N by 1 in [N]
'find_clause%f'(Name,Arity,ChainName,ChainArity,Index)
                                % find specific clause in dynamic chain
'time%f'(Time)                  % get CPU time
'arity%f'(Term,Arity)           % get arity of tuple 
'funct%f'(Term,Functor)         % get functor of tuple 
'interm%f'(Term,Priority,Vars)  % read a term and produce var list 
'ntpl%f'(Length,Tuple)          % create a new tuple of unbounds 
'not%f'(N,Complement)           % binary complement 
'lshift%f'(N,Places,Result)     % left shift function
'rshift%f'(N,Place,Result)      % right shift function
'and%f'(N,M,Anded)              % and function
'or%f'(N,M,Or)                  % or function
'op_prefix%f'(OpPrior,Right,Name)     % define a new prefix operator
'op_postfix%f'(Left,OpPrior,Name)     % define a new postfix operator
'op_infix%f'(Left,OpPrior,Right,Name) % define a new infix operator
'op_look%f'(Name,Pre,PreRight,InLeft,In,InRight,Post,PostLeft)
                                % read specified operator details
'op_get%f'(Name,IndexIn,Pre,PreRight,InLeft,In,InRight,
           Post,PostLeft,IndexOut).
                                % read unspecified operator details
'put_str%f'(List,Quote)         % write a quoted atom (list of ASCII)
'put_atom%f'(Atom)              % write out an atom
'put_number%f'(Number)          % write out a number
'atom_type%f'(Constant,Type)    % is atom alphanumeric or symbols ?
'defined%f'(Pred,Address)       % return address of predicate
'read_catch%f'(ChoicePt)        % read CATCH register
'set_catch%f'(ChoicePt)         % set CATCH register
'read_error%f'(Error)           % read and reset ERROR register
'catch%f'(B)                    % set CATCH to most recent chpt.
'throw%f'(Error)                % throw an error
'cg_init%f'(Type)               % initialise code generator
'cg_fixup%f'(Public)            % fixup generated code
'cg%f'(Instructions)            % generate code for one relation
'undef%f'(Name,Arity)           % get name and arity of undfnd relation
'c_ram%f'(Ramfile,Constant)     % create constant from memory file
'load%f'                        % load code block from current input
'varsin%f'(Term,Vars)           % Vars is list of variables in Term
'fix_tables%f'                  % fixup externals and entries tables
'save%f'(PredList,Saved,Unsaved)   % save code for pred to current output
'pred_look%f'(Name,Arity,Seg,Type) % is specified predicate defined ?
'pred_get%f'(Name,Arity,IndexIn,IndexOut,Seg,Type)
                                % Get unspecified predicate details
'abolish%f'(Name,Arity)         % Abolish predicate
'validate%f'(DefindLst,ErrType) % Gets a list of preds being re-loaded
'unload%f'                      % Free space for last loaded segment
'kill%f'(Name,Arity)            % Kill predicate
'write_term%f'(Term)            % write encoded term
'read_term%f'(Term)             % read encoded term
'tag%f'(Term,Tag)               % return tag as in integer
'grnd_funct%f'(Functor)         % test for ground functor
'tab%f'(Number)                 % print spaces
'concat%f'(First,Second,Join)   % concat two symbols
'prefix%f'(Longname,Prefix)     % symbol prefix test
'suffix%f'(Longname,Suffix)     % symbol suffix test
'to_ground%f'(Hllw,Grnd,Vr,VNm,Used) % create ground copy of term
'to_hollow%f'(Grnd,Hllw,VNames,Vars) % creates hollow copy of a term
'delete%f'(Name,Arity)          % free space for clauses of  Name/Arity
'cg_out%f'                      % write out result of code generator
'set_up_seg%f'                  % initialise segment from ram file
'tty%f'(Name,InStream,OutStream) % create titled window with I/O streams
'ram_pipe%f'(Out,In)            % create pseudo-pipe using ram files
'close_port%f'(Port)            % close one end of a pipe
'read_pipe%f'(Port,Term)        % read a term from a pipe
'write_pipe%f'(Port,Term)       % write a term to a pipe
'new_thread%f'(Thread)          % create a new thread
'kill_thread%f'(Thread)         % kill a thread
'fork%f'(Thread,InputStream)    % fork a thread
'resume%f'(Thread)              % resume a thread
'suspend%f'                     % suspend a thread
'rpc%f'(Thread,InputStream,OutputStream) % remote procedure call
'pipe%f'(In,Out)                % create a pipe using memory files
'thread%f'(Thread)              % get address of current thread
'set_prop%f'(Object, Property, Value) % setting a property
'get_prop%f'(Object, Property, Value) % retrieving a property
'del_prop%f'(Object, Property)  % deleting a property
'get_props%f'(Object, List)     % get property names of an object
'del_props%f'(Object)           % delete all properties of an object
'get_cons%f'(Property, List)    % get objects which have property
'del_cons%f'(Property)          % delete objects which have property
'float%f'(Num)                  % floating-point number test
'put_float%f'(Num)              % write out a floating-point
'number%f'(Num)                 % integer/float test
'fadd%f'(N,M,Sum)               % add two floating point numbers
'fsub%f'(N,M,Difference)        % subtract two floating point numbers
'fmul%f'(N,M,Product)           % multiply two floating point numbers
'fdiv%f'(N,M,Quotient)          % divide two floating point numbers
'int%f'(Float,Int)              % convert float to integer
'sin%f'(N,Result)               % sine function
'cos%f'(N,Result)               % cosine functions
'tan%f'(N,Result)               % tangent function
'asin%f'(N,Result)              % arcsin function
'acos%f'(N,Result)              % arcosine function
'atan%f'(N,Result)              % arctangent function
'atan2%f'(N,M,Result)           % arctangent (N/M) function
'sinh%f'(N,Result)              % hyperbolic sine function
'cosh%f'(N,Result)              % hyperbolic cosine function
'tanh%f'(N,Result)              % hyperbolic tangent function
'exp%f'(N,Result)               % natural anti-logarithm function
'log%f'(N,Result)               % natural logarithm function
'log10%f'(N,Result)             % logarithm (base 10) function
'sqrt%f'(N,Result)              % square root function
'pow%f'(N,M,Result)             % N raised to the power M
'abs%f'(N,Result)               % absolute value function
'sign%f'(N,Result)              % sign of N
'ceil%f'(N,Result)              % round up to next higher integer
'floor%f'(N,Result)             % round down to next lower integer
'pi%f'(Pi)                      % value of pi
'rand%f'(N)                     % random integer in range 0-32767
'deg2rad%f'(N,Result)           % degree to redian conversion
'rad2deg%f'(N,Result)           % radian to degree conversion
'interrupt%f'(Goal)             % retrieve interrupted goal
'unix%f'(Command)               % execute unix command
'out_of_date%f'(File)           % check if need to recompile
'look_pipe%f'(Port,Term)        % read from pipe without removing
'commit_read%f'(Port)           % commits the non-removing read
'look_pipe%f'(Port,Term)        % unlock a pipe
'init_parlog%f'(Th)             % start up a Parlog thread
'tty_get0%f'(Char)              % read character from terminal
'curr_input%f'(In)              % identify current input
'curr_output%f'(Out)            % identify current output
'release_port%f'(Port)          % relinquish ownership of port
'empty_pipe%f'(Pipe)            % test if pipe is empty
'is_iport%f'(Port)              % input port test
'is_oport%f'(Port)              % output port test
'runtime%f'(Flag, List)         % get CPU time (SICSTUS style)
'decrement%f'(N,OneLess)        % decrement by 1
'load_foreign%f'(File,List,Lib) % set up foreign C primitives
'realtime%f'(Number)            % real time (seconds since 1/1/170)
'errno%f'(Error,Msg)            % C errno
'getenv%f'(Name, Value)         % get environment variable
@end example
