next up previous contents index
Next: Input/Output Up: System Predicates Previous: Control

Meta Level

call(+X)

  Usual meta level call, behaving as if the predicate X appeared directly in the body of a rule or goal. Note that this form must be used - it is not permissible to simply put a variable in the body of a rule. Both static and dynamic code can be used with call. In this version, a cut inside a call is ignored. Also, printf/2 and dump/1 cannot be used inside call. Both these restrictions can be avoided by simply redefining them using a subsidiary rule.
not(+X)

  Unsafe negation. It is implemented using call/1, so it is also likely to be rather slow.

dump(+L1, ?L2, ?L3)

  Similar to dump/2 (see Section 3.5.2); the first argument L1 represents the target variables and the second argument L2 represents new variables. The difference with dump/2 is that (a) the projection is meta-coded (cf. Section 3.4), and (b) this projection is not output but rather constructed as the third argument L3 (cf. Section 3.5.2). Note that dump/3 does change the current collection of constraints.

once(+X)

  This is equivalent to call(X), ! and unfortunately right now it is implemented that way as well. Only the first answer to the query X is considered.

nonground(?X)

  True if X is not a ground term.

ground(?X)

  True if X is a ground term.

nonvar(?X)

  True if X is not a variable: i.e, it has been constructed or grounded.

var(?X)

  True if X is a variable. It may have been involved in an arithmetic constraint, but has not been grounded or constructed.

?X == ?Y

  True if X and Y are bound to exactly the same term. In particular, variables in equivalent positions must be identical. For example ?- X == Y fails while ?- X = Y, X == Y succeeds.

atom(?X)

  True if X is an atom -- that is, a functor constant (including the empty list).

atomic(?X)

  True if X is an atom or real number.

functor(?X)

  True if X is constructed with a functor.

real(?X)

  Enforces a constraint that X can take real values; it is equivalent to any tautologous arithmetic constraint involving X, eg: X + 0 = X.

arithmetic(?X)

  True if X is constrained to have a real value. Note that this is just a passive test, as opposed to real/1.

?T =.. ?L

  T is a term and L is the term expanded as a list. (Also known as univ/2). This predicate can be used to both decompose and construct terms. For its use either the first argument must be constructed (a nonvar), or the second argument must be a list of fixed length whose first element is a functor constant.

bsphackfloatpenalty -Mii floatpenalty-Miii parmoderrfloatpenalty@ nextcurrboxfreelist currbox-2floatpenalty@ fltovf currboxtempboxa tempboxa @floatesphackbsphackfloatpenalty -Mii floatpenalty-Miii parmoderrfloatpenalty@ nextcurrboxfreelist currbox-3floatpenalty@ fltovf currboxtempboxa tempboxa @floatesphack

functor(?T, ?F, ?A)

  T is a term, F and A are the name and arity of the principle functor of T. Either T must be constructed or F must be a functor constant (not a real number) and A must be a nonnegative integer.

arg(+N, +T, ?A)

  A is the N tex2html_wrap_inline4525 argument of term T. N must be a positive integer and T a compound term. If N is out of range the call fails. bsphackfloatpenalty -Mii floatpenalty-Miii parmoderrfloatpenalty@ nextcurrboxfreelist currbox-4floatpenalty@ fltovf currboxtempboxa tempboxa @floatesphack

occurs(-V,?T)

  V is a variable occurring in term T.

floor(+R, -I)

  R must be a real number, and I is the largest integer smaller than or equal to R.

dynamic(+P,+A)

  Declares the predicate P with arity A to be dynamic, so that rules can be added and deleted at will.


next up previous contents index
Next: Input/Output Up: System Predicates Previous: Control

Alan Borning
Fri Oct 8 12:51:18 PDT 1999