projog
1. Getting Started
2. Prolog Concepts
    2.1. Prolog Terms, Clauses and Queries
    2.2. Unification of Prolog Terms
    2.3. Prolog List Data Structure
    2.4. Prolog Arithmetic Operators
    2.5. Prolog Term Comparison
    2.6. Input and Output
    2.7. Debugging Prolog Programs
3. Prolog Built-in Predicates
    3.1. Index of Built-in Predicates
 Predicates to explicitly specify when a goal succeeds of fails:
    3.2. fail - always fails.
    3.3. true - always succeeds.
 Predicates for classifying terms:
    3.4. char_type(X,Y) - classifies characters.
    3.5. atom(X) - checks that a term is an atom.
    3.6. atomic(X) - checks that a term is atomic.
    3.7. compound(X) - checks that a term is a compound term.
    3.8. float(X) - checks that a term is a floating point number.
    3.9. integer(X) - checks that a term is an integer.
    3.10. is_list(X) - checks that a term is a list.
    3.11. nonvar(X) - checks that a term is not an uninstantiated variable.
    3.12. number(X) - checks that a term is numeric.
    3.13. var(X) - checks that a term is an uninstantiated variable.
 Predicates to support constraint logic programming:
    3.14. pj_add_clp_expression(X,Y) - defines a Java class as an CLP expression.
    3.15. CLP predicates for comparing boolean values.
    3.16. all_different([X,Y,Z]) - enforce that none of the given CLP variables share the same value.
    3.17. X in 1..4 / [X,Y,Z] ins 1..4 - restrict CLP variables to a range of values.
    3.18. CLP predicates for comparing numeric values.
    3.19. label([X]) - assigns concrete values to the given CLP variables.
 Predicates for comparing terms, including specific predicates for comparing numeric values:
    3.20. between(X,Y,Z) - checks if a number is within a specified range.
    3.21. compare(X,Y,Z) - compares arguments.
    3.22. X=Y - an equality test.
    3.23. X is Y - evaluate arithmetic expression.
    3.24. X\==Y - a strict equality test.
    3.25. X \= Y - checks whether two terms cannot be unified.
    3.26. X=:=Y - numeric equality test.
    3.27. X>Y - numeric "greater than" test.
    3.28. X>=Y - numeric "greater than or equal" test.
    3.29. X=\=Y - numeric inequality test.
    3.30. X<Y - numeric "less than" test.
    3.31. X=<Y - numeric "less than or equal" test.
    3.32. predsort(X,Y,Z) - sorts a list using the specified predicate.
    3.33. X==Y - a strict equality test.
    3.34. X@>Y - term "greater than" test.
    3.35. X@>=Y - term "greater than or equal" test.
    3.36. X@<Y - term "less than" test.
    3.37. X@=<Y - term "less than or equal" test.
    3.38. unify_with_occurs_check(X, Y) - an equality test using sound unification.
 Predicates for the construction of compound/complex sentences:
    3.39. bagof(X,P,L) - find all solutions that satisfy the goal.
    3.40. call(X) - calls the goal represented by a term.
    3.41. X,Y - conjunction.
    3.42. X;Y - disjunction.
    3.43. findall(X,P,L) - find all solutions that satisfy the goal.
    3.44. X->Y - if X succeeds then Y is evaluated.
    3.45. limit(N, X) - calls the goal represented by a term a maximum number of times.
    3.46. \+ X - "not".
    3.47. once(X) - calls the goal represented by a term.
    3.48. setof(X,P,L) - find all solutions that satisfy the goal.
 Predicates for inspecting the structure of terms:
    3.49. arg(N,T,A) - allows access to an argument of a structure.
    3.50. atom_concat(X, Y, Z) - concatenates atom names.
    3.51. copy_term(X,Y) - makes a copy of a term.
    3.52. functor(T,F,N)
    3.53. numbervars(Term,Start,End) - unifies free variables of a term.
    3.54. atom_chars / atom_codes / number_chars / number_codes
    3.55. X=..L - "univ".
 Predicates to support working with the recorded database:
    3.56. erase(X) - removes a record from the recorded database.
    3.57. recorda(X,Y,Z) / recordz(X,Y,Z) - associates a term with a key.
    3.58. recorded(X,Y,Z) - checks if a term is associated with a key.
 Predicates to aid the debugging of Prolog programs:
    3.59. spy(X) / nospy(X) - add or remove a spy point for a predicate.
    3.60. debugging - lists current spy points.
    3.61. nodebug - removes all current spy points.
    3.62. notrace - disables exhaustive tracing.
    3.63. trace - enables exhaustive tracing.
 Predicates for affecting the flow of goal evaluation on backtracking:
    3.64. ! - the "cut".
    3.65. repeat - always succeeds.
    3.66. repeat(N) - succeeds N times.
    3.67. throw(X) - throws an exception with the given message.
 Predicates for system input and output with the file system:
    3.68. close(X) - closes a stream.
    3.69. current_input(X) - match a term to the current input stream.
    3.70. current_output(X) - match a term to the current output stream.
    3.71. get_char(X) - reads the next character from the input stream.
    3.72. get_code(X) - reads the next character from the input stream.
    3.73. nl - outputs a new line character.
    3.74. op(X,Y,Z)
    3.75. open(X,Y,Z) - opens a file.
    3.76. put_char(X) - writes a character.
    3.77. read(X) - reads a term from the input stream.
    3.78. see(X) - opens a file and sets it as the current input stream.
    3.79. seen - closes the current input stream.
    3.80. set_input(X) - sets the current input.
    3.81. set_output(X) - sets the current output.
    3.82. tab(X) - writes X number of spaces to the output stream.
    3.83. tell(X) - opens a file and sets it as the current output stream.
    3.84. told - closes the current output stream.
    3.85. write(X) - writes a term to the output stream.
    3.86. write_canonical(X) - writes a term to the output stream.
    3.87. writef(X,Y) - writes formatted text to the output stream.
 Predicates for inspecting, adding and retracting clauses:
    3.88. pj_add_arithmetic_operator(X,Y) - defines a Java class as an arithmetic operator.
    3.89. pj_add_predicate(X,Y) - defines a Java class as a built-in predicate.
    3.90. arithmetic_function(X) - defines a predicate as an arithmetic function.
    3.91. asserta(X) / assertz(X) - adds a clause to the knowledge base.
    3.92. consult(X) - reads clauses and goals from a file.
    3.93. Read clauses and goals from a list of files.
    3.94. current_predicate(X) - unifies with defined predicates.
    3.95. dynamic/1 - indicates that a user defined predicate is dynamic.
    3.96. ensure_loaded(X) - reads clauses and goals from a file.
    3.97. flag(X,Y,Z) - associates a key with a value.
    3.98. clause(X,Y) / retract(X) - matches terms to existing clauses.
    3.99. listing(X) - outputs current clauses.
    3.100. retractall(X) - remove clauses from the knowledge base.
 Predicates for working with list data structures:
    3.101. append(X,Y,Z) - concatenates two lists.
    3.102. append(ListOfLists, List) - concatenates a list of lists.
    3.103. atomic_list_concat(List,Separator,Atom) / atomic_list_concat(List,Atom)
    3.104. delete(X,Y,Z) - remove all occurrences of a term from a list.
    3.105. min_list / max_list
    3.106. flatten(X,Y) - flattens a nested list.
    3.107. foldl(PredicateName, Values, Start, Result) - combines elements of a list into a single term.
    3.108. keysort(X,Y) - sorts a list of key/value pairs.
    3.109. last(X,Y) - finds the last element of a list.
    3.110. length(X,Y) - determines the length of a list.
    3.111. maplist(X,Y) / maplist(X,Y,Z) - determines if a goal succeeds against elements of a list.
    3.112. member(E, L) - enumerates members of a list.
    3.113. memberchk(E, L) - checks is a term is a member of a list.
    3.114. nth0(X,Y,Z) / nth1(X,Y,Z) - examines an element of a list.
    3.115. pairs_keys(Pairs,Keys) / pairs_values(Pairs,Values) - get keys or values from list of Key-Value pairs.
    3.116. reverse(X,Y) - reverses the order of elements in a list.
    3.117. select(X,Y,Z) - removes an element from a list.
    3.118. msort(X,Y) - sorts a list.
    3.119. sort(X,Y) - sorts a list and removes duplicates.
    3.120. include(X,Y,Z) - filters a list by a goal.
    3.121. subset(X,Y) - checks if a set is a subset.
    3.122. subtract(X,Y,Z) - removes elements from a list.
 Predicates that provide reification functionality:
    3.123. dif(X,Y) - enforces restriction that the two given terms are never equal.
 Predicates to support working with dates and times:
    3.124. convert_time(X,Y) - converts a timestamp to a textual representation.
    3.125. get_time(X) - gets the current system time.
