Copyright (1999-2008) EDMGROUP Pty Ltd - EZY Prolog Reference

List of predicates for group Prolog predicates

[This is preliminary specification and subject to change.]

List of all groups


Type

Predicate

Parameters

Flow pattern

Description

determ

=..

. (cmp(STRING ID,
TERML ),
list (ATOM ID,
LIST )

determ

arg

INTEGER N,
cmp (STRING FID,
TERML )

(i,i)

determ

bitand

INTEGER X,
INTEGER Z

(i,o)

Performs a bit-wise AND operation

determ

bitleft

INTEGER X,
INTEGER Z

(i,o)

Performs a bit-wise left shift

determ

bitnot

INTEGER X,
INTEGER Z

(i,o)

Performs a bit-wise NOT operation

determ

bitor

INTEGER X,
INTEGER Z

(i,o)

Performs a bit-wise OR (inclusive OR).

determ

bitright

INTEGER X,
INTEGER Z

(i,o)

Performs a bit-wise right shift

determ

bitxor

INTEGER X,
INTEGER Z

(i,o)

Performs a bit-wise XOR (exclusive OR)

determ

bound

TERM

(i)

Test whether a variable is bound to a value The bound predicate succeeds if Variable is bound. The bound is used to control flow patterns and the binding of reference variables.

determ

char_int

CHAR CharArg,
INTEGER IntArg

(i,o),(o,i),(i,i)

Convert between characters and their ASCII values

determ

comline

STRING RESULT

(o)

determ

concat

STRING A,
STRING B,
STRING C

(i,i,o),(o,i,i),(i,o,i),(i,i,i)

The concat works as if defined by the equation: LongString = String1 + String2

determ

consult

STRING FILENAME

(i)

Load prolog program from the file and compile it to memory

determ

date

INTEGER Y,
INTEGER M,
INTEGER D

(o,o,o)

Set the system date

determ

deletefile

STRING FILENAME

(i)

Delete file defined by FILENAME

determ

difftime

REAL LaterTimeMark,
REAL EarlierTimeMark,
REAL Difference

(i,i,o)

Return difference between the specified two time marks.

determ

existfile

STRING FILE

(i)

Check whether a file exists

determ

exit

INTEGER RC

(o)

Performs an exit with specified return code.

determ

fail

determ

file_str

STRING FILENAME,
STRING DATA

(i,i),(i,o)

Read or write a whole disk text file to or from a string

determ

filenameext

STRING FILENAME,
STRING NAME,
STRING EXT

(i,i,o),(i,o,o)

Get/Set name of the file extension

determ

filenamepath

STRING FILENAME,
STRING PATH,
STRING NAME

(o,i,i),(i,o,o)

Get/Set file name path

determ

filenamereduce

STRING FILENAME,
STRING BASEDIRECTORY,
STRING REDUCEDNAME

(i,i,o)

Return the reduced filename with the sub-path, if any, from the specified BaseDirectory Remarks FullFileName an input filename with a path. It is not required that the path should start with a device name; it can start from any subdirectory. BaseDirectory an input base directory name. Notice that the last backslash (doubled) character in a directory name can be omitted. educedFileName is the output argument. It returns the filename with the calculated relative sub-path from the BaseDirectory. Notice that filenamereduce is pure string handling predicate and it does not check the correctness of the specified file and path names In the simplest case, when filenamepath can unify all BaseDirectory with root of FullFileName, then it works according to the following formula: \tReducedFileName = FullFileName - BaseDirectory

determ

format

STRING RESULT,
STRING FORMAT_TEMPLATE,
TERML VARIABLES

(o,i,i)

determ

free

TERM

(o)

Check if variable is free.

determ

frontchar

STRING Inpstring,
STRING START,
STRING REST

(i,o,o),(i,i,o),(i,o,i),(i,i,i),(o,i,i)

Return the first character in a string Remarks The frontchar predicate operates as if it were defined by the equation: String = (the concatenation of FirstChar and RestString) The frontchar takes three arguments; the first is a string, the second is a char (the first character of the first string), and the third is the rest of the first string. The frontchar can be used to split a string up into a series of characters, or to create a string from a series of characters, and to test the characters within a string. If the argument String is bound to a zero-length string, the predicate fails.

determ

frontstr

INTEGER POSITION,
STRING Inpstring,
STRING START,
STRING REST

(i,i,o,o)

Split a string into two strings Remarks The frontstr splits SrcString into two parts. StartStr contains the first NumberOfChars characters from SrcString, and EndString contains the rest of SrcString.

determ

fronttoken

STRING IN,
STRING FRONT,
STRING REST

(i,o,o),(i,i,o),(i,o,i),(i,i,i),(o,i,i)

Separates the first token in a string Remarks The fronttoken operates as if it were defined by the equation: String =(the concatenation of Token and RestString)

determ

integer

TERM

(i)

determ

is

INTEGER X,
INTEGER Y

(i,i)

determ

marktime

NTEGER CentiSeconds,
REAL Ticket

(i,o)

Return time-stamp with expiration

determ

random

INTEGER MAX,
INTEGER RAND

(i,o)

Generate integer random numbers

determ

retract

TERM

(i)

Remove a Fact from the matched internal facts section. The retract/1 predicate deletes the first Fact in the facts section that matches the given Fact. During backtracking, the rest of the matching facts are deleted.

determ

retractall

TERM

(i)

Remove all matching facts from the matched internal facts section.

determ

save

TERM

(i)

determ

searchstring

STRING STR,
STRING SearchStr,
INTEGER POSITION

(i,i,o)

Locate a character sequence in a string Remarks The searchstring predicate returns the Position of the first occurrence of a substring SearchStr in another string SourceStr. The first character in SourceStr has position 1. The search is case sensitive.

determ

sleep

INTEGER SECONDS

(i)

Suspend execution

determ

storage

INTEGER STACK,
INTEGER HEAP,
INTEGER TRAIL

(o,o,o)

determ

str_int

STRING STR,
INTEGER RESULT

(i,o),(i,i),(o,i)

Convert between strings and integers

determ

str_len

STRING STR,
INTEGER RESULT

(i,o),(i,i),(i,i)

Correlate strings and their lengths Remarks (i, i) - Succeeds if String has Length characters, otherwise str_len(i, i) fails. (i, o) - Binds Length to the number of characters in String. (o, i) - Returns a string of Length spaces allocated on the global stack.

determ

substring

STRING INPUT,
INTEGER START,
INTEGER NBYTES,
STRING RESULT

(i,i,i,o)

Return part of string Remarks The first character in Source has position 1. It is an error to address outside the string, except that it is not an error to ask for 0 characters at the extreme end of it.

determ

syspath

STRING EXEPATH,
STRING PROGRAMNAME

(o,o)

Return home directory and name of program

determ

system

STRING COMMAND

(i)

Execute a new OS shell Sends CommandString to the OS for execution. If the string is empty(""), the OS shell is activated in interactive mode.

determ

term_str

STRING DOMAIN_NAME,
TERM TERM_VALUE,
STRING STR_VALUE

(i,i,o),(i,o,i)

Converts term into string and vice versa

determ

time

INTEGER HH,
INTEGER MM,
INTEGER SS,
INTEGER HHH

(o,o,o,o)

Read the system time

determ

timeout

REAL Ticket

(i)

Test time-stamp for expiration

determ

true

determ

upper_lower

STRING UPPER_CASE,
STRING LOW_CASE

(o,i),(i,o),(i,i)

Convert between upper and lower case characters Remarks The upper_lower predicate performs conversions between upper and lower case for either two strings or two characters. (i, o) - Binds LowerCase to the lower-case equivalent of UpperCase. (o, i) - Binds UpperCase to the upper-case equivalent of LowerCase. (i, i) - This flow version is different from the other two. It succeeds if the two strings would be equal if they both were either all upper case or all lower-case. In other words, upper_lower (i, i) provides a case-insensitive string comparison.


Copyright 1997-2013 EDMGROUP (Australia)