Next: Other Relations, Previous: Arithmetic, Up: Built-Ins [Contents][Index]
Returns the current time.
fun now() -> num
Returns the lapsed time in seconds since this qulog process was started
fun exec_time() -> num
Returns the time at which this qulog process was started
start_time: () -> num
Returns a random number in
[0,1)
.
fun random_num() -> num
Returns a random integer in the interval
[Lower, Upper]
.
fun random_int(int, int) -> num
Returns the union of sets
S1
andS2
.
fun union(set(T), set(T)) -> set(T)
Returns the intersection of sets
S1
andS2
.
fun inter(set(T), set(T)) -> set(T)
Returns the set difference of sets
S1
andS2
.
fun diff(set(T), set(T)) -> set(T)
Returns the concatination of lists
L1
andL2
.
fun list(T) <> list(T) -> list(T)
Returns the concatination of strings
S1
andS2
.
fun string ++ string -> string
Returns the length of the list, set, or string
L
.
fun #list(T) -> nat, #set(T) -> nat, #string -> nat
Returns the compound term obtained by applying
F
toArgs
.
fun (term @.. list(term)) -> term
Example:
| ?? X = a @.. [1,2]. X = a(1, 2) : term
@..
can also be used to split up a compound term as in the following example.| ?? a(1,2) =? F@..Args. F = a : atom Args = [1, 2] : list(nat)
Here
Name
is an atom that must have been initialised with a statement
int Name:=Integer
, e.g.int count:=0
or
num Name:=Number
, e.g.num savings:=678.50
in the program. It returns the current value associated with
Name
which can be updated by primitive actions (see :=).
Next: Other Relations, Previous: Arithmetic, Up: Built-Ins [Contents][Index]