4. Prolog Arithmetic Operators
    4.1. abs - returns the absolute value of a numeric argument.
    4.2. + - performs addition.
    4.3. /\ - performs bitwise addition.
    4.4. \/ - bitwise 'or'.
    4.5. xor - bitwise 'exclusive or'.
    4.6. / - performs division.
    4.7. // - performs integer division.
    4.8. max - finds the maximum of two numbers.
    4.9. min - finds the minimum of two numbers.
    4.10. - - minus operator.
    4.11. mod - finds the remainder of division of one number by another.
    4.12. * - performs multiplication.
    4.13. ** - calculates the result of the first argument raised to the power of the second argument.
    4.14. random(X) Evaluate to a random integer i for which 0 =< i < X.
    4.15. rem - finds the remainder of division of one number by another.
    4.16. integer(X) - round X to the nearest integer value.
    4.17. << - left shift bits.
    4.18. >> - right shift bits.
    4.19. - - performs subtraction.
5. Prolog Examples
    5.1. Zebra Puzzle
    5.2. Multiple Choice Question
    5.3. Cryptarithmetic
    5.4. Eight Queens
    5.5. Full Adder
    5.6. Towers of Hanoi
6. Integrating Java and Prolog
    6.1. Using Prolog in Java Applications
    6.2. Adding Extra Functionality to Prolog Using Java
    6.3. Adding New Arithmetic Operators to Prolog
7. Projog Design
    7.1. Class Diagrams
    7.2. Design Decisions
    7.3. Testing Prolog