JavaScript "core"

Admin User, created Apr 18. 2025
         
/**
* Modern Albufeira Prolog Interpreter
*
* Warranty & Liability
* To the extent permitted by applicable law and unless explicitly
* otherwise agreed upon, XLOG Technologies AG makes no warranties
* regarding the provided information. XLOG Technologies AG assumes
* no liability that any problems might be solved with the information
* provided by XLOG Technologies AG.
*
* Rights & License
* All industrial property rights regarding the information - copyright
* and patent rights in particular - are the sole property of XLOG
* Technologies AG. If the company was not the originator of some
* excerpts, XLOG Technologies AG has at least obtained the right to
* reproduce, change and translate the information.
*
* Reproduction is restricted to the whole unaltered document. Reproduction
* of the information is only allowed for non-commercial uses. Selling,
* giving away or letting of the execution of the library is prohibited.
* The library can be distributed as part of your applications and libraries
* for execution provided this comment remains unchanged.
*
* Restrictions
* Only to be distributed with programs that add significant and primary
* functionality to the library. Not to be distributed with additional
* software intended to replace any components of the library.
*
* Trademarks
* Jekejeke is a registered trademark of XLOG Technologies AG.
*/
/*********************************************************************/
/* Import Native API */
/*********************************************************************/
/* embedding native API */
import {Clause, add, Cache, make_defined, engine, set_stage,
clear, stage, is_provable, is_cache, set_partition
} from "./store.mjs";
import {
run, Goal, ctx, Context, VOID_ARGS, launch_async, launch,
task_async, callback
} from "./machine.mjs";
import {check_goal, check_clause
} from "./runtime.mjs";
/* engine native API */
import {call, cont, unify, make_error, fs, url,
bind, unbind, trail, check_nonvar, check_callable,
register_signal, register_interrupt, gc_enter, set_gc_enter
} from "./machine.mjs";
import {
check_atom, check_number, make_arithmetic, make_check,
check_integer, check_atomic
} from "./special.mjs";
/* term native API */
import {Variable, is_variable, Compound, is_compound
} from "./store.mjs";
import {
is_atom, is_number, is_integer, is_float, VAR_MASK_STATE,
copy_term, deref, exec_eval, exec_unify, exec_build
} from "./machine.mjs";
import {
objects_list, list_objects, set_to_list
} from "./special.mjs";
import {compare_term, equal_term
} from "./eval.mjs";
/* stream native API */
import {Source, Sink, stream_close, stream_flush,
check_source, check_sink, put_atom, codebase,
get_encoding, MASK_SRC_AREAD, map_stream_error,
bootbase, set_bootbase, set_codebase, file_read_promise
} from "./runtime.mjs";
/* theatre native API */
import {
post, perform, goto_async,
perform_async, FFI_FUNC, register
} from "./theatre.mjs";
/* specific native API */
import {
is_bigint, norm_smallint, norm_bigint, widen_bigint,
char_count, narrow_float, norm_float, make_special
} from "./special.mjs";
/* specific browser API */
import {
fiddle_out, fiddle_in_promise, html_send, html_alert,
set_cursor, set_caret, set_input
} from "./theatre.mjs";
/*********************************************************************/
/* Export Native API */
/*********************************************************************/
/* embedding native API */
export {add, Clause, run, check_goal, clear, set_partition,
Goal, Cache, make_defined, set_stage, VOID_ARGS,
Context, is_provable, is_cache, launch_async, launch,
task_async, callback}
/* engine native API */
export function get_cont() {
return call;
}
export function get_mark() {
return trail;
}
export function get_engine() {
return engine;
}
export function get_ctx() {
return ctx;
}
export function get_stage() {
return stage;
}
export function get_codebase() {
return codebase;
}
export function get_gc_enter() {
return gc_enter;
}
export function get_bootbase() {
return bootbase;
}
export {make_special, make_arithmetic, check_atomic, set_gc_enter,
make_check, cont, make_error, check_clause, register_interrupt,
check_nonvar, check_atom, fs, url, register_signal,
check_number, check_integer, check_callable}
/* term native API */
export {Variable, Compound, is_variable, is_compound,
is_atom, is_number, is_integer, is_float, unify,
equal_term, compare_term, bind, unbind, exec_unify,
deref, copy_term, exec_eval, exec_build, set_to_list,
objects_list, list_objects, VAR_MASK_STATE}
/* stream native API */
export {Source, Sink, stream_close, stream_flush,
check_source, check_sink, put_atom,
MASK_SRC_AREAD, get_encoding, map_stream_error,
set_bootbase, set_codebase, file_read_promise}
/* theatre native API */
export {post, perform, goto_async,
perform_async, FFI_FUNC, register}
/* specific native API */
export {is_bigint, norm_smallint, widen_bigint,
norm_bigint, narrow_float, norm_float, char_count}
/* specific browser API */
export {fiddle_out, fiddle_in_promise, html_send, html_alert,
set_cursor, set_caret, set_input}