built in system functions More...
Go to the source code of this file.
Macros | |
#define | copyPsiTerm(a, b) (ptr_psi_term )memcpy(a,b,sizeof(psi_term)) |
Functions | |
long | c_trace () |
trace More... | |
long | c_tprove () |
c_tprove More... | |
static long | c_step () |
c_step More... | |
static long | c_verbose () |
c_verbose More... | |
static long | c_warning () |
c_warning More... | |
static long | c_maxint () |
c_maxint More... | |
long | c_quiet () |
c_quiet More... | |
static long | c_cputime () |
c_cputime More... | |
static long | c_realtime () |
c_realtime More... | |
static long | c_localtime () |
localtime More... | |
static long | c_statistics () |
c_statistics More... | |
static long | c_garbage () |
c_garbage More... | |
static long | c_getenv () |
c_getenv More... | |
static long | c_system () |
c_system More... | |
static long | c_encode () |
c_encode More... | |
void | setUnitList (GENERIC x) |
setUnitList(GENERIC x) More... | |
ptr_psi_term | unitListValue () |
make psi term from unitListElement More... | |
GENERIC | unitListNext () |
set unitListElement to NULL & return NULL More... | |
ptr_psi_term | intListValue (ptr_int_list p) |
ptr_psi_term intListValue More... | |
GENERIC | intListNext (ptr_int_list p) |
intListNext More... | |
ptr_psi_term | quotedStackCopy (psi_term p) |
ptr_psi_term | residListGoalQuote (ptr_residuation p) |
residListGoalQuote More... | |
GENERIC | residListNext (ptr_residuation p) |
residListNext More... | |
ptr_psi_term | makePsiTerm (ptr_definition x) |
ptr_psi_term makePsiTerm More... | |
ptr_psi_term | makePsiList (GENERIC head, ptr_psi_term(*valueFunc)(), GENERIC(*nextFunc)()) |
makePsiList More... | |
static long | c_residList () |
c_residList() More... | |
ptr_goal | makeGoal (ptr_psi_term p) |
makeGoal More... | |
static long | c_residuate () |
c_residuate More... | |
static long | c_mresiduate () |
c_mresiduate More... | |
void | insert_system_builtins () |
insert_system_builtins More... | |
Variables | |
static GENERIC | unitListElement |
built in system functions
Definition in file bi_sys.c.
#define copyPsiTerm | ( | a, | |
b | |||
) | (ptr_psi_term )memcpy(a,b,sizeof(psi_term)) |
|
static |
c_cputime
Return the cpu-time in seconds used by the Wild_Life interpreter.
Definition at line 207 of file bi_sys.c.
References wl_goal::aaaa_1, aim, wl_goal::bbbb_1, deref_args, deref_ptr, get_real_value(), life_end, life_start, REAL, set_empty, and unify_real_result().
|
static |
c_encode
Force type encoding. This need normally never be called by the user.
Definition at line 449 of file bi_sys.c.
References wl_goal::aaaa_1, aim, deref_args, encode_types(), set_empty, and TRUE.
|
static |
c_garbage
Force a call to the garbage collector.
Definition at line 343 of file bi_sys.c.
References wl_goal::aaaa_1, aim, deref_args, garbage(), set_empty, and TRUE.
|
static |
c_getenv
Get the value of an environment variable.
Definition at line 360 of file bi_sys.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, deref_ptr, Errorline(), FALSE, get_two_args(), heap_copy_string(), matches(), NULL, push_goal(), quoted_string, stack_psi_term(), TRUE, wl_psi_term::type, unify, and wl_psi_term::value_3.
|
static |
localtime
Return a psi-term containing the local time split up into year, month, day, hour, minute, second, and weekday. This is useful for building real-time applications such as clocks.
Definition at line 269 of file bi_sys.c.
References wl_goal::aaaa_1, aim, wl_goal::bbbb_1, day_attr, deref_args, deref_ptr, hour_attr, minute_attr, month_attr, NULL, push_goal(), second_attr, set_empty, stack_add_int_attr(), stack_psi_term(), timesym, TRUE, wl_psi_term::type, unify, weekday_attr, and year_attr.
|
static |
c_maxint
Return the integer of greatest magnitude that guarantees exact integer arithmetic.
Definition at line 157 of file bi_sys.c.
References wl_goal::aaaa_1, aim, wl_goal::bbbb_1, deref_args, deref_ptr, get_real_value(), REAL, set_empty, unify_real_result(), and WL_MAXINT.
|
static |
c_mresiduate
Multiple-variable residuation of a predicate. mresiduate(A,B) -> residuate goal B on a list of variables A, non_strict in both args. If any of the variables is bound the predicate is executed. The list must have finite length.
Definition at line 698 of file bi_sys.c.
References wl_goal::aaaa_1, aim, alist, wl_psi_term::attr_list, deref_args, deref_ptr, Errorline(), FALSE, get_two_args(), makeGoal(), nil, NULL, residuateGoalOnVar(), set_1_2, TRUE, and wl_psi_term::type.
long c_quiet | ( | ) |
c_quiet
Return the value of not(NOTQUIET).
Definition at line 186 of file bi_sys.c.
References wl_goal::aaaa_1, aim, wl_goal::bbbb_1, deref_args, deref_ptr, lf_false, lf_true, NOTQUIET, NULL, push_goal(), set_empty, stack_psi_term(), TRUE, wl_psi_term::type, and unify.
|
static |
c_realtime
Return the time in seconds since 00:00:00 GMT, January 1, 1970. This is useful for building real-time applications such as clocks.
Definition at line 236 of file bi_sys.c.
References wl_goal::aaaa_1, aim, wl_goal::bbbb_1, deref_args, deref_ptr, get_real_value(), REAL, set_empty, and unify_real_result().
|
static |
rlist(A) -> list all eval/prove goals residuated on variable 'A'.
Definition at line 612 of file bi_sys.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, get_one_arg(), makePsiList(), NULL, push_goal(), wl_psi_term::resid, resid_aim, residListGoalQuote(), residListNext(), set_1, TRUE, and unify.
|
static |
c_residuate
residuate(A,B) -> residuate goal B on variable A, non_strict in both args
Definition at line 664 of file bi_sys.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, deref_args, deref_ptr, Errorline(), FALSE, get_two_args(), makeGoal(), NULL, residuateGoalOnVar(), set_1_2, and TRUE.
|
static |
c_statistics
Print some information about Wild_Life: stack size, heap size, total memory.
Definition at line 306 of file bi_sys.c.
References wl_goal::aaaa_1, aim, deref_args, heap_pointer, mem_base, mem_limit, set_empty, stack_pointer, and TRUE.
|
static |
c_step
Toggle the single step flag & print a message saying whether single stepping mode is on or off.
Definition at line 98 of file bi_sys.c.
References wl_goal::aaaa_1, aim, deref_args, set_empty, toggle_step(), and TRUE.
|
static |
c_system
Pass a string to shell for execution. Return the value as the result.
Definition at line 400 of file bi_sys.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, Errorline(), FALSE, get_two_args(), matches(), quoted_string, REAL, set_1, TRUE, wl_psi_term::type, unify_real_result(), and wl_psi_term::value_3.
long c_tprove | ( | ) |
c_tprove
UNSURE
Definition at line 81 of file bi_sys.c.
References wl_goal::aaaa_1, aim, deref_args, set_empty, set_trace_to_prove(), and TRUE.
long c_trace | ( | ) |
trace
long c_trace() turn tracing on or off
Definition at line 30 of file bi_sys.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, deref_args, deref_ptr, Errorline(), FALSE, get_two_args(), is_top, lf_false, lf_true, set_empty, stepflag, toggle_trace(), trace, TRUE, wl_psi_term::type, and unify_bool_result().
|
static |
c_verbose
Toggle the verbose flag & print a message saying whether verbose mode is on or off.
Definition at line 115 of file bi_sys.c.
References wl_goal::aaaa_1, aim, deref_args, set_empty, TRUE, and verbose.
|
static |
c_warning
Toggle the warning flag & print a message saying whether warnings are printed or not. Default: print warnings. (Errors cannot be turned off.)
Definition at line 136 of file bi_sys.c.
References wl_goal::aaaa_1, aim, deref_args, infoline(), set_empty, TRUE, and warningflag.
void insert_system_builtins | ( | ) |
insert_system_builtins
Definition at line 746 of file bi_sys.c.
References bi_module, c_cputime(), c_encode(), c_garbage(), c_getenv(), c_localtime(), c_maxint(), c_mresiduate(), c_quiet(), c_realtime(), c_residList(), c_residuate(), c_statistics(), c_step(), c_system(), c_tprove(), c_trace(), c_verbose(), c_warning(), function_it, new_built_in(), and predicate_it.
GENERIC intListNext | ( | ptr_int_list | p | ) |
intListNext
p | - ptr_int_list p |
not sure purpose (DJD ???)
Definition at line 515 of file bi_sys.c.
References wl_int_list::next.
ptr_psi_term intListValue | ( | ptr_int_list | p | ) |
ptr_psi_term intListValue
p | - ptr_int_list p |
not sure purpose (DJD ???)
Definition at line 503 of file bi_sys.c.
References makePsiTerm(), and wl_int_list::value_1.
ptr_goal makeGoal | ( | ptr_psi_term | p | ) |
makeGoal
p | - ptr_psi_term p |
Definition at line 646 of file bi_sys.c.
References DEFRULES, goal_stack, wl_goal::next, NULL, prove, and push_goal().
ptr_psi_term makePsiList | ( | GENERIC | head, |
ptr_psi_term(*)() | valueFunc, | ||
GENERIC(*)() | nextFunc | ||
) |
makePsiList
head | - GENERIC head |
*valueFunc | - ptr_psi_term (*valueFunc)() |
nextFunc | - GENERIC (*nextFunc)() |
Definition at line 590 of file bi_sys.c.
References stack_cons(), and stack_nil().
ptr_psi_term makePsiTerm | ( | ptr_definition | x | ) |
ptr_psi_term makePsiTerm
x | - ptr_definition x |
Definition at line 573 of file bi_sys.c.
References stack_psi_term(), and wl_psi_term::type.
ptr_psi_term quotedStackCopy | ( | psi_term | p | ) |
Definition at line 528 of file bi_sys.c.
References mark_quote(), and stack_copy_psi_term().
ptr_psi_term residListGoalQuote | ( | ptr_residuation | p | ) |
residListGoalQuote
p | - ptr_residuation p |
Return a ptr to a psi-term marked as evaluated. The psi-term is a copy at the top level of the goal residuated on p, with the rest of the psi-term shared.
Definition at line 546 of file bi_sys.c.
References wl_goal::aaaa_1, copyPsiTerm, wl_residuation::goal, stack_psi_term(), and wl_psi_term::status.
GENERIC residListNext | ( | ptr_residuation | p | ) |
residListNext
p | - ptr_residuation p |
Definition at line 562 of file bi_sys.c.
References wl_residuation::next.
void setUnitList | ( | GENERIC | x | ) |
x | - GENERIC x what to set static unitListElement to (GENERIC) |
not sure purpose (DJD ???)
Definition at line 468 of file bi_sys.c.
References unitListElement.
GENERIC unitListNext | ( | ) |
set unitListElement to NULL & return NULL
not sure purpose (DJD ???)
Definition at line 490 of file bi_sys.c.
References NULL, and unitListElement.
ptr_psi_term unitListValue | ( | ) |
make psi term from unitListElement
not sure purpose (DJD ???)
Definition at line 479 of file bi_sys.c.
References makePsiTerm(), and unitListElement.