This page is on the Computer Science Department's WWW Server at CalState, San Bernardino, California, USA. It was generated by Doc Dick Botting.

This site will be closed Dec 22nd 1995 thru to January 2nd 1996

Disclaimer. I didn't create the data that this page is linked to and do not endorse it. CSUSB and the CS Dept have no responsibility for it either.

There is an alphabetical index.



    Calling Prolog

    Call the prolog compiler by one of the following commands:

    pl invoke interpreter.

    pl -c file compile file into a.out.

    pl -o binary -c source compile source into binary.

    Q compile and if ok run compiled binary called program.

    Interaction with Prolog Program

    When the compiled program is running it will prompt you with a ?- prompt. You can input any command or a query, as long as it is terminated by a period. The command or query can be as long as you like and stretch over several lines. The period is essential to terminate it.

    Here are five useful examples:

    halt. % Terminate the prolog program

    help(word). % Display a description of command etc..

    apropos(word). % Look for apropriate commands and predicates.

    listing. % List the current program/data base

    consult('file.suffix'). % Compile and load file into program

    Notice the periods above.

    Quick Introduction

    Structures, Commands, Data

    Simple data structures, commands, and queries look like this:



    The arguments can be variables or constants. They work as commands and queries when the name is a defined predicate. See the [Predefined Predicates] below.

    Input to Interpeter

    You input a structure terminated by a period, or a more complex queries give a series of conditions that all have to be true

    goal, goal, goal, goal, ... goal.

    or give a series of alternatives:

    alternative; alternative; ... alternative.

    where each alternative is a list of goals.

    Variables and Constants

    Remember that all variables start with an UPPERCASE letter or an underscore _. Constants are: numbers, identifiers beginning with a lowercase letter, and strings of characters. String in single quotes are stored as atoms (identifiers) but strings in double quotes become lists of numbers. Lists begin a square bracket and end with a matched bracket.


    Programs are a sequence of simple facts (that look like this name(arguments). normally). These describe facts that are taken to be true. There are also clauses. A clause looks like this: head :- body.. A clause means, roughly, this: if you want to the head to be true try to make the body true. There are sometimes directives( like this: :-goal.). These are executed by the compiler rather than being compiled (roughly).

    See Also

    Frequently Asked Questions About Prolog

    [prolog.FAQ] or [prolog-faq.1]

    Prolog vocabulary






    Philosophy: Logic Programming


    SWI Prolog

    SWI-Prolog reference manual []


    Predefined Predicates

    A predicate can have any number of arguments, including none. The number of arguments(the arity) distinguishes different meanings. Normally in Prolog manuals etc the following notation is used:
  1. f/N ::= The predicate with name f and arity N.

    A relation is a predicate/2 which is written using infix notation.

    An operator can prefix, postfix or infix. This is a syntactice difference only.


  2. for N:0,1,2,3,..., predicate/N ::=set of predicates with N arguments,
  3. relation::=A predicate/2 written with infix notation.

  4. For s:{xf,fx,xfx,yfx,xfy}, P:1,2,3,4..., operator( s, P)::=Set of pre, post and in-fix operators with precedence P.

  5. (!) ::predicate/0 =Cut (discard choicepoints).
  6. (!) ::predicate/1 =Cut block. See "block/3".
  7. (,) ::operator(xfy,1000)=Conjuction of goals.
  8. (->) ::operator(xfy,1050)=If-then-else.
  9. (.) ::predicate/2 =Consult. Also list constructor.
  10. (<) ::relation=Arithmetic smaller.
  11. (=) ::relation=Unification.
  12. (=..) ::relation="Univ." Term to list conversion`.
  13. (=:=) ::relation=Arithmetic equal.
  14. (=<) ::relation=Arithmetic smaller or equal.
  15. (==) ::relation=Identical.
  16. (=@=) ::relation=Structural identical.
  17. (=\=) ::relation=Arithmetic not equal.
  18. (>) ::relation=Arithmetic larger.
  19. (>=) ::relation=Arithmetic larger or equal.
  20. (@<) ::relation=Standard order smaller.
  21. (@=<) ::relation=Standard order smaller or equal.
  22. (@>) ::relation=Standard order larger.
  23. (@>=) ::relation=Standard order larger or equal.
  24. (\+) ::operator(fy, 900)=Negation by failure to prove. Same as "not/1"
  25. (\=) ::relation=Not unifyable.
  26. (\==) ::relation=Not identical.
  27. (\=@=) ::relation=Not structural identical.
  28. abolish::predicate/2 =Remove predicate definition from the database.
  29. abort::predicate/0 =Abort execution, return to top level.
  30. absolute_file_name::predicate/2 =Get absolute path name.
  31. absolute_file_name::predicate/3 =Get absolute path name with options.
  32. access_file::predicate/2 =Check access permissions of a file.
  33. append::predicate/1 =Append to a file.
  34. append::predicate/3 =Concatenate lists.
  35. apply::predicate/2 =Call goal with additional arguments.
  36. apropos::predicate/1 =\lib{online_help} Show related predicates and manual sections`.
  37. arg::predicate/3 =Access argument of a term.
  38. arithmetic_function::predicate/1 =Register an evaluable function.
  39. assert::predicate/1 =Add a clause to the database.
  40. assert::predicate/2 =Add a clause to the database, give reference.
  41. asserta::predicate/1 =Add a clause to the database (first).
  42. asserta::predicate/2 =Add a clause to the database (first).
  43. assertz::predicate/1 =Add a clause to the database (last).
  44. assertz::predicate/2 =Add a clause to the database (last).
  45. at_halt::predicate/1 =Register goal to run at "halt/1".
  46. at_initialization::predicate/1 =Register goal to run at start-up.
  47. atom::predicate/1 =Type check for an atom.
  48. atom_char::predicate/2 =Convert between atom and ASCII value.
  49. atom_chars::predicate/2 =Convert between atom and list of ASCII values.
  50. atom_length::predicate/2 =Determine length of an atom.
  51. atom_to_term::predicate/3 =Convert between atom and term.
  52. atomic::predicate/1 =Type check for primitive.
  53. autoload::predicate/0 =Autoload all predicates now.
  54. bagof::predicate/3 =Find all solutions to a goal.
  55. between::predicate/3 =Integer range checking/generating.
  56. block::predicate/3 =Start a block (catch'/throw').
  57. break::predicate/0 =Start interactive toplevel.
  58. call::predicate/1 =Call a goal.
  59. call::predicaten=Call with aditional arguments.
  60. call_dll_function::predicate/2 =Win32: Call function in dynamic link library (.dll file).
  61. call_shared_object_function::predicate/2 =UNIX: Call C-function in shared (.so) file.
  62. character_count::predicate/2 =Get character index on a stream.
  63. chdir::predicate/1 =Change working directory.
  64. checklist::predicate/2 =Invoke goal on all members of a list.
  65. clause::predicate/2 =Get clauses of a predicate.
  66. clause::predicate/3 =Get clauses of a predicate.
  67. clause_property::predicate/2 =Get properties of a clause.
  68. close::predicate/1 =Close stream.
  69. close_dde_conversation::predicate/1 =Win32: Close DDE channel.
  70. close_dll::predicate/1 =Win32: Close dynamic link library (.dll file).
  71. close_shared_object::predicate/1 =UNIX: Close shared library (.so file).
  72. compare::predicate/3 =Compare, using a predicate to determine the order.
  73. compiling::predicate/0 =Is this a compilation run?.
  74. compound::predicate/1 =Test for compound term.
  75. concat::predicate/3 =Append two atoms.
  76. concat_atom::predicate/2 =Append a list of atoms.
  77. consult::predicate/1 =Read (compile) a Prolog source file.
  78. context_module::predicate/1 =Get context module of current goal.
  79. convert_time::predicate/8 =Convert time stamp.
  80. copy_term::predicate/2 =Make a copy of a term.
  81. current_arithmetic_function::predicate/1 =Examine evaluable functions.
  82. current_atom::predicate/1 =Examine existing atoms.
  83. current_flag::predicate/1 =Examine existing flags.
  84. current_foreign_library::predicate/2 =\lib{shlib} Examine loaded shared libraries (.so files)`.
  85. current_functor::predicate/2 =Examine existing name/arity pairs.
  86. current_input::predicate/1 =Get current input stream.
  87. current_key::predicate/1 =Examine existing database keys.
  88. current_module::predicate/1 =Examine existing modules.
  89. current_module::predicate/2 =Examine existing modules.
  90. current_op::predicate/3 =Examine current operator declaractions.
  91. current_output::predicate/1 =Get the current output stream.
  92. current_predicate::predicate/2 =Examine existing predicates.
  93. current_stream::predicate/3 =Examine open streams.
  94. dde_current_connection::predicate/2 =Win32: Examine open DDE connections.
  95. dde_current_service::predicate/2 =Win32: Examine DDE services provided.
  96. dde_execute::predicate/2 =Win32: Execute command on DDE server.
  97. dde_register_service::predicate/2 =Win32: Become a DDE server.
  98. dde_request::predicate/3 =Win32: Make a DDE request.
  99. dde_unregister_service::predicate/1 =Win32: Terminate a DDE service.
  100. debug::predicate/0 =Test for debugging mode.
  101. debugging::predicate/0 =Show debugger status.
  102. default_module::predicate/2 =Get the default modules of a module.
  103. delete::predicate/3 =Delete all matching members from a list.
  104. delete_file::predicate/1 =Remove a file from the file system.
  105. discontiguous::operator(fx,1150) =Indicate distributed definition of a predicate.
  106. display::predicate/1 =Write a term, ignore operators.
  107. display::predicate/2 =Write a term, ignore operators on a stream.
  108. displayq::predicate/1 =Write a term with quotes, ignore operators.
  109. displayq::predicate/2 =Write a term with quotes, ignore operators on a stream.
  110. dwim_match::predicate/2 =Atoms match in "Do What I Mean" sense.
  111. dwim_match::predicate/3 =Atoms match in "Do What I Mean" sense.
  112. dwim_predicate::predicate/2 =Find predicate in "Do What I Mean" sense.
  113. dynamic::operator(fx, 1150)=Indicate predicate definition may change .
  114. ed::predicate/0 =Edit last edited predicate.
  115. ed::predicate/1 =Edit a predicate.
  116. edit::predicate/0 =Edit last edited file.
  117. edit::predicate/1 =Edit a file.
  118. edit_source::predicate/1 =User-hook: Intercept editing.
  119. ensure_loaded::predicate/1 =Consult a file if that has not yet been done.
  120. erase::predicate/1 =Erase a database record or clause.
  121. exception::predicate/3 =User-hook: Handle runtime exceptions.
  122. exists_directory::predicate/1 =Check existence of directory.
  123. exists_file::predicate/1 =Check existence of file.
  124. exit::predicate/2 =Exit from named block. See block/3.
  125. expand_file_name::predicate/2 =Wildcard expansion of file names.
  126. expand_file_search_path::predicate/2 =Wildcard expansion of file paths.
  127. expand_term::predicate/2 =Compiler: expand read term into clause(s).
  128. explain::predicate/1 =\lib{explain} Explain argument`.
  129. explain::predicate/2 =\lib{explain} 2nd argument is expalanation of first`.
  130. export::predicate/1 =Export a predicate from a module.
  131. export_list::predicate/2 =List of public predicates of a module.
  132. fail::predicate/0 =Always false.
  133. fail::predicate/1 =Immediately fail named block. See block/3.
  134. feature::predicate/2 =Get system configuration parameters.
  135. file_base_name::predicate/2 =Get file part of path.
  136. file_directory_name::predicate/2 =Get directory part of path.
  137. file_search_path::predicate/2 =Define path-aliases for locating files.
  138. fileerrors::predicate/2 =Do/Don't warn on file errors.
  139. findall::predicate/3 =Find all solutions to a goal.
  140. flag::predicate/3 =Simple global variable system.
  141. flatten::predicate/2 =Transform nested list into flat list.
  142. float::predicate/1 =Type check for a floating point number.
  143. flush::predicate/0 =Output pending characters on current stream.
  144. flush_output::predicate/1 =Output pending characters on specified stream.
  145. forall::predicate/2 =Prove goal for all solutions of another goal.
  146. foreign_file::predicate/1 =Examine loaded foreign files.
  147. format::predicate/1 =Formatted output.
  148. format::predicate/2 =Formatted output with arguments.
  149. format::predicate/3 =Formatted output on a stream.
  150. free_variables::predicate/2 =Find unbound variables in a term.
  151. functor::predicate/3 =Get name and arity of a term or construct a term .
  152. garbage_collect::predicate/0 =Invoke the garbage collector.
  153. gensym::predicate/2 =Generate unique atoms from a base.
  154. get::predicate/1 =Read first non-blank character.
  155. get::predicate/2 =Read first non-blank character from a stream.
  156. get0::predicate/1 =Read next character.
  157. get0::predicate/2 =Read next character from a stream.
  158. get_single_char::predicate/1 =Read next character from the terminal.
  159. get_time::predicate/1 =Get current time.
  160. getenv::predicate/2 =Get shell environment variable.
  161. ground::predicate/1 =Verify term holds no unbound variables.
  162. halt::predicate/0 =Exit from Prolog.
  163. halt::predicate/1 =Exit from Prolog with status.
  164. hash_term::predicate/2 =Hash-value of ground term.
  165. help::predicate/0 =Give help on help.
  166. help::predicate/1 =Give help on predicates and show parts of manual.
  167. history_depth::predicate/1 =Number of remembered queries.
  168. ignore::predicate/1 =Call the argument, but always succeed.
  169. import::predicate/1 =Import a predicate from a module.
  170. index::predicate/1 =Change clause indexing.
  171. initialization::predicate/1 =Initialization directive.
  172. int_to_atom::predicate/2 =Convert from integer to atom.
  173. int_to_atom::predicate/3 =Convert from integer to atom (non-decimal).
  174. integer::predicate/1 =Type check for integer.
  175. intersection::predicate/3 =Set intersection.
  176. is::operator(xfx,700)=Evaluate arithmetic expression.
  177. is_absolute_file_name::predicate/1 =True if arg defines an absolute path.
  178. is_list::predicate/1 =Type check for a list.
  179. is_set::predicate/1 =Type check for a set.
  180. keysort::predicate/2 =Sort, using a key.
  181. last::predicate/2 =Last element of a list.
  182. leash::predicate/1 =Change ports visited by the tracer.
  183. length::predicate/2 =Length of a list.
  184. library_directory::predicate/1 =User-hook: Directories holding Prolog libraries.
  185. limit_stack::predicate/2 =Limit stack expansion.
  186. line_count::predicate/2 =Line number on stream.
  187. line_position::predicate/2 =Character position in line on stream.
  188. list_to_set::predicate/2 =Remove duplicates.
  189. listing::predicate/0 =List program in current module.
  190. listing::predicate/1 =List predicate.
  191. load_foreign::predicate/2 =Load foreign (C) module.
  192. load_foreign::predicate/5 =Load foreign (C) module.
  193. load_foreign_library::predicate/1 =\lib{shlib} Load shared library (.so file)`.
  194. load_foreign_library::predicate/2 =\lib{shlib} Load shared library (.so file)`.
  195. make::predicate/0 =Reconsult all changed source files.
  196. make_fat_filemap::predicate/1 =Win32: Create file containing non-FAT filenames.
  197. make_library_index::predicate/1 =Create autoload file
  198. maplist::predicate/3 =Transform all elements of a list.
  199. member::predicate/2 =Element is member of a list.
  200. merge::predicate/3 =Merge two sorted lists.
  201. merge_set::predicate/3 =Merge two sorted sets.
  202. module::predicate/1 =Query/set current type-in module.
  203. module::predicate/2 =Declare a module.
  204. module_transparent::operator(fx, 1150)=Indicate module based meta predicate.
  205. msort::predicate/2 =Sort, do not remove duplicates.
  206. multifile::operator(fx,1150) =Indicate distributed definition of predicate.
  207. name::predicate/2 =Convert between atom and list of ASCII characters.
  208. nl::predicate/0 =Generate a newline.
  209. nl::predicate/1 =Generate a newline on a stream.
  210. nodebug::predicate/0 =Disable debugging.
  211. nonvar::predicate/1 =Type check for bound term.
  212. noprotocol::predicate/0 =Disable logging of user interaction.
  213. nospy::predicate/1 =Remove spy point.
  214. nospyall::predicate/0 =Remove all spy points.
  215. not::predicate(fy, 900) =Negation by failure to prove. Same as "\+ /1".
  216. notrace::predicate/0 =Stop tracing.
  217. notrace::predicate/1 =Do not debug argument goal.
  218. nth0::predicate/3 =N-th element of a list (0-based). nth0(Index, List, Element)=Index-th element of a list List = Element.
  219. nth1::predicate/3 =N-th element of a list (1-based).
  220. nth_clause::predicate/3 =N-th clause of a predicate.
  221. number::predicate/1 =Type check for integer or float.
  222. number_chars::predicate/2 =Convert between number and atom.
  223. numbervars::predicate/4 =Enumerate unbound variables of a term using a given base.
  224. once::predicate/1 =Call a goal deterministicaly.
  225. op::predicate/3 =Declare an operator.
  226. open::predicate/3 =Open a file (creating a stream).
  227. open::predicate/4 =Open a file (creating a stream).
  228. open_dde_conversation::predicate/3 =Win32: Open DDE channel.
  229. open_null_stream::predicate/1 =Open a stream to discard output.
  230. open_shared_object::predicate/2 =UNIX: Open shared library (.so file).
  231. open_shared_object::predicate/3 =UNIX: Open shared library (.so file).
  232. phrase::predicate/2 =Activate grammar-rule set.
  233. phrase::predicate/3 =Activate grammar-rule set (returning rest).
  234. please::predicate/3 =Query/change environment parameters.
  235. plus::predicate/3 =Logical integer addition.
  236. portray::predicate/1 =User hook to modify behaviour of "print/1".
  237. portray_clause::predicate/1 =Pretty print a clause.
  238. predicate_property::predicate/2 =Query predicate attributes.
  239. predsort::predicate/3 =Sort, using a predicate to determine the order.
  240. preprocessor::predicate/2 =Install a preprocessor before the compiler.
  241. print::predicate/1 =Print a term.
  242. print::predicate/2 =Print a term on a stream.
  243. profile::predicate/3 =Obtain execution statistics.
  244. profile_count::predicate/3 =Obtain profile results on a predicate.
  245. profiler::predicate/2 =Obtain/change status of the profiler.
  246. prolog::predicate/0 =Run interactive toplevel.
  247. prolog_current_frame::predicate/1 =Reference to goal's environment stack.
  248. prolog_frame_attribute::predicate/3 =Obtain information on a goal environment.
  249. prolog_load_context::predicate/2 =Context information for directives.
  250. prolog_skip_level::predicate/2 =Indicate deepest recursion to trace.
  251. prolog_to_os_filename::predicate/2 =Convert between Prolog and OS filenames.
  252. prolog_trace_interception::predicate/3 =\lib{user} Intercept the Prolog tracer`.
  253. prompt1::predicate/1 =Change prompt for 1 line.
  254. prompt::predicate/2 =Change the prompt used by read/1.
  255. proper_list::predicate/1 =Type check for list.
  256. protocol::predicate/1 =Make a log of the user interaction.
  257. protocola::predicate/1 =Append log of the user interaction to file.
  258. protocolling::predicate/1 =On what file is user interaction logged.
  259. put::predicate/1 =Write a character.
  260. put::predicate/2 =Write a character on a stream.
  261. qcompile::predicate/1 =Compile source to Quick Load File.
  262. qload::predicate/1 =Load Quick Load File as consult/1.
  263. qsave_program::predicate/1 =Create runtime application.
  264. qsave_program::predicate/2 =Create runtime application.
  265. read::predicate/1 =Read Prolog term.
  266. read::predicate/2 =Read Prolog term from stream.
  267. read_clause::predicate/1 =Read clause.
  268. read_clause::predicate/2 =Read clause from stream.
  269. read_history::predicate/6 =Read using history substitution.
  270. read_link::predicate/3 =Read a symbolic link.
  271. read_variables::predicate/2 =Read clause including variable names.
  272. read_variables::predicate/3 =Read clause including variable names from stream .
  273. recorda::predicate/2 =Record term in the database (first).
  274. recorda::predicate/3 =Record term in the database (first).
  275. recorded::predicate/2 =Obtain term from the database.
  276. recorded::predicate/3 =Obtain term from the database.
  277. recordz::predicate/2 =Record term in the database (last).
  278. recordz::predicate/3 =Record term in the database (last).
  279. redefine_system_predicate::predicate/1 =Abolish system definition.
  280. rename_file::predicate/2 =Change name of file.
  281. repeat::predicate/0 =Succeed, leaving infinite backtrackpoints.
  282. require::predicate/1 =This file requires these predicates.
  283. reset_profiler::predicate/0 =Clear statistics obtained by the profiler.
  284. restore::predicate/1 =Restore saved-state ("save/1", "save_program/1").
  285. retract::predicate/1 =Remove clause from the database.
  286. retractall::predicate/1 =Remove unifying clauses from the database.
  287. reverse::predicate/2 =Inverse the order of the elements in a list.
  288. same_file::predicate/2 =Succeeds if arguments refer to same file.
  289. save::predicate/1 =Save program including current goal.
  290. save::predicate/2 =Save program including current goal.
  291. save_program::predicate/1 =Save the current program on a file.
  292. save_program::predicate/2 =Save the current program on a file.
  293. see::predicate/1 =Change the current input stream.
  294. seeing::predicate/1 =Query the current input stream.
  295. seen::predicate/0 =Close the current input stream.
  296. select::predicate/3 =Select element of a list.
  297. set_feature::predicate/2 =Define a system feature.
  298. set_input::predicate/1 =Set current input stream from a stream.
  299. set_output::predicate/1 =Set current output stream from a stream.
  300. set_tty::predicate/2 =Set tty' stream`.
  301. setarg::predicate/3 =Destructive assignment on term.
  302. setenv::predicate/2 =Set shell environment variable.
  303. setof::predicate/3 =Find all unique solutions to a goal.
  304. sformat::predicate/2 =Format on a string.
  305. sformat::predicate/3 =Format on a string.
  306. shell::predicate/0 =Execute interactive subshell.
  307. shell::predicate/1 =Execute OS command.
  308. shell::predicate/2 =Execute OS command.
  309. show_profile::predicate/1 =Show results of the profiler.
  310. size_file::predicate/2 =Get size of a file in characters.
  311. skip::predicate/1 =Skip to character in current input.
  312. skip::predicate/2 =Skip to character on stream.
  313. sleep::predicate/1 =Suspend execution for specified time.
  314. sort::predicate/2 =Sort elements in a list.
  315. source_file::predicate/1 =Examine currently loaded source files.
  316. source_file::predicate/2 =Obtain source file of predicate.
  317. source_location::predicate/2 =Location of last read term.
  318. spy::predicate/1 =Force tracer on specified predicate.
  319. stack_parameter::predicate/4 =Some systems: Query/Set runtime stack parameter.
  320. statistics::predicate/0 =Show execution statistics.
  321. statistics::predicate/2 =Obtain collected statistics.
  322. stream_position::predicate/3 =Get/seek to position in file.
  323. string::predicate/1 =Type check for string.
  324. string_length::predicate/2 =Determine length of a string.
  325. string_to_atom::predicate/2 =Conversion between string and atom.
  326. string_to_list::predicate/2 =Conversion between string and list of ASCII.
  327. style_check::predicate/1 =Change level of warnings.
  328. sublist::predicate/3 =Determine elements that meet condition.
  329. subset::predicate/2 =Generate/check subset relation.
  330. substring::predicate/4 =Get part of a string.
  331. subtract::predicate/3 =Delete elements that do not meet condition.
  332. succ::predicate/2 =Logical integer successor relation.
  333. swritef::predicate/2 =Formatted write on a string.
  334. swritef::predicate/3 =Formatted write on a string.
  335. tab::predicate/1 =Output number of spaces.
  336. tab::predicate/2 =Output number of spaces on a stream.
  337. tell::predicate/1 =Change current output stream.
  338. telling::predicate/1 =Query current output stream.
  339. term_expansion::predicate/2 =User-hook: Convert term before compilation.
  340. term_to_atom::predicate/2 =Convert between term and atom.
  341. time::predicate/1 =Determine time needed to execute goal.
  342. time_file::predicate/2 =Get last modification time of file.
  343. tmp_file::predicate/2 =Create a temporary filename.
  344. told::predicate/0 =Close current output.
  345. trace::predicate/0 =Start the tracer.
  346. trace::predicate/1 =Set trace-point on predicate.
  347. trace::predicate/2 =Set/Clear trace-point on ports.
  348. tracing::predicate/0 =Query status of the tracer.
  349. trim_stacks::predicate/0 =Release unused memory resources.
  350. true::predicate/0 =Succeed.
  351. tty_get_capability::predicate/3 =Get terminal parameter.
  352. tty_goto::predicate/2 =Goto position on screen.
  353. tty_put::predicate/2 =Write control string to terminal.
  354. ttyflush::predicate/0 =Flush output on terminal.
  355. union::predicate/3 =Union of two sets.
  356. unknown::predicate/2 =Trap undefined predicates.
  357. unload_foreign_library::predicate/1 =\lib{shlib} Detach shared library (.so file)`.
  358. unsetenv::predicate/1 =Delete shell environment variable.
  359. use_module::predicate/1 =Import a module.
  360. use_module::predicate/2 =Import predicates from a module.
  361. var::predicate/1 =Type check for unbound variable.
  362. visible::predicate/1 =Ports that are visible in the tracer.
  363. (volatile/1{fx 1150}) ::predicate/0 =Predicates that are not saved.
  364. wait_for_input::predicate/3 =Wait for input with optional timeout.
  365. wildcard_match::predicate/2 =Csh(1) style wildcard match.
  366. write::predicate/1 =Write term.
  367. write::predicate/2 =Write term to stream.
  368. write_ln::predicate/1 =Write term, followed by a newline.
  369. writef::predicate/1 =Formatted write.
  370. writef::predicate/2 =Formatted write on stream.
  371. writeq::predicate/1 =Write term, insert quotes.
  372. writeq::predicate/2 =Write term, insert quotes on stream.

    Predefined Arithmetic Functions

  373. (*) ::operator(yfx,400)=Multiplication.
  374. (**) ::operator(xfx,200)=Power function.
  375. (+) ::operator(yfx,500)=Addition.
  376. (-) ::operator( fx,500)=Unary minus.
  377. (-) ::operator(yfx,500)=Subtraction.
  378. (/) ::operator(yfx,400)=Division.
  379. (//) ::operator(yfx,400)=Integer division.
  380. (/\) ::operator(yfx,500)=Bitwise and.
  381. (<<) ::operator(yfx,400)=Bitwise left shift.
  382. (>>) ::operator(yfx,400)=Bitwise right shift.
  383. 'C'::predicate/1 =Character code.
  384. (\) ::operator( fx,500)=Bitwise negation.
  385. (\/) ::operator(yfx,500)=Bitwise or.
  386. (^) ::operator(xfy,200)=Power function.
  387. abs::predicate/1 =Absolute value.
  388. acos::predicate/1 =Inverse (arc) cosine.
  389. asin::predicate/1 =Inverse (arc) sine.
  390. atan::predicate/1 =Inverse (arc) tangent.
  391. atan::predicate/2 =Rectangular to polar conversion.
  392. ceil::predicate/1 =Smallest integer larger than arg.
  393. ceiling::predicate/1 =Smallest integer larger than arg.
  394. cos::predicate/1 =Cosine.
  395. cputime::predicate/0 =Get CPU time.
  396. e::predicate/0 =Mathematical constant.
  397. exp::predicate/1 =Exponent (base $e$).
  398. float::predicate/1 =Explicitely convert to float.
  399. float_fractional_part::predicate/1 =Fractional part of a float.
  400. float_integer_part::predicate/1 =Integer part of a float.
  401. floor::predicate/1 =Largest integer below argument.
  402. integer::predicate/1 =Round to nearest integer.
  403. log::predicate/1 =Natural logarithm.
  404. log10::predicate/1 =10 base logarithm`.
  405. max::predicate/2 =Maximum of two numbers.
  406. min::predicate/2 =Minimum of two numbers.
  407. mod::operator(xfx,300)=Remainder of division.
  408. random::predicate/1 =Generate random number.
  409. rem::predicate/2 =Remainder of division.
  410. round::predicate/1 =Round to nearest integer.
  411. truncate::predicate/1 =Truncate float to integer.
  412. pi::predicate/0 =Mathematical constant.
  413. sign::predicate/1 =Extract sign of value.
  414. sin::predicate/1 =Sine.
  415. sqrt::predicate/1 =Square root.
  416. tan::predicate/1 =Tangent.
  417. xor::operator(yfx,400)=Bitwise exclusive or.

    Predefined Operators

    An fx or prefix operator can be put in front of its single argument without using parenthses. An xf or postfix operator can be put after the argument. Infix operators are of three types xfx, yfx, and xfy depending on how they associate.

  418. ($) ::operator( fx, 1)=Bind toplevel variable.
  419. (^) ::operator(xfy, 200)= Predicate.
  420. (^) ::operator(xfy, 200)= Arithmetic function.
  421. (mod) ::operator(xfx, 300)=Arithmetic function.
  422. (*) ::operator(yfx, 400)=Arithmetic function.
  423. (/) ::operator(yfx, 400)=Arithmetic function.
  424. (//) ::operator(yfx, 400)=Arithmetic function.
  425. (<<) ::operator(yfx, 400)=Arithmetic function.
  426. (>>) ::operator(yfx, 400)=Arithmetic function.
  427. (xor) ::operator(yfx, 400)=Arithmetic function.
  428. (+) ::operator( fx, 500)=Arithmetic function.
  429. (-) ::operator( fx, 500)=Arithmetic function.
  430. (?) ::operator( fx, 500)=XPCE: obtainer.
  431. (\) ::operator( fx, 500)=Arithmetic function.
  432. (+) ::operator(yfx, 500)=Arithmetic function.
  433. (-) ::operator(yfx, 500)=Arithmetic function.
  434. (/\) ::operator(yfx, 500)=Arithmetic function.
  435. (\/) ::operator(yfx, 500)=Arithmetic function.
  436. (:) ::operator(xfy, 600)=module:term separator.
  437. (<) ::operator(xfx, 700)=Predicate.
  438. (=) ::operator(xfx, 700)=Predicate.
  439. (=..) ::operator(xfx, 700)=Predicate.
  440. (=:=) ::operator(xfx, 700)=Predicate.
  441. (=<) ::operator(xfx, 700)=Predicate.
  442. (==) ::operator(xfx, 700)=Predicate.
  443. (=@=) ::operator(xfx, 700)=Predicate.
  444. (=\=) ::operator(xfx, 700)=Predicate.
  445. (>) ::operator(xfx, 700)=Predicate.
  446. (>=) ::operator(xfx, 700)=Predicate.
  447. (@<) ::operator(xfx, 700)=Predicate.
  448. (@=<) ::operator(xfx, 700)=Predicate.
  449. (@>) ::operator(xfx, 700)=Predicate.
  450. (@>=) ::operator(xfx, 700)=Predicate.
  451. (is) ::operator(xfx, 700)=Predicate.
  452. (\=) ::operator(xfx, 700)=Predicate.
  453. (\==) ::operator(xfx, 700)=Predicate.
  454. (\=@=) ::operator(xfx, 700)=Predicate.
  455. (not) ::operator( fy, 900)=Predicate.
  456. (\+) ::operator( fy, 900)=Predicate.
  457. (,) ::operator(xfy,1000)=Predicate.
  458. (->) ::operator(xfy,1050)=Predicate.
  459. (;) ::operator(xfy,1100)=Predicate.
  460. (|) ::operator(xfy,1100)=Predicate.
  461. (discontiguous) ::operator( fx,1150)=Predicate.
  462. (dynamic) ::operator( fx,1150)=Predicate.
  463. (module_transparent) ::operator( fx,1150)=Predicate.
  464. (multifile) ::operator( fx,1150)=Predicate.
  465. (volatile) ::operator( fx,1150)=Predicate.
  466. (initialization) ::operator( fx,1150)=Predicate.
  467. (:-) ::operator( fx,1200)=Introduces a directive.
  468. (?-) ::operator( fx,1200)=Introduces a directive.
  469. (-->) ::operator(xfx,1200)=DCGrammar: rewrite.
  470. (:-) ::operator(xfx,1200)=head :- body. separator.

Labels and Definitions in Alphabetical Order

This was the work of Dick Botting at

Disclaimer: CSUSB may or may not agree with this message.

Copyright(1995): Copy the document in which the link appeared and use as you wish as long as you include the following as source, disclaimer, and copyright.
Also see my home page