const MASK_PRED_PREHASH = 0x00000010;
const MASK_PRED_ARITH = 0x00000008;
const MASK_PRED_SPECIAL = 0x00000004;
const MASK_PRED_TEST = 0x00000002;
const MASK_PRED_DYNAMIC = 0x00000001;

const MASK_TOUCH_PREHASH = 0x00000004;
const MASK_TOUCH_BOTTOM = 0x00000002;
const MASK_TOUCH_DYNAMIC = 0x00000001;

const MASK_REMOVE_REVERSE = 0x00000001;

const VAR_MASK_SEEN = 0x40000000;
const VAR_MASK_EVEN = 0x20000000;
const VAR_MASK_ODD = 0x10000000;
const VAR_MASK_STATE = VAR_MASK_EVEN | VAR_MASK_ODD;
const VAR_MASK_BITS = 28;
const VAR_MASK_SERNO = (1 << VAR_MASK_BITS) - 1;

let kb = {};
let stage = -1;

const MAX_INDEX = 2;
const ROPE_LOW = 24;
const ROPE_HIGH = 40;

function set_stage(num) {
    stage = num;
}

function set_partition(path) {
    engine.partition = path;
}


const SYS_MASK_STATE_ASYNC = 0x00000080;

function Engine() {
    this.signal = undefined;
    this.abort = () => {};
    this.flags = SYS_MASK_STATE_ASYNC;
    this.text_output = undefined;
    this.text_error = undefined;
    this.text_input = undefined;
    this.low = 0;
    this.high = 0;
    this.serno = 0;
    this.backtrail = null;
    this.partition = (stage === -1 ? "system" : "user");
}

let engine = new Engine();

function set_engine(ptr) {
    engine = ptr;
}


function Variable() {
    this.instantiated = undefined;
    this.flags = VAR_MASK_SERNO;
    this.tail = null;
}

function is_variable(obj) {
    return obj instanceof Variable;
}

function variable_serno(alpha) {
    let val = alpha.flags & VAR_MASK_SERNO;
    if (val === VAR_MASK_SERNO) {
        if (engine.low < engine.high) {
            val = engine.low;
            engine.low = val + 1;
        } else {
            val = engine.serno;
            engine.serno = val + 1;
        }
        alpha.flags &= ~VAR_MASK_SERNO;
        alpha.flags |= val;
    }
    return val;
}

function Element(functor, args) {
    this.functor = functor;
    this.args = args;
}

function is_element(obj) {
    return obj instanceof Element;
}

class Structure extends Element {
    constructor(functor, args) {
        super(functor, args);
    }
}

function is_structure(obj) {
    return obj instanceof Structure;
}

class Compound extends Structure {
    constructor(functor, args) {
        super(functor, args);
        this.walk = 0;
    }
}

function is_compound(obj) {
    return obj instanceof Compound;
}


function Place(index) {
    this.index = index;
}

function is_place(obj) {
    return obj instanceof Place;
}

class Skeleton extends Element {
    constructor(functor, args) {
        super(functor, args);
    }
}

function is_skeleton(obj) {
    return obj instanceof Skeleton;
}


function deref(term) {
    while (is_variable(term) && term.instantiated !== undefined)
        term = term.instantiated;
    return term;
}

function copy_term(first) {
    let res;
    try {
        res = walk_copy(first);
    } finally {
        walk_uncopy(first);
    }
    return res;
}

function walk_copy(first) {
    let stack = null;
    for (; ; ) {
        first = deref(first);
        if (is_variable(first)) {
            if (first.tail === null) {
                let peek = new Variable();
                first.tail = peek;
                first = peek;
            } else {
                first = first.tail;
            }
        } else if (is_compound(first)) {
            if (!is_compound(first.functor)) {
                first.functor = new Compound(first.functor,
                    new Array(first.args.length));
                first.walk &= ~VAR_MASK_SERNO;
                stack = stack_push(stack, first);
                first = first.args[0];
                continue;
            } else {
                first = first.functor;
            }
        }
        let item = stack_peek(stack);
        while (item !== null &&
        (item.walk & VAR_MASK_SERNO) === item.args.length - 1) {
            item.functor.args[item.walk & VAR_MASK_SERNO] = first;
            first = item.functor;
            stack_pop(stack);
            item = stack_peek(stack);
        }
        if (item === null) {
            return first;
        } else {
            item.functor.args[item.walk & VAR_MASK_SERNO] = first;
            item.walk++;
            first = item.args[item.walk & VAR_MASK_SERNO];
        }
    }
}

function walk_uncopy(first) {
    let stack = null;
    for (; ; ) {
        first = deref(first);
        if (is_variable(first)) {
            if (first.tail !== null)
                first.tail = null;
        } else if (is_compound(first)) {
            if (is_compound(first.functor)) {
                first.functor = first.functor.functor;
                if (0 !== first.args.length - 1) {
                    first.walk &= ~VAR_MASK_SERNO;
                    stack = stack_push(stack, first);
                }
                first = first.args[0];
                continue;
            }
        }
        let item = stack_peek(stack);
        if (item === null) {
            return;
        } else {
            item.walk++;
            first = item.args[item.walk & VAR_MASK_SERNO];
            if ((item.walk & VAR_MASK_SERNO) === item.args.length - 1)
                stack_pop(stack);
        }
    }
}


function Item(first, second, idx) {
    this.first = first;
    this.second = second;
    this.idx = idx;
}


function stack_push(stack, elem) {
    if (stack === null)
        stack = new Array(0);
    stack.push(elem);
    return stack;
}

function stack_peek(stack) {
    if (stack === null)
        return null;
    if (stack.length === 0)
        return null;
    return stack[stack.length-1];
}

function stack_pop(stack) {
    stack.pop();
}


function Goal(size, body, cutvar) {
    this.size = size;
    this.body = body;
    this.cutvar = cutvar;
}

function is_goal(obj) {
    return obj instanceof Goal;
}

function Clause(size, functor, head, body, cutvar) {
    this.size = size;
    this.functor = functor;
    this.head = head;
    this.body = body;
    this.cutvar = cutvar;
    this.creator = undefined;
    this.remover = undefined;
    this.shard = "";
}

function is_clause(obj) {
    return obj instanceof Clause;
}

function Logical(cache, count, data) {
    this.cache = cache;
    this.count = count;
    this.data = data;
}

function is_logical(obj) {
    return obj instanceof Logical;
}

function Stick(rope, guards, maps) {
    this.rope = rope;
    this.guards = guards;
    this.maps = maps;
}

function is_stick(obj) {
    return obj instanceof Stick;
}

function index_value(temp, body, flags) {
    let j = 0;
    for (;;) {
        if (!is_place(temp)) {
            if ((flags & MASK_PRED_PREHASH) !== 0) {
                if (is_frozen(temp)) {
                    temp = temp.hash;
                } else if (!is_skeleton(temp)) {
                    temp = object_hash_code(temp);
                } else {
                    temp = undefined;
                }
            } else {
                if (is_element(temp))
                    temp = temp.functor;
            }
            break;
        }
        if (temp !== undefined &&
                (flags & MASK_PRED_DYNAMIC) === 0 &&
                j < body.length) {
            let peek = body[j];
            j++;
            if (is_element(peek) &&
                "=" === site_name(peek.functor) &&
                peek.args.length === 2) {
                if (temp === peek.args[0]) {
                    temp = peek.args[1];
                } else if (temp === peek.args[1]) {
                    temp = peek.args[0];
                }
                continue;
            } else if (is_element(peek) &&
                "nonvar" === site_name(peek.functor) &&
                peek.args.length === 1) {
                continue;
            }
        }
        temp = undefined;
        break;
    }
    return temp;
}

function site_name(obj) {
    if (is_cache(obj)) {
        return obj.name;
    } else {
        return obj;
    }
}


function Provable() {
    this.flags = 0;
    this.func = undefined;
    this.creator = stage;
    this.remover = undefined;
    this.overlay = undefined;
}

function is_provable(obj) {
    return obj instanceof Provable;
}

function Cache(name) {
    this.link = undefined;
    this.name = name;
}

function is_cache(obj) {
    return obj instanceof Cache;
}


function snapshot_peek(func) {
    if (is_stick(func)) {
        return snapshot_rope(func.rope);
    } else {
        return snapshot_rope(func);
    }
}

function snapshot_rope(rope) {
    let res = rope.cache;
    if (res === null) {
        res = new Array(rope.count);
        copy_rope(res, rope);
        rope.cache = res;
    }
    return res;
}

function copy_rope(res, rope) {
    if (Array.isArray(rope.data)) {
        let data = rope.data;
        let j = 0;
        for (let i = 0; i < data.length; i++) {
            let clause = data[i];
            if (clause.remover === undefined)
                res[j++] = clause;
        }
    } else {
        let data = rope.data;
        let j = 0;
        for (let clause of data) {
            if (clause.remover === undefined)
                res[j++] = clause;
        }
    }
}


function ensure_link(cache, arity) {
    let peek = cache.link;
    if (peek === undefined || peek.remover !== undefined) {
        peek = pred_link(cache.name, arity);
        cache.link = peek;
    }
    return peek;
}

function pred_link(functor, arity) {
    let temp = kb[functor];
    if (temp === undefined)
        return undefined;
    let peek = temp[arity];
    if (peek === undefined || peek.remover !== undefined)
        return undefined;
    return peek;
}

function resolve_link(functor, arity) {
    if (is_cache(functor)) {
        return ensure_link(functor, arity);
    } else if (is_atom(functor)) {
        return pred_link(functor, arity);
    } else if (is_provable(functor)) {
        return functor;
    } else {
        check_nonvar(functor);
        functor = copy_term(functor);
        throw make_error(new Compound("type_error",
            ["callable", functor]));
    }
}

function check_nonvar(beta) {
    if (is_variable(beta))
        throw make_error("instantiation_error");
}


function ensure_touch(cache, arity, flags) {
    let peek = cache.link;
    if (peek === undefined || peek.remover !== undefined) {
        peek = pred_touch(cache.name, arity, flags);
        cache.link = peek;
    }
    return peek;
}

function pred_touch(functor, arity, flags) {
    let temp = kb[functor];
    if (temp === undefined) {
        temp = new Array(0);
        kb[functor] = temp;
    }
    let peek = temp[arity];
    if (peek === undefined || peek.remover !== undefined) {
        let res = make_defined(VOID_ARGS);
        if (peek !== undefined)
            res.overlay = peek;
        if ((flags & MASK_TOUCH_DYNAMIC) !== 0)
            res.flags |= MASK_PRED_DYNAMIC;
        temp[arity] = res;
        peek = res;
    } else {
        if (!is_logical(peek.func) && !is_stick(peek.func))
            throw make_error(new Compound("permission_error",
                ["modify", "static_procedure",
                    make_indicator(functor, arity)]));
        if ((flags & MASK_TOUCH_DYNAMIC) !== 0)
            if ((peek.flags & MASK_PRED_DYNAMIC) === 0)
                throw make_error(new Compound("permission_error",
                    ["modify", "static_procedure",
                        make_indicator(functor, arity)]));
    }
    if ((flags & MASK_TOUCH_PREHASH) !== 0) {
        if ((peek.flags & MASK_PRED_PREHASH) === 0) {
            if (is_stick(peek.func))
                peek.func = peek.func.rope;
            peek.flags |= MASK_PRED_PREHASH;
        }
    }
    return peek;
}

function resolve_touch(functor, arity, flags) {
    if (is_cache(functor)) {
        return ensure_touch(functor, arity, flags);
    } else if (is_atom(functor)) {
        return pred_touch(functor, arity, flags);
    } else if (is_provable(functor)) {
        return functor;
    } else {
        check_nonvar(functor);
        functor = copy_term(functor);
        throw make_error(new Compound("type_error",
            ["callable", functor]));
    }
}


function make_defined(data) {
    let peek = new Provable();
    peek.func = new_rope();
    for (let i = 0; i < data.length; i++)
        add_peek(peek.func, 0, data[i], MASK_TOUCH_BOTTOM, peek.flags);
    return peek;
}

function new_rope() {
    return new Logical(null, 0, new Array(0));
}

function new_bouquet(rope, width) {
    let guards = new Array(width);
    let maps = new Array(width);
    return new Stick(rope, guards, maps);
}

function extend_bouquet(peek, j, offset, rope, flags) {
    peek.guards[j] = new_rope();
    peek.maps[j] = new Map();
    if (Array.isArray(rope.data)) {
        let data = rope.data;
        for (let i = 0; i < data.length; i++) {
            let clause = data[i];
            if (clause.remover === undefined)
                add_map(peek, j, offset, clause, MASK_TOUCH_BOTTOM, flags);
        }
    } else {
        let data = rope.data;
        for (let clause of data) {
            if (clause.remover === undefined)
                add_map(peek, j, offset, clause, MASK_TOUCH_BOTTOM, flags);
        }
    }
}


function defined_pred(peek, args) {
    let width = Math.min(MAX_INDEX, args.length);
    let offset = 0;
    let func = peek.func;
    let flags = peek.flags;
    let val = null;
    let k = 0;
    for (;;) {
        let rope;
        if (is_stick(func)) {
            rope = func.rope;
        } else {
            rope = func;
        }
        if (rope.count < 2)
            return rope;
        let i = 0;
        for (; i < width; i++) {
            let key = key_value(args[i+offset], flags);
            if (key === undefined)
                continue;
            if (!is_stick(func)) {
                func = new_bouquet(rope, width);
                if (is_stick(peek)) {
                    if (val === undefined) {
                        peek.guards[k] = func;
                    } else {
                        peek.maps[k].set(val, func);
                    }
                } else {
                    peek.func = func;
                }
            }
            peek = func;
            if (peek.maps[i] === undefined)
                extend_bouquet(peek, i, offset, rope, flags);
            if (peek.maps[i].size === 0)
                continue;
            func = peek.maps[i].get(key);
            if (func === undefined) {
                func = peek.guards[i];
                val = undefined;
            } else {
                val = key;
            }
            k = i;
            width = width-i-1;
            offset = i+offset+1;
            i = -1;
            break;
        }
        if (!(i < width))
            return rope;
    }
}

function key_value(term, flags) {
    term = deref(term);
    if (!is_variable(term)) {
        if ((flags & MASK_PRED_PREHASH) !== 0) {
            if (is_frozen(term)) {
                term = term.hash;
            } else if (!is_compound(term)) {
                term = object_hash_code(term);
            } else {
                term = undefined;
            }
        } else {
            if (is_structure(term))
                term = term.functor;
        }
    } else {
        term = undefined;
    }
    return term;
}



function pred_destroy(functor, arity) {
    let temp = kb[functor];
    if (temp === undefined)
        return;
    let peek = temp[arity];
    if (peek === undefined || peek.remover !== undefined)
        return;
    if (peek.creator === stage) {
        peek = clear_pop(peek);
        temp[arity] = peek;
        if (peek === undefined && trim_arities(temp))
            delete kb[functor];
    } else {
        peek.remover = stage;
    }
}

function clear_pop(peek) {
    peek.remover = stage;
    peek.func = undefined;

    let back = peek;
    peek = back.overlay;
    back.overlay = undefined;
    return peek;
}

function trim_arities(peek) {
    let pos = peek.length;
    while (pos > 0 && peek[pos - 1] === undefined)
        pos--;
    if (pos === 0)
        return true;
    if (pos !== peek.length)
        peek.splice(pos, peek.length - pos);
    return false;
}


function clear() {
    for (let functor in kb) {
        let temp = kb[functor];
        for (let i = 0; i < temp.length; i++) {
            let peek = temp[i];
            if (peek === undefined)
                continue;
            if (peek.creator === stage) {
                peek = clear_pop(peek);
                temp[i] = peek;
                if (peek === undefined)
                    continue;
            }
            if (peek.remover === stage)
                peek.remover = undefined;
            if (is_logical(peek.func) || is_stick(peek.func))
                rollback_peek(peek.func, true);
        }
        if (trim_arities(temp))
            delete kb[functor]
    }
}

function rollback_peek(peek, update) {
    if (is_stick(peek)) {
        if (!has_action(peek.rope))
            return;
        for (let i = 0; i < peek.maps.length; i++) {
            let temp = peek.maps[i];
            if (temp === undefined)
                continue;
            for (let [key, val] of temp) {
                rollback_peek(val, false);
                if (size_peek(val) === 0)
                    temp.delete(key);
            }
            rollback_peek(peek.guards[i], false);
        }
        rollback_rope(peek.rope, update);
    } else {
        if (!has_action(peek))
            return;
        rollback_rope(peek, update);
    }
}

function size_peek(func) {
    let rope;
    if (is_stick(func)) {
        rope = func.rope;
    } else {
        rope = func;
    }
    if (Array.isArray(rope.data)) {
        return rope.data.length;
    } else {
        return rope.data.size;
    }
}

function has_action(rope) {
    if (Array.isArray(rope.data)) {
        let data = rope.data;
        for (let i = 0; i < data.length; i++) {
            let clause = data[i];
            if (clause.creator === stage)
                return true;
            if (clause.remover === stage)
                return true;
        }
        return false;
    } else {
        let data = rope.data;
        for (let clause of data) {
            if (clause.creator === stage)
                return true;
            if (clause.remover === stage)
                return true;
        }
        return false;
    }
}

function rollback_rope(rope, update) {
    if (Array.isArray(rope.data)) {
        let data = rope.data;
        let j = 0;
        for (let i = 0; i < data.length; i++) {
            let clause = data[i];
            if (clause.creator === stage) {
                rope.count--;
            } else {
                if (clause.remover === stage) {
                    if (update)
                        clause.remover = undefined;
                    rope.count++;
                }
                data[j++] = clause;
            }
        }
        data.splice(j);
        rope.cache = null;
    } else {
        let data = rope.data;
        for (let clause of data) {
            if (clause.creator === stage) {
                rope.count--;
                data.delete(clause);
            } else {
                if (clause.remover === stage) {
                    if (update)
                        clause.remover = undefined;
                    rope.count++;
                }
            }
        }
        rope.cache = null;
    }
}


function set(functor, arity, pred) {
    let temp = kb[functor];
    if (temp === undefined) {
        temp = new Array(0);
        kb[functor] = temp;
    }
    let peek = temp[arity];
    if (peek === undefined || peek.remover !== undefined) {
        if (peek !== undefined)
            pred.overlay = peek;
        temp[arity] = pred;
    } else {
        throw make_error(new Compound("permission_error",
            ["coerce", "procedure", make_indicator(functor, arity)]));
    }
}


function add(clause) {
    add_clause(clause, MASK_TOUCH_BOTTOM);
}

function add_clause(clause, flags) {
    if (clause.remover !== undefined)
        throw make_error(new Compound("permission_error",
            ["modify", "static_procedure",
                make_indicator(clause.functor, clause.head.length)]));
    if (clause.creator !== undefined)
        return;
    let peek = resolve_touch(clause.functor, clause.head.length, flags);
    add_peek(peek.func, 0, clause, flags, peek.flags);
    clause.creator = stage;
    if ((flags & MASK_TOUCH_DYNAMIC) === 0)
        clause.shard = engine.partition;
}

function add_peek(peek, offset, clause, flags, flags2) {
    if (is_stick(peek)) {
        add_rope(peek.rope, clause, flags);
        for (let i = 0; i < peek.maps.length; i++)
            if (peek.maps[i] !== undefined)
                add_map(peek, i, offset, clause, flags, flags2);
    } else {
        add_rope(peek, clause, flags);
    }
}

function add_map(peek, i, offset, clause, flags, flags2) {
    let key = index_value(clause.head[i+offset], clause.body, flags2);
    let temp = peek.maps[i];
    if (key === undefined) {
        for (let [key, val] of temp)
            add_peek(val, i+offset+1, clause, flags, flags2);
        add_peek(peek.guards[i], i+offset+1, clause, flags, flags2);
    } else {
        let val = temp.get(key);
        if (val === undefined) {
            val = clone_peek(peek.guards[i]);
            temp.set(key, val);
        }
        add_peek(val, i+offset+1, clause, flags, flags2);
    }
}

function add_rope(rope, clause, flags) {
    if (Array.isArray(rope.data)) {
        let data = rope.data;
        if ((flags & MASK_TOUCH_BOTTOM) !== 0) {
            data.push(clause);
        } else {
            data.unshift(clause);
        }
        if (data.length >= ROPE_HIGH)
            rope.data = new Set(data);
        rope.count++;
        rope.cache = null;
    } else {
        let data = rope.data;
        if ((flags & MASK_TOUCH_BOTTOM) !== 0) {
            data.add(clause);
        } else {
            rope.data = new Set((function *() {yield clause; yield * data})());
        }
        rope.count++;
        rope.cache = null;
    }
}

function clone_peek(func) {
    let rope;
    if (is_stick(func)) {
        rope = func.rope;
    } else {
        rope = func;
    }
    if (Array.isArray(rope.data)) {
        return new Logical(rope.cache, rope.count, rope.data.slice());
    } else {
        return new Logical(rope.cache, rope.count, new Set(rope.data));
    }
}


function remove_clause(clause, flags) {
    if (clause.remover !== undefined)
        return false;
    if (clause.creator === undefined)
        return false;
    let peek = resolve_link(clause.functor, clause.head.length);
    if (peek === undefined)
        return false;
    if (!is_logical(peek.func) && !is_stick(peek.func))
        throw make_error(new Compound("permission_error",
            ["modify", "static_procedure",
                make_indicator(clause.functor, clause.head.length)]));
    remove_peek(peek.func, 0, clause, flags, peek.flags);
    if (clause.creator !== stage) {
        clause.remover = stage;
    } else {
        clause.creator = undefined;
    }
    return true;
}

function remove_peek(peek, offset, clause, flags, flags2) {
    if (is_stick(peek)) {
        remove_rope(peek.rope, clause, flags);
        for (let i = 0; i < peek.maps.length; i++) {
            let temp = peek.maps[i];
            if (temp === undefined)
                continue;
            let key = index_value(clause.head[i+offset], clause.body, flags2);
            if (key === undefined) {
                for (let [key, val] of temp) {
                    remove_peek(val, i+offset+1, clause, flags, flags2);
                    if (size_peek(val) === 0)
                        temp.delete(key);
                }
                remove_peek(peek.guards[i], i+offset+1, clause, flags, flags2);
            } else {
                let val = temp.get(key);
                remove_peek(val, i+offset+1, clause, flags, flags2);
                if (size_peek(val) === 0)
                    temp.delete(key);
            }
        }
    } else {
        remove_rope(peek, clause, flags);
    }
}

function remove_rope(rope, clause, flags) {
    if (Array.isArray(rope.data)) {
        let data = rope.data;
        let index;
        if ((flags & MASK_REMOVE_REVERSE) === 0) {
            index = data.indexOf(clause);
        } else {
            index = data.lastIndexOf(clause);
        }
        if (clause.creator === stage) {
            if (index === -1)
                throw new Error("rope corrupted");
            data.splice(index, 1);
        } else {
            if (index === -1)
                throw new Error("rope corrupted");
        }
        rope.count--;
        rope.cache = null;
    } else {
        let data = rope.data;
        if (clause.creator === stage) {
            if (!data.delete(clause))
                throw new Error("rope corrupted");
        } else {
            if (!data.has(clause))
                throw new Error("rope corrupted");
        }
        if (data.size < ROPE_LOW)
            rope.data = [...data];
        rope.count--;
        rope.cache = null;
    }

}


const VOID_ARGS = [];

let fs;
let url;
let path;
let os;
if (typeof window === 'undefined') {
    fs = await import("node:fs");
    url = await import("node:url");
    path = await import("node:path");
    os = await import("node:os");
} else {
    fs = undefined;
    url = undefined;
    path = undefined;
    os = undefined;
}

let trail = null;
let redo = null;
let call = "[]";

function make_error(beta) {
    return new Compound("error", [beta, fetch_stack(ctx)]);
}

function fetch_stack(buf) {
    let temp = pred_link("sys_including", 3);
    if (temp === undefined || (!is_logical(temp.func) &&
        !is_stick(temp.func)))
        return "[]";
    let data = snapshot_peek(temp.func);
    let back = null;
    let res = null;
    for (let i = 0; i < data.length; i++) {
        let clause = data[i];
        let display;
        if (clause.size !== 0) {
            display = new Array(clause.size);
        } else {
            display = null;
        }
        let elem = exec_frame(clause.functor, clause.head, display);
        if (elem.args[1] !== buf)
            continue;
        elem = fetch_frame(elem);
        elem = new Compound(".", [elem, undefined]);
        if (back === null) {
            res = elem;
        } else {
            back.args[1] = elem;
        }
        back = elem;
    }
    if (back === null) {
        res = "[]";
    } else {
        back.args[1] = "[]";
    }
    return res;
}

function exec_frame(functor, head, display) {
    if (head.length > 0) {
        temp_display = display;
        let args = new Array(head.length);
        for (let i = 0; i < args.length; i++)
            args[i] = exec_build(head[i]);
        temp_display = null;
        return new Compound(functor, args);
    } else {
        return functor;
    }
}

function fetch_frame(elem) {
    let file = elem.args[0];
    let k1 = file.lastIndexOf("/");
    let k2 = file.lastIndexOf("\\");
    let name = file.substring(Math.max(k1, k2) + 1);
    let stream = elem.args[2];
    return new Compound("frame",
        ["including", name, stream.lineno]);
}

function make_indicator(functor, arity) {
    if (is_cache(functor))
        functor = functor.name;
    return new Compound("/", [functor, arity]);
}


class Frozen extends Structure {
    constructor(functor, args) {
        super(functor, args);
        this.hash = object_hash_code(functor);
        for (let i = 0; i < args.length; i++) {
            let obj = args[i];
            if (is_frozen(obj)) {
                this.hash = this.hash * 31 + obj.hash;
            } else {
                this.hash = this.hash * 31 + object_hash_code(obj);
            }
        }
    }
}

function is_frozen(obj) {
    return obj instanceof Frozen;
}

function object_hash_code(alpha) {
    if (is_atom(alpha)) {
        let res = 0;
        for (let i = 0; i < alpha.length; i++)
            res = (res * 31 + alpha.charCodeAt(i)) | 0;
        return res;
    } else if (is_number(alpha)) {
        if (is_integer(alpha)) {
            if (!is_bigint(alpha)) {
                return alpha;
            } else {
                let sign;
                if (alpha < 0) {
                    sign = -1;
                    alpha = -alpha;
                } else {
                    sign = 1;
                }
                alpha = alpha.toString(16);
                let res = 0;
                let i = alpha.length % 8;
                if (i > 0)
                    res = parseInt(alpha.substring(0, i), 16) | 0;
                for (; i < alpha.length; i += 8)
                    res = (res * 31 + parseInt(alpha.substring(i, i + 8), 16)) | 0;
                return (sign > 0 ? res : -res);
            }
        } else {
            let beta = new Float64Array(1);
            beta[0] = Number(alpha);
            let gamma = new Int32Array(beta.buffer);
            return gamma[0] ^ gamma[1];
        }
    } else if (alpha === null) {
        return 0;
    } else if (alpha === true) {
        return 1231;
    } else if (alpha === false) {
        return 1237;
    } else {
        return 2467;
    }
}


let gc_maxinfs = 128000;

let gc_mask = VAR_MASK_ODD;

let gc_last = 0.0;
let gc_time = 0.0;
let gc_enter = 0;
let gc_tick = gc_maxinfs;
let gc_tack = 60*gc_maxinfs;
let gc_tock = 3600*gc_maxinfs;

function real_time() {
    if (fs !== undefined) {
        return (Number(process.hrtime.bigint()) / 1000000.0);
    } else {
        return performance.now();
    }
}


function gc_major() {
    gc_time -= real_time();
    gc_mask ^= VAR_MASK_STATE;
    engine.low = 0;
    engine.high = engine.serno;
    engine.serno = 0;
    mark_redo();
    adjust_redo();
    sweep_trail(null);
    gc_time += real_time();
}

function mark_term(first) {
    let stack = null;
    for (;;) {
        if (is_variable(first)) {
            if ((first.flags & VAR_MASK_STATE) !== gc_mask) {
                first.flags = (first.flags & ~VAR_MASK_STATE) | gc_mask;
                let val = first.flags & VAR_MASK_SERNO;
                if (val !== VAR_MASK_SERNO) {
                    if (val > engine.serno)
                        engine.serno = val + 1;
                    if (engine.low <= val && val < engine.high) {
                        if (val - engine.low > engine.high - val) {
                            engine.high = val;
                        } else {
                            engine.low = val + 1;
                        }
                    }
                }
                if (first.instantiated !== undefined) {
                    let peek = first.instantiated;
                    first.instantiated = stack;
                    stack = first;
                    first = peek;
                    continue;
                }
            }
        } else if (is_compound(first)) {
            if ((first.walk & VAR_MASK_STATE) !== gc_mask) {
                first.walk = (first.walk & ~VAR_MASK_STATE) | gc_mask;
                let peek = first.args[0];
                first.args[0] = stack;
                first.walk &= ~VAR_MASK_SERNO;
                stack = first;
                first = peek;
                continue;
            }
        }
        while (stack !== null && (is_variable(stack) ||
            (stack.walk & VAR_MASK_SERNO) === stack.args.length - 1)) {
            if (is_variable(stack)) {
                let peek = stack.instantiated;
                stack.instantiated = first;
                first = stack;
                stack = peek;
            } else {
                let peek = stack.args[stack.walk & VAR_MASK_SERNO];
                stack.args[stack.walk & VAR_MASK_SERNO] = first;
                first = stack;
                stack = peek;
            }
        }
        if (stack === null) {
            return;
        } else {
            let peek = stack.args[stack.walk & VAR_MASK_SERNO];
            stack.args[stack.walk & VAR_MASK_SERNO] = first;
            stack.walk++;
            first = stack.args[stack.walk & VAR_MASK_SERNO];
            stack.args[stack.walk & VAR_MASK_SERNO] = peek;
        }
    }
}

function mark_redo() {
    let term = call;
    let last = redo;
    for (;;) {
        mark_term(term);
        if (last === null)
            break;
        term = last.cont;
        last = last.tail;
    }
}


function gc_minor() {
    gc_time -= real_time();
    mark2_redo();
    mark2_trail(engine.backtrail);
    adjust_redo();
    sweep_trail(engine.backtrail);
    let gc_now = real_time();
    gc_time += gc_now;
    let val = gc_now - gc_last;
    gc_last = gc_now;
    val = (gc_maxinfs * 1000) / val;
    gc_maxinfs = Math.round((3 * gc_maxinfs + val) / 4);
}

function mark2_term(first) {
    let stack = null;
    for (;;) {
        if (is_variable(first)) {
            if ((first.flags & VAR_MASK_STATE) !== gc_mask) {
                first.flags = (first.flags & ~VAR_MASK_STATE) | gc_mask;
                if (first.instantiated !== undefined) {
                    let peek = first.instantiated;
                    first.instantiated = stack;
                    stack = first;
                    first = peek;
                    continue;
                }
            }
        } else if (is_compound(first)) {
            if ((first.walk & VAR_MASK_STATE) !== gc_mask) {
                first.walk = (first.walk & ~VAR_MASK_STATE) | gc_mask;
                let peek = first.args[0];
                first.args[0] = stack;
                first.walk &= ~VAR_MASK_SERNO;
                stack = first;
                first = peek;
                continue;
            }
        }
        while (stack !== null && (is_variable(stack) ||
            (stack.walk & VAR_MASK_SERNO) === stack.args.length - 1)) {
            if (is_variable(stack)) {
                let peek = stack.instantiated;
                stack.instantiated = first;
                first = stack;
                stack = peek;
            } else {
                let peek = stack.args[stack.walk & VAR_MASK_SERNO];
                stack.args[stack.walk & VAR_MASK_SERNO] = first;
                first = stack;
                stack = peek;
            }
        }
        if (stack === null) {
            return;
        } else {
            let peek = stack.args[stack.walk & VAR_MASK_SERNO];
            stack.args[stack.walk & VAR_MASK_SERNO] = first;
            stack.walk++;
            first = stack.args[stack.walk & VAR_MASK_SERNO];
            stack.args[stack.walk & VAR_MASK_SERNO] = peek;
        }
    }
}

function mark2_redo() {
    let term = call;
    let last = redo;
    for (;;) {
        mark2_term(term);
        if (last === null)
            break;
        term = last.cont;
        last = last.tail;
    }
}


function adjust_redo() {
    let last = redo;
    while (last !== null) {
        let temp = last.mark;
        while (temp !== null) {
            if ((temp.flags & VAR_MASK_STATE) === gc_mask) {
                break;
            } else {
                temp = temp.tail;
            }
        }
        last.mark = temp;
        last = last.tail;
    }
}

function mark2_trail(stop) {
    let temp = trail;
    while (temp !== stop) {
        if ((temp.flags & VAR_MASK_STATE) === VAR_MASK_STATE)
            mark2_term(temp);
        temp = temp.tail;
    }
}

function sweep_trail(stop) {
    let temp = trail;
    let back = null;
    while (temp !== stop) {
        let term = temp;
        temp = term.tail;
        if ((term.flags & VAR_MASK_STATE) === gc_mask) {
            if (back !== null) {
                back.tail = term;
            } else {
                trail = term;
            }
            back = term;
        } else {
            term.instantiated = undefined;
            term.tail = null;
        }
    }
    if (back !== null) {
        back.tail = stop;
    } else {
        trail = stop;
    }
    engine.backtrail = trail;
}


function solve_signal(rope,at,choice) {
    if (engine.signal !== undefined) {
        let message = engine.signal;
        engine.signal = undefined;
        throw make_error(message);
    }
    return true;
}


const SYS_MASK_ASYNC_MODE = 0x00000001;
const SYS_MASK_ALLOW_YIELD = 0x00000008;
const SYS_MASK_FULL_ASYNC = SYS_MASK_ASYNC_MODE |
    SYS_MASK_ALLOW_YIELD;

function cont(term) {
    call = term;
}

function solve(snap, found) {
    for (; ;) {
        if (found === true) {
            if (gc_enter >= gc_tick) {
                if (gc_enter >= gc_tock) {
                    gc_major();
                    gc_tock += 3600*gc_maxinfs;
                } else if (gc_enter >= gc_tack) {
                    gc_minor();
                    gc_tack += 60*gc_maxinfs;
                }
                gc_tick += gc_maxinfs;
                if ((engine.flags & SYS_MASK_ASYNC_MODE) !== 0) {
                    more(new Choice(solve_signal, null, 0, trail));
                    return immediate_promise();
                }
            }
            let goal = call;
            if (is_structure(goal)) {
                gc_enter++;
                goal = goal.args[0];
                let peek = lookup_pred(goal);
                if (peek === undefined || (peek.flags & MASK_PRED_ARITH) !== 0)
                    throw make_error(new Compound("existence_error",
                        ["procedure", make_indicator_term(goal)]));
                if (is_structure(goal)) {
                    goal = goal.args;
                } else {
                    goal = VOID_ARGS;
                }
                if ((peek.flags & MASK_PRED_TEST) !== 0) {
                    if (!peek.func(goal)) {
                        found = false;
                    } else {
                        cont(call.args[1]);
                        found = true;
                    }
                } else if ((peek.flags & MASK_PRED_SPECIAL) !== 0) {
                    found = peek.func(goal);
                } else {
                    peek = defined_pred(peek, goal);
                    found = solve2_rope(goal, snapshot_rope(peek), 0, null);
                }
            } else {
                break;
            }
        } else if (found === false) {
            if (redo !== snap) {
                let choice = redo;
                redo = choice.tail;
                unbind(choice.mark);
                call = choice.cont;
                found = choice.func(choice.data, choice.at, choice);
            } else {
                break;
            }
        } else {
            break;
        }
    }
    return found;
}

function immediate_promise() {
    return new Promise(resolve => setDelay(resolve, 0));
}


function lookup_pred(goal) {
    let functor;
    let arity;
    if (is_element(goal)) {
        functor = goal.functor;
        arity = goal.args.length;
    } else {
        functor = goal;
        arity = 0;
    }
    return resolve_link(functor, arity);
}

function lookup_eval(expr) {
    let functor;
    let arity;
    if (is_element(expr)) {
        functor = expr.functor;
        arity = expr.args.length;
    } else {
        functor = expr;
        arity = 0;
    }
    return resolve_link(functor, arity + 1);
}

function make_indicator_term(goal) {
    let functor;
    let arity;
    if (is_structure(goal)) {
        functor = goal.functor;
        arity = goal.args.length;
    } else {
        functor = goal;
        arity = 0;
    }
    return make_indicator(functor, arity);
}

function solve_rope(rope, at, choice) {
    let goal = deref(call.args[0]);
    if (is_structure(goal)) {
        goal = goal.args;
    } else {
        goal = VOID_ARGS;
    }
    return solve2_rope(goal, rope, at, choice);
}

function solve2_rope(paras, rope,at,choice) {
    let mark = trail;
    while (at < rope.length) {
        let clause = rope[at++];
        let display;
        if (clause.size !== 0) {
            display = new Array(clause.size);
        } else {
            display = null;
        }
        if (exec_head(clause.head, display, paras)) {
            let peek = clause.cutvar;
            if (peek !== -1)
                display[peek] = redo;
            if (at < rope.length) {
                if (choice === null) {
                    choice = new Choice(solve_rope, rope, at, mark);
                } else {
                    choice.at = at;
                }
                more(choice);
                if (exec_check(clause.body, display))
                    return true;
                if (redo !== choice)
                    return false;
                more(choice.tail);
            } else {
                return exec_check(clause.body, display);
            }
        }
        unbind(mark);
    }
    return false;
}

function more(choice) {
    redo = choice;
}

function Choice(func, data, at, mark) {
    this.func = func;
    this.data = data;
    this.at = at;
    this.mark = mark;
    this.cont = call;
    this.tail = redo;
}


let CTX_MAIN = "main";

function run(goal) {
    if (!launch(goal, CTX_MAIN, VOID_ARGS))
        throw make_error(new Compound("syntax_error", ["directive_failed"]));
}

function snap_setup() {
    redo = new Choice(solve_setup, null, 0, trail);
    return redo;
}

function solve_setup(rope,at,choice) {
    return false;
}

function snap_cleanup(snap) {
    more(snap.tail);
    unbind(snap.mark);
    call = snap.cont;
}


function is_atom(obj) {
    return typeof obj === "string";
}

function is_number(obj) {
    if (typeof obj === "number")
        return true;
    if (typeof obj === "bigint")
        return true;
    return false;
}

function is_integer(obj) {
    if (typeof obj === "number" &&
        Number.isInteger(obj) &&
        ((-94906266 <= obj) && (obj <= 94906266)))
        return true;
    if (typeof obj === "bigint" &&
        !((-94906266 <= obj) && (obj <= 94906266)))
        return true;
    return false;
}

function is_float(obj) {
    if (typeof obj === "number" &&
        (!Number.isInteger(obj) ||
            !((-94906266 <= obj) && (obj <= 94906266))))
        return true;
    if (typeof obj === "bigint" &&
        ((-94906266 <= obj) && (obj <= 94906266)))
        return true;
    return false;
}

function is_bigint(alpha) {
    return typeof alpha === "bigint";
}

function is_special(alpha) {
    return (typeof alpha === "number" &&
                !Number.isFinite(alpha));
}


let temp_display = null;

function set_temp_display(display) {
    temp_display = display;
}

function is_pending(template) {
    if (template === undefined) {
        return true;
    } else if (is_place(template)) {
        return true;
    } else {
        return false;
    }
}

function exec_deref(template) {
    if (template === undefined) {
        return template;
    } else if (is_place(template)) {
        let index = template.index;
        let peek = temp_display[index];
        if (peek === undefined) {
            return template;
        } else {
            return deref(peek);
        }
    } else {
        return deref(template);
    }
}


function exec_build(template) {
    let back = null;
    for (; ;) {
        if (template === undefined) {
            template = new Variable();
            break;
        } else if (is_place(template)) {
            let index = template.index;
            template = temp_display[index];
            if (template === undefined) {
                template = new Variable();
                temp_display[index] = template;
            } else {
                template = deref(template);
            }
            break;
        } else if (is_skeleton(template)) {
            let args = new Array(template.args.length);
            args[args.length - 1] = back;
            back = new Compound(template.functor, args);
            template = template.args;
            let i = 0;
            for (; i < args.length - 1; i++)
                args[i] = exec_build(template[i]);
            template = template[i];
        } else {
            template = deref(template);
            break;
        }
    }
    while (back !== null) {
        let peek = back.args[back.args.length - 1];
        back.args[back.args.length - 1] = template;
        template = back;
        back = peek;
    }
    return template;
}

function exec_unify(template, alpha) {
    for (; ;) {
        if (template === undefined) {
            return true;
        } else if (is_place(template)) {
            let index = template.index;
            template = temp_display[index];
            if (template === undefined) {
                temp_display[index] = deref(alpha);
                return true;
            } else {
                return unify(alpha, template);
            }
        } else if (is_skeleton(template)) {
            alpha = deref(alpha);
            if (is_variable(alpha)) {
                let args = new Array(template.args.length);
                bind(new Compound(template.functor, args), alpha);
                template = template.args;
                for (let i = 0; i < args.length; i++)
                    args[i] = exec_build(template[i]);
                return true;
            } else if (is_structure(alpha)) {
                if (template.args.length !== alpha.args.length)
                    return false;
                if (template.functor !== alpha.functor)
                    return false;
                template = template.args;
                alpha = alpha.args;
                let i = 0;
                for (; i < template.length - 1; i++)
                    if (!exec_unify(template[i], alpha[i]))
                        return false;
                template = template[i];
                alpha = alpha[i];
            } else {
                return false;
            }
        } else {
            return unify(template, alpha);
        }
    }
}


function exec_body(code, display) {
    temp_display = display;
    let back = null;
    let res = null;
    for (let i = 0; i < code.length; i++) {
        let goal = exec_build(code[i]);
        let temp = new Compound(".", [goal, undefined]);
        if (back === null) {
            res = temp;
        } else {
            back.args[1] = temp;
        }
        back = temp;
    }
    if (back === null) {
        res = "[]";
    } else {
        back.args[1] = "[]";
    }
    temp_display = null;
    return res;
}

function exec_head(code, display, aux) {
    if (aux.length !== code.length)
        return false;
    temp_display = display;
    for (let i = 0; i < code.length; i++) {
        if (!exec_unify(code[i], aux[i])) {
            temp_display = null;
            return false;
        }
    }
    temp_display = null;
    return true;
}


function exec_eval(template) {
    if (template === undefined) {
        throw make_error("instantiation_error");
    } else if (is_place(template)) {
        let index = template.index;
        template = temp_display[index];
        if (template === undefined)
            throw make_error("instantiation_error");
    }
    template = deref(template);
    if (is_number(template))
        return template;
    let peek = lookup_eval(template);
    if (peek === undefined || (peek.flags & MASK_PRED_ARITH) === 0)
        throw make_error(new Compound("type_error",
            ["evaluable", make_indicator_term(template)]));
    if (is_element(template)) {
        template = template.args;
    } else {
        template = VOID_ARGS;
    }
    return peek.func(template);
}

function exec_test(template) {
    let peek = lookup_pred(template);
    if (peek === undefined || (peek.flags & MASK_PRED_TEST) === 0) {
        return exec_build(template);
    } else {
        if (is_element(template)) {
            template = template.args;
        } else {
            template = VOID_ARGS;
        }
        gc_enter++;
        return peek.func(template);
    }
}

function exec_check(code, display) {
    temp_display = display;
    let check = true;
    let back = null;
    let res = null;
    for (let i = 0; i < code.length; i++) {
        let goal = (check ? exec_test(code[i]) : exec_build(code[i]));
        if (true === goal)
            continue;
        if (false === goal) {
            temp_display = null;
            return false;
        }
        goal = new Compound(".", [goal, undefined]);
        if (back === null) {
            res = goal;
        } else {
            back.args[1] = goal;
        }
        back = goal;
        check = false;
    }
    if (back === null) {
        res = call.args[1];
    } else {
        back.args[1] = call.args[1];
    }
    temp_display = null;
    cont(res);
    return true;
}


function unify(first, second) {
    let stack = null;
    let log = null;
    try {
        for (; ;) {
            first = deref(first);
            second = deref(second);
            if (is_variable(first)) {
                if (!is_variable(second) || first !== second)
                    bind(second, first);
            } else if (is_variable(second)) {
                bind(first, second);
            } else if (!is_structure(first)) {
                if (!Object.is(first, second))
                    break;
            } else if (!is_structure(second)) {
                break;
            } else if (first.args.length !== second.args.length) {
                break;
            } else {
                first = union_find(first);
                second = union_find(second);
                if (first !== second) {
                    if (is_frozen(first) && is_frozen(second) &&
                        first.hash !== second.hash)
                        break;
                    if (first.functor !== second.functor)
                        break;
                    log = union_add(log, first, second);
                    if (0 !== first.args.length - 1) {
                        let item2 = new Item(first, second, 0);
                        stack = stack_push(stack, item2);
                    }
                    first = first.args[0];
                    second = second.args[0];
                    continue;
                }
            }
            let item = stack_peek(stack);
            if (item === null) {
                return true;
            } else {
                item.idx++;
                first = item.first.args[item.idx];
                second = item.second.args[item.idx];
                if (item.idx === item.first.args.length - 1)
                    stack_pop(stack);
            }
        }
        return false;
    } finally {
        union_undo(log);
    }
}

function union_find(obj) {
    while (is_structure(obj.functor))
        obj = obj.functor;
    return obj;
}

function union_add(log, from, to) {
    from.functor = to;
    if (log === null)
        log = new Array(0);
    log.push(from);
    return log;
}

function union_undo(log) {
    if (log === null)
        return;
    for (let i = log.length - 1; i >= 0; i--) {
        let elem = log[i];
        elem.functor = elem.functor.functor;
    }
}

function bind(source, term) {
    term.instantiated = source;
    term.tail = trail;
    if ((term.flags & VAR_MASK_STATE) === gc_mask)
        term.flags |= VAR_MASK_STATE;
    trail = term;
}

function unbind(mark) {
    while (mark !== trail) {
        let term = trail;
        if (engine.backtrail === term)
            engine.backtrail = term.tail;
        trail = term.tail;
        term.instantiated = undefined;
        term.tail = null;
    }
}


let tasks = new Array(0);

let notify = () => {};

function Context() {
    this.trail = null;
    this.redo = null;
    this.call = "[]";
    this.gc_mask = VAR_MASK_ODD;
    this.engine = new Engine();
    this.engine.text_output = engine.text_output;
    this.engine.text_error = engine.text_error;
    this.engine.text_input = engine.text_input;
    tasks.push(this);
}

function ctx_ended(buf) {
    let k = tasks.lastIndexOf(buf);
    if (k !== -1)
        tasks.splice(k, 1);
    notify();
}


function group_teardown() {
    for (let i = 0; i < tasks.length; i++) {
        let buf = tasks[i];
        let msg = new Compound("system_error", ["user_exit"]);
        register_signal(buf, msg);
        invoke_interrupt(buf);
    }
}

async function group_gather_async() {
    while (tasks.length > 0) {
        solve_signal(null, 0, null);
        let prom = wait_promise(CTX_MAIN);
        await prom;
    }
    solve_signal(null, 0, null);

}

function wait_promise(buf) {
    return new Promise(resolve => {
        function handler() {
            notify = () => {};
            register_interrupt(buf, () => {});
            resolve();
        }
        notify = handler;
        register_interrupt(buf, () => {
            notify = () => {};
            register_interrupt(buf, () => {});
            resolve();
        });
    });
}


let ctx = CTX_MAIN;

function ctx_set(buf) {
    ctx = buf;
}

function ctx_switch(buf) {
    let temp = trail;
    trail = buf.trail;
    buf.trail = temp;
    temp = redo;
    redo = buf.redo;
    buf.redo = temp;
    temp = call;
    call = buf.call;
    buf.call = temp;
    temp = gc_mask;
    gc_mask = buf.gc_mask;
    buf.gc_mask = temp;
    temp = engine;
    set_engine(buf.engine);
    buf.engine = temp;
}


function launch(form, buf, paras) {
    if (buf !== CTX_MAIN) {
        ctx_set(buf);
        ctx_switch(buf);
    }
    let back = engine.flags & SYS_MASK_FULL_ASYNC;
    engine.flags &= ~SYS_MASK_FULL_ASYNC;
    let snap = snap_setup();
    if (is_clause(form)) {
        call = melt_clause(form, paras);
    } else if (is_goal(form)) {
        call = melt_directive(form);
    } else {
        call = form;
    }
    let found;
    try {
        found = solve(snap, true);
    } finally {
        snap_cleanup(snap);
        engine.flags &= ~SYS_MASK_FULL_ASYNC;
        engine.flags |= back;
        if (buf !== CTX_MAIN) {
            ctx_switch(buf);
            ctx_set(CTX_MAIN);
        }
    }
    return found;
}

function callback(form, buf, paras) {
    try {
        return launch(form, buf, paras);
    } catch (err) {
        return false;
    }
}

function melt_directive(goal) {
    let display;
    if (goal.size !== 0) {
        display = new Array(goal.size);
    } else {
        display = null;
    }
    let peek = goal.cutvar;
    if (peek !== -1)
        display[peek] = redo;
    return exec_body(goal.body, display);
}

function melt_clause(clause, paras) {
    let display;
    if (clause.size !== 0) {
        display = new Array(clause.size);
    } else {
        display = null;
    }
    if (exec_head(clause.head, display, paras)) {
        let peek = clause.cutvar;
        if (peek !== -1)
            display[peek] = redo;
        return exec_body(clause.body, display);
    } else {
        return "[]";
    }
}


async function launch_async(form, buf, paras) {
    gc_last += real_time();
    if (buf !== CTX_MAIN) {
        ctx_set(buf);
        ctx_switch(buf);
    }
    let back = engine.flags & SYS_MASK_FULL_ASYNC;
    engine.flags |= SYS_MASK_FULL_ASYNC;
    let found = true;
    let snap = snap_setup();
    if (is_clause(form)) {
        call = melt_clause(form, paras);
    } else if (is_goal(form)) {
        call = melt_directive(form);
    } else {
        call = form;
    }
    try {
        for (;;) {
            found = solve(snap, found);
            if (found === false) {
                break;
            } else if (found !== true) {
                if (buf !== CTX_MAIN) {
                    ctx_switch(buf);
                    ctx_set(CTX_MAIN);
                }
                gc_last -= real_time();
                await found;
                gc_last += real_time();
                if (buf !== CTX_MAIN) {
                    ctx_set(buf);
                    ctx_switch(buf);
                }
                found = false;
            } else {
                break;
            }
        }
    } finally {
        snap_cleanup(snap);
        engine.flags &= ~SYS_MASK_FULL_ASYNC;
        engine.flags |= back;
        if (buf !== CTX_MAIN) {
            ctx_switch(buf);
            ctx_set(CTX_MAIN);
            ctx_ended(buf);
        }
    }
    gc_last -= real_time();
    return found;
}

async function task_async(form, buf, paras) {
    try {
        await launch_async(form, buf, paras);
    } catch (err) {
        /* */
    }
}

function setDelay(proc, delay) {
    if (delay === 0 && fs !== undefined) {
        return setImmediate(proc);
    } else {
        return setTimeout(proc, delay);
    }
}

function register_interrupt(buf, func) {
    let en = determine_engine(buf);
    en.abort = func;
}

function register_signal(buf, msg) {
    let en = determine_engine(buf);
    en.signal = msg;
}

function invoke_interrupt(buf) {
    let en = determine_engine(buf);
    en.abort();
}

function determine_engine(buf) {
    if (buf !== CTX_MAIN) {
        if (buf !== ctx) {
            return buf.engine;
        } else {
            return engine;
        }
    } else {
        if (ctx !== CTX_MAIN) {
            return ctx.engine;
        } else {
            return engine;
        }
    }
}

const pool = [[15, 15, 15, 15, 15, 15, 15, 15],
    [12, 24, 24, 24, 26, 24, 24, 24],
    [21, 22, 24, 25, 24, 20, 24, 24],
    [41, 73, 105, 137, 169, 201, 233, 265],
    [297, 329, 24, 24, 25, 25, 25, 24],
    [24, 353, 385, 417, 449, 481, 513, 545],
    [577, 609, 641, 673, 705, 737, 769, 801],
    [833, 865, 897, 929, 961, 993, 1025, 1057],
    [1089, 1121, 1153, 21, 24, 22, 27, 23],
    [27, 354, 386, 418, 450, 482, 514, 546],
    [578, 610, 642, 674, 706, 738, 770, 802],
    [834, 866, 898, 930, 962, 994, 1026, 1058],
    [1090, 1122, 1154, 21, 25, 22, 25, 15],
    [12, 24, 26, 26, 26, 26, 28, 24],
    [27, 28, 5, 29, 25, 16, 28, 27],
    [28, 25, 11, 11, 27, 2, 24, 24],
    [27, 11, 5, 30, 11, 11, 11, 24],
    [1, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 1, 1, 1, 25],
    [1, 1, 1, 1, 1, 1, 1, 2],
    [2, 2, 2, 2, 2, 2, 2, 2],
    [2, 2, 2, 2, 2, 2, 2, 25],
    [1, 2, 1, 2, 1, 2, 1, 2],
    [2, 1, 2, 1, 2, 1, 2, 1],
    [2, 2, 1, 2, 1, 2, 1, 2],
    [1, 1, 2, 1, 2, 1, 2, 2],
    [2, 1, 1, 2, 1, 2, 1, 1],
    [2, 1, 1, 1, 2, 2, 1, 1],
    [1, 1, 2, 1, 1, 2, 1, 1],
    [1, 2, 2, 2, 1, 1, 2, 1],
    [1, 2, 1, 2, 1, 2, 1, 1],
    [2, 1, 2, 2, 1, 2, 1, 1],
    [2, 1, 1, 1, 2, 1, 2, 1],
    [1, 2, 2, 5, 1, 2, 2, 2],
    [5, 5, 5, 5, 1, 3, 2, 1],
    [3, 2, 1, 3, 2, 1, 2, 1],
    [2, 1, 2, 1, 2, 2, 1, 2],
    [2, 1, 3, 2, 1, 2, 1, 1],
    [1, 2, 1, 2, 2, 2, 2, 2],
    [2, 2, 1, 1, 2, 1, 1, 2],
    [2, 1, 2, 1, 1, 1, 1, 2],
    [2, 2, 2, 2, 5, 5, 2, 2],
    [4, 4, 4, 4, 4, 4, 4, 4],
    [4, 4, 27, 27, 27, 27, 4, 4],
    [4, 4, 27, 27, 27, 27, 27, 27],
    [27, 27, 27, 27, 27, 27, 27, 27],
    [4, 4, 4, 4, 4, 27, 27, 27],
    [27, 27, 27, 27, 4, 27, 4, 27],
    [6, 6, 6, 6, 6, 6, 6, 6],
    [1, 2, 1, 2, 4, 27, 1, 2],
    [0, 0, 4, 2, 2, 2, 24, 1],
    [0, 0, 0, 0, 27, 27, 1, 24],
    [1, 1, 1, 0, 1, 0, 1, 1],
    [2, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 0, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 2, 2, 2, 2],
    [2, 2, 2, 2, 2, 2, 2, 1],
    [2, 2, 1, 1, 1, 2, 2, 2],
    [2, 2, 2, 2, 1, 2, 25, 1],
    [2, 1, 1, 2, 2, 1, 1, 1],
    [1, 2, 28, 6, 6, 6, 6, 6],
    [7, 7, 1, 2, 1, 2, 1, 2],
    [1, 1, 2, 1, 2, 1, 2, 1],
    [2, 1, 2, 1, 2, 1, 2, 2],
    [0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 1, 1, 1, 0],
    [0, 4, 24, 24, 24, 24, 24, 24],
    [2, 24, 20, 0, 0, 28, 28, 26],
    [0, 6, 6, 6, 6, 6, 6, 6],
    [6, 6, 6, 6, 6, 6, 20, 6],
    [24, 6, 6, 24, 6, 6, 24, 6],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [5, 5, 5, 5, 5, 5, 5, 5],
    [5, 5, 5, 0, 0, 0, 0, 5],
    [5, 5, 5, 24, 24, 0, 0, 0],
    [16, 16, 16, 16, 16, 16, 25, 25],
    [25, 24, 24, 26, 24, 24, 28, 28],
    [6, 6, 6, 24, 16, 24, 24, 24],
    [4, 5, 5, 5, 5, 5, 5, 5],
    [5, 5, 5, 6, 6, 6, 6, 6],
    [297, 329, 24, 24, 24, 24, 5, 5],
    [6, 5, 5, 5, 5, 5, 5, 5],
    [5, 5, 5, 5, 24, 5, 6, 6],
    [6, 6, 6, 6, 6, 16, 28, 6],
    [6, 6, 6, 6, 6, 4, 4, 6],
    [6, 28, 6, 6, 6, 6, 5, 5],
    [297, 329, 5, 5, 5, 28, 28, 5],
    [24, 24, 24, 24, 24, 24, 24, 24],
    [24, 24, 24, 24, 24, 24, 0, 16],
    [5, 6, 5, 5, 5, 5, 5, 5],
    [6, 6, 6, 0, 0, 5, 5, 5],
    [5, 5, 5, 5, 5, 5, 6, 6],
    [6, 5, 0, 0, 0, 0, 0, 0],
    [297, 329, 5, 5, 5, 5, 5, 5],
    [6, 6, 6, 6, 4, 4, 28, 24],
    [24, 24, 4, 0, 0, 6, 26, 26],
    [6, 6, 4, 6, 6, 6, 6, 6],
    [6, 6, 6, 6, 4, 6, 6, 6],
    [4, 6, 6, 6, 6, 6, 0, 0],
    [24, 24, 24, 24, 24, 24, 24, 0],
    [5, 6, 6, 6, 0, 0, 24, 0],
    [5, 5, 5, 0, 0, 0, 0, 0],
    [27, 5, 5, 5, 5, 5, 5, 5],
    [16, 16, 0, 0, 0, 0, 0, 6],
    [5, 4, 6, 6, 6, 6, 6, 6],
    [6, 6, 16, 6, 6, 6, 6, 6],
    [6, 6, 6, 8, 5, 5, 5, 5],
    [5, 5, 6, 8, 6, 5, 8, 8],
    [8, 6, 6, 6, 6, 6, 6, 6],
    [6, 8, 8, 8, 8, 6, 8, 8],
    [5, 6, 6, 6, 6, 6, 6, 6],
    [5, 5, 6, 6, 24, 24, 41, 73],
    [105, 137, 169, 201, 233, 265, 297, 329],
    [24, 4, 5, 5, 5, 5, 5, 5],
    [5, 6, 8, 8, 0, 5, 5, 5],
    [5, 5, 5, 5, 5, 0, 0, 5],
    [5, 0, 0, 5, 5, 5, 5, 5],
    [5, 0, 5, 5, 5, 5, 5, 5],
    [5, 0, 5, 0, 0, 0, 5, 5],
    [5, 5, 0, 0, 6, 5, 8, 8],
    [8, 6, 6, 6, 6, 0, 0, 8],
    [8, 0, 0, 8, 8, 6, 5, 0],
    [0, 0, 0, 0, 0, 0, 0, 8],
    [0, 0, 0, 0, 5, 5, 0, 5],
    [5, 5, 6, 6, 0, 0, 41, 73],
    [5, 5, 26, 26, 11, 11, 11, 11],
    [11, 11, 28, 26, 5, 24, 6, 0],
    [0, 6, 6, 8, 0, 5, 5, 5],
    [5, 0, 5, 5, 0, 5, 5, 0],
    [5, 5, 0, 0, 6, 0, 8, 8],
    [8, 6, 6, 0, 0, 0, 0, 6],
    [6, 0, 0, 6, 6, 6, 0, 0],
    [0, 6, 0, 0, 0, 0, 0, 0],
    [0, 5, 5, 5, 5, 0, 5, 0],
    [0, 0, 0, 0, 0, 0, 41, 73],
    [6, 6, 5, 5, 5, 6, 24, 0],
    [5, 5, 5, 5, 5, 5, 0, 5],
    [5, 5, 0, 5, 5, 5, 5, 5],
    [5, 0, 5, 5, 0, 5, 5, 5],
    [8, 6, 6, 6, 6, 6, 0, 6],
    [6, 8, 0, 8, 8, 6, 0, 0],
    [5, 0, 0, 0, 0, 0, 0, 0],
    [24, 26, 0, 0, 0, 0, 0, 0],
    [0, 5, 6, 6, 6, 6, 6, 6],
    [0, 6, 8, 8, 0, 5, 5, 5],
    [5, 5, 0, 0, 6, 5, 8, 6],
    [8, 0, 0, 8, 8, 6, 0, 0],
    [0, 0, 0, 0, 0, 6, 6, 8],
    [28, 5, 11, 11, 11, 11, 11, 11],
    [0, 0, 6, 5, 0, 5, 5, 5],
    [5, 5, 5, 0, 0, 0, 5, 5],
    [5, 0, 5, 5, 5, 5, 0, 0],
    [0, 5, 5, 0, 5, 0, 5, 5],
    [0, 0, 0, 5, 5, 0, 0, 0],
    [5, 5, 0, 0, 0, 0, 8, 8],
    [6, 8, 8, 0, 0, 0, 8, 8],
    [8, 0, 8, 8, 8, 6, 0, 0],
    [5, 0, 0, 0, 0, 0, 0, 8],
    [11, 11, 11, 28, 28, 28, 28, 28],
    [28, 26, 28, 0, 0, 0, 0, 0],
    [6, 8, 8, 8, 6, 5, 5, 5],
    [5, 5, 5, 5, 5, 0, 5, 5],
    [5, 5, 0, 0, 6, 5, 6, 6],
    [6, 8, 8, 8, 8, 0, 6, 6],
    [6, 0, 6, 6, 6, 6, 0, 0],
    [0, 0, 0, 0, 0, 6, 6, 0],
    [5, 5, 5, 0, 5, 5, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 24],
    [11, 11, 11, 11, 11, 11, 11, 28],
    [5, 6, 8, 8, 24, 5, 5, 5],
    [5, 5, 5, 5, 0, 5, 5, 5],
    [8, 8, 8, 8, 8, 0, 6, 8],
    [8, 0, 8, 8, 6, 6, 0, 0],
    [0, 0, 0, 0, 0, 8, 8, 0],
    [0, 0, 0, 0, 5, 5, 5, 0],
    [0, 5, 5, 8, 0, 0, 0, 0],
    [6, 6, 8, 8, 5, 5, 5, 5],
    [5, 5, 5, 6, 6, 5, 8, 8],
    [8, 6, 6, 6, 6, 0, 8, 8],
    [8, 0, 8, 8, 8, 6, 5, 28],
    [0, 0, 0, 0, 5, 5, 5, 8],
    [11, 11, 11, 11, 11, 11, 11, 5],
    [11, 11, 11, 11, 11, 11, 11, 11],
    [11, 28, 5, 5, 5, 5, 5, 5],
    [5, 5, 5, 5, 5, 5, 5, 0],
    [0, 0, 5, 5, 5, 5, 5, 5],
    [5, 5, 5, 5, 0, 5, 0, 0],
    [0, 0, 6, 0, 0, 0, 0, 8],
    [8, 8, 6, 6, 6, 0, 6, 0],
    [8, 8, 8, 8, 8, 8, 8, 8],
    [0, 0, 8, 8, 24, 0, 0, 0],
    [0, 5, 5, 5, 5, 5, 5, 5],
    [5, 6, 5, 5, 6, 6, 6, 6],
    [6, 6, 6, 0, 0, 0, 0, 26],
    [5, 5, 5, 5, 5, 5, 4, 6],
    [6, 6, 6, 6, 6, 6, 6, 24],
    [297, 329, 24, 24, 0, 0, 0, 0],
    [5, 5, 5, 0, 5, 5, 5, 5],
    [5, 5, 5, 5, 0, 5, 0, 5],
    [6, 6, 6, 6, 6, 5, 0, 0],
    [5, 5, 5, 5, 5, 0, 4, 0],
    [6, 6, 6, 6, 6, 6, 6, 0],
    [297, 329, 0, 0, 5, 5, 5, 5],
    [5, 28, 28, 28, 24, 24, 24, 24],
    [24, 24, 24, 28, 24, 28, 28, 28],
    [6, 6, 28, 28, 28, 28, 28, 28],
    [297, 329, 11, 11, 11, 11, 11, 11],
    [11, 11, 11, 11, 28, 6, 28, 6],
    [28, 6, 21, 22, 21, 22, 8, 8],
    [5, 5, 5, 5, 5, 0, 0, 0],
    [6, 6, 6, 6, 6, 6, 6, 8],
    [6, 6, 6, 6, 6, 24, 6, 6],
    [5, 5, 5, 5, 5, 6, 6, 6],
    [6, 6, 6, 6, 6, 0, 28, 28],
    [28, 28, 28, 28, 28, 28, 6, 28],
    [28, 28, 28, 28, 28, 0, 28, 28],
    [24, 24, 24, 24, 24, 28, 28, 28],
    [28, 24, 24, 0, 0, 0, 0, 0],
    [5, 5, 5, 8, 8, 6, 6, 6],
    [6, 8, 6, 6, 6, 6, 6, 6],
    [8, 6, 6, 8, 8, 6, 6, 5],
    [297, 329, 24, 24, 24, 24, 24, 24],
    [5, 5, 5, 5, 5, 5, 8, 8],
    [6, 6, 5, 5, 5, 5, 6, 6],
    [6, 5, 8, 8, 8, 5, 5, 8],
    [8, 8, 8, 8, 8, 8, 5, 5],
    [5, 6, 6, 6, 6, 5, 5, 5],
    [5, 5, 6, 8, 8, 6, 6, 8],
    [8, 8, 8, 8, 8, 6, 5, 8],
    [297, 329, 8, 8, 8, 6, 28, 28],
    [1, 1, 1, 1, 1, 1, 0, 1],
    [0, 0, 0, 0, 0, 1, 0, 0],
    [2, 2, 2, 24, 4, 2, 2, 2],
    [5, 5, 5, 0, 0, 6, 6, 6],
    [24, 11, 11, 11, 11, 11, 11, 11],
    [11, 11, 11, 11, 11, 0, 0, 0],
    [28, 28, 28, 28, 28, 28, 28, 28],
    [28, 28, 0, 0, 0, 0, 0, 0],
    [1, 1, 1, 1, 1, 1, 0, 0],
    [2, 2, 2, 2, 2, 2, 0, 0],
    [20, 5, 5, 5, 5, 5, 5, 5],
    [5, 5, 5, 5, 5, 28, 24, 5],
    [12, 5, 5, 5, 5, 5, 5, 5],
    [5, 5, 5, 21, 22, 0, 0, 0],
    [5, 5, 5, 24, 24, 24, 10, 10],
    [10, 5, 5, 5, 5, 5, 5, 5],
    [5, 5, 6, 6, 6, 8, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 5],
    [5, 5, 6, 6, 8, 24, 24, 0],
    [5, 5, 6, 6, 0, 0, 0, 0],
    [5, 0, 6, 6, 0, 0, 0, 0],
    [5, 5, 5, 5, 6, 6, 8, 6],
    [6, 6, 6, 6, 6, 6, 8, 8],
    [8, 8, 8, 8, 8, 8, 6, 8],
    [6, 6, 6, 6, 24, 24, 24, 4],
    [24, 24, 24, 26, 5, 6, 0, 0],
    [297, 329, 0, 0, 0, 0, 0, 0],
    [11, 11, 0, 0, 0, 0, 0, 0],
    [24, 24, 24, 24, 24, 24, 20, 24],
    [24, 24, 24, 6, 6, 6, 16, 6],
    [5, 5, 5, 4, 5, 5, 5, 5],
    [5, 5, 5, 5, 5, 6, 6, 5],
    [5, 6, 5, 0, 0, 0, 0, 0],
    [5, 5, 5, 5, 5, 5, 0, 0],
    [6, 6, 6, 8, 8, 8, 8, 6],
    [6, 8, 8, 8, 0, 0, 0, 0],
    [8, 8, 6, 8, 8, 8, 8, 8],
    [8, 6, 6, 6, 0, 0, 0, 0],
    [28, 0, 0, 0, 24, 24, 41, 73],
    [5, 5, 5, 5, 0, 0, 0, 0],
    [5, 5, 0, 0, 0, 0, 0, 0],
    [297, 329, 11, 0, 0, 0, 28, 28],
    [5, 5, 5, 5, 5, 5, 5, 6],
    [6, 8, 8, 6, 0, 0, 24, 24],
    [5, 5, 5, 5, 5, 8, 6, 8],
    [6, 8, 6, 8, 8, 6, 6, 6],
    [6, 6, 6, 6, 6, 8, 8, 8],
    [8, 8, 8, 6, 6, 6, 6, 6],
    [6, 6, 6, 6, 6, 0, 0, 6],
    [24, 24, 24, 24, 24, 24, 24, 4],
    [24, 24, 24, 24, 24, 24, 0, 0],
    [6, 6, 6, 6, 6, 6, 7, 6],
    [6, 6, 6, 6, 6, 6, 0, 0],
    [6, 6, 6, 6, 0, 0, 0, 0],
    [6, 6, 6, 6, 8, 5, 5, 5],
    [5, 5, 5, 5, 6, 8, 6, 6],
    [6, 6, 6, 8, 6, 8, 8, 8],
    [8, 8, 6, 8, 8, 5, 5, 5],
    [5, 5, 5, 5, 5, 0, 24, 24],
    [24, 28, 28, 28, 28, 28, 28, 28],
    [28, 28, 28, 6, 6, 6, 6, 6],
    [6, 6, 6, 6, 28, 28, 28, 28],
    [28, 28, 28, 28, 28, 24, 24, 24],
    [6, 6, 8, 5, 5, 5, 5, 5],
    [5, 8, 6, 6, 6, 6, 8, 8],
    [6, 6, 8, 6, 6, 6, 5, 5],
    [5, 5, 5, 5, 5, 5, 6, 8],
    [6, 6, 8, 8, 8, 6, 8, 6],
    [6, 6, 8, 8, 0, 0, 0, 0],
    [0, 0, 0, 0, 24, 24, 24, 24],
    [5, 5, 5, 5, 8, 8, 8, 8],
    [8, 8, 8, 8, 6, 6, 6, 6],
    [6, 6, 6, 6, 8, 8, 6, 6],
    [0, 0, 0, 24, 24, 24, 24, 24],
    [297, 329, 0, 0, 0, 5, 5, 5],
    [4, 4, 4, 4, 4, 4, 24, 24],
    [2, 1, 2, 0, 0, 0, 0, 0],
    [1, 1, 1, 0, 0, 1, 1, 1],
    [6, 6, 6, 24, 6, 6, 6, 6],
    [6, 5, 5, 5, 5, 6, 5, 5],
    [5, 5, 5, 5, 6, 5, 5, 8],
    [6, 6, 5, 0, 0, 0, 0, 0],
    [2, 2, 2, 2, 4, 4, 4, 4],
    [4, 4, 4, 2, 2, 2, 2, 2],
    [4, 2, 2, 2, 2, 2, 2, 2],
    [2, 2, 2, 4, 4, 4, 4, 4],
    [1, 2, 1, 2, 1, 2, 2, 2],
    [2, 2, 2, 2, 2, 2, 1, 2],
    [0, 1, 0, 1, 0, 1, 0, 1],
    [3, 3, 3, 3, 3, 3, 3, 3],
    [2, 2, 2, 2, 2, 0, 2, 2],
    [1, 1, 1, 1, 3, 27, 2, 27],
    [27, 27, 2, 2, 2, 0, 2, 2],
    [1, 1, 1, 1, 3, 27, 27, 27],
    [2, 2, 2, 2, 0, 0, 2, 2],
    [1, 1, 1, 1, 0, 27, 27, 27],
    [1, 1, 1, 1, 1, 27, 27, 27],
    [0, 0, 2, 2, 2, 0, 2, 2],
    [1, 1, 1, 1, 3, 27, 27, 0],
    [12, 12, 12, 12, 12, 12, 12, 12],
    [12, 12, 12, 16, 16, 16, 16, 16],
    [20, 20, 20, 20, 20, 20, 24, 24],
    [29, 30, 21, 29, 29, 30, 21, 29],
    [13, 14, 16, 16, 16, 16, 16, 12],
    [24, 29, 30, 24, 24, 24, 24, 23],
    [23, 24, 24, 24, 25, 21, 22, 24],
    [24, 24, 25, 24, 23, 24, 24, 24],
    [24, 24, 24, 24, 24, 24, 24, 12],
    [16, 16, 16, 16, 16, 0, 16, 16],
    [16, 16, 16, 16, 16, 16, 16, 16],
    [11, 4, 0, 0, 11, 11, 11, 11],
    [11, 11, 25, 25, 25, 21, 22, 4],
    [11, 11, 25, 25, 25, 21, 22, 0],
    [4, 4, 4, 4, 4, 0, 0, 0],
    [26, 26, 26, 26, 26, 26, 26, 26],
    [26, 26, 0, 0, 0, 0, 0, 0],
    [6, 6, 6, 6, 6, 7, 7, 7],
    [7, 6, 7, 7, 7, 6, 6, 6],
    [6, 0, 0, 0, 0, 0, 0, 0],
    [28, 28, 1, 28, 28, 28, 28, 1],
    [28, 28, 2, 1, 1, 1, 2, 2],
    [1, 1, 1, 2, 28, 1, 28, 28],
    [25, 1, 1, 1, 1, 1, 28, 28],
    [28, 28, 28, 28, 1, 28, 1, 28],
    [1, 28, 1, 1, 1, 1, 28, 2],
    [1, 1, 1, 1, 2, 5, 5, 5],
    [5, 2, 28, 28, 2, 2, 1, 1],
    [25, 25, 25, 25, 25, 1, 2, 2],
    [2, 2, 28, 25, 28, 28, 2, 28],
    [10, 10, 10, 10, 10, 10, 10, 10],
    [10, 10, 10, 1, 2, 10, 10, 10],
    [10, 11, 28, 28, 0, 0, 0, 0],
    [25, 25, 25, 25, 25, 28, 28, 28],
    [28, 28, 25, 25, 28, 28, 28, 28],
    [25, 28, 28, 25, 28, 28, 25, 28],
    [28, 28, 28, 28, 28, 28, 25, 28],
    [28, 28, 28, 28, 28, 28, 25, 25],
    [28, 28, 25, 28, 25, 28, 28, 28],
    [28, 28, 28, 28, 25, 25, 25, 25],
    [25, 25, 25, 25, 25, 25, 25, 25],
    [21, 22, 21, 22, 28, 28, 28, 28],
    [25, 25, 28, 28, 28, 28, 28, 28],
    [28, 21, 22, 28, 28, 28, 28, 28],
    [28, 28, 28, 28, 25, 28, 28, 28],
    [28, 28, 28, 25, 25, 25, 25, 25],
    [25, 25, 25, 25, 28, 28, 28, 28],
    [28, 28, 28, 0, 0, 0, 0, 0],
    [11, 11, 11, 11, 28, 28, 28, 28],
    [28, 28, 11, 11, 11, 11, 11, 11],
    [28, 28, 28, 28, 28, 28, 28, 25],
    [28, 25, 28, 28, 28, 28, 28, 28],
    [21, 22, 21, 22, 21, 22, 21, 22],
    [21, 22, 21, 22, 21, 22, 11, 11],
    [25, 25, 25, 25, 25, 21, 22, 25],
    [25, 25, 25, 25, 25, 25, 21, 22],
    [25, 25, 25, 21, 22, 21, 22, 21],
    [22, 21, 22, 21, 22, 21, 22, 21],
    [22, 25, 25, 25, 25, 25, 25, 25],
    [21, 22, 21, 22, 25, 25, 25, 25],
    [25, 25, 25, 25, 21, 22, 25, 25],
    [25, 25, 25, 25, 25, 28, 28, 25],
    [28, 28, 28, 28, 0, 0, 28, 28],
    [1, 2, 1, 1, 1, 2, 2, 1],
    [2, 1, 2, 1, 2, 1, 1, 1],
    [1, 2, 1, 2, 2, 1, 2, 2],
    [2, 2, 2, 2, 4, 4, 1, 1],
    [1, 2, 1, 2, 2, 28, 28, 28],
    [28, 28, 28, 1, 2, 1, 2, 6],
    [6, 6, 1, 2, 0, 0, 0, 0],
    [0, 24, 24, 24, 24, 11, 24, 24],
    [2, 2, 2, 2, 2, 2, 0, 2],
    [0, 0, 0, 0, 0, 2, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 4],
    [24, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 6],
    [24, 24, 29, 30, 29, 30, 24, 24],
    [24, 29, 30, 24, 29, 30, 24, 24],
    [24, 24, 24, 24, 24, 24, 24, 20],
    [24, 24, 20, 24, 29, 30, 24, 24],
    [29, 30, 21, 22, 21, 22, 21, 22],
    [21, 22, 24, 24, 24, 24, 24, 4],
    [24, 24, 20, 20, 24, 24, 24, 24],
    [20, 24, 21, 24, 24, 24, 24, 24],
    [28, 28, 24, 24, 24, 21, 22, 21],
    [22, 21, 22, 21, 22, 20, 0, 0],
    [28, 28, 0, 28, 28, 28, 28, 28],
    [28, 28, 28, 28, 0, 0, 0, 0],
    [28, 28, 28, 28, 28, 28, 0, 0],
    [12, 24, 24, 24, 28, 4, 5, 10],
    [21, 22, 28, 28, 21, 22, 21, 22],
    [21, 22, 21, 22, 20, 21, 22, 22],
    [28, 10, 10, 10, 10, 10, 10, 10],
    [10, 10, 6, 6, 6, 6, 8, 8],
    [20, 4, 4, 4, 4, 4, 28, 28],
    [10, 10, 10, 4, 5, 24, 28, 28],
    [0, 6, 6, 27, 27, 4, 4, 5],
    [5, 5, 5, 24, 4, 4, 4, 5],
    [0, 0, 0, 0, 0, 5, 5, 5],
    [28, 28, 11, 11, 11, 11, 28, 28],
    [0, 0, 0, 0, 0, 0, 0, 28],
    [28, 28, 28, 28, 28, 28, 28, 0],
    [11, 11, 28, 28, 28, 28, 28, 28],
    [28, 11, 11, 11, 11, 11, 11, 11],
    [5, 5, 5, 5, 5, 4, 5, 5],
    [5, 5, 5, 5, 4, 24, 24, 24],
    [297, 329, 5, 5, 0, 0, 0, 0],
    [1, 2, 1, 2, 1, 2, 5, 6],
    [7, 7, 7, 24, 6, 6, 6, 6],
    [6, 6, 6, 6, 6, 6, 24, 4],
    [1, 2, 1, 2, 4, 4, 6, 6],
    [5, 5, 5, 5, 5, 5, 10, 10],
    [6, 6, 24, 24, 24, 24, 24, 24],
    [27, 27, 27, 27, 27, 27, 27, 4],
    [27, 27, 1, 2, 1, 2, 1, 2],
    [2, 1, 2, 1, 2, 1, 1, 2],
    [4, 27, 27, 1, 2, 1, 2, 5],
    [1, 2, 1, 2, 2, 2, 1, 2],
    [1, 2, 1, 1, 1, 1, 1, 2],
    [1, 1, 1, 1, 1, 2, 1, 2],
    [1, 2, 1, 2, 1, 1, 1, 1],
    [2, 1, 2, 1, 1, 2, 1, 2],
    [1, 2, 1, 2, 1, 0, 0, 0],
    [0, 4, 4, 4, 4, 1, 2, 5],
    [4, 4, 2, 5, 5, 5, 5, 5],
    [5, 5, 6, 5, 5, 5, 6, 5],
    [5, 5, 5, 6, 5, 5, 5, 5],
    [5, 5, 5, 8, 8, 6, 6, 8],
    [28, 28, 28, 28, 6, 0, 0, 0],
    [11, 11, 11, 11, 11, 11, 28, 28],
    [26, 28, 0, 0, 0, 0, 0, 0],
    [5, 5, 5, 5, 24, 24, 24, 24],
    [8, 8, 5, 5, 5, 5, 5, 5],
    [8, 8, 8, 8, 6, 6, 0, 0],
    [0, 0, 0, 0, 0, 0, 24, 24],
    [6, 6, 5, 5, 5, 5, 5, 5],
    [24, 24, 24, 5, 24, 5, 5, 6],
    [6, 6, 6, 6, 6, 6, 24, 24],
    [5, 5, 5, 6, 8, 8, 6, 6],
    [6, 6, 8, 8, 6, 6, 8, 8],
    [8, 24, 24, 24, 24, 24, 24, 24],
    [24, 24, 24, 24, 24, 24, 0, 4],
    [297, 329, 0, 0, 0, 0, 24, 24],
    [5, 5, 5, 5, 5, 6, 4, 5],
    [297, 329, 5, 5, 5, 5, 5, 0],
    [5, 6, 6, 6, 6, 6, 6, 8],
    [8, 6, 6, 8, 8, 6, 6, 0],
    [5, 5, 5, 5, 6, 8, 0, 0],
    [297, 329, 0, 0, 24, 24, 24, 24],
    [4, 5, 5, 5, 5, 5, 5, 28],
    [28, 28, 5, 8, 6, 8, 5, 5],
    [6, 5, 6, 6, 6, 5, 5, 6],
    [6, 5, 5, 5, 5, 5, 6, 6],
    [0, 0, 0, 5, 5, 4, 24, 24],
    [5, 5, 5, 8, 6, 6, 8, 8],
    [24, 24, 5, 4, 4, 8, 6, 0],
    [0, 5, 5, 5, 5, 5, 5, 0],
    [2, 2, 2, 27, 4, 4, 4, 4],
    [2, 4, 27, 27, 0, 0, 0, 0],
    [5, 5, 5, 8, 8, 6, 8, 8],
    [6, 8, 8, 24, 8, 6, 0, 0],
    [0, 0, 0, 5, 5, 5, 5, 5],
    [19, 19, 19, 19, 19, 19, 19, 19],
    [18, 18, 18, 18, 18, 18, 18, 18],
    [2, 2, 2, 2, 2, 2, 2, 0],
    [0, 0, 0, 2, 2, 2, 2, 2],
    [0, 0, 0, 0, 0, 5, 6, 5],
    [5, 25, 5, 5, 5, 5, 5, 5],
    [5, 5, 5, 5, 5, 0, 5, 0],
    [5, 5, 0, 5, 5, 0, 5, 5],
    [5, 5, 27, 27, 27, 27, 27, 27],
    [27, 27, 27, 28, 28, 28, 28, 28],
    [28, 28, 28, 5, 5, 5, 5, 5],
    [5, 5, 5, 5, 5, 5, 22, 21],
    [28, 28, 5, 5, 5, 5, 5, 5],
    [5, 5, 5, 5, 26, 28, 28, 28],
    [24, 24, 24, 24, 24, 24, 24, 21],
    [22, 24, 0, 0, 0, 0, 0, 0],
    [24, 20, 20, 23, 23, 21, 22, 21],
    [22, 21, 22, 21, 22, 24, 24, 21],
    [22, 24, 24, 24, 24, 23, 23, 23],
    [24, 24, 24, 0, 24, 24, 24, 24],
    [20, 21, 22, 21, 22, 21, 22, 24],
    [24, 24, 25, 20, 25, 25, 25, 0],
    [24, 26, 24, 24, 0, 0, 0, 0],
    [5, 5, 5, 5, 5, 0, 0, 16],
    [0, 24, 24, 24, 26, 24, 24, 24],
    [1090, 1122, 1154, 21, 25, 22, 25, 21],
    [22, 24, 21, 22, 24, 24, 5, 5],
    [5, 5, 5, 5, 5, 5, 4, 4],
    [0, 0, 5, 5, 5, 0, 0, 0],
    [26, 26, 25, 27, 28, 26, 26, 0],
    [28, 25, 25, 25, 25, 28, 28, 0],
    [0, 16, 16, 16, 28, 28, 0, 0],
    [5, 5, 5, 0, 5, 5, 0, 5],
    [24, 24, 24, 0, 0, 0, 0, 11],
    [11, 11, 11, 11, 0, 0, 0, 28],
    [10, 10, 10, 10, 10, 11, 11, 11],
    [11, 28, 28, 28, 28, 28, 28, 28],
    [28, 28, 11, 11, 28, 28, 28, 0],
    [28, 28, 28, 28, 28, 0, 0, 0],
    [28, 0, 0, 0, 0, 0, 0, 0],
    [28, 28, 28, 28, 28, 6, 0, 0],
    [6, 11, 11, 11, 11, 11, 11, 11],
    [11, 11, 11, 11, 0, 0, 0, 0],
    [5, 10, 5, 5, 5, 5, 5, 5],
    [5, 5, 10, 0, 0, 0, 0, 0],
    [6, 6, 6, 0, 0, 0, 0, 0],
    [5, 5, 5, 5, 5, 5, 0, 24],
    [24, 10, 10, 10, 10, 10, 0, 0],
    [1, 1, 1, 1, 0, 0, 0, 0],
    [2, 2, 2, 2, 0, 0, 0, 0],
    [1, 1, 1, 0, 1, 1, 1, 1],
    [1, 1, 1, 0, 1, 1, 0, 2],
    [2, 2, 0, 2, 2, 2, 2, 2],
    [2, 2, 0, 2, 2, 0, 0, 0],
    [4, 4, 4, 4, 4, 4, 0, 4],
    [4, 0, 4, 4, 4, 4, 4, 4],
    [4, 4, 4, 0, 0, 0, 0, 0],
    [5, 0, 0, 0, 5, 0, 0, 5],
    [5, 5, 5, 5, 5, 5, 5, 28],
    [0, 0, 0, 0, 0, 0, 0, 11],
    [0, 0, 0, 11, 11, 11, 11, 11],
    [5, 5, 5, 5, 5, 5, 11, 11],
    [11, 11, 11, 11, 0, 0, 0, 24],
    [5, 5, 0, 0, 0, 0, 0, 24],
    [0, 0, 0, 0, 11, 11, 5, 5],
    [0, 0, 11, 11, 11, 11, 11, 11],
    [5, 6, 6, 6, 0, 6, 6, 0],
    [0, 0, 0, 0, 6, 6, 6, 6],
    [6, 6, 6, 0, 0, 0, 0, 6],
    [11, 0, 0, 0, 0, 0, 0, 0],
    [5, 5, 5, 5, 5, 11, 11, 24],
    [5, 5, 5, 5, 5, 11, 11, 11],
    [28, 5, 5, 5, 5, 5, 5, 5],
    [5, 5, 5, 5, 5, 6, 6, 0],
    [0, 24, 24, 24, 24, 24, 24, 24],
    [0, 24, 24, 24, 24, 0, 0, 0],
    [0, 11, 11, 11, 11, 11, 11, 11],
    [1, 1, 1, 0, 0, 0, 0, 0],
    [2, 2, 2, 0, 0, 0, 0, 0],
    [5, 5, 5, 5, 6, 6, 6, 6],
    [297, 329, 5, 5, 5, 5, 4, 5],
    [0, 6, 6, 6, 6, 6, 20, 4],
    [0, 0, 0, 0, 0, 0, 25, 25],
    [11, 11, 11, 11, 11, 11, 11, 0],
    [5, 5, 0, 6, 6, 20, 0, 0],
    [0, 0, 5, 5, 5, 4, 5, 5],
    [0, 0, 6, 6, 6, 6, 6, 6],
    [6, 11, 11, 11, 11, 24, 24, 24],
    [24, 24, 0, 0, 0, 0, 0, 0],
    [5, 5, 6, 6, 6, 6, 24, 24],
    [8, 6, 8, 5, 5, 5, 5, 5],
    [11, 11, 11, 11, 11, 11, 41, 73],
    [6, 5, 5, 6, 6, 5, 0, 0],
    [8, 8, 8, 6, 6, 6, 6, 8],
    [8, 6, 6, 24, 24, 16, 24, 24],
    [24, 24, 6, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 16, 0, 0],
    [6, 6, 6, 5, 5, 5, 5, 5],
    [6, 6, 6, 6, 8, 6, 6, 6],
    [6, 6, 6, 6, 6, 0, 41, 73],
    [24, 24, 24, 24, 5, 8, 8, 5],
    [5, 5, 5, 6, 24, 24, 5, 0],
    [5, 5, 5, 8, 8, 8, 6, 6],
    [8, 5, 5, 5, 5, 24, 24, 24],
    [24, 6, 6, 6, 6, 24, 8, 6],
    [297, 329, 5, 24, 5, 24, 24, 24],
    [5, 5, 5, 5, 8, 8, 8, 6],
    [6, 6, 8, 8, 6, 8, 6, 6],
    [24, 24, 24, 24, 24, 24, 6, 5],
    [5, 6, 0, 0, 0, 0, 0, 0],
    [5, 0, 5, 5, 5, 5, 0, 5],
    [5, 24, 0, 0, 0, 0, 0, 0],
    [6, 6, 8, 8, 0, 5, 5, 5],
    [5, 5, 0, 6, 6, 5, 8, 8],
    [6, 8, 8, 8, 8, 0, 0, 8],
    [8, 0, 0, 8, 8, 8, 0, 0],
    [5, 5, 8, 8, 0, 0, 6, 6],
    [6, 6, 6, 6, 6, 0, 0, 0],
    [5, 5, 0, 5, 0, 0, 5, 0],
    [6, 0, 8, 0, 0, 8, 0, 8],
    [8, 8, 8, 0, 8, 8, 6, 8],
    [6, 5, 6, 5, 24, 24, 0, 24],
    [0, 6, 6, 0, 0, 0, 0, 0],
    [5, 5, 5, 5, 5, 8, 8, 8],
    [8, 8, 6, 6, 6, 8, 6, 5],
    [5, 5, 5, 24, 24, 24, 24, 24],
    [297, 329, 24, 24, 0, 24, 6, 5],
    [6, 8, 6, 8, 8, 8, 8, 6],
    [6, 8, 6, 6, 5, 5, 24, 5],
    [5, 5, 5, 5, 5, 5, 5, 8],
    [8, 8, 6, 6, 6, 6, 0, 0],
    [8, 8, 8, 8, 6, 6, 8, 6],
    [6, 24, 24, 24, 24, 24, 24, 24],
    [5, 5, 5, 5, 6, 6, 0, 0],
    [6, 6, 6, 8, 8, 6, 8, 6],
    [6, 24, 24, 24, 5, 0, 0, 0],
    [24, 24, 24, 24, 24, 0, 0, 0],
    [5, 5, 5, 6, 8, 6, 8, 8],
    [6, 6, 6, 6, 6, 6, 8, 6],
    [297, 329, 41, 73, 105, 137, 169, 201],
    [233, 265, 297, 329, 0, 0, 0, 0],
    [5, 5, 5, 0, 0, 6, 8, 6],
    [8, 8, 6, 6, 6, 6, 8, 6],
    [297, 329, 11, 11, 24, 24, 24, 28],
    [8, 6, 6, 24, 0, 0, 0, 0],
    [11, 11, 11, 0, 0, 0, 0, 0],
    [0, 5, 0, 0, 5, 5, 5, 5],
    [5, 5, 5, 5, 0, 5, 5, 0],
    [8, 8, 8, 8, 8, 8, 0, 8],
    [8, 0, 0, 6, 6, 8, 6, 5],
    [8, 5, 8, 6, 24, 24, 24, 0],
    [5, 8, 8, 8, 6, 6, 6, 6],
    [0, 0, 6, 6, 8, 8, 8, 8],
    [6, 5, 24, 5, 8, 0, 0, 0],
    [6, 8, 5, 6, 6, 6, 6, 24],
    [24, 24, 24, 24, 24, 24, 24, 6],
    [8, 6, 6, 6, 5, 5, 5, 5],
    [5, 5, 6, 6, 6, 6, 6, 6],
    [6, 6, 24, 24, 24, 5, 24, 24],
    [24, 24, 24, 0, 0, 0, 0, 0],
    [6, 8, 6, 6, 6, 8, 6, 8],
    [5, 24, 24, 24, 24, 24, 0, 0],
    [24, 24, 5, 5, 5, 5, 5, 5],
    [0, 8, 6, 6, 6, 6, 6, 6],
    [6, 8, 6, 6, 8, 6, 6, 0],
    [5, 6, 6, 6, 6, 6, 6, 0],
    [0, 0, 6, 0, 6, 6, 0, 6],
    [6, 6, 6, 6, 6, 6, 5, 6],
    [5, 5, 8, 8, 8, 8, 8, 0],
    [6, 6, 0, 8, 8, 6, 8, 6],
    [5, 4, 5, 5, 0, 0, 0, 0],
    [5, 5, 5, 6, 6, 8, 8, 24],
    [6, 6, 5, 8, 5, 5, 5, 5],
    [5, 5, 5, 5, 8, 8, 6, 6],
    [6, 6, 6, 0, 0, 0, 8, 8],
    [6, 8, 6, 24, 24, 24, 24, 24],
    [297, 329, 6, 0, 0, 0, 0, 0],
    [11, 11, 11, 11, 11, 28, 28, 28],
    [28, 28, 28, 28, 28, 26, 26, 26],
    [26, 28, 28, 28, 28, 28, 28, 28],
    [10, 10, 10, 10, 10, 10, 10, 0],
    [5, 24, 24, 0, 0, 0, 0, 0],
    [6, 5, 5, 5, 5, 5, 5, 6],
    [6, 6, 8, 8, 8, 6, 6, 6],
    [6, 6, 6, 6, 6, 24, 0, 0],
    [24, 24, 24, 24, 28, 28, 28, 28],
    [4, 4, 4, 4, 24, 28, 0, 0],
    [297, 329, 0, 11, 11, 11, 11, 11],
    [11, 11, 0, 5, 5, 5, 5, 5],
    [4, 4, 4, 5, 5, 5, 5, 5],
    [5, 5, 5, 4, 4, 24, 24, 24],
    [11, 11, 11, 11, 11, 11, 11, 24],
    [1, 0, 0, 2, 2, 2, 2, 2],
    [5, 5, 5, 0, 0, 0, 0, 6],
    [5, 8, 8, 8, 8, 8, 8, 8],
    [6, 6, 6, 4, 4, 4, 4, 4],
    [4, 4, 24, 4, 6, 0, 0, 0],
    [8, 8, 4, 4, 10, 10, 10, 0],
    [4, 4, 4, 4, 0, 4, 4, 4],
    [4, 4, 4, 4, 0, 4, 4, 0],
    [0, 0, 5, 0, 0, 0, 0, 0],
    [5, 5, 5, 0, 0, 5, 0, 0],
    [0, 0, 0, 0, 5, 5, 5, 5],
    [5, 5, 0, 0, 28, 6, 6, 24],
    [16, 16, 16, 16, 0, 0, 0, 0],
    [297, 329, 28, 28, 28, 0, 0, 0],
    [0, 0, 28, 28, 28, 28, 28, 28],
    [25, 0, 0, 0, 0, 0, 0, 0],
    [0, 28, 28, 28, 28, 28, 28, 28],
    [28, 28, 28, 28, 28, 8, 8, 6],
    [6, 6, 28, 28, 28, 8, 8, 8],
    [8, 8, 8, 16, 16, 16, 16, 16],
    [16, 16, 16, 6, 6, 6, 6, 6],
    [6, 6, 6, 28, 28, 6, 6, 6],
    [28, 28, 6, 6, 6, 6, 28, 28],
    [28, 28, 6, 6, 6, 28, 0, 0],
    [1, 1, 2, 2, 2, 2, 2, 2],
    [2, 2, 2, 2, 1, 1, 1, 1],
    [1, 1, 1, 1, 1, 1, 2, 2],
    [2, 2, 2, 2, 1, 0, 1, 1],
    [0, 0, 1, 0, 0, 1, 1, 0],
    [0, 1, 1, 1, 1, 0, 1, 1],
    [2, 2, 0, 2, 0, 2, 2, 2],
    [2, 2, 2, 2, 0, 2, 2, 2],
    [2, 2, 2, 2, 1, 1, 0, 1],
    [1, 1, 1, 1, 1, 0, 1, 1],
    [1, 1, 1, 1, 1, 0, 2, 2],
    [1, 1, 0, 1, 1, 1, 1, 0],
    [1, 1, 1, 1, 1, 0, 1, 0],
    [0, 0, 1, 1, 1, 1, 1, 1],
    [1, 0, 2, 2, 2, 2, 2, 2],
    [1, 25, 2, 2, 2, 2, 2, 2],
    [2, 2, 2, 25, 2, 2, 2, 2],
    [2, 2, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 25, 2, 2, 2, 2],
    [2, 2, 2, 2, 2, 25, 2, 2],
    [1, 1, 1, 1, 1, 25, 2, 2],
    [2, 2, 2, 2, 2, 2, 1, 1],
    [2, 25, 2, 2, 2, 2, 2, 2],
    [2, 2, 1, 2, 0, 0, 41, 73],
    [233, 265, 297, 329, 41, 73, 105, 137],
    [169, 201, 233, 265, 297, 329, 41, 73],
    [6, 6, 6, 6, 6, 6, 6, 28],
    [6, 6, 6, 6, 6, 28, 28, 28],
    [28, 28, 28, 28, 28, 6, 28, 28],
    [28, 28, 28, 28, 6, 28, 28, 24],
    [24, 24, 24, 24, 0, 0, 0, 0],
    [0, 0, 0, 6, 6, 6, 6, 6],
    [2, 2, 5, 2, 2, 2, 2, 2],
    [0, 0, 0, 0, 0, 2, 2, 2],
    [6, 0, 0, 6, 6, 6, 6, 6],
    [6, 6, 0, 6, 6, 0, 6, 6],
    [4, 4, 4, 4, 4, 4, 0, 0],
    [6, 6, 6, 6, 6, 6, 6, 4],
    [297, 329, 0, 0, 0, 0, 5, 28],
    [5, 5, 5, 5, 5, 5, 6, 0],
    [297, 329, 0, 0, 0, 0, 0, 26],
    [5, 5, 5, 4, 6, 6, 6, 6],
    [5, 41, 73, 105, 137, 169, 201, 233],
    [265, 297, 329, 0, 0, 0, 0, 24],
    [5, 5, 5, 6, 5, 5, 6, 5],
    [5, 5, 5, 5, 5, 6, 0, 0],
    [0, 0, 0, 0, 0, 0, 5, 4],
    [5, 5, 5, 5, 5, 0, 0, 11],
    [2, 2, 2, 2, 6, 6, 6, 6],
    [6, 6, 6, 4, 0, 0, 0, 0],
    [11, 11, 11, 11, 28, 11, 11, 11],
    [26, 11, 11, 11, 11, 0, 0, 0],
    [11, 11, 11, 11, 11, 11, 28, 11],
    [11, 11, 11, 11, 11, 11, 0, 0],
    [0, 5, 5, 0, 5, 0, 0, 5],
    [0, 5, 0, 5, 0, 0, 0, 0],
    [0, 0, 5, 0, 0, 0, 0, 5],
    [0, 5, 0, 5, 0, 5, 5, 5],
    [0, 5, 0, 5, 0, 5, 0, 5],
    [0, 5, 5, 5, 0, 5, 5, 5],
    [25, 25, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 28, 28],
    [28, 28, 28, 27, 27, 27, 27, 27],
    [28, 0, 0, 0, 28, 28, 28, 28],
    [28, 28, 28, 0, 0, 0, 28, 28],
    [28, 0, 0, 0, 0, 28, 28, 28],
    [28, 28, 28, 28, 28, 0, 0, 28],
    [28, 28, 28, 0, 0, 0, 0, 28],
    [28, 28, 28, 0, 28, 28, 28, 28],
    [297, 329, 28, 0, 0, 0, 0, 0],
    [0, 16, 0, 0, 0, 0, 0, 0],
    [18, 18, 18, 18, 18, 18, 0, 0]];
const pool2 = [[0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 
    0, 0, 0, 0, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 20, 
    22, 22, 22, 22, 22, 22, 22, 23, 23, 24, 22, 22, 22, 22, 22, 25, 
    26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 23, 36, 22, 22, 37, 22],
    [22, 22, 22, 22, 22, 22, 38, 39, 40, 22, 20, 20, 20, 20, 20, 20, 
    20, 20, 41, 20, 20, 20, 42, 42, 43, 42, 44, 45, 46, 47, 45, 45, 
    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 49, 50, 
    51, 52, 53, 17, 54, 55, 20, 20, 20, 56, 57, 22, 22, 22, 58, 59],
    [17, 17, 17, 17, 17, 17, 20, 20, 20, 20, 20, 20, 22, 22, 22, 22, 
    60, 61, 22, 22, 22, 22, 22, 22, 62, 63, 22, 22, 22, 22, 22, 22, 
    22, 22, 22, 22, 22, 22, 64, 17, 17, 17, 65, 66, 20, 20, 20, 20, 
    20, 67, 68, 48, 48, 48, 48, 69, 70, 71, 72, 72, 72, 73, 74, 71],
    [75, 76, 48, 77, 72, 72, 72, 72, 78, 79, 48, 48, 3, 80, 81, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 82, 83, 84, 85, 3, 86, 
    87, 88, 89, 72, 72, 72, 48, 48, 48, 90, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 91, 48, 92, 71, 3, 93, 72, 72, 72, 79, 94, 95],
    [72, 72, 91, 96, 97, 98, 87, 99, 72, 72, 72, 100, 72, 101, 72, 72, 
    72, 102, 103, 48, 72, 72, 72, 72, 72, 104, 48, 48, 105, 48, 48, 48, 
    106, 72, 72, 72, 72, 72, 72, 107, 108, 109, 110, 72, 111, 112, 113, 72, 
    114, 115, 116, 72, 72, 117, 118, 119, 120, 121, 122, 123, 124, 112, 125, 126],
    [127, 73, 116, 72, 72, 117, 128, 129, 130, 131, 132, 133, 134, 112, 135, 71, 
    127, 136, 137, 72, 72, 117, 138, 119, 139, 140, 141, 71, 124, 112, 142, 143, 
    144, 115, 116, 72, 72, 117, 138, 145, 120, 146, 147, 123, 124, 112, 148, 71, 
    149, 150, 151, 152, 153, 150, 72, 154, 155, 156, 157, 71, 134, 112, 158, 159],
    [160, 161, 117, 72, 72, 117, 72, 162, 163, 164, 165, 166, 124, 112, 167, 168, 
    169, 161, 117, 72, 72, 117, 170, 145, 171, 172, 173, 174, 124, 112, 175, 71, 
    176, 161, 117, 72, 72, 72, 72, 177, 178, 179, 180, 181, 124, 112, 182, 183, 
    144, 72, 184, 185, 72, 72, 137, 186, 184, 187, 188, 189, 134, 112, 190, 71],
    [191, 72, 72, 72, 72, 72, 192, 193, 194, 195, 3, 196, 71, 71, 71, 71, 
    152, 197, 72, 72, 198, 72, 192, 199, 200, 201, 3, 202, 71, 71, 71, 71, 
    203, 87, 204, 205, 3, 206, 207, 208, 72, 191, 72, 72, 72, 209, 68, 210, 
    211, 212, 48, 68, 48, 48, 48, 213, 214, 215, 216, 217, 71, 71, 71, 71],
    [72, 72, 72, 72, 72, 218, 219, 220, 3, 221, 222, 223, 224, 225, 226, 72, 
    227, 228, 3, 229, 17, 17, 17, 17, 230, 231, 20, 20, 20, 20, 20, 232, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 151, 184, 151, 72, 72, 72, 72, 
    72, 151, 72, 72, 72, 72, 151, 184, 151, 72, 184, 72, 72, 72, 72, 72, 
    72, 72, 151, 72, 72, 72, 72, 72, 72, 72, 72, 233, 87, 234, 182, 235, 
    72, 72, 236, 237, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 238, 239],
    [240, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 241, 72, 72, 
    242, 72, 72, 243, 72, 72, 72, 72, 72, 72, 72, 72, 72, 244, 245, 141, 
    72, 72, 246, 247, 72, 72, 248, 71, 72, 72, 249, 71, 72, 161, 250, 71, 
    72, 72, 72, 72, 72, 72, 251, 252, 253, 108, 254, 255, 3, 256, 182, 257],
    [258, 259, 3, 256, 72, 72, 72, 72, 260, 72, 72, 72, 72, 72, 72, 141, 
    261, 72, 72, 72, 72, 262, 72, 72, 72, 72, 72, 72, 72, 72, 263, 71, 
    72, 72, 72, 184, 264, 265, 266, 267, 268, 112, 72, 72, 72, 263, 209, 71, 
    72, 72, 72, 72, 72, 269, 72, 72, 72, 270, 3, 271, 236, 236, 236, 236],
    [72, 72, 272, 273, 72, 72, 72, 72, 72, 72, 274, 201, 275, 276, 277, 278, 
    3, 256, 3, 256, 279, 280, 48, 281, 48, 48, 48, 282, 48, 283, 71, 71, 
    284, 72, 72, 72, 72, 72, 285, 286, 287, 288, 3, 221, 289, 290, 291, 292, 
    293, 72, 72, 72, 294, 295, 3, 93, 72, 72, 72, 72, 296, 297, 298, 299],
    [72, 72, 72, 72, 300, 301, 302, 303, 3, 304, 3, 93, 72, 72, 72, 305, 
    20, 306, 17, 17, 17, 17, 17, 307, 87, 71, 308, 48, 219, 309, 310, 311, 
    20, 20, 20, 20, 20, 312, 42, 42, 42, 42, 42, 42, 42, 313, 20, 314, 
    20, 20, 20, 315, 42, 42, 42, 42, 48, 48, 48, 48, 48, 48, 48, 48],
    [22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 
    22, 22, 316, 317, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 
    20, 17, 239, 238, 20, 17, 20, 17, 239, 238, 20, 318, 20, 17, 20, 239, 
    20, 319, 20, 319, 20, 319, 320, 321, 322, 323, 324, 325, 20, 326, 327, 328],
    [329, 330, 331, 332, 87, 333, 87, 334, 335, 87, 336, 337, 338, 339, 340, 341, 
    182, 342, 42, 343, 344, 344, 344, 344, 345, 71, 48, 346, 347, 48, 348, 71, 
    349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 182, 182, 359, 359, 359, 359, 
    360, 361, 362, 363, 364, 365, 236, 236, 236, 366, 367, 236, 236, 236, 368, 369],
    [369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 
    369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 
    236, 370, 236, 236, 371, 372, 236, 236, 236, 236, 236, 236, 236, 236, 236, 373, 
    236, 236, 236, 374, 369, 369, 375, 236, 236, 236, 236, 368, 371, 236, 236, 236],
    [236, 236, 236, 236, 236, 237, 71, 71, 236, 376, 71, 71, 182, 182, 182, 182, 
    182, 182, 182, 377, 236, 236, 236, 236, 236, 236, 236, 236, 236, 378, 182, 182, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 379, 236, 380, 236, 236, 236, 236, 236, 236, 369],
    [236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 379, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 381, 382, 182, 
    182, 182, 377, 236, 236, 236, 236, 236, 383, 369, 369, 369, 384, 381, 369, 369],
    [236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 
    385, 386, 386, 387, 369, 369, 369, 369, 369, 369, 369, 388, 369, 369, 369, 389],
    [369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 
    369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 
    236, 236, 236, 236, 236, 236, 369, 369, 390, 362, 236, 236, 236, 236, 391, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236],
    [17, 17, 17, 17, 17, 17, 20, 20, 20, 20, 20, 20, 392, 393, 394, 395, 
    22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 396, 397, 398, 399, 
    20, 20, 20, 20, 400, 401, 72, 72, 72, 72, 72, 72, 72, 402, 403, 404, 
    72, 72, 184, 71, 184, 184, 184, 184, 184, 184, 184, 184, 48, 48, 48, 48],
    [405, 406, 407, 408, 409, 410, 87, 411, 412, 87, 413, 414, 71, 71, 71, 71, 
    236, 236, 236, 415, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 416, 71, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 417, 71, 71, 71, 236, 236],
    [418, 381, 419, 420, 421, 422, 423, 424, 191, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 184, 425, 240, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 426, 
    427, 72, 72, 72, 72, 72, 191, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 184, 428, 236, 72, 72, 72, 72, 236, 236, 236, 236, 417, 429, 72, 72],
    [236, 236, 236, 430, 182, 431, 236, 236, 236, 182, 432, 182, 236, 236, 236, 236, 
    182, 431, 236, 236, 236, 236, 432, 182, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 236, 236, 236, 236, 236, 236, 236, 236],
    [72, 72, 433, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 209, 236, 236, 236, 236, 236, 236, 430, 71, 72, 72, 72, 72, 72, 305, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 434, 72, 72, 3, 435, 71, 71, 22, 22, 22, 22, 22, 436, 437, 438, 
    22, 22, 22, 439, 72, 72, 72, 72, 72, 72, 72, 72, 440, 359, 441, 71, 
    45, 45, 442, 42, 443, 22, 24, 22, 22, 22, 22, 22, 22, 22, 314, 444, 
    22, 445, 446, 22, 22, 447, 448, 22, 449, 450, 22, 451, 71, 71, 452, 453],
    [454, 455, 72, 72, 456, 457, 458, 459, 72, 72, 72, 72, 72, 72, 460, 71, 
    461, 72, 72, 72, 72, 72, 300, 189, 462, 463, 3, 256, 48, 48, 464, 465, 
    3, 93, 72, 72, 91, 466, 72, 72, 272, 48, 298, 167, 72, 72, 72, 209, 
    106, 72, 72, 72, 72, 72, 467, 468, 469, 470, 3, 471, 472, 72, 3, 473],
    [72, 72, 72, 72, 72, 474, 475, 71, 455, 476, 3, 477, 72, 72, 478, 479, 
    72, 72, 72, 72, 72, 72, 480, 481, 262, 71, 71, 482, 72, 483, 484, 71, 
    485, 485, 485, 71, 184, 184, 20, 20, 20, 20, 20, 486, 20, 487, 20, 20, 
    20, 20, 20, 20, 20, 20, 20, 20, 72, 72, 72, 72, 488, 489, 3, 256],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 269, 71, 72, 72, 184, 490, 72, 72, 72, 72, 72, 269],
    [491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 
    491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 
    491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 
    491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491],
    [492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 
    492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 
    492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 
    492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492],
    [492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 
    492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 263, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 270, 71, 71, 71, 71, 
    493, 71, 494, 495, 72, 496, 184, 497, 498, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 499, 45, 500, 236, 501, 72, 72, 72, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 502, 236, 236, 72, 72, 72, 72, 72, 72, 
    72, 72, 503, 72, 72, 72, 72, 72, 72, 236, 71, 71, 71, 71, 72, 504],
    [48, 48, 505, 506, 48, 48, 507, 386, 508, 509, 510, 511, 512, 513, 161, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 514, 
    515, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 516, 517, 72, 78, 72, 
    72, 72, 72, 518, 72, 72, 72, 184, 185, 185, 185, 519, 520, 521, 71, 522],
    [72, 170, 72, 72, 184, 72, 72, 523, 72, 263, 72, 263, 71, 71, 71, 71, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 101, 
    524, 182, 182, 182, 182, 182, 525, 236, 359, 359, 359, 359, 359, 359, 526, 527, 
    236, 528, 236, 529, 530, 71, 71, 71, 71, 71, 236, 236, 236, 236, 236, 531],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    72, 72, 72, 209, 72, 72, 72, 72, 72, 72, 141, 71, 532, 182, 182, 533, 
    72, 72, 72, 72, 533, 427, 72, 72, 534, 535, 72, 72, 72, 72, 91, 536, 
    72, 72, 72, 537, 72, 72, 72, 72, 269, 72, 538, 71, 71, 71, 71, 71],
    [17, 17, 17, 17, 17, 20, 20, 20, 20, 20, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 263, 3, 256, 17, 17, 17, 17, 539, 20, 20, 20, 20, 540, 
    72, 72, 72, 72, 72, 71, 72, 72, 72, 72, 72, 72, 269, 167, 17, 541, 
    17, 541, 542, 20, 543, 20, 543, 544, 72, 72, 72, 72, 72, 72, 269, 71],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 184, 71, 72, 72, 263, 71, 72, 71, 71, 71, 
    545, 42, 42, 42, 42, 42, 546, 547, 71, 71, 71, 71, 71, 71, 71, 71],
    [263, 117, 72, 72, 72, 72, 136, 548, 72, 72, 537, 182, 72, 72, 549, 432, 
    72, 72, 72, 184, 550, 182, 71, 71, 71, 71, 71, 71, 72, 72, 166, 551, 
    72, 72, 552, 553, 72, 72, 72, 554, 72, 72, 72, 270, 71, 71, 71, 71, 
    72, 72, 72, 72, 72, 72, 72, 555, 182, 182, 556, 182, 182, 182, 182, 182],
    [557, 558, 170, 191, 72, 72, 263, 559, 182, 560, 87, 403, 72, 72, 72, 561, 
    72, 72, 72, 562, 71, 71, 71, 71, 72, 563, 72, 72, 564, 551, 99, 71, 
    72, 72, 72, 72, 72, 72, 263, 565, 72, 72, 263, 182, 72, 72, 101, 182, 
    72, 72, 270, 566, 71, 567, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 141, 71, 71, 71, 71, 71, 71, 
    17, 17, 17, 17, 17, 17, 568, 71, 20, 20, 20, 20, 20, 20, 569, 556, 
    72, 72, 72, 72, 570, 71, 3, 256, 3, 571, 17, 17, 238, 572, 20, 20, 
    239, 573, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 182, 182, 182, 574, 
    72, 72, 72, 72, 72, 575, 270, 71, 576, 71, 289, 530, 71, 71, 71, 577, 
    72, 72, 72, 562, 181, 71, 72, 72, 91, 48, 578, 579, 71, 71, 72, 72, 
    580, 579, 71, 71, 71, 71, 72, 72, 562, 533, 71, 71, 72, 72, 184, 71],
    [581, 72, 72, 72, 72, 72, 72, 48, 195, 280, 556, 182, 582, 112, 583, 404, 
    293, 72, 72, 72, 72, 72, 584, 585, 586, 587, 72, 72, 72, 141, 3, 256, 
    588, 72, 72, 72, 272, 589, 590, 112, 591, 71, 72, 72, 72, 72, 592, 71, 
    293, 72, 72, 72, 72, 72, 593, 210, 594, 595, 3, 596, 567, 182, 235, 71],
    [72, 72, 137, 72, 72, 597, 598, 599, 600, 71, 71, 71, 71, 71, 71, 71, 
    184, 601, 72, 136, 72, 602, 72, 72, 72, 72, 72, 272, 277, 536, 3, 256, 
    603, 115, 116, 72, 72, 117, 138, 604, 605, 606, 157, 427, 607, 608, 608, 71, 
    72, 609, 72, 72, 72, 72, 136, 277, 610, 611, 612, 403, 613, 71, 71, 71],
    [72, 72, 72, 72, 72, 72, 614, 48, 615, 616, 3, 617, 270, 71, 71, 71, 
    72, 72, 72, 72, 72, 72, 277, 618, 619, 71, 3, 256, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    72, 72, 72, 72, 72, 620, 621, 622, 623, 87, 87, 624, 71, 71, 71, 71],
    [72, 72, 72, 72, 72, 72, 277, 625, 626, 71, 3, 256, 87, 627, 71, 71, 
    72, 72, 72, 72, 72, 628, 629, 602, 3, 256, 3, 630, 631, 71, 71, 71, 
    72, 72, 72, 632, 633, 283, 3, 634, 184, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [72, 72, 72, 72, 72, 597, 48, 635, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 17, 17, 17, 17, 20, 20, 20, 20, 3, 206, 636, 247, 
    184, 637, 638, 72, 72, 72, 639, 640, 641, 71, 3, 256, 71, 71, 71, 71, 
    71, 71, 71, 71, 72, 185, 72, 72, 72, 72, 642, 643, 644, 71, 71, 71],
    [110, 588, 72, 72, 72, 72, 79, 645, 646, 71, 474, 647, 72, 72, 72, 72, 
    72, 648, 210, 649, 650, 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, 141, 
    87, 579, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 651, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 602, 71, 3, 256],
    [72, 117, 72, 72, 72, 620, 201, 629, 652, 71, 3, 206, 182, 235, 653, 72, 
    72, 72, 577, 48, 48, 654, 655, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    184, 137, 72, 72, 72, 72, 656, 657, 658, 71, 3, 256, 136, 117, 72, 72, 
    72, 659, 660, 141, 3, 256, 72, 72, 72, 72, 72, 661, 3, 256, 71, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 72, 72, 662, 403, 
    663, 72, 117, 72, 72, 72, 664, 665, 666, 87, 3, 667, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 141, 71, 182, 182, 668, 669, 670, 236, 237, 167],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 270, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [359, 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, 671, 627, 71, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 269, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 672, 71],
    [72, 72, 72, 72, 72, 72, 339, 339, 673, 48, 282, 71, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 101],
    [72, 72, 72, 72, 72, 72, 72, 72, 184, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    72, 72, 72, 91, 48, 674, 3, 256, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [72, 72, 72, 72, 72, 72, 72, 141, 72, 72, 72, 184, 3, 471, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 184, 3, 256, 72, 72, 72, 263, 675, 71, 
    72, 72, 72, 72, 72, 72, 195, 676, 677, 71, 3, 678, 679, 72, 72, 427, 
    72, 72, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 680, 72, 72, 72, 72, 681, 3, 256, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 17, 17, 17, 17, 20, 20, 20, 20, 
    182, 182, 682, 650, 17, 17, 17, 683, 20, 20, 540, 71, 71, 71, 71, 71, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 684, 685, 189, 189, 189, 189, 189, 
    189, 404, 686, 42, 71, 71, 71, 71, 71, 71, 71, 71, 687, 71, 688, 71],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 263, 71, 71, 71, 71, 247, 
    72, 72, 72, 184, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 101, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 689, 690],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 101, 71, 691, 71, 71, 71, 692, 71, 693, 71, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 269, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 101, 72, 209, 
    72, 141, 72, 694, 695, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 3, 696, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236],
    [236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 416, 697, 236, 236, 530, 71, 236, 236, 698, 71, 
    48, 48, 48, 48, 48, 282, 48, 48, 201, 71, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 416, 71, 71, 71, 71, 71, 71, 71],
    [236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 417, 71, 
    236, 236, 236, 236, 430, 699, 236, 236, 236, 236, 236, 236, 700, 701, 702, 703, 
    704, 291, 236, 236, 236, 705, 236, 236, 236, 236, 236, 236, 236, 376, 71, 71],
    [236, 236, 236, 236, 236, 236, 236, 236, 706, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 182, 182, 533, 71, 182, 182, 533, 71, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 430, 71, 182, 182, 182, 560, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [17, 17, 17, 707, 20, 20, 708, 17, 17, 709, 320, 20, 20, 17, 17, 17, 
    707, 20, 20, 710, 711, 712, 709, 713, 714, 20, 17, 17, 17, 707, 20, 20, 
    715, 307, 716, 717, 20, 20, 20, 718, 719, 720, 721, 20, 20, 708, 17, 17, 
    709, 20, 20, 20, 17, 17, 17, 707, 20, 20, 708, 17, 17, 709, 20, 20],
    [20, 17, 17, 17, 707, 20, 20, 708, 17, 17, 709, 20, 20, 20, 17, 17, 
    17, 707, 20, 20, 239, 17, 17, 17, 722, 20, 20, 723, 724, 17, 17, 725, 
    20, 20, 726, 708, 17, 17, 727, 20, 20, 21, 728, 17, 17, 18, 20, 20, 
    20, 729, 17, 17, 17, 722, 20, 20, 723, 730, 112, 3, 630, 731, 732, 112],
    [236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236],
    [48, 48, 48, 48, 48, 48, 733, 290, 48, 48, 48, 48, 48, 734, 735, 236, 
    736, 737, 71, 738, 68, 48, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    20, 739, 20, 493, 740, 569, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [201, 48, 48, 741, 742, 536, 42, 42, 42, 42, 42, 42, 42, 743, 71, 71, 
    71, 404, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    72, 72, 72, 72, 72, 209, 744, 743, 3, 745, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 72, 72, 72, 746, 71, 71, 72, 72, 72, 72, 72, 570, 3, 747, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, 748, 3, 256, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, 91, 749, 750],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, 184, 751, 91, 752, 753, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 184, 638, 72, 184],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 754, 182, 201, 71, 71, 71, 71, 71, 
    17, 17, 17, 17, 707, 20, 20, 20, 755, 756, 3, 471, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 567, 182, 
    182, 182, 182, 182, 182, 757, 758, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    567, 182, 182, 182, 182, 759, 182, 760, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [170, 72, 72, 72, 761, 191, 197, 762, 763, 764, 761, 765, 761, 197, 197, 133, 
    72, 137, 72, 269, 766, 137, 72, 269, 71, 71, 71, 71, 71, 71, 767, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [236, 236, 236, 236, 236, 416, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 416, 71, 236, 430, 699, 236, 699, 236, 699, 236, 236, 236, 417, 71, 
    182, 668, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 417, 71, 71, 71, 71, 71, 71, 768, 236, 236, 236],
    [376, 71, 236, 236, 236, 236, 236, 416, 236, 530, 237, 71, 417, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 769],
    [236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 770, 236, 529, 236, 529, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 237, 236, 416, 530, 71],
    [236, 416, 236, 236, 236, 236, 236, 236, 236, 71, 236, 237, 236, 236, 236, 236, 
    236, 71, 236, 236, 236, 417, 236, 416, 237, 71, 369, 698, 71, 71, 71, 71, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236],
    [236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 71, 236, 417, 236, 529, 
    236, 771, 236, 236, 236, 236, 236, 236, 430, 772, 236, 773, 236, 774, 236, 530, 
    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 
    236, 236, 775, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 3, 776],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 71, 71, 71, 71, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 72, 72, 263, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 263, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 141, 71, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 263, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [72, 72, 72, 263, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 101, 72, 72, 72, 72, 72, 72, 
    72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72],
    [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 270, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71],
    [777, 71, 71, 71, 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, 
    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 71, 71],
    [492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 
    492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 
    492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 
    492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 778]];
const buf3 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 26, 26, 26, 27, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
    28, 26, 29, 30, 31, 32, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 33, 34, 34, 34, 34, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 36, 37, 38, 39, 
    40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 
    26, 56, 57, 58, 58, 58, 58, 59, 26, 26, 60, 26, 26, 26, 26, 26, 
    26, 61, 26, 62, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    63, 58, 58, 58, 26, 64, 65, 66, 26, 26, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 26, 26, 26, 67, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 68, 69, 70, 58, 58, 58, 58, 71, 58, 
    58, 58, 58, 58, 58, 58, 72, 73, 74, 75, 76, 77, 78, 79, 58, 80, 
    81, 82, 83, 84, 85, 58, 86, 87, 88, 89, 78, 90, 91, 92, 58, 58, 
    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 93, 26, 26, 26, 26, 26, 26, 26, 26, 94, 26, 26, 26, 
    26, 26, 26, 26, 26, 26, 26, 95, 26, 26, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 26, 26, 96, 26, 97, 58, 58, 58, 58, 26, 98, 58, 58, 
    26, 26, 26, 26, 26, 26, 26, 26, 26, 99, 26, 26, 26, 26, 26, 26, 
    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 100, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    101, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 102, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 102];

function code_property(ch) {
    return pool[pool2[buf3[ch>>9]][(ch>>3)&0x3F]][ch&0x7];
}
function code_category(ch) {
    return code_property(ch) & 0x1F;
}
function code_numeric(ch) {
    return (code_property(ch) >> 5) - 1;
}


const MAX_ARITY = 2147483647;


function make_special(func) {
    let peek = new Provable();
    peek.flags |= MASK_PRED_SPECIAL;
    peek.func = func;
    return peek;
}

function make_check(func) {
    let peek = new Provable();
    peek.flags |= MASK_PRED_TEST;
    peek.func = func;
    return peek;
}

function make_arithmetic(func) {
    let peek = new Provable();
    peek.flags |= MASK_PRED_ARITH;
    peek.func = func;
    return peek;
}


function test_fail(args) {
    return false;
}

function test_cut(args) {
    let choice = exec_build(args[0]);
    more(choice);
    return true;
}

function test_mark(args) {
    let choice = redo;
    return exec_unify(args[0], choice);
}


function special_seq(args) {
    let temp = deref(args[0]);
    solve_mark(temp);
    temp = deref(args[1]);
    solve_seq(temp);
    return true;
}

function solve_mark(temp) {
    if (temp === "nothing") {
        /* */
    } else if (is_structure(temp) &&
            temp.functor === "just" &&
            temp.args.length === 1) {
        temp = deref(temp.args[0]);
        bind(redo, temp);
    } else {
        check_nonvar(temp);
        temp = copy_term(temp);
        throw make_error(new Compound("type_error", ["maybe", temp]));
    }
}

function solve_seq(peek) {
    let back = null;
    let res = null;
    while (is_structure(peek) &&
                peek.functor === "." &&
                peek.args.length === 2) {
        let goal = deref(peek.args[0]);
        goal = new Compound(".", [goal, undefined]);
        if (back === null) {
            res = goal;
        } else {
            back.args[1] = goal;
        }
        back = goal;
        peek = deref(peek.args[1]);
    }
    check_nil(peek);
    if (back === null) {
        res = call.args[1];
    } else {
        back.args[1] = call.args[1];
    }
    cont(res);
}

function special_alt(args) {
    let goal = deref(args[0]);
    return solve_alt(goal, -1, null);
}

function solve_alt(peek, at, choice) {
    if (is_structure(peek) &&
            peek.functor === "." &&
            peek.args.length === 2) {
        let mark = trail;
        let goal = deref(peek.args[0]);
        solve_mark(deref(goal.args[0]));
        peek = deref(peek.args[1]);
        if (is_structure(peek) &&
                peek.functor === "." &&
                peek.args.length === 2) {
            if (choice === null) {
                choice = new Choice(solve_alt, peek, -1, mark);
            } else {
                choice.data = peek;
            }
            more(choice);
        }
        solve_seq(deref(goal.args[1]));
        return true;
    } else {
        return false;
    }
}


function test_sys_raise(args) {
    let problem = exec_build(args[0]);
    throw copy_term(problem);
}

function special_sys_trap(args) {
    let goal = deref(args[0]);
    let snap = snap_setup();
    goal = new Compound(".", [goal, "[]"]);
    cont(goal);
    return solve_catch(snap, true, null);
}

function solve_catch(snap, found, choice) {
    if (choice !== null) {
        choice.mark = null;
        choice.cont = "[]";
        choice.tail = null;
    }
    try {
        found = solve(snap, found);
    } catch (err) {
        snap_cleanup(snap);
        let goal = deref(call.args[0]);
        err = map_throwable(err);
        if (!unify(goal.args[1], err))
            throw err;
        goal = deref(goal.args[2]);
        goal = new Compound(".", [goal, call.args[1]]);
        cont(goal);
        return true;
    }
    if (found === false)
        return false;
    if (redo !== snap) {
        if (choice === null) {
            choice = new Choice(solve_catch, snap, false, trail);
        } else {
            choice.mark = trail;
            choice.cont = call;
            choice.tail = redo;
        }
        more(choice);
    } else {
        more(snap.tail);
    }
    if (found === true)
        cont(snap.cont.args[1]);
    return found;
}

function map_throwable(err) {
    if (err instanceof RangeError && err.message.includes("stack"))
        err = make_error(new Compound("system_error", ["stack_overflow"]));
    return err;
}


function test_os_sleep_promise(args) {
    let delay = exec_build(args[0]);
    check_integer(delay);
    if (delay < 0)
        throw make_error(new Compound("domain_error",
            ["not_less_than_zero", delay]));
    let buf = ctx;
    return exec_unify(args[1], sleep_promise(buf, delay));
}

function sleep_promise(buf, delay) {
    return new Promise(resolve => {
        function handler() {
            register_interrupt(buf, () => {});
            resolve();
        }
        let timer = setDelay(handler, delay);
        register_interrupt(buf, () => {
            clearTimeout(timer);
            register_interrupt(buf, () => {});
            resolve()
        });
    });
}

function test_os_import_promise(args) {
    let url = exec_build(args[0]);
    check_atom(url);
    let res = {};
    if (!exec_unify(args[1], res))
        return false;
    let buf = ctx;
    return exec_unify(args[2], import_promise(buf, url, res));
}

async function import_promise(buf, path, res) {
    try {
        let path2;
        if (fs !== undefined) {
            path2 = url.pathToFileURL(path);
        } else {
            path2 = path;
        }
        res.module = await import(path2);
    } catch (err) {
        if (err instanceof SyntaxError) {
            register_signal(buf,
                new Compound("syntax_error", ["bad_module"]));
        } else {
            register_signal(buf,
                new Compound("existence_error", ["module", path]));
        }
    }
}

function test_os_invoke_main(args) {
    let module = exec_build(args[0]);
    let val = module.main;
    if (val === undefined) {
        throw make_error(new Compound("existence_error",
            ["method", "main"]));
    } else if (typeof val !== "function") {
        throw make_error(new Compound("permission_error",
            ["invoke", "method", "main"]));
    } else {
        val();
    }
    return true;
}


function special_yield(args) {
    if ((engine.flags & SYS_MASK_ALLOW_YIELD) === 0)
        throw make_error(new Compound("system_error", ["illegal_yield"]));
    cont(call.args[1]);
    more(new Choice(solve_signal, null, 0, trail));
    return deref(args[0]);
}

function special_shield(args) {
    let goal = deref(args[0]);
    let snap = snap_setup();
    goal = new Compound(".", [goal, "[]"]);
    cont(goal);
    return solve_shield(snap, true, null);
}

function solve_shield(snap, found, choice) {
    if (choice !== null) {
        choice.mark = null;
        choice.cont = "[]";
        choice.tail = null;
    }
    let back = engine.flags & SYS_MASK_ASYNC_MODE;
    engine.flags &= ~SYS_MASK_ASYNC_MODE;
    try {
        found = solve(snap, found);
    } catch (x) {
        engine.flags &= ~SYS_MASK_ASYNC_MODE;
        engine.flags |= back;
        snap_cleanup(snap);
        throw x;
    }
    engine.flags &= ~SYS_MASK_ASYNC_MODE;
    engine.flags |= back;
    if (found === false)
        return false;
    if (redo !== snap) {
        if (choice === null) {
            choice = new Choice(solve_shield, snap, false, trail);
        } else {
            choice.mark = trail;
            choice.cont = call;
            choice.tail = redo;
        }
        more(choice);
    } else {
        more(snap.tail);
    }
    if (found === true)
        cont(snap.cont.args[1]);
    return found;
}

function special_unshield(args) {
    let goal = deref(args[0]);
    let snap = snap_setup();
    goal = new Compound(".", [goal, "[]"]);
    cont(goal);
    return solve_unshield(snap, true, null);
}

function solve_unshield(snap, found, choice) {
    if (choice !== null) {
        choice.mark = null;
        choice.cont = "[]";
        choice.tail = null;
    }
    let back = engine.flags & SYS_MASK_ASYNC_MODE;
    engine.flags |= SYS_MASK_ASYNC_MODE;
    try {
        found = solve(snap, found);
    } catch (x) {
        engine.flags &= ~SYS_MASK_ASYNC_MODE;
        engine.flags |= back;
        snap_cleanup(snap);
        throw x;
    }
    engine.flags &= ~SYS_MASK_ASYNC_MODE;
    engine.flags |= back;
    if (found === false)
        return false;
    if (redo !== snap) {
        if (choice === null) {
            choice = new Choice(solve_unshield, snap, false, trail);
        } else {
            choice.mark = trail;
            choice.cont = call;
            choice.tail = redo;
        }
        more(choice);
    } else {
        more(snap.tail);
    }
    if (found === true)
        cont(snap.cont.args[1]);
    return found;
}

function special_call(args) {
    let goal = deref(args[0]);
    goal = new Compound(".", [goal, call.args[1]]);
    cont(goal);
    return true;
}


function check_atom(beta) {
    if (!is_atom(beta)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["atom", beta]));
    }
}

function check_number(beta) {
    if (!is_number(beta)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["number", beta]));
    }
}

function check_integer(beta) {
    if (!is_integer(beta)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["integer", beta]));
    }
}

function check_atomic(beta) {
    if (is_variable(beta) || is_structure(beta)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["atomic", beta]));
    }
}

function check_nil(beta) {
    if (beta === "[]")
        return;
    if (is_structure(beta) && beta.functor === "."
        && beta.args.length === 2) {
        throw make_error(new Compound("representation_error",
            ["max_arity"]));
    } else {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error",
            ["list", beta]));
    }
}


function test_unify(args) {
    let alpha = exec_build(args[0]);
    return exec_unify(args[1], alpha);
}

function test_copy_term(args) {
    let alpha = exec_build(args[0]);
    alpha = copy_term(alpha);
    return exec_unify(args[1], alpha);
}


function test_univ(args) {
    let alpha = exec_deref(args[0]);
    if (is_variable(alpha) || is_pending(alpha)) {
        let beta = exec_build(args[1]);
        beta = special_univ_pack(beta);
        return exec_unify(alpha, beta);
    } else {
        alpha = exec_build(alpha);
        alpha = special_univ_unpack(alpha);
        return exec_unify(args[1], alpha);
    }
}

function special_univ_pack(beta) {
    if (is_structure(beta) &&
        "." === beta.functor &&
        beta.args.length === 2) {
        /* */
    } else {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["list", beta]));
    }
    let functor = deref(beta.args[0]);
    check_atomic(functor);
    beta = deref(beta.args[1]);
    let args = list_objects(beta);
    if (args.length === 0) {
        /* */
    } else {
        if (is_number(functor))
            throw make_error(new Compound("type_error", ["atom", functor]));
        functor = new Compound(functor, args);
    }
    return functor;
}

function list_objects(obj) {
    let peek = obj;
    let i = 0;
    while (is_structure(peek) &&
            "." === peek.functor &&
            peek.args.length === 2 &&
            i < MAX_ARITY) {
        i++;
        peek = deref(peek.args[1]);
    }
    check_nil(peek);
    if (i === 0) {
        return VOID_ARGS;
    } else {
        let args = new Array(i);
        peek = obj;
        i = 0;
        while (is_structure(peek) &&
                "." === peek.functor &&
                peek.args.length === 2) {
            args[i++] = deref(peek.args[0]);
            peek = deref(peek.args[1]);
        }
        return args;
    }
}

function special_univ_unpack(alpha) {
    if (is_structure(alpha)) {
        let temp = alpha.args;
        alpha = alpha.functor;
        return new Compound(".", [alpha,
            objects_list(temp, 0, temp.length)]);
    } else {
        return new Compound(".", [alpha, "[]"]);
    }
}

function objects_list(args, off, count) {
    let res = "[]";
    for (let i = off + count - 1; i >= off; i--)
        res = new Compound(".", [args[i], res]);
    return res;
}

function test_functor(args) {
    let alpha = exec_deref(args[0]);
    if (is_variable(alpha) || is_pending(alpha)) {
        let functor = exec_build(args[1]);
        check_atomic(functor);
        let arity = exec_build(args[2]);
        check_integer(arity);
        if (arity < 0)
            throw make_error(new Compound("domain_error",
                ["not_less_than_zero", arity]));
        if (arity > MAX_ARITY)
            throw make_error(new Compound("representation_error",
                ["max_arity"]));
        arity = narrow_float(arity);
        if (arity === 0) {
            /* */
        } else {
            if (is_number(functor))
                throw make_error(new Compound("type_error", ["atom", functor]));
            let temp = new Array(arity);
            for (let i = 0; i < arity; i++)
                temp[i] = new Variable();
            functor = new Compound(functor, temp);
        }
        return exec_unify(alpha, functor);
    } else {
        alpha = exec_build(alpha);
        let functor;
        let arity;
        if (is_structure(alpha)) {
            functor = alpha.functor;
            arity = alpha.args.length;
        } else {
            functor = alpha;
            arity = 0;
        }
        if (!exec_unify(args[1], functor))
            return false;
        return exec_unify(args[2], norm_smallint(arity));
    }
}

function test_arg(args) {
    let alpha = exec_build(args[0]);
    check_integer(alpha);
    let beta = exec_build(args[1]);
    check_callable(beta);
    let arity;
    if (is_structure(beta)) {
        arity = beta.args.length;
    } else {
        arity = 0;
    }
    if (alpha < 1 || arity < alpha)
        return false;
    beta = beta.args[alpha - 1];
    return exec_unify(args[2], beta);
}

function check_callable(beta) {
    if (is_variable(beta) || is_number(beta)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["callable", beta]));
    }
}


function test_change_arg(args) {
    let alpha = exec_build(args[0]);
    check_integer(alpha);
    let beta = exec_build(args[1]);
    check_callable(beta);
    let gamma = exec_build(args[2]);
    let arity;
    if (is_structure(beta)) {
        arity = beta.args.length;
    } else {
        arity = 0;
    }
    if (alpha < 1 || arity < alpha)
        return false;
    linkarg(gamma, beta, alpha);
    return true;
}

function linkarg(source, term, pos) {
    if (is_frozen(term))
        throw make_error(new Compound("permission_error",
            ["modify", "compound", term]));
    if ((term.walk & VAR_MASK_STATE) === gc_mask)
        mark2_term(source);
    term.args[pos-1] = source;
}


function test_term_variables(args) {
    let alpha = exec_build(args[0]);
    let res = null;
    let back = null;

    function term_variables2(node) {
        let peek = new Compound(".", [node, undefined]);
        if (back === null) {
            res = peek;
        } else {
            back.args[1] = peek;
        }
        back = peek;
        return false;
    }

    walk_vars(alpha, term_variables2, VAR_MASK_SEEN);
    if (back === null) {
        res = "[]";
    } else {
        back.args[1] = "[]";
    }
    walk_vars(alpha, node => false, 0);
    return exec_unify(args[1], res);
}

function walk_vars(first, acceptor, state) {
    let stack = null;
    for (; ; ) {
        first = deref(first);
        if (is_variable(first)) {
            if ((first.flags & VAR_MASK_SEEN) !== state) {
                if (acceptor(first))
                    return true;
                first.flags = (first.flags & ~VAR_MASK_SEEN) | state;
            }
        } else if (is_compound(first)) {
            if ((first.walk & VAR_MASK_SEEN) !== state) {
                first.walk = (first.walk & ~VAR_MASK_SEEN) | state;
                if (0 !== first.args.length - 1) {
                    first.walk &= ~VAR_MASK_SERNO;
                    stack = stack_push(stack, first);
                }
                first = first.args[0];
                continue;
            }
        }
        let item = stack_peek(stack);
        if (item === null) {
            return false;
        } else {
            item.walk++;
            first = item.args[item.walk & VAR_MASK_SERNO];
            if ((item.walk & VAR_MASK_SERNO) === item.args.length - 1)
                stack_pop(stack);
        }
    }
}


function test_var(args) {
    let alpha = exec_build(args[0]);
    return is_variable(alpha);
}

function test_compound(args) {
    let alpha = exec_build(args[0]);
    return is_structure(alpha);
}

function test_nonvar(args) {
    let alpha = exec_build(args[0]);
    return !is_variable(alpha);
}


function test_atomic(args) {
    let alpha = exec_build(args[0]);
    if (is_structure(alpha) || is_variable(alpha))
        return false;
    return true;
}

function test_number(args) {
    let alpha = exec_build(args[0]);
    return is_number(alpha);
}

function test_float(args) {
    let alpha = exec_build(args[0]);
    return is_float(alpha) && !is_special(alpha);
}


function test_integer(args) {
    let alpha = exec_build(args[0]);
    return is_integer(alpha);
}

function test_atom(args) {
    let alpha = exec_build(args[0]);
    return is_atom(alpha);
}

function test_callable(args) {
    let alpha = exec_build(args[0]);
    if (is_variable(alpha) || is_number(alpha))
        return false;
    return true;
}

function test_must_be(args) {
    let alpha = exec_build(args[0]);
    check_atom(alpha);
    let beta = exec_build(args[1]);
    if ("integer" === alpha) {
        check_integer(beta);
    } else if ("atom" === alpha) {
        check_atom(beta);
    } else if ("callable" === alpha) {
        check_callable(beta);
    } else {
        throw make_error(new Compound("type_error",
                ["type", alpha]));
    }
    return true;
}


function norm_smallint(alpha) {
    if ((-94906266 <= alpha) && (alpha <= 94906266)) {
        return alpha;
    } else {
        return BigInt(alpha);
    }
}

function norm_bigint(alpha) {
    if ((-94906266 <= alpha) && (alpha <= 94906266)) {
        return Number(alpha);
    } else {
        return alpha;
    }
}

function widen_bigint(alpha) {
    if (!is_bigint(alpha)) {
        return BigInt(alpha);
    } else {
        return alpha;
    }
}

function narrow_float(alpha) {
    if (!is_bigint(alpha)) {
        if (!Number.isFinite(alpha))
            throw make_error(new Compound("evaluation_error", ["undefined"]));
    } else {
        alpha = Number(alpha);
        if (!Number.isFinite(alpha))
            throw make_error(new Compound("evaluation_error", ["float_overflow"]));
    }
    return alpha;
}

function norm_float(alpha) {
    if (Number.isNaN(alpha))
        throw make_error(new Compound("evaluation_error", ["undefined"]));
    if (!Number.isFinite(alpha))
        throw make_error(new Compound("evaluation_error", ["float_overflow"]));
    if ((-94906266 <= alpha) && (alpha <= 94906266)
        && Number.isInteger(alpha))
        return BigInt(alpha);
    return alpha;
}


function test_code_category(args) {
    let alpha = exec_build(args[0]);
    check_integer(alpha);
    if (alpha < 0 || alpha > 0x10FFFF) {
        alpha = 0; // UNASSIGNED
    } else {
        alpha = code_category(alpha);
    }
    return exec_unify(args[1], alpha);
}

function test_code_numeric(args) {
    let alpha = exec_build(args[0]);
    check_integer(alpha);
    if (alpha < 0 || alpha > 0x10FFFF) {
        alpha = -1; // UNASSIGNED
    } else {
        alpha = code_numeric(alpha);
    }
    return exec_unify(args[1], alpha);
}


function test_atom_integer(args) {
    let radix = exec_build(args[1]);
    check_integer(radix);
    if (radix < 2 || radix > 36)
        throw make_error(new Compound("domain_error", ["radix", radix]));
    let text = exec_deref(args[0]);
    if (is_variable(text) || is_pending(text)) {
        let beta = exec_build(args[2]);
        check_integer(beta);
        beta = beta.toString(radix);
        return exec_unify(text, beta);
    } else {
        text = exec_build(text);
        check_atom(text);
        text = atom_integer_decode(text, radix);
        return exec_unify(args[2], text);
    }
}

function atom_integer_decode(text, radix) {
    text = ascii_replace(text, radix, false);
    let res;
    let step = (52 / (32 - Math.clz32(radix - 1))) | 0;
    if (text.length <= step) {
        res = Number.parseInt(text, radix);
        if (isNaN(res))
            throw make_error(new Compound("syntax_error", ["illegal_number"]));
        res = norm_smallint(res);
    } else {
        if (0 < text.length && text.charCodeAt(0) === 45) {
            res = -bigint_parse(text, 1, step, radix);
        } else {
            res = bigint_parse(text, 0, step, radix);
        }
        res = norm_bigint(res);
    }
    return res;
}

function bigint_parse(str, help, step, radix) {
    if (help === str.length)
        throw make_error(new Compound("syntax_error", ["illegal_number"]));
    let res = BigInt(0);
    while (help + step < str.length) {
        let temp = Number.parseInt(str.slice(help, help + step), radix);
        if (isNaN(temp) || temp < 0)
            throw make_error(new Compound("syntax_error", ["illegal_number"]));
        res = res * BigInt(radix ** step) + BigInt(temp);
        help += step;
    }
    let temp = Number.parseInt(str.slice(help), radix);
    if (isNaN(temp) || temp < 0)
        throw make_error(new Compound("syntax_error", ["illegal_number"]));
    return res * BigInt(radix ** (str.length - help)) + BigInt(temp);
}

function ascii_replace(text, radix, expo) {
    let buf = "";
    let last = 0;
    let pos = 0;
    while (pos < text.length) {
        let ch = text.codePointAt(pos);
        let val = code_numeric(ch);
        if (val >= 0 && val < radix) {
            if (ch <= 127) { // ASCII
                /* */
            } else {
                if (val < 10) {
                    val += 48; // '0'
                } else {
                    val += 55; // 'A'-10
                }
                buf += text.slice(last, pos) + String.fromCodePoint(val);
                last = pos + char_count(ch);
            }
        } else if ((ch===43 || ch===45) && (pos===0 ||
            (expo && (text.charCodeAt(pos-1)===101 || text.charCodeAt(pos-1)===69)))) {
            /*  */
        } else if (expo && (ch===46 || ch===101 || ch===69)) {
            /*  */
        } else {
            throw make_error(new Compound("syntax_error", ["illegal_number"]));
        }
        pos += char_count(ch);
    }
    if (last !== 0) {
        buf += text.slice(last);
        return buf;
    } else {
        return text;
    }
}

function char_count(ch) {
    if (ch <= 0xFFFF) {
        return 1;
    } else {
        return 2;
    }
}


function test_atom_number(args) {
    let text = exec_deref(args[0]);
    if (is_variable(text) || is_pending(text)) {
        let beta = exec_build(args[1]);
        check_number(beta);
        beta = atom_number_encode(beta);
        return exec_unify(text, beta);
    } else {
        text = exec_build(text);
        check_atom(text);
        text = atom_number_decode(text);
        return exec_unify(args[1], text);
    }
}

function atom_number_encode(num) {
    if (is_integer(num)) {
        return num.toString();
    } else {
        num = narrow_float(num);
        let res = num.toPrecision(16);
        if (Number(res) !== num)
            res = num.toPrecision(17);
        return shape_number(res);
    }
}

function shape_number(res) {
    let peek = res.indexOf("e");
    if (peek !== -1) {
        res = shape_number_mantissa(res.slice(0, peek)) +
            "e" + shape_number_exponent(res.slice(peek + 1));
    } else {
        res = shape_number_mantissa(res);
    }
    return res;
}

function shape_number_mantissa(res) {
    if (res.indexOf(".") !== -1) {
        let pos = res.length;
        while (res.charCodeAt(pos - 1) === 48)  // '0'
            pos--;
        if (res.charCodeAt(pos - 1) === 46)  // '.'
            pos++;
        if (pos !== res.length)
            res = res.slice(0, pos);
    } else {
        res += ".0";
    }
    return res;
}

function shape_number_exponent(res) {
    if (res.startsWith("+"))
        res = res.slice(1);
    return res;
}

function atom_number_decode(text) {
    text = ascii_replace(text, 10, true);
    let res;
    if ((text.indexOf(".") !== -1) ||
        (text.indexOf("e") !== -1) ||
        (text.indexOf("E") !== -1)) {
        res = Number(text);
        if (isNaN(res))
            throw make_error(new Compound("syntax_error", ["illegal_number"]));
        res = norm_float(res);
    } else {
        if (text.length <= 8) {
            res = Number(text);
            if (isNaN(res))
                throw make_error(new Compound("syntax_error", ["illegal_number"]));
            res = norm_smallint(res);
        } else {
            try {
                res = BigInt(text);
            } catch (e) {
                throw make_error(new Compound("syntax_error", ["illegal_number"]));
            }
            res = norm_bigint(res);
        }
    }
    return res;
}


function test_sys_goal_ossify(args) {
    let alpha = exec_build(args[0]);
    let body = list_objects(alpha);
    let beta = exec_build(args[1]);
    let cutvar;
    let size = 0;
    try {
        size = number_term(beta, size);
        size = number_objects(body, size);
        cutvar = ossify_cutvar(beta);
        ossify_objects(body);
    } finally {
        unossify_term(beta);
        unossify_objects(alpha);
    }
    return exec_unify(args[2],
        new Goal(size, body, cutvar));
}

function test_sys_clause_ossify(args) {
    let alpha = exec_build(args[0]);
    let head = list_objects(alpha);
    let beta = exec_build(args[1]);
    let body = list_objects(beta);
    let gamma = exec_build(args[2]);
    let mue = exec_build(args[3]);
    let cutvar;
    let size = 0;
    try {
        size = number_term(gamma, size);
        size = number_objects(head, size);
        size = number_objects(body, size);
        cutvar = ossify_cutvar(gamma);
        ossify_objects(head);
        ossify_objects(body);
    } finally {
        unossify_term(gamma);
        unossify_objects(alpha);
        unossify_objects(beta);
    }
    return exec_unify(args[4],
        new Clause(size, mue, head, body, cutvar));
}


function number_objects(peek, size) {
    for (let i = 0; i < peek.length; i++)
       size = number_term(peek[i], size);
    return size;
}

function ossify_objects(peek) {
    for (let i = 0; i < peek.length; i++)
        peek[i] = ossify_term(peek[i]);
}

function unossify_objects(peek) {
    while (is_structure(peek) &&
            "." === peek.functor &&
            peek.args.length === 2) {
        unossify_term(peek.args[0]);
        peek = deref(peek.args[1]);
    }
}


function ossify_cutvar(peek) {
    if (is_structure(peek) &&
        "just" === peek.functor &&
        peek.args.length === 1) {
        let res = ossify_term(peek.args[0]);
        return res.index;
    } else {
        return -1;
    }
}


function number_term(alpha, size) {

    function number_term2(first) {
        for (; ;) {
            first = deref(first);
            if (is_variable(first)) {
                if (first.tail === null) {
                    first.tail = undefined;
                } else if (first.tail === undefined) {
                    first.tail = new Place(size);
                    size++;
                }
            } else if (is_compound(first)) {
                let i = 0;
                for (; i < first.args.length - 1; i++)
                    number_term2(first.args[i]);
                first = first.args[i];
                continue;
            }
            break;
        }
    }

    number_term2(alpha);
    return size;
}

function ossify_term(first) {
    let back = null;
    for (;;) {
        first = deref(first);
        if (is_variable(first)) {
            first = first.tail;
        } else if (is_compound(first)) {
            let args = new Array(first.args.length);
            let i = 0;
            for (; i < first.args.length-1; i++)
                args[i] = ossify_term(first.args[i]);
            args[i] = back;
            back = new Skeleton(first.functor, args);
            first = first.args[i];
            continue;
        }
        while (back !== null) {
            let peek = back.args[back.args.length-1];
            back.args[back.args.length-1] = first;
            first = try_freeze(back);
            back = peek;
        }
        return first;
    }
}

function try_freeze(alpha) {
    for (let i = 0; i < alpha.args.length; i++) {
        let temp = alpha.args[i];
        if (is_pending(temp))
            return alpha;
        if (is_skeleton(temp))
            return alpha;
    }
    return new Frozen(alpha.functor, alpha.args);
}

function unossify_term(first) {
    for (;;) {
        first = deref(first);
        if (is_variable(first)) {
            if (first.tail != null)
                first.tail = null;
        } else if (is_compound(first)) {
            let i = 0;
            for (; i < first.args.length-1; i++)
                unossify_term(first.args[i]);
            first = first.args[i];
            continue;
        }
        break;
    }
}


function test_sys_clause_add(args) {
    let gamma = exec_build(args[0]);
    check_clause(gamma);
    let flags = exec_build(args[1]);
    check_integer(flags);
    add_clause(gamma, flags);
    return true;
}

function check_clause(beta) {
    if (!is_clause(beta)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["clause", beta]));
    }
}

function special_sys_goal_call(args) {
    let goal = deref(args[0]);
    check_goal(goal);
    goal = melt_directive(goal);
    solve_seq(goal);
    return true;
}

function check_goal(beta) {
    if (!is_goal(beta)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["goal", beta]));
    }
}


// Albufeira compiler, control flow
set("fail", 0, make_check(test_fail));
set("$CUT", 1, make_check(test_cut));
set("$MARK", 1, make_check(test_mark));
set("$SEQ", 2, make_special(special_seq));
set("$ALT", 1, make_special(special_alt));
set("sys_raise", 1, make_check(test_sys_raise));
set("sys_trap", 3, make_special(special_sys_trap));

// Albufeira compiler, async flow
set("os_sleep_promise", 2, make_check(test_os_sleep_promise));
set("os_import_promise", 3, make_check(test_os_import_promise));
set("os_invoke_main", 1, make_check(test_os_invoke_main));
set("$YIELD", 1, make_special(special_yield));
set("shield", 1, make_special(special_shield));
set("unshield", 1, make_special(special_unshield));
set("call", 1, make_special(special_call));

// term specials
set("=", 2, make_check(test_unify));
set("copy_term", 2, make_check(test_copy_term));
set("=..", 2, make_check(test_univ));
set("functor", 3, make_check(test_functor));
set("arg", 3, make_check(test_arg));
set("change_arg", 3, make_check(test_change_arg));
set("term_variables", 2, make_check(test_term_variables));

// type specials
set("var", 1, make_check(test_var));
set("compound", 1, make_check(test_compound));
set("nonvar", 1, make_check(test_nonvar));
set("atomic", 1, make_check(test_atomic));
set("number", 1, make_check(test_number));
set("float", 1, make_check(test_float));

// must specials
set("integer", 1, make_check(test_integer));
set("atom", 1, make_check(test_atom));
set("callable", 1, make_check(test_callable));
set("must_be", 2, make_check(test_must_be));

// atom specials
set("code_category", 2, make_check(test_code_category));
set("code_numeric", 2, make_check(test_code_numeric));
set("atom_integer", 3, make_check(test_atom_integer));
set("atom_number", 2, make_check(test_atom_number));

// clause specials
set("sys_goal_ossify", 3, make_check(test_sys_goal_ossify));
set("sys_clause_ossify", 5, make_check(test_sys_clause_ossify));
set("sys_clause_add", 2, make_check(test_sys_clause_add));
set("sys_goal_call", 1, make_special(special_sys_goal_call));


const MAX_BUF = 4096;

let bootbase = "";
let codebase = "";

function set_bootbase(url) {
    bootbase = url;
}

function set_codebase(url) {
    codebase = url;
}


const MASK_DST_COLR = 0x00000004;
const MASK_DST_CYCL = 0x00000008;
const MASK_DST_FEAT = MASK_DST_COLR | MASK_DST_CYCL;

const MASK_DST_LINE = 0x00000010;

function Sink() {
    this.buf = null;
    this.send = (fd, buf) => fd;
    this.last = -1;
    this.flags = 0;
    this.notify = fd => {};
    this.release = fd => {};
    this.data = undefined;
    this.indent = 0;
    this.offset = 0;
}

function test_current_output(args) {
    let alpha = engine.text_output;
    return exec_unify(args[0], alpha);
}

function test_current_error(args) {
    let alpha = engine.text_error;
    return exec_unify(args[0], alpha);
}


function test_set_output(args) {
    let obj = exec_build(args[0]);
    check_sink(obj);
    engine.text_output = obj;
    return true;
}

function test_set_error(args) {
    let obj = exec_build(args[0]);
    check_sink(obj);
    engine.text_error = obj;
    return true;
}

function check_sink(beta) {
    if (!(beta instanceof Sink)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["writer", beta]));
    }
}


function test_put_atom(args) {
    let stream = exec_build(args[0]);
    check_sink(stream);
    let text = exec_build(args[1]);
    check_atom(text);
    put_atom(stream, text);
    return true;
}

function put_atom(stream, text) {
    if (text.length > 0) {
        let pos = text.lastIndexOf("\n");
        if (pos !== -1) {
            stream.offset = atom_count(text, pos+1, text.length);
        } else {
            stream.offset += atom_count(text, 0, text.length);
        }
        stream.last = code_point_before(text, text.length);
        if (stream.buf !== null) {
            stream.buf += text;
            if (stream.buf.length >= MAX_BUF)
                flush_buffer(stream);
        } else {
            stream.data = stream.send(stream.data, text);
        }
    }
}

function flush_buffer(stream) {
    if (stream.buf !== null && stream.buf.length > 0) {
        let text = stream.buf;
        stream.buf = "";
        stream.data = stream.send(stream.data, text);
    }
}

function code_point_before(text, pos) {
    let ch = text.charCodeAt(pos - 1);
    if (ch >= 0xDC00 && ch <= 0xDFFF && pos > 1) {
        let res2 = text.charCodeAt(pos - 2);
        if (res2 >= 0xD800 && res2 <= 0xDBFF)
            ch = ((res2 - 0xD7C0) << 10) + ch - 0xDC00;
    }
    return ch;
}


const MASK_SRC_SKIP = 0x00000001;
const MASK_SRC_AREAD = 0x00000002;

function Source() {
    this.buf = "";
    this.pos = 0;
    this.receive = fd => "";
    this.flags = 0;
    this.lineno = 0;
    this.release = fd => {};
    this.data = undefined;
    this.partial = undefined;
}

function test_current_input(args) {
    let alpha = engine.text_input;
    return exec_unify(args[0], alpha);
}

function test_set_input(args) {
    let obj = exec_build(args[0]);
    check_source(obj);
    engine.text_input = obj;
    return true;
}

function check_source(beta) {
    if (!(beta instanceof Source)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["reader", beta]));
    }
}


function test_os_get_code(args) {
    let stream = exec_build(args[0]);
    let pos = stream.pos;
    let buf = stream.buf;
    if (pos < buf.length) {
        let ch = buf.codePointAt(pos);
        pos += char_count(ch);
        if (ch === 13 || (ch === 10 && (stream.flags & MASK_SRC_SKIP) === 0))
            stream.lineno++;
        if (ch === 13) {
            stream.flags |= MASK_SRC_SKIP;
        } else {
            stream.flags &= ~MASK_SRC_SKIP;
        }
        stream.pos = pos;
        return exec_unify(args[1], ch);
    } else {
        return false;
    }
}

function test_os_peek_code(args) {
    let stream = exec_build(args[0]);
    let pos = stream.pos;
    let buf = stream.buf;
    if (pos < buf.length) {
        let ch = buf.codePointAt(pos);
        return exec_unify(args[1], ch);
    } else {
        return false;
    }
}


function test_os_open_promise(args) {
    let url = exec_build(args[0]);
    check_atom(url);
    let opts = exec_build(args[1]);
    let stream = new Source();
    if (!exec_unify(args[2], stream))
        return false;
    let buf = ctx;
    let prom;
    if (fs !== undefined) {
        prom = open_file_promise_opts(buf, stream, url, opts);
    } else {
        throw make_error(new Compound("permission_error",
            ["access", "source_sink", url]));
    }
    return exec_unify(args[3], prom);
}

function get_encoding(opts) {
    if (opts !== null && opts.get("encoding") !== undefined) {
        return opts.get("encoding");
    } else {
        return "utf8";
    }
}

function open_file_promise_opts(buf, stream, url, opts) {
    return new Promise(resolve => {
        fs.open(url, (err, fd) => {
            if (!err) {
                let enc = get_encoding(opts);
                stream.data = fd;
                stream.receive = (buf, stream) => file_read_promise(enc, buf, stream);
                stream.release = file_close_promise;
                stream.partial = Buffer.alloc(0);
                stream.flags |= MASK_SRC_AREAD;
            } else {
                register_signal(buf, map_file_error(err, url));
            }
            resolve();
        });
    });
}

function map_file_error(err, url) {
    if (err.cause !== undefined) {
        let code = err.cause.code;
        if (code === "ENOTFOUND") {
            return new Compound("resource_error", ["unknown_host"]);
        } else {
            return new Compound("resource_error", ["connect_failed"]);
        }
    } else {
        let code = err.code;
        if (code === "ENOENT" || code === "EISDIR" || code === "EPERM") {
            return new Compound("existence_error",
                ["source_sink", url]);
        } else {
            return new Compound("resource_error", ["remote_error"]);
        }
    }
}


function test_os_read_promise(args) {
    let stream = exec_build(args[0]);
    let buf = ctx;
    return exec_unify(args[1], stream.receive(buf, stream));
}

function file_read_promise(enc, buf, stream) {
    return new Promise(resolve => {
        let res = Buffer.alloc(8192);
        stream.partial.copy(res, 0);
        let pos = stream.partial.length;
        fs.read(stream.data, res, pos, 8192-pos, null, (err, len, _) => {
            if (!err) {
                let last = last_valid(res, pos+len, enc);
                stream.buf = res.toString(enc, 0, last);
                stream.pos = 0;
                stream.partial = res.slice(last, pos+len);
            } else {
                register_signal(buf, map_stream_error(err));
            }
            resolve();
        });
    });
}

function last_valid(res, len, enc) {
    if (enc === "utf8") {
        let pos = len;
        while (pos > 0 && (res[pos-1] & 0xC0) === 0x80)
            pos--;
        if (pos > 0) {
            if ((res[pos - 1] & 0x80) === 0x00 && pos === len) {
                return len;
            } else if ((res[pos - 1] & 0xE0) === 0xC0 && pos === len - 1) {
                return len;
            } else if ((res[pos - 1] & 0xF0) === 0xE0 && pos === len - 2) {
                return len;
            } else if ((res[pos - 1] & 0xF8) === 0xF0 && pos === len - 3) {
                return len;
            } else {
                pos--;
            }
        }
        return pos;
    } else {
        return len;
    }
}

function map_stream_error(err) {
    let code = err.code;
    if (code === "ETIMEDOUT") {
        return new Compound("resource_error",
            ["socket_timeout"]);
    } else if (code === "EADDRINUSE") {
        return new Compound("resource_error",
            ["port_error"]);
    } else if (code === "ECONNRESET") {
        return new Compound("resource_error",
            ["remote_error"]);
    } else {
        return new Compound("resource_error",
            ["io_exception"]);
    }
}

function test_os_close_promise(args) {
    let stream = exec_build(args[0]);
    let buf = ctx;
    return exec_unify(args[1], stream.release(buf, stream));
}

function file_close_promise(buf, stream) {
    return new Promise(resolve => {
        fs.close(stream.data, err => {
            if (!err) {
                /* */
            } else {
                register_signal(buf, map_stream_error(err));
            }
            resolve();
        });
    });
}


function test_os_prop_promise(args) {
    let url = exec_build(args[0]);
    check_atom(url);
    let res = {};
    if (!exec_unify(args[1], res))
        return false;
    let buf = ctx;
    let prom;
    if (fs !== undefined) {
        prom = prop_file_promise(buf, url, res);
    } else {
        throw make_error(new Compound("permission_error",
            ["access", "source_sink", url]));
    }
    return exec_unify(args[2], prom);
}

function prop_file_promise(buf, url, res) {
    return new Promise(resolve => {
        fs.stat(url, (err, stats) => {
            if (!err) {
                let ftype = (stats.isFile() ? "regular" :
                    (stats.isDirectory() ? "directory" : "other"));
                let mtime = Math.floor(stats.mtimeMs);

                res.last_modified = norm_smallint(mtime);
                res.absolute_path = (ftype === "directory" ?
                    path.resolve(url) + path.sep : path.resolve(url));
                res.type = ftype;
                res.can_write =((stats.mode & 0x80) !== 0 ? "true" : "false");
            } else {
                register_signal(buf, map_file_error(err, url));
            }
            resolve();
        });
    });
}


function test_os_open_sync(args) {
    let url = exec_build(args[0]);
    check_atom(url);
    let mode = exec_build(args[1]);
    check_atom(mode);
    let opts = exec_build(args[2]);
    let stream;
    if ("read" === mode) {
        throw make_error(new Compound("resource_error",
            ["not_supported"]));
    } else if ("write" === mode) {
        stream = open_write(url, "w", opts);
    } else if ("append" === mode) {
        stream = open_write(url, "a", opts);
    } else {
        throw make_error(new Compound("domain_error",
            ["io_mode", mode]));
    }
    return exec_unify(args[3], stream);
}

function open_write(url, mode, opts) {
    if (fs !== undefined) {
        let file;
        try {
            file = fs.openSync(url, mode);
        } catch (err) {
            throw make_error(map_file_error(err, url));
        }
        let enc = get_encoding(opts);
        let dst = new Sink();
        dst.buf = "";
        dst.data = file;
        dst.send = (data, buf) => file_write(data, buf, enc);
        dst.release = file_close;
        return dst;
    } else {
        throw make_error(new Compound("resource_error", ["io_exception"]));
    }
}

function file_write(data, buf, enc) {
    try {
        fs.writeSync(data, buf, null, enc);
        return data;
    } catch (err) {
        throw make_error(map_stream_error(err));
    }
}

function file_close(data) {
    try {
        fs.closeSync(data);
    } catch (err) {
        throw make_error(map_stream_error(err));
    }
}


function test_flush_output(args) {
    let stream = exec_build(args[0]);
    check_sink(stream);
    stream_flush(stream);
    return true;
}

function stream_flush(stream) {
    flush_buffer(stream);
    stream.notify(stream.data);
}

function test_os_close_sync(args) {
    let stream = exec_build(args[0]);
    if (stream instanceof Sink) {
        /* */
    } else {
        check_source(stream);
    }
    stream_close(stream);
    return true;
}

function stream_close(stream) {
    if (stream instanceof Sink) {
        flush_buffer(stream);
        stream.release(stream.data);
    } else {
        stream.release(stream.data);
    }
}


function test_os_cntrl_sync(args) {
    let url = exec_build(args[0]);
    check_atom(url);
    if (fs === undefined)
        throw make_error(new Compound("permission_error", ["access", "source_sink", url]));
    let prop = exec_build(args[1]);
    if (is_structure(prop) &&
        prop.functor === "last_modified" &&
        prop.args.length === 1) {
        let val = deref(prop.args[0]);
        check_integer(val);
        if (val < 0)
            throw make_error(new Compound("domain_error",
                ["not_less_than_zero", val]));
        val = new Date(narrow_float(val));
        try {
            fs.utimesSync(url, val, val);
        } catch (err) {
            throw make_error(map_file_error(err, url));
        }
    } else if (is_structure(prop) &&
            prop.functor === "can_write" &&
            prop.args.length === 1) {
        let val = deref(prop.args[0]);
        check_atom(val);
        if ("true" !== val && "false" !== val)
            throw make_error(new Compound("domain_error",
                ["boolean", val]));
        try {
            let stats = fs.statSync(url);
            if ("true" === val)
                fs.chmodSync(url, (stats.mode | 0x80));
            else
                fs.chmodSync(url, (stats.mode & ~0x80));
        } catch (err) {
            throw make_error(map_file_error(err, url));
        }
    } else {
        check_nonvar(prop);
        prop = copy_term(prop);
        throw make_error(new Compound("domain_error",
            ["file_property", prop]));
    }
    return true;
}

function test_os_read_sync(args) {
    let stream = exec_build(args[0]);
    stream.buf = stream.receive(stream.data);
    stream.pos = 0;
    return true;
}


function test_ir_site_new(args) {
    let alpha = exec_build(args[0]);
    if (is_structure(alpha)) {
        if (is_atom(alpha.functor))
            alpha = new Compound(new Cache(alpha.functor), alpha.args);
    } else if (is_atom(alpha)) {
        alpha = new Cache(alpha);
    }
    return exec_unify(args[1], alpha);
}

function test_ir_is_site(args) {
    let alpha = exec_build(args[0]);
    if (is_structure(alpha))
        return is_cache(alpha.functor);
    return is_cache(alpha);
}

function test_ir_site_name(args) {
    let alpha = exec_build(args[0]);
    if (is_structure(alpha)) {
        if (is_cache(alpha.functor))
            alpha = new Compound(alpha.functor.name, alpha.args);
    } else if (is_cache(alpha)) {
        alpha = alpha.name;
    }
    return exec_unify(args[1], alpha);
}


function test_ir_link_new(args) {
    let alpha = exec_build(args[0]);
    alpha = list_objects(alpha);
    return exec_unify(args[1], make_defined(alpha));
}

function test_ir_is_link(args) {
    let alpha = exec_build(args[0]);
    if (is_structure(alpha))
        return is_provable(alpha.functor);
    return is_provable(alpha);
}


const MASK_FIND_MODIFY = 0x00000001;
const MASK_FIND_DYNAMIC = 0x00000002;
const MASK_FIND_REVERSE = 0x00000004;
const MASK_FIND_SIGNAL = 0x00000008;

function special_kb_clause_ref(args) {
    let head = deref(args[0]);
    check_callable(head);
    let flags = deref(args[1]);
    check_integer(flags);
    let peek = lookup_pred(head);
    if (peek === undefined) {
        if ((flags & MASK_FIND_SIGNAL) !== 0) {
            throw make_error(new Compound("existence_error",
                ["procedure", make_indicator_term(head)]));
        } else {
            return false;
        }
    }
    if ((flags & MASK_FIND_DYNAMIC) !== 0) {
        if ((peek.flags & MASK_PRED_DYNAMIC) === 0) {
            make_error_find(head, flags);
        }
    }
    if (!is_logical(peek.func) && !is_stick(peek.func)) {
        if ((flags & MASK_FIND_SIGNAL) !== 0) {
            make_error_find(head, flags);
        } else {
            return false;
        }
    }
    if (is_structure(head)) {
        head = head.args;
    } else {
        head = VOID_ARGS;
    }
    peek = defined_pred(peek, head);
    peek = snapshot_rope(peek);
    if ((flags & MASK_FIND_REVERSE) === 0) {
        return solve2_ref(args, peek, 0, null);
    } else {
        return solve2_ref_reverse(args, peek, peek.length, null);
    }
}

function make_error_find(head, flags) {
    if ((flags & MASK_FIND_MODIFY) !== 0) {
        throw make_error(new Compound("permission_error",
            ["modify", "static_procedure", make_indicator_term(head)]));
    } else {
        throw make_error(new Compound("permission_error",
            ["access", "private_procedure", make_indicator_term(head)]));
    }
}

function solve_ref(rope, at, choice) {
    let goal = deref(call.args[0]);
    return solve2_ref(goal.args, rope, at, choice);
}

function solve_ref_reverse(rope, at, choice) {
    let goal = deref(call.args[0]);
    return solve2_ref_reverse(goal.args, rope, at, choice);
}

function solve2_ref(args, rope, at, choice) {
    let mark = trail;
    while (at < rope.length) {
        let clause = rope[at++];
        if (unify(args[2], clause)) {
            if (at < rope.length) {
                if (choice === null) {
                    choice = new Choice(solve_ref, rope, at, mark);
                } else {
                    choice.at = at;
                }
                more(choice);
            }
            cont(call.args[1]);
            return true;
        }
        unbind(mark);
    }
    return false;
}

function solve2_ref_reverse(args, rope, at, choice) {
    let mark = trail;
    while (at > 0) {
        let clause = rope[--at];
        if (unify(args[2], clause)) {
            if (at > 0) {
                if (choice === null) {
                    choice = new Choice(solve_ref_reverse, rope, at, mark);
                } else {
                    choice.at = at;
                }
                more(choice);
            }
            cont(call.args[1]);
            return true;
        }
        unbind(mark);
    }
    return false;
}

function test_kb_pred_touch(args) {
    let functor = exec_build(args[0]);
    check_atom(functor);
    let arity = exec_build(args[1]);
    check_integer(arity);
    let flags = exec_build(args[2]);
    check_integer(flags);
    pred_touch(functor, arity, flags);
    return true;
}


function test_kb_clause_remove(args) {
    let alpha = exec_build(args[0]);
    check_clause(alpha);
    let beta = exec_build(args[1]);
    check_integer(beta);
    return remove_clause(alpha, beta);
}

function test_kb_pred_destroy(args) {
    let functor = exec_build(args[0]);
    check_atom(functor);
    let arity = exec_build(args[1]);
    check_integer(arity);
    pred_destroy(functor, arity);
    return true;
}


function test_kb_pred_link(args) {
    let functor = exec_build(args[0]);
    check_atom(functor);
    let arity = exec_build(args[1]);
    check_integer(arity);
    let peek = pred_link(functor, arity);
    if (peek === undefined)
        return false;
    return exec_unify(args[2], peek);
}

function test_kb_link_flags(args) {
    let peek = exec_build(args[0]);
    check_provable(peek);
    let res = peek.flags;
    return exec_unify(args[1], res);
}

function check_provable(beta) {
    if (!is_provable(beta)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error",
            ["provable", beta]));
    }
}

function test_kb_pred_list(args) {
    let res = kb_pred_list();
    return exec_unify(args[0], res);
}

function kb_pred_list() {
    let back = null;
    let res = null;
    for (let functor in kb) {
        let temp = kb[functor];
        for (let i = 0; i < temp.length; i++) {
            let peek = temp[i]
            if (peek === undefined || peek.remover !== undefined)
                continue;
            peek = new Compound(".", [make_indicator(functor, i), undefined]);
            if (back === null) {
                res = peek;
            } else {
                back.args[1] = peek;
            }
            back = peek;
        }
    }
    if (back === null) {
        res = "[]";
    } else {
        back.args[1] = "[]";
    }
    return res;
}


function test_kb_clause_shard(args) {
    let clause = exec_build(args[0]);
    check_clause(clause);
    return exec_unify(args[1], clause.shard);
}

function special_kb_clause_head(args) {
    let clause = deref(args[0]);
    check_clause(clause);
    let head = deref(args[1]);
    let display;
    if (clause.size !== 0) {
        display = new Array(clause.size);
    } else {
        display = null;
    }
    if (!is_variable(head)) {
        let paras;
        if (is_structure(head)) {
            paras = head.args;
        } else {
            paras = VOID_ARGS;
        }
        if (!exec_head(clause.head, display, paras))
            return false;
    } else {
        let alpha = exec_frame(clause.functor, clause.head, display);
        bind(alpha, head);
    }
    cont(call.args[1]);
    return true;
}

function special_kb_clause_data(args) {
    let clause = deref(args[0]);
    check_clause(clause);
    let head = deref(args[1]);
    let display;
    if (clause.size !== 0) {
        display = new Array(clause.size);
    } else {
        display = null;
    }
    if (!is_variable(head)) {
        let paras;
        if (is_structure(head)) {
            paras = head.args;
        } else {
            paras = VOID_ARGS;
        }
        if (!exec_head(clause.head, display, paras))
            return false;
    } else {
        let alpha = exec_frame(clause.functor, clause.head, display);
        bind(alpha, head);
    }
    let temp;
    let peek = clause.cutvar;
    if (peek !== -1) {
        temp = new Variable();
        display[peek] = temp;
        temp = new Compound("just", [temp]);
    } else {
        temp = "nothing";
    }
    if (!unify(args[2], temp))
        return false;
    temp = exec_body(clause.body, display);
    if (!unify(args[3], temp))
        return false;
    cont(call.args[1]);
    return true;
}


// stream specials, output
set("current_output", 1, make_check(test_current_output));
set("current_error", 1, make_check(test_current_error));
set("set_output", 1, make_check(test_set_output));
set("set_error", 1, make_check(test_set_error));
set("put_atom", 2, make_check(test_put_atom));

// stream specials, input
set("current_input", 1, make_check(test_current_input));
set("set_input", 1, make_check(test_set_input));
set("os_get_code", 2, make_check(test_os_get_code));
set("os_peek_code", 2, make_check(test_os_peek_code));

// stream specials, async
set("os_open_promise", 4, make_check(test_os_open_promise));
set("os_read_promise", 2, make_check(test_os_read_promise));
set("os_close_promise", 2, make_check(test_os_close_promise));
set("os_prop_promise", 3, make_check(test_os_prop_promise));

// stream specials, sync
set("os_open_sync", 4, make_check(test_os_open_sync));
set("flush_output", 1, make_check(test_flush_output));
set("os_close_sync", 1, make_check(test_os_close_sync));
set("os_cntrl_sync", 2, make_check(test_os_cntrl_sync));
set("os_read_sync", 1, make_check(test_os_read_sync));

// intermediate representation, Albufeira code
set("ir_site_new", 2, make_check(test_ir_site_new));
set("ir_is_site", 1, make_check(test_ir_is_site));
set("ir_site_name", 2, make_check(test_ir_site_name));
set("ir_link_new", 2, make_check(test_ir_link_new));
set("ir_is_link", 1, make_check(test_ir_is_link));

// knowledge base specials, dynamic database, internal only
set("kb_clause_ref", 3, make_special(special_kb_clause_ref));
set("kb_pred_touch", 3, make_check(test_kb_pred_touch));
set("kb_clause_remove", 2, make_check(test_kb_clause_remove));
set("kb_pred_destroy", 2, make_check(test_kb_pred_destroy));

// knowledge base specials, linked provables, internal only
set("kb_pred_link", 3, make_check(test_kb_pred_link));
set("kb_link_flags", 2, make_check(test_kb_link_flags));
set("kb_pred_list", 1, make_check(test_kb_pred_list));

// knowledge base specials, meta data, internal only
set("kb_clause_shard", 2, make_check(test_kb_clause_shard));
set("kb_clause_head", 2, make_special(special_kb_clause_head));
set("kb_clause_data", 4, make_special(special_kb_clause_data));





function test_eval(args) {
    let res = exec_eval(args[1]);
    return exec_unify(args[0], res);
}

function arit_neg(args) {
    let alpha = exec_eval(args[0]);
    if (is_bigint(alpha)) {
        return -alpha;
    } else {
        return 0 - alpha;
    }
}

function arit_abs(args) {
    let alpha = exec_eval(args[0]);
    if (is_integer(alpha)) {
        if (alpha < 0)
            return -alpha;
        return alpha;
    } else {
        return norm_float(Math.abs(narrow_float(alpha)));
    }
}

function arit_sign(args) {
    let alpha = exec_eval(args[0]);
    if (is_integer(alpha)) {
        if (alpha < 0)
            return -1;
        if (alpha > 0)
            return 1;
        return 0;
    } else {
        return norm_float(Math.sign(narrow_float(alpha)));
    }
}


function arit_add(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    if (is_integer(alpha) && is_integer(beta)) {
        if (!is_bigint(alpha) && !is_bigint(beta)) {
            return norm_smallint(alpha + beta);
        } else {
            return norm_bigint(widen_bigint(alpha) + widen_bigint(beta));
        }
    } else {
        return norm_float(narrow_float(alpha) + narrow_float(beta));
    }
}

function arit_sub(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    if (is_integer(alpha) && is_integer(beta)) {
        if (!is_bigint(alpha) && !is_bigint(beta)) {
            return norm_smallint(alpha - beta);
        } else {
            return norm_bigint(widen_bigint(alpha) - widen_bigint(beta));
        }
    } else {
        return norm_float(narrow_float(alpha) - narrow_float(beta));
    }
}

function arit_mul(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    if (is_integer(alpha) && is_integer(beta)) {
        if (!is_bigint(alpha) && !is_bigint(beta)) {
            return norm_smallint(alpha * beta);
        } else {
            return norm_bigint(widen_bigint(alpha) * widen_bigint(beta));
        }
    } else {
        return norm_float(narrow_float(alpha) * narrow_float(beta));
    }
}

function arit_quot(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    beta = narrow_float(beta);
    if (beta === 0)
        throw make_error(new Compound("evaluation_error",["zero_divisor"]));
    return norm_float(narrow_float(alpha) / beta);
}

function arit_intquot(args) {
    let alpha = exec_eval(args[0]);
    check_integer(alpha);
    let beta = exec_eval(args[1]);
    check_integer(beta);
    if (beta === 0)
        throw make_error(new Compound("evaluation_error",["zero_divisor"]));
    if (!is_bigint(alpha) && !is_bigint(beta)) {
        return (alpha / beta) | 0;
    } else {
        return norm_bigint(widen_bigint(alpha) / widen_bigint(beta));
    }
}

function arit_rem(args) {
    let alpha = exec_eval(args[0]);
    check_integer(alpha);
    let beta = exec_eval(args[1]);
    check_integer(beta);
    if (beta === 0)
        throw make_error(new Compound("evaluation_error",["zero_divisor"]));
    if (!is_bigint(alpha) && !is_bigint(beta)) {
        return alpha % beta;
    } else {
        return norm_bigint(widen_bigint(alpha) % widen_bigint(beta));
    }
}


function arit_float(args) {
    let alpha = exec_eval(args[0]);
    return norm_float(narrow_float(alpha));
}

function arit_intpow(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    if (is_integer(alpha) && is_integer(beta)) {
        if (beta < 0)
            throw make_error(new Compound("domain_error",
                ["not_less_than_zero", beta]));
        if (!is_bigint(alpha) && !is_bigint(beta)) {
            if ((32 - Math.clz32(Math.abs(alpha))) * beta < 53) {
                return norm_smallint(Math.pow(alpha, beta));
            } else {
                return norm_bigint(widen_bigint(alpha) ** widen_bigint(beta));
            }
        } else {
            return norm_bigint(widen_bigint(alpha) ** widen_bigint(beta));
        }
    } else {
        return norm_float(Math.pow(narrow_float(alpha), narrow_float(beta)));
    }
}

function arit_div(args) {
    let alpha = exec_eval(args[0]);
    check_integer(alpha);
    let beta = exec_eval(args[1]);
    check_integer(beta);
    if (beta === 0)
        throw make_error(new Compound("evaluation_error", ["zero_divisor"]));
    if (!is_bigint(alpha) && !is_bigint(beta)) {
        return Math.floor(alpha / beta);
    } else {
        return norm_bigint(bigint_div(
            widen_bigint(alpha), widen_bigint(beta)));
    }
}

function bigint_div(alpha, beta) {
    let temp = alpha / beta;
    if ((alpha < 0n) !== (beta < 0n)) {
        let res = alpha % beta;
        if (res !== 0n)
            temp--;
    }
    return temp;
}

function arit_mod(args) {
    let alpha = exec_eval(args[0]);
    check_integer(alpha);
    let beta = exec_eval(args[1]);
    check_integer(beta);
    if (beta === 0)
        throw make_error(new Compound("evaluation_error",["zero_divisor"]));
    if (!is_bigint(alpha) && !is_bigint(beta)) {
        return smallint_mod(alpha, beta);
    } else {
        return norm_bigint(bigint_mod(
            widen_bigint(alpha), widen_bigint(beta)));
    }
}


function smallint_mod(alpha, beta) {
    let res = alpha % beta;
    if ((alpha < 0) !== (beta < 0)) {
        if (res !== 0)
            res += beta;
    }
    return res;
}

function bigint_mod(alpha, beta) {
    let res = alpha % beta;
    if ((alpha < 0n) !== (beta < 0n)) {
        if (res !== 0n)
            res += beta;
    }
    return res;
}


function arit_min(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    if (is_special(alpha) || is_special(beta)) {
        if (Number.isNaN(alpha))
            return beta;
        if (Number.isNaN(beta))
            return alpha;
        if (alpha === Infinity)
            return beta;
        if (beta === Infinity)
            return alpha;
        if (alpha === -Infinity)
            return alpha;
        return beta;
    } else if (is_integer(alpha) && is_integer(beta)) {
        if (alpha < beta)
            return alpha;
        return beta;
    } else {
        return norm_float(Math.min(
            narrow_float(alpha), narrow_float(beta)));
    }
}

function arit_max(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    if (is_special(alpha) || is_special(beta)) {
        if (Number.isNaN(alpha))
            return beta;
        if (Number.isNaN(beta))
            return alpha;
        if (alpha === -Infinity)
            return beta;
        if (beta === -Infinity)
            return alpha;
        if (alpha === Infinity)
            return alpha;
        return beta;
    } else if (is_integer(alpha) && is_integer(beta)) {
        if (alpha > beta)
            return alpha;
        return beta;
    } else {
        return norm_float(Math.max(
            narrow_float(alpha), narrow_float(beta)));
    }
}

function arit_inf(args) {
    return Infinity;
}

function arit_nan(args) {
    return NaN;
}


function arit_truncate(args) {
    let alpha = exec_eval(args[0]);
    if (is_integer(alpha)) {
        return alpha;
    } else {
        return norm_smallint(0 + Math.trunc(narrow_float(alpha)));
    }
}

function arit_floor(args) {
    let alpha = exec_eval(args[0]);
    if (is_integer(alpha)) {
        return alpha;
    } else {
        return norm_smallint(Math.floor(narrow_float(alpha)));
    }
}

function arit_ceiling(args) {
    let alpha = exec_eval(args[0]);
    if (is_integer(alpha)) {
        return alpha;
    } else {
        return norm_smallint(0 + Math.ceil(narrow_float(alpha)));
    }
}

function arit_round(args) {
    let alpha = exec_eval(args[0]);
    if (is_integer(alpha)) {
        return alpha;
    } else {
        return norm_smallint(0 + Math.round(narrow_float(alpha)));
    }
}


function test_numberequal(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    return number_equal(alpha, beta);
}

function test_numbernotequal(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    return !number_equal(alpha, beta);
}

function number_equal(alpha, beta) {
    if (is_special(alpha) || is_special(beta)) {
        if (Number.isNaN(alpha))
            return false;
        if (Number.isNaN(beta))
            return false;
        return (alpha === beta);
    } else if (is_integer(alpha) && is_integer(beta)) {
        return alpha === beta;
    } else {
        return narrow_float(alpha) === narrow_float(beta);
    }
}

function test_numberless(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    return number_less(alpha, beta);
}

function test_numbergreaterequal(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    return number_lessequal(beta, alpha);
}

function test_numbergreater(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    return number_less(beta, alpha);
}

function test_numberlessequal(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    return number_lessequal(alpha, beta);
}

function number_less(alpha, beta) {
    if (is_special(alpha) || is_special(beta)) {
        if (Number.isNaN(alpha))
            return false;
        if (Number.isNaN(beta))
            return false;
        if (alpha === beta)
            return false;
        if (beta === Infinity)
            return true;
        return (alpha === -Infinity);
    } else if (is_integer(alpha) && is_integer(beta)) {
        return alpha < beta;
    } else {
        return narrow_float(alpha) < narrow_float(beta);
    }
}

function number_lessequal(alpha, beta) {
    if (is_special(alpha) || is_special(beta)) {
        if (Number.isNaN(alpha))
            return false;
        if (Number.isNaN(beta))
            return false;
        if (alpha === beta)
            return true;
        if (beta === Infinity)
            return true;
        return (alpha === -Infinity);
    } else if (is_integer(alpha) && is_integer(beta)) {
        return alpha <= beta;
    } else {
        return narrow_float(alpha) <= narrow_float(beta);
    }
}


function arit_sin(args) {
    let alpha = exec_eval(args[0]);
    return norm_float(Math.sin(narrow_float(alpha)));
}

function arit_cos(args) {
    let alpha = exec_eval(args[0]);
    return norm_float(Math.cos(narrow_float(alpha)));
}

function arit_tan(args) {
    let alpha = exec_eval(args[0]);
    return norm_float(Math.tan(narrow_float(alpha)));
}

function arit_asin(args) {
    let alpha = exec_eval(args[0]);
    return norm_float(Math.asin(narrow_float(alpha)));
}

function arit_acos(args) {
    let alpha = exec_eval(args[0]);
    return norm_float(Math.acos(narrow_float(alpha)));
}

function arit_atan(args) {
    let alpha = exec_eval(args[0]);
    return norm_float(Math.atan(narrow_float(alpha)));
}

function arit_pi(args) {
    return Math.PI;
}


function arit_pow(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    return norm_float(Math.pow(narrow_float(alpha), narrow_float(beta)));
}

function arit_exp(args) {
    let alpha = exec_eval(args[0]);
    return norm_float(Math.exp(narrow_float(alpha)));
}

function arit_log(args) {
    let alpha = exec_eval(args[0]);
    return norm_float(Math.log(narrow_float(alpha)));
}

function arit_sqrt(args) {
    let alpha = exec_eval(args[0]);
    return norm_float(Math.sqrt(narrow_float(alpha)));
}

function arit_e(args) {
    return Math.E;
}

function arit_epsilon(args) {
    return Number.EPSILON;
}

function arit_atan2(args) {
    let alpha = exec_eval(args[0]);
    let beta = exec_eval(args[1]);
    alpha = narrow_float(alpha);
    beta = narrow_float(beta);
    if (alpha === 0.0 && beta === 0.0) {
        throw make_error(new Compound("evaluation_error", ["undefined"]));
    } else {
        return norm_float(Math.atan2(alpha, beta));
    }
}


function arit_not(args) {
    let alpha = exec_eval(args[0]);
    check_integer(alpha);
    return ~alpha;
}

function arit_and(args) {
    let alpha = exec_eval(args[0]);
    check_integer(alpha);
    let beta = exec_eval(args[1]);
    check_integer(beta);
    if (!is_bigint(alpha) && !is_bigint(beta)) {
        return alpha & beta;
    } else {
        return norm_bigint(widen_bigint(alpha) & widen_bigint(beta));
    }
}

function arit_or(args) {
    let alpha = exec_eval(args[0]);
    check_integer(alpha);
    let beta = exec_eval(args[1]);
    check_integer(beta);
    if (!is_bigint(alpha) && !is_bigint(beta)) {
        return norm_smallint(alpha | beta);
    } else {
        return norm_bigint(widen_bigint(alpha) | widen_bigint(beta));
    }
}

function arit_xor(args) {
    let alpha = exec_eval(args[0]);
    check_integer(alpha);
    let beta = exec_eval(args[1]);
    check_integer(beta);
    if (!is_bigint(alpha) && !is_bigint(beta)) {
        return norm_smallint(alpha ^ beta);
    } else {
        return norm_bigint(widen_bigint(alpha) ^ widen_bigint(beta));
    }
}

function arit_shiftright(args) {
    let alpha = exec_eval(args[0]);
    check_integer(alpha);
    let beta = exec_eval(args[1]);
    check_integer(beta);
    if (!is_bigint(alpha) && !is_bigint(beta)) {
        if (0 <= beta && beta < 32) {
            return alpha >> beta;
        } else if (0 > beta && beta < Math.clz32(Math.abs(alpha)) - 1) {
            return norm_smallint(alpha << -beta);
        } else {
            return norm_bigint(widen_bigint(alpha) >> widen_bigint(beta));
        }
    } else {
        return norm_bigint(widen_bigint(alpha) >> widen_bigint(beta));
    }
}

function arit_shiftleft(args) {
    let alpha = exec_eval(args[0]);
    check_integer(alpha);
    let beta = exec_eval(args[1]);
    check_integer(beta);
    if (!is_bigint(alpha) && !is_bigint(beta)) {
        if (0 < beta && beta < Math.clz32(Math.abs(alpha)) - 1) {
            return norm_smallint(alpha << beta);
        } else if (0 >= beta && -beta < 32) {
            return alpha >> -beta;
        } else {
            return norm_bigint(widen_bigint(alpha) << widen_bigint(beta));
        }
    } else {
        return norm_bigint(widen_bigint(alpha) << widen_bigint(beta));
    }
}


function test_equal(args) {
    let alpha = exec_build(args[0]);
    let beta = exec_build(args[1]);
    return equal_term(alpha, beta);
}

function test_notequal(args) {
    let alpha = exec_build(args[0]);
    let beta = exec_build(args[1]);
    return !equal_term(alpha, beta);
}

function equal_term(first, second) {
    let stack = null;
    let log = null;
    try {
        for (; ;) {
            first = deref(first);
            second = deref(second);
            if (!is_structure(first)) {
                if (!Object.is(first, second))
                    break;
            } else if (!is_structure(second)) {
                break;
            } else if (first.args.length !== second.args.length) {
                break;
            } else {
                first = union_find(first);
                second = union_find(second);
                if (first !== second) {
                    if (is_frozen(first) && is_frozen(second) &&
                        first.hash !== second.hash)
                        break;
                    if (first.functor !== second.functor)
                        break;
                    log = union_add(log, first, second);
                    if (0 !== first.args.length - 1) {
                        let item = new Item(first, second, 0);
                        stack = stack_push(stack, item);
                    }
                    first = first.args[0];
                    second = second.args[0];
                    continue;
                }
            }
            let item = stack_peek(stack);
            if (item === null) {
                return true;
            } else {
                item.idx++;
                first = item.first.args[item.idx];
                second = item.second.args[item.idx];
                if (item.idx === item.first.args.length - 1)
                    stack_pop(stack);
            }
        }
        return false;
    } finally {
        union_undo(log);
    }
}


function Triple(backup, accum, children) {
    this.backup = backup;
    this.accum = accum;
    this.children = children;
}

function is_triple(obj) {
    return obj instanceof Triple;
}


function test_term_hash(args) {
    let alpha = exec_build(args[0]);
    let res;
    try {
        res = walk_compute(alpha, init_hash, union_hash);
    } finally {
        walk_uncompute(alpha);
    }
    return exec_unify(args[1], norm_smallint(res));
}

function init_hash(first) {
    if (is_compound(first)) {
        return object_hash_code(first.functor);
    } else if (is_variable(first)) {
        return variable_serno(first);
    } else if (is_frozen(first)) {
        return first.hash;
    } else {
        return object_hash_code(first);
    }
}

function union_hash(first, second) {
    return (first * 31 + second) | 0;
}

function walk_compute(first, init, reduce) {
    let stack = null;
    for (; ; ) {
        first = deref(first);
        if (is_compound(first)) {
            if (!is_triple(first.functor)) {
                first.functor = new Triple(
                            first.functor,
                            init(first), null);
                first.walk &= ~VAR_MASK_SERNO;
                stack = stack_push(stack, first);
                first = first.args[0];
                continue;
            } else {
                first = first.functor.accum;
            }
        } else {
            first = init(first);
        }
        let item = stack_peek(stack);
        while (item !== null &&
        (item.walk & VAR_MASK_SERNO) === item.args.length - 1) {
            first = reduce(item.functor.accum, first);
            item.functor.accum = first;
            stack_pop(stack);
            item = stack_peek(stack);
        }
        if (item === null) {
            return first;
        } else {
            first = reduce(item.functor.accum, first);
            item.functor.accum = first;
            item.walk++;
            first = item.args[item.walk & VAR_MASK_SERNO];
        }
    }
}

function walk_uncompute(first) {
    let stack = null;
    for (; ; ) {
        first = deref(first);
        if (is_compound(first)) {
            if (is_triple(first.functor)) {
                first.functor = first.functor.backup;
                if (0 !== first.args.length - 1) {
                    first.walk &= ~VAR_MASK_SERNO;
                    stack = stack_push(stack, first);
                }
                first = first.args[0];
                continue;
            }
        }
        let item = stack_peek(stack);
        if (item === null) {
            return;
        } else {
            item.walk++;
            first = item.args[item.walk & VAR_MASK_SERNO];
            if ((item.walk & VAR_MASK_SERNO) === item.args.length - 1)
                stack_pop(stack);
        }
    }
}


function test_atom_codes(args) {
    let text = exec_deref(args[0]);
    if (is_variable(text) || is_pending(text)) {
        let res = exec_build(args[1]);
        res = atom_codes_pack(res);
        return exec_unify(text, res);
    } else {
        text = exec_build(text);
        check_atom(text);
        text = atom_codes_unpack(text);
        return exec_unify(args[1], text);
    }
}

function atom_codes_pack(peek) {
    let temp = peek;
    let i = 0;
    while (is_structure(temp) &&
        temp.functor === "." &&
        temp.args.length === 2 &&
        i < MAX_ARITY) {
        let ch = deref(temp.args[0]);
        check_integer(ch);
        if (ch < 0 || ch > 0x10FFFF)
            throw make_error(new Compound("domain_error",
                ["character_code", ch]));
        i++;
        temp = deref(temp.args[1]);
    }
    check_nil(temp);
    let res = new Array(i);
    temp = peek;
    i = 0;
    while (is_structure(temp) &&
            temp.functor === "." &&
            temp.args.length === 2) {
        let ch = deref(temp.args[0]);
        res[i++] = ch;
        temp = deref(temp.args[1]);
    }
    return String.fromCodePoint(...res);
}

function atom_codes_unpack(text) {
    let back = null;
    let res;
    let i = 0;
    while (i < text.length) {
        let ch = text.codePointAt(i);
        let peek = new Compound(".", [ch, undefined]);
        if (back !== null) {
            back.args[1] = peek;
        } else {
            res = peek;
        }
        back = peek;
        i += char_count(ch);
    }
    if (back !== null) {
        back.args[1] = "[]";
    } else {
        res = "[]";
    }
    return res;
}

function test_char_code(args) {
    let text = exec_deref(args[0]);
    if (is_variable(text) || is_pending(text)) {
        let ch = exec_build(args[1]);
        check_integer(ch);
        if (ch < 0 || ch > 0x10FFFF)
            throw make_error(new Compound("domain_error",
                ["character_code", ch]));
        ch = String.fromCodePoint(ch);
        return exec_unify(text, ch);
    } else {
        text = exec_build(text);
        check_atom(text);
        let ch;
        if (text.length === 0 ||
            text.length !== char_count(ch = text.codePointAt(0)))
            throw make_error(new Compound("type_error",
                ["character", text]));
        return exec_unify(args[1], ch);
    }
}


function test_atom_length(args) {
    let text = exec_build(args[0]);
    check_atom(text);
    let res = atom_count(text, 0, text.length);
    return exec_unify(args[1], norm_smallint(res));
}

function atom_count(text, from, to) {
    let res = 0;
    while (from < to) {
        let ch = text.codePointAt(from);
        from += char_count(ch);
        res ++;
    }
    return res;
}

function test_atom_join(args) {
    let alpha = exec_build(args[0]);
    let res = atom_join(alpha);
    return exec_unify(args[1], res);
}

function atom_join(res) {
    let peek = res;
    let i = 0;
    while (is_structure(peek) &&
    peek.functor === "." &&
    peek.args.length === 2 &&
    i < MAX_ARITY) {
        i++;
        peek = deref(peek.args[1]);
    }
    check_nil(peek);
    let elems = new Array(i);
    peek = res;
    i = 0;
    while (is_structure(peek) &&
    peek.functor === "." &&
    peek.args.length === 2) {
        let val = deref(peek.args[0]);
        check_atom(val);
        elems[i++] = val;
        peek = deref(peek.args[1]);
    }
    return elems.join("");
}


function special_atom_concat(args) {
    let first = deref(args[0]);
    let second = deref(args[1]);
    let third = deref(args[2]);
    if (is_variable(second)) {
        if (is_variable(first)) {
            check_atom(third);
            return solve2_concat(args, null, 0, null);
        } else {
            check_atom(first);
            check_atom(third);
            if (!third.startsWith(first))
                return false;
            if (!unify(second, third.substring(first.length)))
                return false;
        }
    } else if (is_variable(first)) {
        check_atom(second);
        check_atom(third);
        if (!third.endsWith(second))
            return false;
        if (!unify(first, third.substring(0,third.length-second.length)))
            return false;
    } else {
        check_atom(first);
        check_atom(second);
        if (!unify(third, first + second))
            return false;
    }
    cont(call.args[1]);
    return true;
}

function solve_concat(rope, at, choice) {
    let goal = deref(call.args[0]);
    return solve2_concat(goal.args, rope, at, choice);
}

function solve2_concat(args, rope, at, choice) {
    let text = deref(args[2]);
    let mark = trail;
    while (at <= text.length) {
        if (unify(args[0], text.substring(0, at)) &&
            unify(args[1], text.substring(at))) {
            at = atom_succ(text,at);
            if (at <= text.length) {
                if (choice === null) {
                    choice = new Choice(solve_concat, null, at, mark);
                } else {
                    choice.at = at;
                }
                more(choice);
            }
            cont(call.args[1]);
            return true;
        }
        unbind(mark);
        at = atom_succ(text,at);
    }
    return false;
}

function atom_succ(text, at) {
    if (at < text.length) {
        let ch = text.codePointAt(at);
        return at + char_count(ch);
    } else {
        return at + 1;
    }
}


function special_sys_atom_match(args) {
    let text = deref(args[0]);
    check_atom(text);
    let part = deref(args[1]);
    check_atom(part);
    let alpha = deref(args[2]);
    if (is_variable(alpha)) {
        return solve2_match(args, 0, 0, null);
    } else {
        check_integer(alpha);
        alpha = atom_offset(text, 0, alpha);
        if (alpha < 0)
            return false;
        if (!text.startsWith(part, alpha))
            return false;
    }
    cont(call.args[1]);
    return true;
}

function atom_offset(text, pos, alpha) {
    if (alpha < 0)
        return -1;
    while (alpha > 0 && pos < text.length) {
        let ch = text.codePointAt(pos);
        pos += char_count(ch);
        alpha--;
    }
    if (alpha > 0)
        return -1;
    return pos;
}

function solve_match(rope, at, choice) {
    let goal = deref(call.args[0]);
    return solve2_match(goal.args, rope, at, choice);
}

function solve2_match(args, res, at, choice) {
    let text = deref(args[0]);
    let part = deref(args[1]);
    let mark = trail;
    while (at + part.length <= text.length) {
        let pos = text.indexOf(part, at);
        if (pos < 0)
            return false;
        res += atom_count(text, at, pos);
        at = pos;
        if (unify(args[2], norm_smallint(res))) {
            at = atom_succ(text, at);
            res++;
            if (at + part.length <= text.length) {
                if (choice === null) {
                    choice = new Choice(solve_match, res, at, mark);
                } else {
                    choice.data = res;
                    choice.at = at;
                }
                more(choice);
            }
            cont(call.args[1]);
            return true;
        }
        unbind(mark);
        at = atom_succ(text,at);
        res++;
    }
    return false;
}

function special_sys_atom_part(args) {
    let text = deref(args[0]);
    check_atom(text);
    let alpha = deref(args[1]);
    if (is_variable(alpha)) {
        let beta = deref(args[2]);
        check_integer(beta);
        let at = (0 <= beta && beta <= MAX_ARITY ?
                        narrow_float(beta) : -1);
        let res = atom_offset(text, 0, at);
        if (res < 0)
            return false;
        return solve2_part(args, [0,0], res, null);
    } else {
        check_integer(alpha);
        let beta = deref(args[2]);
        check_integer(beta);
        let at = (0 <= alpha && alpha <= MAX_ARITY ?
                        narrow_float(alpha) : -1);
        let from = atom_offset(text, 0, at);
        if (from < 0)
            return false;
        at = (0 <= beta && beta <= MAX_ARITY ?
                    narrow_float(beta) : -1);
        let to = atom_offset(text, from, at);
        if (to < 0)
            return false;
        if (!unify(args[3], text.substring(from, to)))
            return false;
    }
    cont(call.args[1]);
    return true;
}

function solve_part(rope, at, choice) {
    let goal = deref(call.args[0]);
    return solve2_part(goal.args, rope, at, choice);
}

function solve2_part(args, pair, to, choice) {
    let text = deref(args[0]);
    let mark = trail;
    while (to <= text.length) {
        if (unify(args[1], norm_smallint(pair[1])) &&
            unify(args[3], text.substring(pair[0], to))) {
            pair[0] = atom_succ(text, pair[0]);
            pair[1]++;
            to = atom_succ(text, to);
            if (to <= text.length) {
                if (choice === null) {
                    choice = new Choice(solve_part, pair, to, mark);
                } else {
                    choice.at = to;
                }
                more(choice);
            }
            cont(call.args[1]);
            return true;
        }
        unbind(mark);
        pair[0] = atom_succ(text, pair[0]);
        pair[1]++;
        to = atom_succ(text, to);
    }
    return false;
}


function special_sys_last_atom_match(args) {
    let text = deref(args[0]);
    check_atom(text);
    let part = deref(args[1]);
    check_atom(part);
    let alpha = deref(args[2]);
    if (is_variable(alpha)) {
        let at = text.length - part.length;
        let res = atom_count(text, 0, at);
        return solve2_last_match(args, res, at, null);
    } else {
        check_integer(alpha);
        alpha = atom_offset(text, 0, alpha);
        if (alpha < 0)
            return false;
        if (!text.startsWith(part, alpha))
            return false;
    }
    cont(call.args[1]);
    return true;
}

function solve_last_match(rope, at, choice) {
    let goal = deref(call.args[0]);
    return solve2_last_match(goal.args, rope, at, choice);
}

function solve2_last_match(args, res, at, choice) {
    let text = deref(args[0]);
    let part = deref(args[1]);
    let mark = trail;
    while (at >= 0) {
        let pos = text.lastIndexOf(part, at);
        if (pos < 0)
            return false;
        res -= atom_count(text, pos, at);
        at = pos;
        if (unify(args[2], norm_smallint(res))) {
            at = atom_pred(text, at);
            res--;
            if (at >= 0) {
                if (choice === null) {
                    choice = new Choice(solve_last_match, res, at, mark);
                } else {
                    choice.data = res;
                    choice.at = at;
                }
                more(choice);
            }
            cont(call.args[1]);
            return true;
        }
        unbind(mark);
        at = atom_pred(text, at);
        res--;
    }
    return false;
}

function atom_pred(text, at) {
    if (0 < at) {
        let ch = code_point_before(text, at);
        return at - char_count(ch);
    } else {
        return at - 1;
    }
}

function special_sys_last_atom_part(args) {
    let text = deref(args[0]);
    check_atom(text);
    let alpha = deref(args[1]);
    if (is_variable(alpha)) {
        let beta = deref(args[2]);
        check_integer(beta);
        beta = last_atom_offset(text, text.length, beta);
        if (beta < 0)
            return false;
        let res = atom_count(text, 0, beta);
        return solve2_last_part(args, [beta,res], text.length, null);
    } else {
        check_integer(alpha);
        let beta = deref(args[2]);
        check_integer(beta);
        alpha = atom_offset(text, 0, alpha);
        if (alpha < 0)
            return false;
        beta = atom_offset(text, alpha, beta);
        if (beta < 0)
            return false;
        if (!unify(args[3], text.substring(alpha, beta)))
            return false;
    }
    cont(call.args[1]);
    return true;
}

function last_atom_offset(text,pos,alpha) {
    if (alpha < 0)
        return -1;
    while (alpha > 0 && 0 < pos) {
        let ch = code_point_before(text, pos);
        pos -= char_count(ch);
        alpha--;
    }
    if (alpha > 0)
        return -1;
    return pos;
}

function solve_last_part(rope, at, choice) {
    let goal = deref(call.args[0]);
    return solve2_last_part(goal.args, rope, at, choice);
}

function solve2_last_part(args, pair, to, choice) {
    let text = deref(args[0]);
    let mark = trail;
    while (pair[0] >= 0) {
        if (unify(args[1], norm_smallint(pair[1])) &&
            unify(args[3], text.substring(pair[0], to))) {
            pair[0] = atom_pred(text, pair[0]);
            pair[1]--;
            to = atom_pred(text, to);
            if (pair[0] >= 0) {
                if (choice === null) {
                    choice = new Choice(solve_last_part, pair, to, mark);
                } else {
                    choice.at = to;
                }
                more(choice);
            }
            cont(call.args[1]);
            return true;
        }
        unbind(mark);
        pair[0] = atom_pred(text, pair[0]);
        pair[1]--;
        to = atom_pred(text, to);
    }
    return false;
}


// number specials, basic predicates
set("is", 2, make_check(test_eval));
set("-", 2, make_arithmetic(arit_neg));
set("abs", 2, make_arithmetic(arit_abs));
set("sign", 2, make_arithmetic(arit_sign));

// number specials, basic operations
set("+", 3, make_arithmetic(arit_add));
set("-", 3, make_arithmetic(arit_sub));
set("*", 3, make_arithmetic(arit_mul));
set("/", 3, make_arithmetic(arit_quot));
set("//", 3, make_arithmetic(arit_intquot));
set("rem", 3, make_arithmetic(arit_rem));

// number specials, more operations
set("float", 2, make_arithmetic(arit_float));
set("^", 3, make_arithmetic(arit_intpow));
set("div", 3, make_arithmetic(arit_div));
set("mod", 3, make_arithmetic(arit_mod));

// number specials, magnitude operations
set("min", 3, make_arithmetic(arit_min));
set("max", 3, make_arithmetic(arit_max));
set("inf", 1, make_arithmetic(arit_inf));
set("nan", 1, make_arithmetic(arit_nan));

// number specials, rounding operations
set("truncate", 2, make_arithmetic(arit_truncate));
set("floor", 2, make_arithmetic(arit_floor));
set("ceiling", 2, make_arithmetic(arit_ceiling));
set("round", 2, make_arithmetic(arit_round));

// number specials, magnitude predicates
set("=:=", 2, make_check(test_numberequal));
set("=\\=", 2, make_check(test_numbernotequal));
set("<", 2, make_check(test_numberless));
set(">=", 2, make_check(test_numbergreaterequal));
set(">", 2, make_check(test_numbergreater));
set("=<", 2, make_check(test_numberlessequal));

// number specials, trigonometric operations
set("sin", 2, make_arithmetic(arit_sin));
set("cos", 2, make_arithmetic(arit_cos));
set("tan", 2, make_arithmetic(arit_tan));
set("asin", 2, make_arithmetic(arit_asin));
set("acos", 2, make_arithmetic(arit_acos));
set("atan", 2, make_arithmetic(arit_atan));
set("pi", 1, make_arithmetic(arit_pi));

// number specials, exponential operations
set("**", 3, make_arithmetic(arit_pow));
set("exp", 2, make_arithmetic(arit_exp));
set("log", 2, make_arithmetic(arit_log));
set("sqrt", 2, make_arithmetic(arit_sqrt));
set("e", 1, make_arithmetic(arit_e));
set("epsilon", 1, make_arithmetic(arit_epsilon));
set("atan2", 3, make_arithmetic(arit_atan2));

// number specials, bitwise operations
set("\\", 2, make_arithmetic(arit_not));
set("/\\", 3, make_arithmetic(arit_and));
set("\\/", 3, make_arithmetic(arit_or));
set("xor", 3, make_arithmetic(arit_xor));
set(">>", 3, make_arithmetic(arit_shiftright));
set("<<", 3, make_arithmetic(arit_shiftleft));

// term specials, miscellaneous equality
set("==", 2, make_check(test_equal));
set("\\==", 2, make_check(test_notequal));
set("term_hash", 2, make_check(test_term_hash));

// atom specials, standard
set("atom_codes", 2, make_check(test_atom_codes));
set("char_code", 2, make_check(test_char_code));
set("atom_length", 2, make_check(test_atom_length));
set("atom_join", 2, make_check(test_atom_join));

// atom specials, non-standard
set("atom_concat", 3, make_special(special_atom_concat));
set("sys_atom_part", 4, make_special(special_sys_atom_part));
set("sys_atom_match", 3, make_special(special_sys_atom_match));
set("sys_last_atom_part", 4, make_special(special_sys_last_atom_part));
set("sys_last_atom_match", 3, make_special(special_sys_last_atom_match));

let xml_serializer;
if (fs === undefined) {
    xml_serializer = new XMLSerializer();
} else {
    xml_serializer = undefined;
}


function post(msg) {
    register_signal(CTX_MAIN, msg);
    invoke_interrupt(CTX_MAIN);
}

function perform(goal) {
    goal = new Compound(".", [goal, "[]"]);
    return launch(goal, CTX_MAIN, VOID_ARGS);
}

async function perform_async(goal) {
    goal = new Compound(".", [goal, "[]"]);
    return await launch_async(goal, CTX_MAIN, VOID_ARGS);
}


const FFI_FUNC = 0x00000100;

function register(functor, arity, func, flags) {
    let res;
    if ((flags & FFI_FUNC) !== 0) {
        res = make_check(args => invoke_func(func, args));
    } else {
        res = make_check(args => invoke(func, args));
    }
    set(functor, arity, res);
}

function invoke(func, args) {
    let temp = new Array(args.length);
    for (let i = 0; i < temp.length; i++)
        temp[i] = exec_build(args[i]);
    func(...temp);
    return true;
}

function invoke_func(func, args) {
    let temp = new Array(args.length - 1);
    for (let i = 0; i < temp.length; i++)
        temp[i] = exec_build(args[i]);
    let res = func(...temp);
    return exec_unify(args[args.length-1], res);
}


function set_cursor(elem) {
    let dom = engine.text_output.data;
    dom.data = elem;

    dom = engine.text_error.data;
    dom.data = elem;
}

function html_encode(buf) {
    return xml_serializer.serializeToString(new Text(buf));
}

function html_send(data, buf) {
    buf = html_encode(buf);
    put_atom(data, buf);
    return data;
}

function fiddle_flush(data) {
    if (data.hasAttribute("cell-clear")) {
        data.innerHTML = "";
        data.removeAttribute("cell-clear");
    }
}

function fiddle_out(data, buf) {
    if (data.hasAttribute("cell-clear")) {
        data.innerHTML = "";
        data.removeAttribute("cell-clear");
    }
    let depth = 0;
    let k = buf.indexOf("<");
    let i = 0;
    while (k !== -1) {
        let k2 = buf.indexOf(">", k+1);
        if (k2 === -1)
            throw make_error(new Compound("syntax_error",
                ["missing_angle"]));
        if (buf.charCodeAt(k+1) === 47) { // '/'
            if (depth > 0) {
                depth--;
            } else {
                data.insertAdjacentHTML("beforeend", buf.substring(i, k));
                data = data.parentElement;
                i = k2 + 1;
            }
        } else if (buf.charCodeAt(k2-1) !== 47) { // '/'
            depth++;
        }
        k = buf.indexOf("<", k2+1);
    }
    data.insertAdjacentHTML("beforeend", buf.substring(i));
    while (depth > 0) {
        data = data.lastElementChild;
        depth--;
    }
    return data;
}


function set_input(text) {
    let src = engine.text_input;
    src.data = undefined;
    src.receive = fd => "";
    src.flags &= ~MASK_SRC_AREAD;
    src.buf = text;
    src.pos = 0;
    src.lineno = 0;
}


function set_caret_wait(elem) {
    let src = engine.text_input;
    src.data = elem;
    src.receive = fiddle_in_promise;
    src.flags |= MASK_SRC_AREAD;
    src.buf = "";
    src.pos = 0;
    src.lineno = 0;
}

function fiddle_in_promise(buf, stream) {
    return new Promise(resolve => {
        function keydown_handler(event) {
            if (event.key === "Enter") {
                event.preventDefault();

                let elem = stream.data;
                elem.insertAdjacentText("beforeend", "\n");
                elem.setAttribute("contenteditable", "false");
                elem.insertAdjacentHTML("afterend", "<span></span>");

                set_cursor(elem);
                stream.data = elem.nextElementSibling;
                stream.buf = elem.innerText;
                stream.pos = 0;

                elem = stream.data.parentElement;
                elem.removeEventListener("keydown", keydown_handler);
                register_interrupt(buf, () => {});
                resolve();
            }
        }

        let elem = stream.data;
        window.getSelection().collapse(elem, 0);
        elem.scrollIntoView();

        elem = stream.data.parentElement;
        elem.addEventListener("keydown", keydown_handler);
        register_interrupt(buf, () => {
            elem.removeEventListener("keydown", keydown_handler);
            register_interrupt(buf, () => {});
            resolve();
        });
    });
}


function shield_buttons(flag) {
    let pres = document.getElementsByClassName("nb_box");
    for (let num = 0; num < pres.length; num++) {
        let btn = pres[num].nextElementSibling;
        btn.disabled = flag;
    }
}

function rollback_stage(num) {
    let pres = document.getElementsByClassName("nb_box");
    while (num < stage) {
        set_stage(stage-1);
        let out = pres[stage].getElementsByClassName("nb_out")[0];
        if (num === stage) {
            out.setAttribute("cell-clear", "true");
        } else {
            out.innerHTML = "";
        }
        clear();
    }
}

async function advance_async(num) {
    let pres = document.getElementsByClassName("nb_box");
    while (num >= stage) {
        let btn = pres[stage].nextElementSibling;
        btn.disabled = false;
        btn.firstChild.className = "hack_box";
        let out = pres[stage].getElementsByClassName("nb_out")[0];
        set_cursor(out);
        let txt = pres[stage].getElementsByClassName("nb_txt")[0];
        set_input(txt.innerText);
        try {
            await perform_async(new Compound("ensure_loaded", ["user"]));
            await group_gather_async();
            perform("flush_output");
        } catch (err) {
            group_teardown();
            perform(new Compound("sys_print_error", [err]));
        }
        set_stage(stage+1);
        btn.disabled = true;
        btn.firstChild.className = "hack_arrow";
    }
}

async function goto_async(form) {
    let pres = document.getElementsByClassName("nb_box");
    let num = [].indexOf.call(pres,form);
    let btn = form.nextElementSibling;
    if (btn.firstChild.className === "hack_arrow") {
        shield_buttons(true);
        rollback_stage(num);
        await advance_async(num);
        shield_buttons(false);
    } else {
        post(new Compound("system_error", ["user_abort"]));
    }
}


async function instrument_document_async() {
    engine.text_output.flags |= MASK_DST_FEAT;
    engine.text_error.flags |= MASK_DST_FEAT;
    let pres = Array.from(document.querySelectorAll(".code, .raw"));
    for (let num = 0; num < pres.length; num++) {
        let pre = pres[num];

        if (pre.className === "code") {
            pre.insertAdjacentHTML("beforebegin", '<div class="nb_flex"></div>');
            pre.previousElementSibling.appendChild(pre);

            /* modify text */
            let text = pre.innerHTML;
            text = '<div class="nb_txt" contenteditable="plaintext-only">' + text
                + '</div><div class="nb_out"></div>'
            pre.innerHTML = text;
            pre.className = "nb_box";

            /* create button */
            pre.insertAdjacentHTML("afterend", '&nbsp;<button class="nb_btn" disabled>' +
                '<div class="hack_arrow"></div>' +
                '</button>');
            let btn = pre.nextElementSibling;
            btn.addEventListener("click", async function () {
                await goto_async(pre);
            });
            btn.disabled = false;

            /* instrument text */
            let txt = pre.getElementsByClassName("nb_txt")[0];
            perform(new Compound("instrument_elem", [txt]));

        } else {
            /* colorize text */
            perform(new Compound("colorize_elem", [pre]));
        }

    }
}


function test_ir_object_new(args) {
    let res = new Map();
    return exec_unify(args[0], res);
}

function test_ir_object_current(args) {
    let obj = exec_build(args[0]);
    let key = exec_build(args[1]);
    check_atom(key);
    let res;
    if (obj instanceof Map) {
        res = obj.get(key);
    } else {
        try {
            res = obj[key];
        } catch (err) {
            res = undefined;
        }
    }
    if (res === undefined)
        return false;
    return exec_unify(args[2], res);
}


function test_ir_object_set(args) {
    let obj = exec_build(args[0]);
    let key = exec_build(args[1]);
    check_atom(key);
    let value = exec_build(args[2]);
    if (obj instanceof Map) {
        obj.set(key, value);
    } else {
        try {
            obj[key] = value;
        } catch (err) {
            throw make_error(new Compound("permission_error",
                ["modify", "field", key]));
        }
    }
    return true;
}

function test_ir_object_reset(args) {
    let obj = exec_build(args[0]);
    let key = exec_build(args[1]);
    check_atom(key);
    if (obj instanceof Map) {
        obj.delete(key);
    } else {
        try {
            delete obj[key];
        } catch (err) {
            throw make_error(new Compound("permission_error",
                ["modify", "field", key]));
        }
    }
    return true;
}

function test_ir_object_keys(args) {
    let obj = exec_build(args[0]);
    if (obj instanceof Map) {
        obj = obj.keys();
    } else {
        obj = Object.keys(obj);
    }
    obj = set_to_list(obj);
    return exec_unify(args[1], obj);
}

function set_to_list(temp) {
    let back = null;
    let res = null;
    if (temp !== null) {
        for (let peek of temp) {
            peek = new Compound(".", [peek, undefined]);
            if (back === null) {
                res = peek;
            } else {
                back.args[1] = peek;
            }
            back = peek;
        }
    }
    if (back === null) {
        res = "[]";
    } else {
        back.args[1] = "[]";
    }
    return res;
}


function test_ir_float_value(args) {
    let alpha = exec_deref(args[0]);
    if (is_variable(alpha) || is_pending(alpha)) {
        let beta = exec_build(args[1]);
        check_number(beta);
        let res = (is_special(beta) ? beta :
            norm_float(narrow_float(beta)));
        return exec_unify(alpha, res);
    } else {
        alpha = exec_build(alpha);
        check_number(alpha);
        let res = (is_special(alpha) ? alpha :
            narrow_float(alpha));
        return exec_unify(args[1], res);
    }
}

function test_ir_atom_offset(args) {
    let alpha = exec_build(args[0]);
    check_atom(alpha);
    let beta = exec_deref(args[1]);
    if (is_variable(beta) || is_pending(beta)) {
        let gamma = exec_build(args[2]);
        check_integer(gamma);
        let at = (0 <= gamma && gamma <= MAX_ARITY ?
                        narrow_float(gamma) : -1);
        if (at < 0 || at > alpha.length)
            return false;
        let res = atom_count(alpha, 0, at);
        return exec_unify(beta, norm_smallint(res));
    } else {
        beta = exec_build(beta);
        check_integer(beta);
        let at = (0 <= beta && beta <= MAX_ARITY ?
                        narrow_float(beta) : -1);
        let res = atom_offset(alpha, 0, at);
        if (res < 0)
            return false;
        return exec_unify(args[2], norm_smallint(res));
    }
}


function Timer(id) {
    this.id = id;
}

function test_os_call_later(args) {
    let goal = exec_build(args[0]);
    check_goal(goal);
    let delay = exec_build(args[1]);
    check_integer(delay);
    if (delay < 0)
        throw make_error(new Compound("domain_error",
            ["not_less_than_zero", delay]));
    delay = narrow_float(delay);
    let buf = ctx;
    let id = setDelay(() => callback(goal, buf, VOID_ARGS), delay);
    return exec_unify(args[2], new Timer(id));
}

function test_timer_cancel(args) {
    let tid = exec_build(args[0]);
    check_timer(tid);
    clearTimeout(tid.id);
    return true;
}

function check_timer(beta) {
    if (!(beta instanceof Timer)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["timer", beta]));
    }
}


function test_current_task(args) {
    return exec_unify(args[0], ctx);
}

function test_task_abort(args) {
    let buf = exec_build(args[0]);
    check_task(buf);
    let msg = exec_build(args[1]);
    msg = copy_term(msg);
    register_signal(buf, msg);
    invoke_interrupt(buf);
    return true;
}

function check_task(beta) {
    if ((beta !== CTX_MAIN) &&
        !(beta instanceof Context)) {
        check_nonvar(beta);
        beta = copy_term(beta);
        throw make_error(new Compound("type_error", ["task", beta]));
    }
}

function test_os_task_create(args) {
    let goal = exec_build(args[0]);
    check_goal(goal);
    let buf = new Context();
    setDelay(async () => await task_async(goal, buf, VOID_ARGS), 0);
    return exec_unify(args[1], buf);
}


function test_net_open_promise(args) {
    let url = exec_build(args[0]);
    check_atom(url);
    let opts = exec_build(args[1]);
    let stream = new Source();
    if (!exec_unify(args[2], stream))
        return false;
    let buf = ctx;
    let prom;
    if (fs !== undefined) {
        prom = open_http_promise_opts(buf, stream, url, opts);
    } else {
        try {
            url = new URL(url, codebase).href;
        } catch (err) {
            throw make_error(
                new Compound("resource_error", ["base_url"]));
        }
        prom = open_http_promise_opts(buf, stream, url, opts);
    }
    return exec_unify(args[3], prom);
}

async function open_http_promise_opts(buf, stream, url, opts) {
    let paras = {};
    if (opts !== null && opts.get("method") !== undefined) {
        paras.method = opts.get("method");
    } else if (opts !== null && opts.get("body") !== undefined) {
        paras.method = "POST";
    } else {
        paras.method = "GET";
    }
    if (opts !== null && opts.get("body") !== undefined) {
        let opts2 = opts.get("body");
        if (fs !== undefined) {
            let enc = get_encoding(opts2);
            paras.body = Buffer.from(opts2.get("text"), enc);
        } else {
            paras.body = opts2.get("text");
        }
    }
    if (opts !== null && opts.get("headers") !== undefined)
        paras.headers = opts.get("headers");
    let contr = new AbortController();
    paras.signal = contr.signal;
    register_interrupt(buf, () => contr.abort("ABORT"));
    try {
        let response = await fetch(url, paras);
        register_interrupt(buf, () => {});
        if (response.status < 200 || 399 < response.status) {
            register_signal(buf, map_http_result(response.status, url));
        } else {
            if (opts !== null) {
                opts.set("uri", response.url);
                opts.set("status", response.status);
                let res = new Map();
                let map = response.headers;
                for (let key of map.keys())
                    res.set(key, map.get(key));
                opts.set("fields", res);
            }
            if (!response.body) {
                /* */
            } else {
                let enc = get_encoding(opts);
                stream.data = response.body.getReader();
                stream.receive = (buf, stream) => http_read_promise(enc, buf, stream);
                stream.release = http_close_promise;
                stream.flags |= MASK_SRC_AREAD;
            }
        }
    } catch (err) {
        register_interrupt(buf, () => {});
        if ("ABORT" !== err)
            register_signal(buf, map_file_error(err, url));
    }
}

async function http_read_promise(enc, buf, stream) {
    try {
        let {done, value} = await stream.data.read();
        let res;
        if (done) {
            res = "";
        } else {
            if (fs !== undefined) {
                res = Buffer.from(value.buffer).toString(enc);
            } else {
                let txt = new TextDecoder("utf8");
                res = txt.decode(value);
            }
        }
        stream.buf = res;
        stream.pos = 0;
    } catch (err) {
        register_signal(buf, map_stream_error(err));
    }
}

function http_close_promise(buf, stream) {
    return stream.data.cancel();
}

function map_http_result(res, url) {
    switch (res) {
        case 403: // Forbidden
            return new Compound("permission_error",
                ["open", "source_sink", url]);
        case 404: // Not Found
            return new Compound("existence_error",
                ["source_sink", url]);
        case 405: // Method Not Allowed
            return new Compound("resource_error",
                ["illegal_method"]);
        case 500: // Internal Server Error
            return new Compound("resource_error",
                ["internal_error"]);
        case 503: // Service Unavailable
            return new Compound("resource_error",
                ["service_unavailable"]);
        default:
            return new Compound("resource_error",
                ["io_exception"]);
    }
}


const HTTP_TIME = "%a, %d %b %Y %H:%M:%S GMT";

function test_net_prop_promise(args) {
    let url = exec_build(args[0]);
    check_atom(url);
    let res = {};
    if (!exec_unify(args[1], res))
        return false;
    let buf = ctx;
    let prom;
    if (fs !== undefined) {
        prom = prop_http_promise(buf, url, res);
    } else {
        try {
            url = new URL(url, codebase).href;
        } catch (err) {
            throw make_error(
                new Compound("resource_error", ["base_url"]));
        }
        prom = prop_http_promise(buf, url, res);
    }
    return exec_unify(args[2], prom);
}

async function prop_http_promise(buf, url, res) {
    let paras = {};
    paras.method = "HEAD";
    let contr = new AbortController();
    paras.signal = contr.signal;
    register_interrupt(buf, () => contr.abort("ABORT"));
    try {
        let response = await fetch(url, paras);
        register_interrupt(buf, () => { });
        if (response.status !== 200) {
            register_signal(buf, map_http_result(response.status, url));
        } else {
            let val = response.headers.get("Last-Modified");
            let mtime = (val !== null ? sys_time_parse(
                val, HTTP_TIME, 1) : -1);

            res.last_modified = norm_smallint(mtime);
            res.absolute_path = response.url;
            res.type = "regular";
            res.can_write = "false";
        }
    } catch(err) {
        register_interrupt(buf, () => {});
        if ("ABORT" !== err)
            register_signal(buf, map_file_error(err, url));
    }
}


function test_net_open_sync(args) {
    let url = exec_build(args[0]);
    check_atom(url);
    throw make_error(new Compound("permission_error",
        ["access", "source_sink", url]));
}

function test_net_cntrl_sync(args) {
    let url = exec_build(args[0]);
    check_atom(url);
    throw make_error(new Compound("permission_error",
        ["access", "source_sink", url]));
}


function test_sys_atom_time(args) {
    let fmt = exec_build(args[1]);
    check_atom(fmt);
    let flag = exec_build(args[2]);
    check_integer(flag);
    let text = exec_deref(args[0]);
    if (is_variable(text) || is_pending(text)) {
        let tms = exec_build(args[3]);
        check_integer(tms);
        let res = sys_time_format(fmt, narrow_float(tms), flag);
        if (res === null)
            throw make_error(new Compound("domain_error",
                ["time_format", fmt]));
        return exec_unify(text, res);
    } else {
        text = exec_build(text);
        check_atom(text);
        let tms = sys_time_parse(text, fmt, flag);
        if (isNaN(tms))
            throw make_error(new Compound("syntax_error", ["illegal_date"]));
        if (tms === null)
            throw make_error(new Compound("domain_error",
                ["time_format", fmt]));
        return exec_unify(args[3], norm_smallint(tms));
    }
}

function sys_time_parse(res, pat, utc) {
    let year = 1900; let month = 1; let day = 1;
    let hour = 0; let  minute = 0; let second = 0;
    let j = 0;
    for (let i = 0; i < pat.length; i++) {
        let ch = pat.charCodeAt(i);
        if (ch === 37) { // %
            i++;
            let k;
            switch (pat.charCodeAt(i)) {
                case 37: // %
                    if (j < res.length && res.charCodeAt(j) === 37) {
                        j++;
                    } else {
                        return NaN;
                    }
                    break;
                case 97: // a
                    k = scan_alphanum(res, j);
                    let f = new Intl.DateTimeFormat((utc !== 0 ? "en-US":undefined), {weekday: "short"});
                    let weekday = parse_weekday(res.substring(j, k), f);
                    if (isNaN(weekday))
                        return NaN;
                    j = k;
                    break;
                case 98: // b
                    k = scan_alphanum(res, j);
                    let g = new Intl.DateTimeFormat((utc !== 0 ? "en-US":undefined), {month: "short"});
                    month = parse_month(res.substring(j, k), g);
                    if (isNaN(month))
                        return NaN;
                    j = k;
                    break;
                case 100: // d
                    k = scan_integer(res, j);
                    day = Number.parseInt(res.substring(j, k));
                    if (isNaN(day))
                        return NaN;
                    j = k;
                    break;
                case 109: // m
                    k = scan_integer(res, j);
                    month = Number.parseInt(res.substring(j, k));
                    if (isNaN(month))
                        return NaN;
                    j = k;
                    break;
                case 89: // Y
                    k = scan_integer(res, j);
                    year = Number.parseInt(res.substring(j, k));
                    if (isNaN(year))
                        return NaN;
                    j = k;
                    break;
                case 72: // H
                    k = scan_integer(res, j);
                    hour = Number.parseInt(res.substring(j, k));
                    if (isNaN(hour))
                        return NaN;
                    j = k;
                    break;
                case 77: // M
                    k = scan_integer(res, j);
                    minute = Number.parseInt(res.substring(j, k));
                    if (isNaN(minute))
                        return NaN;
                    j = k;
                    break;
                case 83: // S
                    k = scan_integer(res, j);
                    second = Number.parseInt(res.substring(j, k));
                    if (isNaN(second))
                        return NaN;
                    j = k;
                    break;
                default:
                    return null;
            }
        } else {
            if (j < res.length && res.charCodeAt(j) === ch) {
                j++;
            } else {
                return NaN;
            }
        }
    }
    if (utc !== 0) {
        return Date.UTC(year, month - 1, day, hour, minute, second);
    } else {
        return new Date(year, month - 1, day, hour, minute, second).getTime();
    }
}

function scan_alphanum(res, j) {
    let ch;
    while (j < res.length && ((48 <= (ch = res.charCodeAt(j)) && ch <= 57) ||
        (65 <= ch && ch <= 90) ||
        (97 <= ch && ch <= 122)))
        j++;
    return j;
}

function parse_weekday(str, fmt) {
    str = str.toLowerCase();
    for (let i=1; i < 8; i++) {
        let wday = new Date(Date.UTC(2001,0,i,0,0,0));
        let val = fmt.format(wday);
        val = val.toLowerCase();
        if (str === val)
            return i;
    }
    return NaN;
}

function parse_month(str, fmt) {
    str = str.toLowerCase();
    for (let i=1; i < 13; i++) {
        let mon = new Date(Date.UTC(2001,i-1,1,0,0,0));
        let val = fmt.format(mon);
        val = val.toLowerCase();
        if (str === val)
            return i;
    }
    return NaN;
}

function scan_integer(res, j) {
    let ch;
    while (j < res.length && 48 <= (ch = res.charCodeAt(j)) && ch <= 57)
        j++;
    return j;
}

function sys_time_format(pat, tms, utc) {
    let date = new Date(tms);
    let buf = "";
    let k = 0;
    for (let i = 0; i < pat.length; i++) {
        let ch = pat.charCodeAt(i);
        if (ch === 37) { // %
            buf += pat.substring(k, i);
            i++;
            if (i < pat.length) {
                switch (pat.charCodeAt(i)) {
                    case 37: // %
                        buf += "%";
                        break;
                    case 97: // a
                        let f;
                        if (utc !== 0) {
                            f = new Intl.DateTimeFormat("en-US", {timeZone: "UTC", weekday: "short"});
                        } else {
                            f = new Intl.DateTimeFormat(undefined, {weekday: "short"});
                        }
                        buf += f.format(date);
                        break;
                    case 98: // b
                        let g;
                        if (utc !== 0) {
                            g = new Intl.DateTimeFormat("en-US", {timeZone: "UTC", month: "short"});
                        } else {
                            g = new Intl.DateTimeFormat(undefined, {month: "short"});
                        }
                        buf += g.format(date);
                        break;
                    case 100: // d
                        buf = append_padded(buf, (utc !== 0 ? date.getUTCDate():date.getDate()));
                        break;
                    case 109: // m
                        buf = append_padded(buf, (utc !== 0 ? date.getUTCMonth():date.getMonth())+1);
                        break;
                    case 89: // Y
                        buf += (utc !== 0 ? date.getUTCFullYear():date.getFullYear());
                        break;
                    case 72: // H
                        buf = append_padded(buf, (utc !== 0 ? date.getUTCHours():date.getHours()));
                        break;
                    case 77: // M
                        buf = append_padded(buf, (utc !== 0 ? date.getUTCMinutes():date.getMinutes()));
                        break;
                    case 83: // S
                        buf = append_padded(buf, (utc !== 0 ? date.getUTCSeconds():date.getSeconds()));
                        break;
                    default:
                        return null;
                }
                k = i + 1;
            } else {
                k = i;
            }
        }
    }
    buf += pat.substring(k, pat.length);
    return buf;
}

function append_padded(buf, value) {
    if (value < 10)
        buf += '0';
    buf += value.toString();
    return buf;
}


function test_os_get_gestalt(args) {
    let gestalt = new Map();
    let scm;
    if (fs !== undefined) {
        scm = process.env["TERM_SCHEME"];
    } else {
        scm  = "[]";
    }
    gestalt.set("sys_color", (scm !== undefined ? scm : "normal"));
    let loc = new Intl.DateTimeFormat().resolvedOptions().locale;
    gestalt.set("sys_locale", loc.replace("-", "_"));
    let res;
    if (fs !== undefined) {
        res = objects_list(process.argv, 2, process.argv.length - 2);
    } else {
        res  = "[]";
    }
    gestalt.set("argv", res);
    return exec_unify(args[0], gestalt);
}

function test_os_get_host(args) {
    let res = new Map();
    let host_info;
    let mach_info;
    if (fs !== undefined) {
        host_info = (process.versions.bun !== undefined ? "Bun" : "Node")+
            ", JavaScript "+ process.versions.node;
        let help = os.version();
        let k = help.indexOf(":");
        mach_info = os.cpus()[0].model.trim()+", "+
            (k !== -1 ? help.substring(0, k) : help);
    } else {
        host_info = "N/A";
        mach_info = "N/A";
    }
    res.set("system_url", bootbase);
    res.set("foreign_ext", ".mjs");
    res.set("host_info", host_info);
    res.set("mach_info", mach_info);
    return exec_unify(args[0], res);
}


function test_os_get_workdir(args) {
    let url;
    if (fs !== undefined) {
        url = process.cwd() + path.sep;
    } else {
        url = codebase;
    }
    return exec_unify(args[0], url);
}

function test_os_set_workdir(args) {
    let url = exec_build(args[0]);
    check_atom(url);

    if (fs !== undefined) {
        try {
            process.chdir(url);
        } catch (err) {
            throw make_error(map_file_error(err, url));
        }
    } else {
        try {
            url = new URL(url, codebase).href;
        } catch (err) {
            throw make_error(new Compound("resource_error", ["base_url"]));
        }
        set_codebase(url);
    }
    return true;
}


function test_dg_get_flags(args) {
    return exec_unify(args[0], norm_smallint(engine.flags));
}

function test_dg_get_partition(args) {
    return exec_unify(args[0], engine.partition);
}

function test_dg_set_partition(args) {
    let value = exec_build(args[0]);
    check_atom(value);
    set_partition(value);
    return true;
}


function test_dg_clear_stage(args) {
    clear();
    return true;
}

function test_dg_get_stage(args) {
    return exec_unify(args[0], norm_smallint(stage));
}

function test_dg_set_stage(args) {
    let value = exec_build(args[0]);
    check_integer(value);
    set_stage(narrow_float(value));
    return true;
}


// object specials
set("ir_object_new", 1, make_check(test_ir_object_new));
set("ir_object_current", 3, make_check(test_ir_object_current));
set("ir_object_set", 3, make_check(test_ir_object_set));
set("ir_object_reset", 2, make_check(test_ir_object_reset));
set("ir_object_keys", 2, make_check(test_ir_object_keys));

// object specials II
set("ir_float_value", 2, make_check(test_ir_float_value));
set("ir_atom_offset", 3, make_check(test_ir_atom_offset));

// system specials, coroutines
set("os_call_later", 3, make_check(test_os_call_later));
set("timer_cancel", 1, make_check(test_timer_cancel));
set("current_task", 1, make_check(test_current_task));
set("task_abort", 2, make_check(test_task_abort));
set("os_task_create", 2, make_check(test_os_task_create));

// net specials, async
set("net_open_promise", 4, make_check(test_net_open_promise));
set("net_prop_promise", 3, make_check(test_net_prop_promise));

// net specials, sync
set("net_open_sync", 4, make_check(test_net_open_sync));
set("net_cntrl_sync", 2, make_check(test_net_cntrl_sync));

// atom specials, time
set("sys_atom_time", 4, make_check(test_sys_atom_time));

// object specials, gestalt
set("os_get_gestalt", 1, make_check(test_os_get_gestalt));
set("os_get_host", 1, make_check(test_os_get_host));
set("os_get_workdir", 1, make_check(test_os_get_workdir));
set("os_set_workdir", 1, make_check(test_os_set_workdir));

// system specials, staging, internal only
set("dg_get_flags", 1, make_check(test_dg_get_flags));
set("dg_get_partition", 1, make_check(test_dg_get_partition));
set("dg_set_partition", 1, make_check(test_dg_set_partition));
set("dg_clear_stage", 0, make_check(test_dg_clear_stage));
set("dg_get_stage", 1, make_check(test_dg_get_stage));
set("dg_set_stage", 1, make_check(test_dg_set_stage));

add(new Clause(1, "sys_trans_horn", [new Place(0), undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(5, "sys_trans_horn", [new Skeleton(":-", [new Place(1)]), new Skeleton("tr_goal", [new Place(2), new Place(3)]), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_body"), [new Place(1), "nothing", new Place(2), new Place(4), new Place(3), "[]"])], 0));
add(new Clause(6, "sys_trans_horn", [new Skeleton(":-", [new Place(1), new Place(2)]), new Skeleton("tr_clause", [new Place(3), new Place(1), new Place(4)]), new Place(5)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("must_be"), ["callable", new Place(1)]), new Skeleton(new Cache("sys_trans_body"), [new Place(2), "nothing", new Place(3), new Place(5), new Place(4), "[]"])], 0));
add(new Clause(1, "sys_trans_horn", [new Place(0), new Skeleton("tr_clause", ["nothing", new Place(0), "[]"]), undefined], [new Skeleton(new Cache("must_be"), ["callable", new Place(0)])], -1));
add(new Clause(5, "sys_trans_body", [new Place(1), new Place(2), new Place(2), undefined, new Place(3), new Place(4)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), new Skeleton(".", [new Skeleton("call", [new Place(1)]), new Place(4)])])], 0));
add(new Clause(4, "sys_trans_body", ["true", new Place(1), new Place(1), undefined, new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(10, "sys_trans_body", [new Skeleton(",", [new Place(1), new Place(2)]), new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_body"), [new Place(1), new Place(3), new Place(8), new Place(5), new Place(6), new Place(9)]), new Skeleton(new Cache("sys_trans_body"), [new Place(2), new Place(8), new Place(4), new Place(5), new Place(9), new Place(7)])], 0));
add(new Clause(5, "sys_trans_body", ["!", new Place(1), new Skeleton("just", [new Place(2)]), undefined, new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_cut"), [new Place(1), new Place(2)]), new Skeleton(new Cache("="), [new Place(3), new Skeleton(".", [new Skeleton("$CUT", [new Place(2)]), new Place(4)])])], 0));
add(new Clause(9, "sys_trans_body", [new Skeleton(";", [new Place(1), new Place(2)]), new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_disj"), [new Skeleton(";", [new Place(1), new Place(2)]), 0, new Place(3), new Place(4), new Place(5), new Place(8)]), new Skeleton(new Cache("="), [new Place(6), new Skeleton(".", [new Skeleton("$ALT", [new Place(8)]), new Place(7)])])], 0));
add(new Clause(9, "sys_trans_body", [new Skeleton("->", [new Place(1), new Place(2)]), new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_disj"), [new Skeleton("->", [new Place(1), new Place(2)]), 0, new Place(3), new Place(4), new Place(5), new Place(8)]), new Skeleton(new Cache("="), [new Place(6), new Skeleton(".", [new Skeleton("$ALT", [new Place(8)]), new Place(7)])])], 0));
add(new Clause(6, "sys_trans_body", [new Skeleton("\\+", [new Place(1)]), new Place(2), new Place(3), 1, new Place(4), new Place(5)], [new Skeleton(new Cache("sys_safe_meta"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_body"), [new Skeleton(";", [new Skeleton("->", [new Place(1), "fail"]), "true"]), new Place(2), new Place(3), 1, new Place(4), new Place(5)])], 0));
add(new Clause(6, "sys_trans_body", [new Skeleton("once", [new Place(1)]), new Place(2), new Place(3), 1, new Place(4), new Place(5)], [new Skeleton(new Cache("sys_safe_meta"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_body"), [new Skeleton("->", [new Place(1), "true"]), new Place(2), new Place(3), 1, new Place(4), new Place(5)])], 0));
add(new Clause(4, "sys_trans_body", [new Place(0), new Place(1), new Place(1), undefined, new Place(2), new Place(3)], [new Skeleton(new Cache("must_be"), ["callable", new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Skeleton(".", [new Place(0), new Place(3)])])], -1));
add(new Clause(1, "sys_trans_cut", ["nothing", undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_trans_cut", [new Skeleton("just", [new Place(0)]), new Place(0)], [], -1));
add(new Clause(6, "sys_trans_disj", [new Place(1), undefined, new Place(2), new Place(3), new Place(4), new Skeleton(".", [new Place(5), "[]"])], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_alter"), [new Place(1), new Place(2), new Place(3), new Place(5), new Place(4), undefined])], 0));
add(new Clause(10, "sys_trans_disj", [new Skeleton(";", [new Place(1), new Place(2)]), undefined, new Place(3), new Place(4), new Place(5), new Skeleton(".", [new Place(6), new Place(7)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_alter"), [new Place(1), new Place(3), new Place(8), new Place(6), new Place(5), new Place(9)]), new Skeleton(new Cache("sys_trans_disj"), [new Place(2), new Place(9), new Place(8), new Place(4), new Place(5), new Place(7)])], 0));
add(new Clause(2, "sys_trans_disj", ["fail", 1, new Place(1), new Place(1), undefined, "[]"], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(5, "sys_trans_disj", [new Place(0), undefined, new Place(1), new Place(2), new Place(3), new Skeleton(".", [new Place(4), "[]"])], [new Skeleton(new Cache("sys_trans_alter"), [new Place(0), new Place(1), new Place(2), new Place(4), new Place(3), undefined])], -1));
add(new Clause(6, "sys_trans_alter", [new Place(1), new Place(2), new Place(3), new Skeleton("$SEQ", ["nothing", new Place(4)]), new Place(5), 0], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_body"), [new Place(1), new Place(2), new Place(3), new Place(5), new Place(4), "[]"])], 0));
add(new Clause(11, "sys_trans_alter", [new Skeleton("->", [new Place(1), new Place(2)]), new Place(3), new Place(4), new Skeleton("$SEQ", [new Skeleton("just", [new Place(5)]), new Place(6)]), new Place(7), 1], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_body"), [new Place(1), "nothing", new Place(8), new Place(7), new Place(9), new Skeleton(".", [new Skeleton("$CUT", [new Place(5)]), new Place(10)])]), new Skeleton(new Cache("sys_trans_body"), [new Place(2), new Place(3), new Place(4), new Place(7), new Place(10), "[]"]), new Skeleton(new Cache("sys_trans_mark"), [new Place(8), new Place(6), new Place(9)])], 0));
add(new Clause(5, "sys_trans_alter", [new Place(0), new Place(1), new Place(2), new Skeleton("$SEQ", ["nothing", new Place(3)]), new Place(4), 0], [new Skeleton(new Cache("sys_trans_body"), [new Place(0), new Place(1), new Place(2), new Place(4), new Place(3), "[]"])], -1));
add(new Clause(3, "sys_trans_mark", [new Skeleton("just", [new Place(1)]), new Skeleton(".", [new Skeleton("$MARK", [new Place(1)]), new Place(2)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_trans_mark", ["nothing", new Place(0), new Place(0)], [], -1));
add(new Clause(2, "sys_safe_meta", [new Place(1)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0));
add(new Clause(3, "sys_safe_meta", [new Skeleton(",", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_safe_meta"), [new Place(1)]), new Skeleton(new Cache("sys_safe_meta"), [new Place(2)])], 0));
add(new Clause(3, "sys_safe_meta", [new Skeleton(";", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_safe_meta"), [new Place(1)]), new Skeleton(new Cache("sys_safe_meta"), [new Place(2)])], 0));
add(new Clause(3, "sys_safe_meta", [new Skeleton("->", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_safe_meta"), [new Place(1)]), new Skeleton(new Cache("sys_safe_meta"), [new Place(2)])], 0));
add(new Clause(1, "sys_safe_meta", [new Place(0)], [new Skeleton(new Cache("callable"), [new Place(0)])], -1));
add(new Clause(0, "sys_untrans_body", ["[]", undefined, undefined, "true"], [], -1));
add(new Clause(6, "sys_untrans_body", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_untrans_goal"), [new Place(0), new Place(2), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_untrans_rest"), [new Place(1), new Place(5), new Place(2), new Place(3), new Place(4)])], -1));
add(new Clause(5, "sys_untrans_rest", [new Place(1), new Skeleton(";", [new Skeleton("->", [new Place(2), "fail"]), "true"]), new Place(3), 1, new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_untrans_rest"), [new Place(1), new Skeleton("\\+", [new Place(2)]), new Place(3), 1, new Place(4)])], 0));
add(new Clause(5, "sys_untrans_rest", [new Place(1), new Skeleton("->", [new Place(2), "true"]), new Place(3), 1, new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_untrans_rest"), [new Place(1), new Skeleton("once", [new Place(2)]), new Place(3), 1, new Place(4)])], 0));
add(new Clause(1, "sys_untrans_rest", ["[]", new Place(0), undefined, undefined, new Place(0)], [], -1));
add(new Clause(7, "sys_untrans_rest", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Place(3), new Place(4), new Skeleton(",", [new Place(2), new Place(5)])], [new Skeleton(new Cache("sys_untrans_goal"), [new Place(0), new Place(3), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_untrans_rest"), [new Place(1), new Place(6), new Place(3), new Place(4), new Place(5)])], -1));
add(new Clause(3, "sys_untrans_goal", [new Skeleton("$CUT", [new Place(1)]), new Skeleton("just", [new Place(2)]), undefined, "!"], [new Skeleton(new Cache("=="), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(5, "sys_untrans_goal", [new Skeleton("$ALT", [new Place(1)]), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_untrans_disj"), [new Place(1), new Place(2), new Place(3), new Place(4)])], 0));
add(new Clause(1, "sys_untrans_goal", [new Place(0), undefined, undefined, new Place(0)], [], -1));
add(new Clause(0, "sys_untrans_disj", ["[]", undefined, undefined, "fail"], [], -1));
add(new Clause(5, "sys_untrans_disj", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_untrans_more"), [new Place(1), new Place(0), new Place(2), new Place(3), new Place(4)])], -1));
add(new Clause(5, "sys_untrans_more", ["[]", new Skeleton("$SEQ", [new Place(0), new Place(1)]), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_untrans_alter"), [new Place(0), new Place(1), new Place(2), new Place(3), new Place(4)])], -1));
add(new Clause(8, "sys_untrans_more", [new Skeleton(".", [new Place(0), new Place(1)]), new Skeleton("$SEQ", [new Place(2), new Place(3)]), new Place(4), new Place(5), new Skeleton(";", [new Place(6), new Place(7)])], [new Skeleton(new Cache("sys_untrans_alter"), [new Place(2), new Place(3), new Place(4), new Place(5), new Place(6)]), new Skeleton(new Cache("sys_untrans_more"), [new Place(1), new Place(0), new Place(4), new Place(5), new Place(7)])], -1));
add(new Clause(5, "sys_untrans_alter", ["nothing", new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_untrans_body"), [new Place(0), new Place(1), new Place(2), new Place(4)]), new Skeleton(new Cache("sys_untrans_ambiguity"), [new Place(4), new Place(3)])], -1));
add(new Clause(10, "sys_untrans_alter", [new Skeleton("just", [new Place(0)]), new Place(1), new Place(2), new Place(3), new Skeleton("->", [new Place(4), new Place(5)])], [new Skeleton(new Cache("sys_untrans_split"), [new Place(1), new Place(0), new Place(6), new Place(7)]), new Skeleton(new Cache("sys_trans_mark"), [new Place(8), new Place(6), new Place(9)]), new Skeleton(new Cache("sys_untrans_body"), [new Place(9), new Place(8), new Place(3), new Place(4)]), new Skeleton(new Cache("sys_untrans_body"), [new Place(7), new Place(2), new Place(3), new Place(5)])], -1));
add(new Clause(4, "sys_untrans_split", [new Skeleton(".", [new Skeleton("$CUT", [new Place(1)]), new Place(2)]), new Place(3), "[]", new Place(2)], [new Skeleton(new Cache("=="), [new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(5, "sys_untrans_split", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Skeleton(".", [new Place(0), new Place(3)]), new Place(4)], [new Skeleton(new Cache("sys_untrans_split"), [new Place(1), new Place(2), new Place(3), new Place(4)])], -1));
add(new Clause(3, "sys_untrans_ambiguity", [new Skeleton("->", [new Place(1), new Place(2)]), new Skeleton(";", [new Skeleton("->", [new Place(1), new Place(2)]), "fail"])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_untrans_ambiguity", [new Place(0), new Place(0)], [], -1));
add(new Clause(2, "sys_encode_horn", [new Place(1), new Place(1), 0], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_encode_horn", [new Skeleton("tr_goal", [new Place(0), new Place(1)]), new Skeleton("tr_goal", [new Place(0), new Place(2)]), undefined], [new Skeleton(new Cache("sys_encode_body"), [new Place(1), new Place(2), new Place(0)])], -1));
add(new Clause(4, "sys_encode_horn", [new Skeleton("tr_clause", [new Place(0), new Place(1), new Place(2)]), new Skeleton("tr_clause", [new Place(0), new Place(1), new Place(3)]), undefined], [new Skeleton(new Cache("sys_encode_body"), [new Place(2), new Place(3), new Skeleton("-", [new Place(0), new Place(1)])])], -1));
add(new Clause(0, "sys_meta_args", ["is", 2, new Frozen(".", ["t", new Frozen(".", ["e", "[]"])])], [], -1));
add(new Clause(0, "sys_meta_args", ["=:=", 2, new Frozen(".", ["e", new Frozen(".", ["e", "[]"])])], [], -1));
add(new Clause(0, "sys_meta_args", ["=\\=", 2, new Frozen(".", ["e", new Frozen(".", ["e", "[]"])])], [], -1));
add(new Clause(0, "sys_meta_args", ["<", 2, new Frozen(".", ["e", new Frozen(".", ["e", "[]"])])], [], -1));
add(new Clause(0, "sys_meta_args", ["=<", 2, new Frozen(".", ["e", new Frozen(".", ["e", "[]"])])], [], -1));
add(new Clause(0, "sys_meta_args", [">", 2, new Frozen(".", ["e", new Frozen(".", ["e", "[]"])])], [], -1));
add(new Clause(0, "sys_meta_args", [">=", 2, new Frozen(".", ["e", new Frozen(".", ["e", "[]"])])], [], -1));
add(new Clause(0, "sys_meta_args", ["\\+", 1, new Frozen(".", ["p", "[]"])], [], -1));
add(new Clause(0, "sys_meta_args", ["once", 1, new Frozen(".", ["p", "[]"])], [], -1));
add(new Clause(0, "sys_meta_args", ["asserta", 1, new Frozen(".", ["c", "[]"])], [], -1));
add(new Clause(0, "sys_meta_args", ["assertz", 1, new Frozen(".", ["c", "[]"])], [], -1));
add(new Clause(0, "sys_meta_args", ["clause", 2, new Frozen(".", ["p", new Frozen(".", ["t", "[]"])])], [], -1));
add(new Clause(0, "sys_meta_args", ["retract", 1, new Frozen(".", ["c", "[]"])], [], -1));
add(new Clause(0, "sys_meta_args", ["retractall", 1, new Frozen(".", ["p", "[]"])], [], -1));
add(new Clause(0, "sys_encode_body", ["[]", "[]", undefined], [], -1));
add(new Clause(5, "sys_encode_body", [new Skeleton(".", [new Place(0), new Place(1)]), new Skeleton(".", [new Place(2), new Place(3)]), new Place(4)], [new Skeleton(new Cache("sys_encode_goal"), [new Place(0), new Place(2), new Skeleton("-", [new Place(1), new Place(4)])]), new Skeleton(new Cache("sys_encode_body"), [new Place(1), new Place(3), new Skeleton(".", [new Place(0), new Place(4)])])], -1));
add(new Clause(2, "sys_encode_goal", [new Place(1), new Place(1), undefined], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(7, "sys_encode_goal", [new Skeleton("$ALT", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("vars_intersection"), [new Place(1), new Place(3), new Place(4)]), new Skeleton(new Cache("=.."), [new Place(5), new Skeleton(".", ["", new Place(4)])]), new Skeleton(new Cache("sys_encode_disj"), [new Place(1), new Place(5), new Place(6)]), new Skeleton(new Cache("sys_encode_link"), [new Place(5), new Place(2), new Place(6)])], 0));
add(new Clause(7, "sys_encode_goal", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("functor"), [new Place(1), new Place(4), new Place(5)]), new Skeleton(new Cache("sys_meta_args"), [new Place(4), new Place(5), new Place(6)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_encode_meta"), [new Place(6), new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(2, "sys_encode_goal", [new Place(0), new Place(1), undefined], [new Skeleton(new Cache("ir_site_new"), [new Place(0), new Place(1)])], -1));
add(new Clause(7, "sys_encode_disj", [new Skeleton(".", [new Skeleton("$SEQ", [new Place(0), new Place(1)]), new Place(2)]), new Place(3), new Skeleton(".", [new Place(4), new Place(5)])], [new Skeleton(new Cache("sys_encode_horn"), [new Skeleton("tr_clause", [new Place(0), new Place(3), new Place(1)]), new Place(6), 1]), new Skeleton(new Cache("sys_host_ossify"), [new Place(6), new Place(4)]), new Skeleton(new Cache("sys_encode_disj"), [new Place(2), new Place(3), new Place(5)])], -1));
add(new Clause(0, "sys_encode_disj", ["[]", undefined, "[]"], [], -1));
add(new Clause(5, "sys_encode_link", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("=.."), [new Place(0), new Skeleton(".", [undefined, new Place(3)])]), new Skeleton(new Cache("ir_link_new"), [new Place(2), new Place(4)]), new Skeleton(new Cache("=.."), [new Place(1), new Skeleton(".", [new Place(4), new Place(3)])])], -1));
add(new Clause(8, "sys_encode_meta", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("=.."), [new Place(1), new Skeleton(".", [new Place(4), new Place(5)])]), new Skeleton(new Cache("sys_encode_params"), [new Place(0), new Place(5), new Place(6), new Place(3)]), new Skeleton(new Cache("=.."), [new Place(7), new Skeleton(".", [new Place(4), new Place(6)])]), new Skeleton(new Cache("ir_site_new"), [new Place(7), new Place(2)])], -1));
add(new Clause(0, "sys_encode_params", ["[]", "[]", "[]", undefined], [], -1));
add(new Clause(7, "sys_encode_params", [new Skeleton(".", [new Place(0), new Place(1)]), new Skeleton(".", [new Place(2), new Place(3)]), new Skeleton(".", [new Place(4), new Place(5)]), new Place(6)], [new Skeleton(new Cache("sys_encode_param"), [new Place(0), new Place(2), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_encode_params"), [new Place(1), new Place(3), new Place(5), new Place(6)])], -1));
add(new Clause(1, "sys_encode_param", ["t", new Place(0), new Place(0), undefined], [], -1));
add(new Clause(2, "sys_encode_param", ["e", new Place(0), new Place(1), undefined], [new Skeleton(new Cache("sys_encode_expr"), [new Place(0), new Place(1)])], -1));
add(new Clause(2, "sys_encode_param", ["c", new Place(0), new Place(1), undefined], [new Skeleton(new Cache("sys_encode_clause"), [new Place(0), new Place(1)])], -1));
add(new Clause(3, "sys_encode_param", ["p", new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_encode_goal"), [new Place(0), new Place(1), new Place(2)])], -1));
add(new Clause(7, "sys_encode_expr", [new Place(1), new Place(2)], [new Skeleton(new Cache("compound"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("=.."), [new Place(1), new Skeleton(".", [new Place(3), new Place(4)])]), new Skeleton(new Cache("sys_encode_args"), [new Place(4), new Place(5)]), new Skeleton(new Cache("=.."), [new Place(6), new Skeleton(".", [new Place(3), new Place(5)])]), new Skeleton(new Cache("ir_site_new"), [new Place(6), new Place(2)])], 0));
add(new Clause(2, "sys_encode_expr", [new Place(0), new Place(1)], [new Skeleton(new Cache("ir_site_new"), [new Place(0), new Place(1)])], -1));
add(new Clause(0, "sys_encode_args", ["[]", "[]"], [], -1));
add(new Clause(4, "sys_encode_args", [new Skeleton(".", [new Place(0), new Place(1)]), new Skeleton(".", [new Place(2), new Place(3)])], [new Skeleton(new Cache("sys_encode_expr"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_encode_args"), [new Place(1), new Place(3)])], -1));
add(new Clause(5, "sys_encode_clause", [new Place(1), new Skeleton(":-", [new Place(2), new Place(3)])], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(":-", [new Place(4), new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("ir_site_new"), [new Place(4), new Place(2)])], 0));
add(new Clause(2, "sys_encode_clause", [new Place(0), new Place(1)], [new Skeleton(new Cache("ir_site_new"), [new Place(0), new Place(1)])], -1));
add(new Clause(0, "sys_decode_body", ["[]", "[]"], [], -1));
add(new Clause(4, "sys_decode_body", [new Skeleton(".", [new Place(0), new Place(1)]), new Skeleton(".", [new Place(2), new Place(3)])], [new Skeleton(new Cache("sys_decode_goal"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_decode_body"), [new Place(1), new Place(3)])], -1));
add(new Clause(2, "sys_decode_goal", [new Place(1), new Place(1)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(4, "sys_decode_goal", [new Place(1), new Place(2)], [new Skeleton(new Cache("ir_is_site"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("ir_site_name"), [new Place(1), new Place(3)]), new Skeleton(new Cache("sys_decode_goal"), [new Place(3), new Place(2)])], 0));
add(new Clause(5, "sys_decode_goal", [new Place(1), new Skeleton("$ALT", [new Place(2)])], [new Skeleton(new Cache("ir_is_link"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("findall"), [new Place(3), new Skeleton("kb_clause_ref", [new Place(1), 0, new Place(3)]), new Place(4)]), new Skeleton(new Cache("sys_decode_disj"), [new Place(4), new Place(1), new Place(2)])], 0));
add(new Clause(6, "sys_decode_goal", [new Place(1), new Place(2)], [new Skeleton(new Cache("functor"), [new Place(1), new Place(3), new Place(4)]), new Skeleton(new Cache("sys_meta_args"), [new Place(3), new Place(4), new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_decode_meta"), [new Place(5), new Place(1), new Place(2)])], 0));
add(new Clause(1, "sys_decode_goal", [new Place(0), new Place(0)], [], -1));
add(new Clause(0, "sys_decode_disj", ["[]", undefined, "[]"], [], -1));
add(new Clause(7, "sys_decode_disj", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Skeleton(".", [new Skeleton("$SEQ", [new Place(3), new Place(4)]), new Place(5)])], [new Skeleton(new Cache("kb_clause_data"), [new Place(0), new Place(2), new Place(3), new Place(6)]), new Skeleton(new Cache("sys_decode_body"), [new Place(6), new Place(4)]), new Skeleton(new Cache("sys_decode_disj"), [new Place(1), new Place(2), new Place(5)])], -1));
add(new Clause(6, "sys_decode_meta", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("=.."), [new Place(1), new Skeleton(".", [new Place(3), new Place(4)])]), new Skeleton(new Cache("sys_decode_params"), [new Place(0), new Place(4), new Place(5)]), new Skeleton(new Cache("=.."), [new Place(2), new Skeleton(".", [new Place(3), new Place(5)])])], -1));
add(new Clause(0, "sys_decode_params", ["[]", "[]", "[]"], [], -1));
add(new Clause(6, "sys_decode_params", [new Skeleton(".", [new Place(0), new Place(1)]), new Skeleton(".", [new Place(2), new Place(3)]), new Skeleton(".", [new Place(4), new Place(5)])], [new Skeleton(new Cache("sys_decode_param"), [new Place(0), new Place(2), new Place(4)]), new Skeleton(new Cache("sys_decode_params"), [new Place(1), new Place(3), new Place(5)])], -1));
add(new Clause(1, "sys_decode_param", ["t", new Place(0), new Place(0)], [], -1));
add(new Clause(2, "sys_decode_param", ["e", new Place(0), new Place(1)], [new Skeleton(new Cache("sys_decode_expr"), [new Place(0), new Place(1)])], -1));
add(new Clause(2, "sys_decode_param", ["c", new Place(0), new Place(1)], [new Skeleton(new Cache("sys_decode_clause"), [new Place(0), new Place(1)])], -1));
add(new Clause(2, "sys_decode_param", ["p", new Place(0), new Place(1)], [new Skeleton(new Cache("sys_decode_goal"), [new Place(0), new Place(1)])], -1));
add(new Clause(7, "sys_decode_expr", [new Place(1), new Place(2)], [new Skeleton(new Cache("compound"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("=.."), [new Place(1), new Skeleton(".", [new Place(3), new Place(4)])]), new Skeleton(new Cache("sys_decode_args"), [new Place(4), new Place(5)]), new Skeleton(new Cache("=.."), [new Place(6), new Skeleton(".", [new Place(3), new Place(5)])]), new Skeleton(new Cache("ir_site_name"), [new Place(6), new Place(2)])], 0));
add(new Clause(2, "sys_decode_expr", [new Place(0), new Place(1)], [new Skeleton(new Cache("ir_site_name"), [new Place(0), new Place(1)])], -1));
add(new Clause(0, "sys_decode_args", ["[]", "[]"], [], -1));
add(new Clause(4, "sys_decode_args", [new Skeleton(".", [new Place(0), new Place(1)]), new Skeleton(".", [new Place(2), new Place(3)])], [new Skeleton(new Cache("sys_decode_expr"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_decode_args"), [new Place(1), new Place(3)])], -1));
add(new Clause(5, "sys_decode_clause", [new Place(1), new Skeleton(":-", [new Place(2), new Place(3)])], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(":-", [new Place(4), new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("ir_site_name"), [new Place(4), new Place(2)])], 0));
add(new Clause(2, "sys_decode_clause", [new Place(0), new Place(1)], [new Skeleton(new Cache("ir_site_name"), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("kb_pred_touch"), ["sys_source", 3, 1])], -1));
run(new Goal(0, [new Frozen(new Cache("kb_pred_touch"), ["sys_srcprop", 2, 1])], -1));
add(new Clause(1, "current_source", [new Place(0)], [new Skeleton(new Cache("sys_source"), [new Place(0), undefined, undefined])], -1));
add(new Clause(2, "source_property", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_srcprop"), [new Place(0), new Place(1)])], -1));
add(new Clause(4, "discontiguous", [new Skeleton("\/", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("must_be"), ["atom", new Place(1)]), new Skeleton(new Cache("must_be"), ["integer", new Place(2)]), new Skeleton(new Cache("dg_get_partition"), [new Place(3)]), new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_predprop"), [new Place(1), new Place(2), new Skeleton("sys_discontiguous", [new Place(3)])])])], 0));
add(new Clause(1, "discontiguous", [new Place(0)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["predicate_indicator", new Place(0)]), undefined])])], -1));
add(new Clause(3, "multifile", [new Skeleton("\/", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("must_be"), ["atom", new Place(1)]), new Skeleton(new Cache("must_be"), ["integer", new Place(2)]), new Skeleton(new Cache("sys_multifile_safe"), [new Place(1), new Place(2)])], 0));
add(new Clause(1, "multifile", [new Place(0)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["predicate_indicator", new Place(0)]), undefined])])], -1));
add(new Clause(3, "sys_multifile_safe", [new Place(0), new Place(1)], [new Skeleton(new Cache("dg_get_partition"), [new Place(2)]), new Skeleton(make_defined([new Clause(5, "", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_predprop"), [new Place(1), new Place(2), new Skeleton("sys_usage", [new Place(4)])]), new Skeleton(new Cache("\\=="), [new Place(3), new Place(4)]), new Skeleton(make_defined([new Clause(4, "", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_predprop"), [new Place(1), new Place(2), new Skeleton("sys_multifile", [new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0), new Clause(0, "", [undefined, undefined, undefined], [], -1)]), [new Place(1), new Place(2), new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("permission_error", ["promote", "multifile", new Skeleton("\/", [new Place(1), new Place(2)])]), undefined])])], 0), new Clause(0, "", [undefined, undefined, undefined], [], -1)]), [new Place(0), new Place(1), new Place(2)]), new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_predprop"), [new Place(0), new Place(1), new Skeleton("sys_multifile", [new Place(2)])])])], -1));
add(new Clause(3, "include", [new Place(0)], [new Skeleton(new Cache("sys_file_relative"), [new Place(0), new Place(1)]), new Skeleton(new Cache("file_property"), [new Place(1), new Skeleton("absolute_path", [new Place(2)])]), new Skeleton(new Cache("sys_include_file"), [new Place(2)])], -1));
add(new Clause(2, "sys_include_file", ["user"], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("current_input"), [new Place(1)]), new Skeleton(new Cache("sys_include_lines"), [new Place(1)])], 0));
add(new Clause(5, "sys_include_file", [new Place(1)], [new Skeleton(new Cache("current_prolog_flag"), ["foreign_ext", new Place(2)]), new Skeleton(new Cache("sub_atom"), [new Place(1), undefined, undefined, 0, new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_include_native"), [new Place(1), new Place(3)]), new Skeleton(new Cache("ir_object_current"), [new Place(3), "module", new Place(4)]), new Skeleton(new Cache("os_invoke_main"), [new Place(4)])], 0));
add(new Clause(2, "sys_include_file", [new Place(0)], [new Skeleton(new Cache("setup_once_cleanup"), [new Skeleton("open", [new Place(0), "read", new Place(1)]), new Skeleton("sys_include_stream", [new Place(0), new Place(1)]), new Skeleton("close", [new Place(1)])])], -1));
add(new Clause(4, "sys_include_native", [new Place(1), new Place(2)], [new Frozen(new Cache("current_prolog_flag"), ["import_async", "on"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("os_import_promise"), [new Place(1), new Place(2), new Place(3)]), new Skeleton(new Cache("$YIELD"), [new Place(3)])], 0));
add(new Clause(2, "sys_include_native", [new Place(0), new Place(1)], [new Skeleton(new Cache("os_import_sync"), [new Place(0), new Place(1)])], -1));
add(new Clause(3, ".", [new Place(0), new Place(1)], [new Skeleton(new Cache("member"), [new Place(2), new Skeleton(".", [new Place(0), new Place(1)])]), new Skeleton(new Cache("ensure_loaded"), [new Place(2)]), new Cache("fail")], -1));
add(new Clause(0, ".", [undefined, undefined], [], -1));
add(new Clause(1, "ensure_loaded", [new Place(0)], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(1, "ensure_loaded", ["user"], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Frozen(new Cache("sys_include_file"), ["user"])], 0));
add(new Clause(5, "ensure_loaded", [new Place(0)], [new Skeleton(new Cache("sys_file_relative"), [new Place(0), new Place(1)]), new Skeleton(new Cache("dg_get_partition"), [new Place(2)]), new Skeleton(new Cache("sys_prop_map"), [new Place(1), new Place(3)]), new Skeleton(new Cache("ir_object_current"), [new Place(3), "absolute_path", new Place(4)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_srcprop"), [new Place(1), new Skeleton("sys_link", [new Place(2)])]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(2, "", [new Place(0), new Place(1)], [new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_srcprop"), [new Place(0), new Skeleton("sys_link", [new Place(1)])])])], -1)]), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_check_file"), [new Place(4), new Place(3)])], -1));
add(new Clause(4, "sys_check_file", [new Place(1), new Place(2)], [new Skeleton(new Cache("shield"), [new Skeleton("sys_action_file", [new Place(1), new Place(2), new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2)], [new Skeleton(new Cache("="), [new Place(1), "replay"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_replay_file"), [new Place(2)])], 0), new Clause(3, "", [new Place(1), new Place(2)], [new Skeleton(new Cache("="), [new Place(1), "clear_load"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_clear_file"), [new Place(2)]), new Skeleton(new Cache("sys_load_file"), [new Place(2)])], 0), new Clause(0, "", [undefined, undefined], [], -1)]), [new Place(3), new Place(1)])], 0));
add(new Clause(1, "sys_check_file", [new Place(0), undefined], [new Skeleton(new Cache("sys_load_file"), [new Place(0)])], -1));
add(new Clause(6, "sys_action_file", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_source"), [new Place(1), new Place(4), new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2), undefined, undefined, undefined], [new Skeleton(new Cache("="), [new Place(1), 1]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), "none"])], 0), new Clause(5, "", [undefined, new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_prop_map"), [new Place(2), new Place(1)])], 0), new Clause(0, "", [undefined, undefined], [], -1)]), [new Place(1), new Place(2)]), new Skeleton(new Cache("ir_object_current"), [new Place(1), "last_modified", new Place(4)]), new Skeleton(make_defined([new Clause(5, "", [new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("="), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), "replay"]), new Skeleton(new Cache("retractall"), [new Skeleton(new Cache("sys_source"), [new Place(4), undefined, undefined])]), new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_source"), [new Place(4), new Place(2), 1])])], 0), new Clause(3, "", [new Place(0), undefined, new Place(1), new Place(2)], [new Skeleton(new Cache("="), [new Place(1), "clear_load"]), new Skeleton(new Cache("retractall"), [new Skeleton(new Cache("sys_source"), [new Place(2), undefined, undefined])]), new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_source"), [new Place(2), new Place(0), 1])])], -1)]), [new Place(4), new Place(3), new Place(0), new Place(2)])], -1)]), [new Place(5), new Place(3), new Place(2), new Place(1), new Place(4)])], 0));
add(new Clause(3, "sys_action_file", [new Place(0), new Place(1), undefined], [new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_prop_map"), [new Place(2), new Place(1)])], 0), new Clause(0, "", [undefined, undefined], [], -1)]), [new Place(1), new Place(0)]), new Skeleton(new Cache("ir_object_current"), [new Place(1), "last_modified", new Place(2)]), new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_source"), [new Place(0), new Place(2), 1])]), new Cache("fail")], -1));
run(new Goal(0, [new Frozen(new Cache("kb_pred_touch"), ["sys_lastpred", 3, 1])], -1));
add(new Clause(3, "sys_load_file", [new Place(0)], [new Skeleton(new Cache("setup_once_cleanup"), [new Skeleton("sys_loading_begin", [new Place(0), new Place(1), new Place(2)]), new Skeleton("sys_include_file", [new Place(0)]), new Skeleton("sys_loading_end", [new Place(1), new Place(2)])])], -1));
add(new Clause(6, "sys_loading_begin", [new Place(1), new Place(2), new Skeleton("just", [new Place(3), new Place(4)])], [new Skeleton(new Cache("current_task"), [new Place(5)]), new Skeleton(new Cache("retract"), [new Skeleton(new Cache("sys_lastpred"), [new Place(5), new Place(3), new Place(4)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("dg_get_partition"), [new Place(2)]), new Skeleton(new Cache("dg_set_partition"), [new Place(1)])], 0));
add(new Clause(2, "sys_loading_begin", [new Place(0), new Place(1), "nothing"], [new Skeleton(new Cache("dg_get_partition"), [new Place(1)]), new Skeleton(new Cache("dg_set_partition"), [new Place(0)])], -1));
add(new Clause(4, "sys_loading_end", [new Place(0), new Skeleton("just", [new Place(1), new Place(2)])], [new Skeleton(new Cache("dg_get_partition"), [new Place(3)]), new Skeleton(new Cache("retractall"), [new Skeleton(new Cache("sys_predprop"), [undefined, undefined, new Skeleton("sys_discontiguous", [new Place(3)])])]), new Skeleton(new Cache("dg_set_partition"), [new Place(0)]), new Skeleton(new Cache("sys_update_last"), [new Place(1), new Place(2)])], -1));
add(new Clause(3, "sys_loading_end", [new Place(0), "nothing"], [new Skeleton(new Cache("dg_get_partition"), [new Place(1)]), new Skeleton(new Cache("retractall"), [new Skeleton(new Cache("sys_predprop"), [undefined, undefined, new Skeleton("sys_discontiguous", [new Place(1)])])]), new Skeleton(new Cache("dg_set_partition"), [new Place(0)]), new Skeleton(new Cache("current_task"), [new Place(2)]), new Skeleton(new Cache("retractall"), [new Skeleton(new Cache("sys_lastpred"), [new Place(2), undefined, undefined])])], -1));
add(new Clause(3, "sys_update_last", [new Place(0), new Place(1)], [new Skeleton(new Cache("current_task"), [new Place(2)]), new Skeleton(new Cache("retractall"), [new Skeleton(new Cache("sys_lastpred"), [new Place(2), undefined, undefined])]), new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_lastpred"), [new Place(2), new Place(0), new Place(1)])])], -1));
add(new Clause(2, "sys_style_static", [new Place(1)], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(":-", [undefined])]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_style_static", [new Place(1)], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(":-", [new Place(2), undefined])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_style_head"), [new Place(2)])], 0));
add(new Clause(1, "sys_style_static", [new Place(0)], [new Skeleton(new Cache("sys_style_head"), [new Place(0)])], -1));
add(new Clause(4, "sys_style_head", [new Place(1)], [new Skeleton(new Cache("callable"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("functor"), [new Place(1), new Place(2), new Place(3)]), new Skeleton(new Cache("sys_style_indicator"), [new Place(2), new Place(3)])], 0));
add(new Clause(0, "sys_style_head", [undefined], [], -1));
add(new Clause(4, "sys_style_indicator", [new Place(1), new Place(2)], [new Skeleton(new Cache("current_task"), [new Place(3)]), new Skeleton(new Cache("sys_lastpred"), [new Place(3), new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(4, "sys_style_indicator", [new Place(1), new Place(2)], [new Skeleton(new Cache("dg_get_partition"), [new Place(3)]), new Skeleton(new Cache("sys_predprop"), [new Place(1), new Place(2), new Skeleton("sys_usage", [new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(make_defined([new Clause(4, "", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_predprop"), [new Place(1), new Place(2), new Skeleton("sys_discontiguous", [new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(3, "", [new Place(0), new Place(1), undefined], [new Skeleton(new Cache("="), [new Place(2), new Skeleton("warning", [new Skeleton("syntax_error", ["discontiguous_pred", new Skeleton("\/", [new Place(0), new Place(1)])]), undefined])]), new Skeleton(new Cache("sys_fill_stack"), [new Place(2)]), new Skeleton(new Cache("sys_print_error"), [new Place(2)])], -1)]), [new Place(1), new Place(2), new Place(3)]), new Skeleton(new Cache("sys_update_last"), [new Place(1), new Place(2)])], 0));
add(new Clause(2, "sys_style_indicator", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_usage_predicate"), [new Place(0), new Place(1)]), new Skeleton(new Cache("sys_update_last"), [new Place(0), new Place(1)])], -1));
add(new Clause(3, "sys_usage_predicate", [new Place(0), new Place(1)], [new Skeleton(new Cache("dg_get_partition"), [new Place(2)]), new Skeleton(make_defined([new Clause(5, "", [new Place(1), new Place(2), new Place(3)], [new Skeleton(make_defined([new Clause(4, "", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_predprop"), [new Place(1), new Place(2), new Skeleton("sys_multifile", [new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0), new Clause(0, "", [undefined, undefined, undefined], [], -1)]), [new Place(1), new Place(2), new Place(3)]), new Skeleton(new Cache("sys_predprop"), [new Place(1), new Place(2), new Skeleton("sys_usage", [new Place(4)])]), new Skeleton(new Cache("\\=="), [new Place(3), new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("permission_error", ["redefine", "procedure", new Skeleton("\/", [new Place(1), new Place(2)])]), undefined])])], 0), new Clause(0, "", [undefined, undefined, undefined], [], -1)]), [new Place(0), new Place(1), new Place(2)]), new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_predprop"), [new Place(0), new Place(1), new Skeleton("sys_usage", [new Place(2)])])])], -1));
add(new Clause(3, "sys_include_stream", [new Place(0), new Place(1)], [new Skeleton(new Cache("current_task"), [new Place(2)]), new Skeleton(new Cache("setup_once_cleanup"), [new Skeleton("asserta", [new Skeleton("sys_including", [new Place(0), new Place(2), new Place(1)])]), new Skeleton("sys_include_lines", [new Place(1)]), new Skeleton("once", [new Skeleton("retract", [new Skeleton("sys_including", [new Place(0), new Place(2), new Place(1)])])])])], -1));
add(new Clause(3, "sys_include_lines", [new Place(1)], [new Cache("repeat"), new Skeleton(new Cache("catch"), [new Skeleton("sys_next_term", [new Place(1)]), new Place(2), new Skeleton(",", [new Skeleton("sys_print_error", [new Place(2)]), "fail"])]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(4, "sys_next_term", [new Place(0)], [new Skeleton(new Cache("read_term"), [new Place(0), new Place(1), new Skeleton(".", [new Skeleton("variable_names", [new Place(2)]), new Skeleton(".", [new Skeleton("singletons", [new Place(3)]), "[]"])])]), new Skeleton(make_defined([new Clause(2, "", [new Place(1), undefined, undefined], [new Skeleton(new Cache("=="), [new Place(1), "end_of_file"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(5, "", [new Place(1), new Place(2), undefined], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton("?-", [new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_expand_unattended"), [new Place(3), new Place(2), new Place(4)]), new Skeleton(new Cache("sys_query_unattended"), [new Place(4), new Place(2)]), new Cache("fail")], 0), new Clause(6, "", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_multiton_keys"), [new Place(1), new Place(2), new Place(3)]), new Skeleton(new Cache("sys_multiton_check"), [new Place(3)]), new Skeleton(new Cache("sys_singleton_keys"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_singleton_check"), [new Place(4)]), new Skeleton(new Cache("expand_term"), [new Place(0), new Place(5)]), new Skeleton(new Cache("sys_handle_clump"), [new Place(5)]), new Cache("fail")], -1)]), [new Place(1), new Place(2), new Place(3)])], -1));
add(new Clause(4, "sys_handle_clump", [new Place(1)], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(".", [new Place(2), new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_handle_clump"), [new Place(2)]), new Skeleton(new Cache("sys_handle_clump"), [new Place(3)])], 0));
add(new Clause(2, "sys_handle_clump", [new Place(1)], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), "[]"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_handle_clump", [new Place(0)], [new Skeleton(new Cache("sys_style_static"), [new Place(0)]), new Skeleton(new Cache("sys_handle_static"), [new Place(0)])], -1));
add(new Clause(3, "sys_handle_static", [new Place(1)], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(":-", [undefined])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_frost_horn"), [new Place(1), 1, new Place(2)]), new Skeleton(make_defined([new Clause(2, "", [new Place(1)], [new Skeleton(new Cache("sys_goal_call"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(0, "", [undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("syntax_error", ["directive_failed"]), undefined])])], -1)]), [new Place(2)])], 0));
add(new Clause(7, "sys_handle_static", [new Place(1)], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(":-", [new Place(2), undefined])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("functor"), [new Place(2), new Place(3), new Place(4)]), new Skeleton(new Cache("sys_load_type"), [new Place(3), new Place(4), new Place(5)]), new Skeleton(new Cache("sys_frost_horn"), [new Place(1), new Place(5), new Place(6)]), new Skeleton(new Cache("sys_clause_add"), [new Place(6), 2])], 0));
add(new Clause(5, "sys_handle_static", [new Place(0)], [new Skeleton(new Cache("functor"), [new Place(0), new Place(1), new Place(2)]), new Skeleton(new Cache("sys_load_type"), [new Place(1), new Place(2), new Place(3)]), new Skeleton(new Cache("sys_frost_horn"), [new Place(0), new Place(3), new Place(4)]), new Skeleton(new Cache("sys_clause_add"), [new Place(4), 2])], -1));
add(new Clause(5, "sys_load_type", [new Place(1), new Place(2), 0], [new Skeleton(new Cache("kb_pred_link"), [new Place(1), new Place(2), new Place(3)]), new Skeleton(new Cache("kb_link_flags"), [new Place(3), new Place(4)]), new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(4), 1]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "sys_load_type", [undefined, undefined, 1], [], -1));
add(new Clause(0, "strings", ["syntax_error.discontiguous_pred", "de", "Unterbrochenes Prädikat ~q, entsprechend deklarieren."], [], -1));
add(new Clause(0, "strings", ["syntax_error.bad_module", "de", "Fehlerhaftes Modul."], [], -1));
add(new Clause(0, "strings", ["permission_error.modify.static_procedure", "de", "Kann Prädikat ~q nicht aktualisieren."], [], -1));
add(new Clause(0, "strings", ["permission_error.coerce.procedure", "de", "Kann Prädikat ~q nicht zu anderen Delegiertentyp zwingen."], [], -1));
add(new Clause(0, "strings", ["permission_error.access.private_procedure", "de", "Kann auf Prädikat ~q nicht zugreifen."], [], -1));
add(new Clause(0, "strings", ["permission_error.redefine.procedure", "de", "Kann Prädikat ~q nicht umdefinieren, nicht als Mehrdateien markiert."], [], -1));
add(new Clause(0, "strings", ["permission_error.promote.multifile", "de", "Kann Funktion ~q nicht zu Mehrdateien heben."], [], -1));
add(new Clause(0, "strings", ["permission_error.create.operator", "de", "Kann Operator ~q nicht erstellen."], [], -1));
add(new Clause(0, "strings", ["permission_error.invoke.method", "de", "Kann Methode ~q nicht aufrufen."], [], -1));
add(new Clause(0, "strings", ["permission_error.modify.field", "de", "Kann Feld ~q nicht aktualisieren."], [], -1));
add(new Clause(0, "strings", ["permission_error.access.source_sink", "de", "Kann auf Strom ~q nicht zugreifen."], [], -1));
add(new Clause(0, "strings", ["resource_error.unknown_host", "de", "Dienst nicht gefunden, Verzeichnisdienst aktivieren."], [], -1));
add(new Clause(0, "strings", ["resource_error.connect_failed", "de", "Verbindung zu Dienst fehlgeschlagen, Verbindungsfähigkeit sicherstellen."], [], -1));
add(new Clause(0, "strings", ["resource_error.illegal_method", "de", "Methode nicht zugelassen."], [], -1));
add(new Clause(0, "strings", ["resource_error.internal_error", "de", "Interner Fehler, Administrator kontaktieren."], [], -1));
add(new Clause(0, "strings", ["resource_error.service_unavailable", "de", "Dienst nicht verfügbar, später wieder versuchen."], [], -1));
add(new Clause(0, "strings", ["resource_error.state_error", "de", "Übergang nicht erlaubt."], [], -1));
add(new Clause(0, "strings", ["existence_error.method", "de", "Methode ~q undefiniert."], [], -1));
add(new Clause(0, "strings", ["existence_error.procedure", "de", "Prädikat ~q undefiniert."], [], -1));
add(new Clause(0, "strings", ["syntax_error.discontiguous_pred", "", "Discontiguous predicate ~q, declare accordingly."], [], -1));
add(new Clause(0, "strings", ["syntax_error.bad_module", "", "Faulty module."], [], -1));
add(new Clause(0, "strings", ["permission_error.modify.static_procedure", "", "Can\'t modify predicate ~q."], [], -1));
add(new Clause(0, "strings", ["permission_error.coerce.procedure", "", "Can\'t coerce predicate ~q into other delegate type."], [], -1));
add(new Clause(0, "strings", ["permission_error.access.private_procedure", "", "Can\'t access predicate ~q."], [], -1));
add(new Clause(0, "strings", ["permission_error.redefine.procedure", "", "Can\'t redefine predicate ~q, not marked multfile."], [], -1));
add(new Clause(0, "strings", ["permission_error.promote.multifile", "", "Can\'t promote predicate ~q to multi-file."], [], -1));
add(new Clause(0, "strings", ["permission_error.create.operator", "", "Can\'t create operator ~q."], [], -1));
add(new Clause(0, "strings", ["permission_error.invoke.method", "", "Can\'t invoke method ~q."], [], -1));
add(new Clause(0, "strings", ["permission_error.modify.field", "", "Can\'t modify field ~q."], [], -1));
add(new Clause(0, "strings", ["permission_error.access.source_sink", "", "Can\'t access stream ~q."], [], -1));
add(new Clause(0, "strings", ["resource_error.unknown_host", "", "Service lookup failed, enable directory service."], [], -1));
add(new Clause(0, "strings", ["resource_error.connect_failed", "", "Service connect failed, assure connectivity."], [], -1));
add(new Clause(0, "strings", ["resource_error.illegal_method", "", "Method not allowed."], [], -1));
add(new Clause(0, "strings", ["resource_error.internal_error", "", "Internal error, contact administrator."], [], -1));
add(new Clause(0, "strings", ["resource_error.service_unavailable", "", "Service unavailable, try again later."], [], -1));
add(new Clause(0, "strings", ["resource_error.state_error", "", "Transition not permitted."], [], -1));
add(new Clause(0, "strings", ["existence_error.method", "", "Undefined method ~q."], [], -1));
add(new Clause(0, "strings", ["existence_error.procedure", "", "Undefined predicate ~q."], [], -1));
add(new Clause(0, "true", [], [], -1));
add(new Clause(1, "!", [], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(6, ",", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_trans_body"), [new Place(0), "nothing", new Place(2), 0, new Place(3), new Place(4)]), new Skeleton(new Cache("sys_trans_body"), [new Place(1), new Place(2), new Place(5), 0, new Place(4), "[]"]), new Skeleton(new Cache("$SEQ"), [new Place(5), new Place(3)])], -1));
add(new Clause(7, ";", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_trans_alter"), [new Place(0), "nothing", new Place(2), new Place(3), 0, new Place(4)]), new Skeleton(new Cache("sys_trans_disj"), [new Place(1), new Place(4), new Place(2), new Place(5), 0, new Place(6)]), new Skeleton(new Cache("$SEQ"), [new Place(5), new Skeleton(".", [new Skeleton("$ALT", [new Skeleton(".", [new Place(3), new Place(6)])]), "[]"])])], -1));
add(new Clause(8, "->", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_trans_body"), [new Place(0), "nothing", new Place(2), 0, new Place(3), new Skeleton(".", [new Skeleton("$CUT", [new Place(4)]), new Place(5)])]), new Skeleton(new Cache("sys_trans_body"), [new Place(1), "nothing", new Place(6), 0, new Place(5), "[]"]), new Skeleton(new Cache("sys_trans_mark"), [new Place(2), new Place(7), new Place(3)]), new Skeleton(new Cache("$SEQ"), [new Place(6), new Skeleton(".", [new Skeleton("$ALT", [new Skeleton(".", [new Skeleton("$SEQ", [new Skeleton("just", [new Place(4)]), new Place(7)]), "[]"])]), "[]"])])], -1));
add(new Clause(3, "\\=", [new Place(1), new Place(2)], [new Skeleton(new Cache("="), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0));
add(new Clause(0, "\\=", [undefined, undefined], [], -1));
add(new Clause(2, "\\+", [new Place(1)], [new Skeleton(new Cache("call"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0));
add(new Clause(0, "\\+", [undefined], [], -1));
add(new Clause(2, "once", [new Place(1)], [new Skeleton(new Cache("call"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "repeat", [], [], -1));
add(new Clause(0, "repeat", [], [new Cache("repeat")], -1));
add(new Clause(4, "catch", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_trap"), [new Place(0), new Place(3), new Skeleton("sys_error_handler", [new Place(3), new Place(1), new Place(2)])])], -1));
add(new Clause(1, "sys_error_handler", [new Place(0), undefined, undefined], [new Skeleton(new Cache("sys_chain_head"), [new Place(0), new Skeleton("error", [new Skeleton("system_error", [undefined]), undefined])]), new Skeleton(new Cache("sys_raise"), [new Place(0)])], -1));
add(new Clause(4, "sys_error_handler", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_chain_head"), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("call"), [new Place(3)])], 0));
add(new Clause(1, "sys_error_handler", [new Place(0), undefined, undefined], [new Skeleton(new Cache("sys_raise"), [new Place(0)])], -1));
add(new Clause(3, "sys_chain_head", [new Skeleton("cause", [new Place(1), undefined]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(1, "sys_chain_head", [new Place(0), new Place(0)], [], -1));
add(new Clause(1, "throw", [new Place(0)], [new Skeleton(new Cache("sys_fill_stack"), [new Place(0)]), new Skeleton(new Cache("sys_raise"), [new Place(0)])], -1));
add(new Clause(1, "sys_fill_stack", [new Place(0)], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(2, "sys_fill_stack", [new Skeleton("error", [undefined, new Place(1)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_fetch_stack"), [new Place(1)])], 0));
add(new Clause(2, "sys_fill_stack", [new Skeleton("warning", [undefined, new Place(1)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_fetch_stack"), [new Place(1)])], 0));
add(new Clause(0, "sys_fill_stack", [undefined], [], -1));
add(new Clause(7, "sys_fetch_stack", [new Place(1)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("current_task"), [new Place(2)]), new Skeleton(new Cache("findall"), [new Skeleton("frame", ["including", new Place(3), new Place(4)]), new Skeleton(",", [new Skeleton("sys_including", [new Place(5), new Place(2), new Place(6)]), new Skeleton("sys_fetch_frame", [new Place(5), new Place(6), new Place(3), new Place(4)])]), new Place(1)])], 0));
add(new Clause(2, "sys_fetch_stack", [new Skeleton(".", [undefined, new Place(1)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_fetch_stack"), [new Place(1)])], 0));
add(new Clause(0, "sys_fetch_stack", [undefined], [], -1));
add(new Clause(4, "sys_fetch_frame", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("file_base_name"), [new Place(0), new Place(2)]), new Skeleton(new Cache("ir_object_current"), [new Place(1), "lineno", new Place(3)])], -1));
add(new Clause(7, "try_call_finally", [new Place(1), new Place(2), new Place(3)], [new Skeleton(make_defined([new Clause(1, "", [new Place(0), undefined], [new Skeleton(new Cache("call"), [new Place(0)])], -1), new Clause(1, "", [undefined, new Place(0)], [new Skeleton(new Cache("call"), [new Place(0)]), new Cache("fail")], -1)]), [new Place(1), new Place(3)]), new Skeleton(new Cache("$MARK"), [new Place(4)]), new Skeleton(new Cache("sys_trap"), [new Place(2), new Place(5), new Skeleton(",", [new Place(3), new Skeleton("sys_raise", [new Place(5)])])]), new Skeleton(new Cache("$MARK"), [new Place(6)]), new Skeleton(make_defined([new Clause(5, "", [new Place(1), new Place(2), new Place(3), new Place(4), undefined], [new Skeleton(new Cache("=="), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("$CUT"), [new Place(3)]), new Skeleton(new Cache("call"), [new Place(4)])], 0), new Clause(1, "", [undefined, undefined, undefined, new Place(0), undefined], [new Skeleton(new Cache("call"), [new Place(0)])], -1), new Clause(1, "", [undefined, undefined, undefined, undefined, new Place(0)], [new Skeleton(new Cache("call"), [new Place(0)]), new Cache("fail")], -1)]), [new Place(4), new Place(6), new Place(0), new Place(3), new Place(1)])], 0));
add(new Clause(2, "ignore", [new Place(1)], [new Skeleton(new Cache("call"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "ignore", [undefined], [], -1));
add(new Clause(3, "chain", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_trap"), [new Place(0), new Place(2), new Skeleton("sys_chain_error", [new Place(2), new Place(1)])]), new Skeleton(new Cache("call"), [new Place(1)])], -1));
add(new Clause(3, "sys_chain_error", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_trap"), [new Place(1), new Place(2), new Skeleton("sys_chain_raise", [new Place(0), new Place(2)])]), new Skeleton(new Cache("sys_raise"), [new Place(0)])], -1));
add(new Clause(1, "sys_chain_error", [new Place(0), undefined], [new Skeleton(new Cache("sys_raise"), [new Place(0)])], -1));
add(new Clause(3, "sys_chain_raise", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_chain_concat"), [new Place(0), new Place(1), new Place(2)]), new Skeleton(new Cache("sys_raise"), [new Place(2)])], -1));
add(new Clause(5, "sys_chain_concat", [new Skeleton("cause", [new Place(1), new Place(2)]), new Place(3), new Skeleton("cause", [new Place(1), new Place(4)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_chain_concat"), [new Place(2), new Place(3), new Place(4)])], 0));
add(new Clause(2, "sys_chain_concat", [new Place(0), new Place(1), new Skeleton("cause", [new Place(0), new Place(1)])], [], -1));
add(new Clause(3, "once_cleanup", [new Place(1), new Place(2)], [new Frozen(new Cache("current_prolog_flag"), ["async_mode", "on"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("shield"), [new Skeleton("sys_once_cleanup", [new Skeleton("unshield", [new Place(1)]), new Place(2)])])], 0));
add(new Clause(2, "once_cleanup", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_once_cleanup"), [new Place(0), new Place(1)])], -1));
add(new Clause(4, "setup_once_cleanup", [new Place(1), new Place(2), new Place(3)], [new Frozen(new Cache("current_prolog_flag"), ["async_mode", "on"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("shield"), [new Skeleton("sys_setup_once_cleanup", [new Place(1), new Skeleton("unshield", [new Place(2)]), new Place(3)])])], 0));
add(new Clause(3, "setup_once_cleanup", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_setup_once_cleanup"), [new Place(0), new Place(1), new Place(2)])], -1));
add(new Clause(3, "sys_setup_once_cleanup", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("call"), [new Place(0)]), new Skeleton(new Cache("sys_once_cleanup"), [new Place(1), new Place(2)])], -1));
add(new Clause(3, "sys_once_cleanup", [new Place(1), new Place(2)], [new Skeleton(new Cache("chain"), [new Place(1), new Skeleton("ignore", [new Place(2)])]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_once_cleanup", [undefined, new Place(0)], [new Skeleton(new Cache("ignore"), [new Place(0)]), new Cache("fail")], -1));
add(new Clause(2, "sleep", [new Place(0)], [new Skeleton(new Cache("os_sleep_promise"), [new Place(0), new Place(1)]), new Skeleton(new Cache("$YIELD"), [new Place(1)])], -1));
add(new Clause(3, "call_later", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_frost_horn"), [new Skeleton(":-", [new Place(0)]), 0, new Place(2)]), new Skeleton(new Cache("os_call_later"), [new Place(2), new Place(1), undefined])], -1));
add(new Clause(4, "call_later", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_frost_horn"), [new Skeleton(":-", [new Place(0)]), 0, new Place(3)]), new Skeleton(new Cache("os_call_later"), [new Place(3), new Place(1), new Place(2)])], -1));
add(new Clause(5, "call_with_time_limit", [new Place(1), new Place(2)], [new Frozen(new Cache("current_prolog_flag"), ["allow_yield", "on"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("current_task"), [new Place(3)]), new Skeleton(new Cache("setup_once_cleanup"), [new Skeleton("call_later", [new Skeleton("sys_timeout_signal", [new Place(3)]), new Place(1), new Place(4)]), new Place(2), new Skeleton("timer_cancel", [new Place(4)])])], 0));
add(new Clause(0, "call_with_time_limit", [undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("system_error", ["illegal_yield"]), undefined])])], -1));
add(new Clause(1, "sys_timeout_signal", [new Place(0)], [new Skeleton(new Cache("task_abort"), [new Place(0), new Frozen("system_error", ["timelimit_exceeded"])])], -1));
add(new Clause(2, "create_task", [new Place(0)], [new Skeleton(new Cache("sys_frost_horn"), [new Skeleton(":-", [new Place(0)]), 0, new Place(1)]), new Skeleton(new Cache("os_task_create"), [new Place(1), undefined])], -1));
add(new Clause(3, "create_task", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_frost_horn"), [new Skeleton(":-", [new Place(0)]), 0, new Place(2)]), new Skeleton(new Cache("os_task_create"), [new Place(2), new Place(1)])], -1));
add(new Clause(5, "sys_frost_horn", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_trans_horn"), [new Place(0), new Place(3), new Place(1)]), new Skeleton(new Cache("sys_encode_horn"), [new Place(3), new Place(4), new Place(1)]), new Skeleton(new Cache("sys_host_ossify"), [new Place(4), new Place(2)])], -1));
add(new Clause(6, "sys_host_ossify", [new Skeleton("tr_clause", [new Place(0), new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("=.."), [new Place(1), new Skeleton(".", [new Place(4), new Place(5)])]), new Skeleton(new Cache("sys_clause_ossify"), [new Place(5), new Place(2), new Place(0), new Place(4), new Place(3)])], -1));
add(new Clause(3, "sys_host_ossify", [new Skeleton("tr_goal", [new Place(0), new Place(1)]), new Place(2)], [new Skeleton(new Cache("sys_goal_ossify"), [new Place(1), new Place(0), new Place(2)])], -1));
add(new Clause(3, "member", [new Place(0), new Skeleton(".", [new Place(1), new Place(2)])], [new Skeleton(new Cache("sys_member"), [new Place(2), new Place(1), new Place(0)])], -1));
add(new Clause(1, "sys_member", [undefined, new Place(0), new Place(0)], [], -1));
add(new Clause(3, "sys_member", [new Skeleton(".", [new Place(0), new Place(1)]), undefined, new Place(2)], [new Skeleton(new Cache("sys_member"), [new Place(1), new Place(0), new Place(2)])], -1));
add(new Clause(4, "select", [new Place(0), new Skeleton(".", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("sys_select"), [new Place(2), new Place(1), new Place(0), new Place(3)])], -1));
add(new Clause(2, "sys_select", [new Place(0), new Place(1), new Place(1), new Place(0)], [], -1));
add(new Clause(5, "sys_select", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Place(3), new Skeleton(".", [new Place(2), new Place(4)])], [new Skeleton(new Cache("sys_select"), [new Place(1), new Place(0), new Place(3), new Place(4)])], -1));
add(new Clause(2, "reverse", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_reverse"), [new Place(0), "[]", new Place(1)])], -1));
add(new Clause(1, "sys_reverse", ["[]", new Place(0), new Place(0)], [], -1));
add(new Clause(4, "sys_reverse", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_reverse"), [new Place(1), new Skeleton(".", [new Place(0), new Place(2)]), new Place(3)])], -1));
add(new Clause(1, "append", ["[]", new Place(0), new Place(0)], [], -1));
add(new Clause(4, "append", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Skeleton(".", [new Place(0), new Place(3)])], [new Skeleton(new Cache("append"), [new Place(1), new Place(2), new Place(3)])], -1));
add(new Clause(3, "length", [new Place(1), new Place(2)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_length"), [new Place(1), 0, new Place(2)])], 0));
add(new Clause(2, "length", [new Place(0), new Place(1)], [new Skeleton(new Cache("must_be"), ["integer", new Place(1)]), new Skeleton(new Cache(">="), [new Place(1), 0]), new Skeleton(new Cache("sys_length"), [new Place(1), new Place(0)])], -1));
add(new Clause(1, "sys_length", ["[]", new Place(0), new Place(0)], [], -1));
add(new Clause(4, "sys_length", [new Skeleton(".", [undefined, new Place(0)]), new Place(1), new Place(2)], [new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("+"), [new Place(1), 1])]), new Skeleton(new Cache("sys_length"), [new Place(0), new Place(3), new Place(2)])], -1));
add(new Clause(2, "sys_length", [0, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "[]"])], 0));
add(new Clause(3, "sys_length", [new Place(0), new Skeleton(".", [undefined, new Place(1)])], [new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("-"), [new Place(0), 1])]), new Skeleton(new Cache("sys_length"), [new Place(2), new Place(1)])], -1));
add(new Clause(4, "between", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("var"), [new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("must_be"), ["integer", new Place(1)]), new Skeleton(new Cache("must_be"), ["integer", new Place(2)]), new Skeleton(new Cache("=<"), [new Place(1), new Place(2)]), new Skeleton(new Cache("sys_between"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(3, "between", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("must_be"), ["integer", new Place(2)]), new Skeleton(new Cache("must_be"), ["integer", new Place(0)]), new Skeleton(new Cache("must_be"), ["integer", new Place(1)]), new Skeleton(new Cache("=<"), [new Place(0), new Place(2)]), new Skeleton(new Cache("=<"), [new Place(2), new Place(1)])], -1));
add(new Clause(3, "sys_between", [new Place(1), new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(1, "sys_between", [new Place(0), undefined, new Place(0)], [], -1));
add(new Clause(4, "sys_between", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("+"), [new Place(0), 1])]), new Skeleton(new Cache("sys_between"), [new Place(3), new Place(1), new Place(2)])], -1));
add(new Clause(4, "findall", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_find_init"), [new Place(3)]), new Skeleton(make_defined([new Clause(3, "", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("call"), [new Place(0)]), new Skeleton(new Cache("sys_find_next"), [new Place(1), new Place(2)]), new Cache("fail")], -1), new Clause(0, "", [undefined, undefined, undefined], [], -1)]), [new Place(1), new Place(0), new Place(3)]), new Skeleton(new Cache("sys_find_fini"), [new Place(3), new Place(2)])], -1));
add(new Clause(2, "sys_find_init", [new Place(0)], [new Skeleton(new Cache("=.."), [new Place(1), new Frozen(".", [".", new Frozen(".", ["-", new Frozen(".", ["[]", "[]"])])])]), new Skeleton(new Cache("="), [new Place(0), new Skeleton("v", [new Place(1), new Place(1)])])], -1));
add(new Clause(4, "sys_find_next", [new Place(0), new Place(1)], [new Skeleton(new Cache("copy_term"), [new Skeleton(".", [new Place(0), "[]"]), new Place(2)]), new Skeleton(new Cache("arg"), [1, new Place(1), new Place(3)]), new Skeleton(new Cache("change_arg"), [2, new Place(3), new Place(2)]), new Skeleton(new Cache("change_arg"), [1, new Place(1), new Place(2)])], -1));
add(new Clause(1, "sys_find_fini", [new Skeleton("v", [undefined, new Skeleton(".", [undefined, new Place(0)])]), new Place(0)], [], -1));
add(new Clause(4, "get_message", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("current_prolog_flag"), ["sys_locale", new Place(3)]), new Skeleton(new Cache("get_message"), [new Place(0), new Place(3), new Place(1), new Place(2)])], -1));
add(new Clause(6, "get_message", [new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("=.."), [new Place(1), new Skeleton(".", [new Place(5), new Place(4)])]), new Skeleton(new Cache("atom"), [new Place(5)]), new Skeleton(new Cache("sys_get_string"), [new Place(5), new Place(2), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(8, "get_message", [new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("=.."), [new Place(1), new Skeleton(".", [new Place(5), new Skeleton(".", [new Place(6), new Place(4)])])]), new Skeleton(new Cache("atom"), [new Place(5)]), new Skeleton(new Cache("atom"), [new Place(6)]), new Skeleton(new Cache("atom_join"), [new Skeleton(".", [new Place(5), new Skeleton(".", [".", new Skeleton(".", [new Place(6), "[]"])])]), new Place(7)]), new Skeleton(new Cache("sys_get_string"), [new Place(7), new Place(2), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(9, "get_message", [new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("=.."), [new Place(1), new Skeleton(".", [new Place(5), new Skeleton(".", [new Place(6), new Skeleton(".", [new Place(7), new Place(4)])])])]), new Skeleton(new Cache("atom"), [new Place(5)]), new Skeleton(new Cache("atom"), [new Place(6)]), new Skeleton(new Cache("atom"), [new Place(7)]), new Skeleton(new Cache("atom_join"), [new Skeleton(".", [new Place(5), new Skeleton(".", [".", new Skeleton(".", [new Place(6), new Skeleton(".", [".", new Skeleton(".", [new Place(7), "[]"])])])])]), new Place(8)]), new Skeleton(new Cache("sys_get_string"), [new Place(8), new Place(2), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_get_string", [new Place(0), new Place(1)], [new Skeleton(new Cache("current_prolog_flag"), ["sys_locale", new Place(2)]), new Skeleton(new Cache("sys_get_string"), [new Place(0), new Place(2), new Place(1)])], -1));
add(new Clause(6, "sys_get_string", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_locale_ancestor"), [new Place(2), new Place(4)]), new Skeleton(new Cache("strings"), [new Place(1), new Place(4), new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), new Place(5)])], 0));
add(new Clause(1, "sys_locale_ancestor", [new Place(0), new Place(0)], [], -1));
add(new Clause(3, "sys_locale_ancestor", [new Place(0), new Place(1)], [new Skeleton(new Cache("last_sub_atom"), [new Place(0), new Place(2), undefined, undefined, "_"]), new Skeleton(new Cache("sub_atom"), [new Place(0), 0, new Place(2), undefined, new Place(1)])], -1));
add(new Clause(1, "sys_locale_ancestor", [new Place(0), ""], [new Skeleton(new Cache("\\=="), [new Place(0), ""])], -1));
add(new Clause(5, "sys_multiton_keys", [new Skeleton(".", [new Skeleton("=", [new Place(1), undefined]), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(make_defined([new Clause(2, "", [new Place(1)], [new Skeleton(new Cache("sys_marked_at"), [new Place(1), 0, new Frozen(".", [23, "[]"])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0), new Clause(0, "", [undefined], [], -1)]), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_multiton_keys"), [new Place(2), new Place(3), new Place(4)])], 0));
add(new Clause(5, "sys_multiton_keys", [new Skeleton(".", [new Skeleton("=", [new Place(1), undefined]), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(make_defined([new Clause(2, "", [new Place(1)], [new Skeleton(new Cache("sys_marked_at"), [new Place(1), 1, new Frozen(".", [1, new Frozen(".", [3, new Frozen(".", [23, "[]"])])])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0), new Clause(0, "", [undefined], [], -1)]), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_multiton_keys"), [new Place(2), new Place(3), new Place(4)])], 0));
add(new Clause(5, "sys_multiton_keys", [new Skeleton(".", [new Skeleton("=", [new Place(1), undefined]), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("member"), [new Skeleton("=", [new Place(1), undefined]), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_multiton_keys"), [new Place(2), new Place(3), new Place(4)])], 0));
add(new Clause(4, "sys_multiton_keys", [new Skeleton(".", [new Skeleton("=", [new Place(0), undefined]), new Place(1)]), new Place(2), new Skeleton(".", [new Place(0), new Place(3)])], [new Skeleton(new Cache("sys_multiton_keys"), [new Place(1), new Place(2), new Place(3)])], -1));
add(new Clause(0, "sys_multiton_keys", ["[]", undefined, "[]"], [], -1));
add(new Clause(3, "sys_multiton_check", [new Skeleton(".", [new Place(0), new Place(1)])], [new Skeleton(new Cache("="), [new Place(2), new Skeleton("warning", [new Skeleton("syntax_error", ["multiton_var", new Skeleton(".", [new Place(0), new Place(1)])]), undefined])]), new Skeleton(new Cache("sys_fill_stack"), [new Place(2)]), new Skeleton(new Cache("sys_print_error"), [new Place(2)])], -1));
add(new Clause(0, "sys_multiton_check", ["[]"], [], -1));
add(new Clause(4, "sys_singleton_keys", [new Skeleton(".", [new Skeleton("=", [new Place(1), undefined]), new Place(2)]), new Place(3)], [new Skeleton(new Cache("sys_marked_at"), [new Place(1), 0, new Frozen(".", [23, "[]"])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_singleton_keys"), [new Place(2), new Place(3)])], 0));
add(new Clause(3, "sys_singleton_keys", [new Skeleton(".", [new Skeleton("=", [new Place(0), undefined]), new Place(1)]), new Skeleton(".", [new Place(0), new Place(2)])], [new Skeleton(new Cache("sys_singleton_keys"), [new Place(1), new Place(2)])], -1));
add(new Clause(0, "sys_singleton_keys", ["[]", "[]"], [], -1));
add(new Clause(3, "sys_singleton_check", [new Skeleton(".", [new Place(0), new Place(1)])], [new Skeleton(new Cache("="), [new Place(2), new Skeleton("warning", [new Skeleton("syntax_error", ["singleton_var", new Skeleton(".", [new Place(0), new Place(1)])]), undefined])]), new Skeleton(new Cache("sys_fill_stack"), [new Place(2)]), new Skeleton(new Cache("sys_print_error"), [new Place(2)])], -1));
add(new Clause(0, "sys_singleton_check", ["[]"], [], -1));
add(new Clause(7, "sys_marked_at", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sub_atom"), [new Place(1), new Place(2), 1, undefined, new Place(4)]), new Skeleton(new Cache("char_code"), [new Place(4), new Place(5)]), new Skeleton(new Cache("code_category"), [new Place(5), new Place(6)]), new Skeleton(new Cache("member"), [new Place(6), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(6, "expand_term", [new Place(1), new Skeleton(".", [new Place(2), new Place(3)])], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(".", [new Place(4), new Place(5)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("expand_term"), [new Place(4), new Place(2)]), new Skeleton(new Cache("expand_term"), [new Place(5), new Place(3)])], 0));
add(new Clause(2, "expand_term", [new Place(1), "[]"], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), "[]"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(4, "expand_term", [new Place(1), new Place(2)], [new Skeleton(new Cache("term_expansion"), [new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("expand_term"), [new Place(3), new Place(2)])], 0));
add(new Clause(1, "expand_term", [new Place(0), new Place(0)], [], -1));
add(new Clause(1, "phrase", [new Place(0), undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(4, "phrase", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_phrase_expansion"), [new Place(0), 0, 0, new Place(1), new Place(2), new Place(3)]), new Skeleton(new Cache("call"), [new Place(3)])], -1));
add(new Clause(4, "term_expansion", [new Place(0), new Place(1)], [new Skeleton(new Cache("nonvar"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(0), new Skeleton("-->", [new Place(2), new Place(3)])]), new Skeleton(new Cache("sys_dcg_expansion"), [new Place(2), new Place(3), new Place(1)])], -1));
add(new Clause(10, "sys_dcg_expansion", [new Place(0), new Place(1), new Skeleton(":-", [new Place(2), new Skeleton(",", [new Place(3), new Place(4)])])], [new Skeleton(new Cache("nonvar"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(0), new Skeleton(",", [new Place(5), new Place(6)])]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(5), 0, 0, new Place(7), new Place(8), new Place(2)]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(1), 1, 0, new Place(7), new Place(9), new Place(3)]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(6), 0, 0, new Place(8), new Place(9), new Place(4)])], -1));
add(new Clause(6, "sys_dcg_expansion", [new Place(0), new Place(1), new Skeleton(":-", [new Place(2), new Place(3)])], [new Skeleton(new Cache("sys_phrase_expansion"), [new Place(0), 0, 0, new Place(4), new Place(5), new Place(2)]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(1), 1, 0, new Place(4), new Place(5), new Place(3)])], -1));
add(new Clause(4, "sys_phrase_expansion", [new Place(1), undefined, undefined, new Place(2), new Place(3), new Skeleton("phrase", [new Place(1), new Place(2), new Place(3)])], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(10, "sys_phrase_expansion", [new Skeleton(",", [new Place(1), new Place(2)]), new Place(3), new Place(4), new Place(5), new Place(6), new Skeleton(",", [new Place(7), new Place(8)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(1), new Place(3), 1, new Place(5), new Place(9), new Place(7)]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(2), 0, new Place(4), new Place(9), new Place(6), new Place(8)])], 0));
add(new Clause(7, "sys_phrase_expansion", [new Skeleton(";", [new Place(1), new Place(2)]), undefined, undefined, new Place(3), new Place(4), new Skeleton(";", [new Place(5), new Place(6)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(1), 0, 0, new Place(3), new Place(4), new Place(5)]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(2), 0, 0, new Place(3), new Place(4), new Place(6)])], 0));
add(new Clause(10, "sys_phrase_expansion", [new Skeleton("->", [new Place(1), new Place(2)]), new Place(3), new Place(4), new Place(5), new Place(6), new Skeleton("->", [new Place(7), new Place(8)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(1), new Place(3), 1, new Place(5), new Place(9), new Place(7)]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(2), 0, new Place(4), new Place(9), new Place(6), new Place(8)])], 0));
add(new Clause(3, "sys_phrase_expansion", ["[]", 0, undefined, new Place(1), new Place(2), new Skeleton("=", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_phrase_expansion", ["[]", 1, undefined, new Place(1), new Place(2), "true"], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(6, "sys_phrase_expansion", [new Skeleton(".", [new Place(1), new Place(2)]), 0, undefined, new Place(3), new Place(4), new Skeleton("=", [new Place(3), new Skeleton(".", [new Place(1), new Place(5)])])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_list_expansion"), [new Place(2), new Place(4), new Place(5)])], 0));
add(new Clause(6, "sys_phrase_expansion", [new Skeleton(".", [new Place(1), new Place(2)]), 1, undefined, new Place(3), new Place(4), "true"], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), new Skeleton(".", [new Place(1), new Place(5)])]), new Skeleton(new Cache("sys_list_expansion"), [new Place(2), new Place(4), new Place(5)])], 0));
add(new Clause(3, "sys_phrase_expansion", ["!", undefined, 0, new Place(1), new Place(2), new Skeleton(",", ["!", new Skeleton("=", [new Place(1), new Place(2)])])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_phrase_expansion", ["!", undefined, 1, new Place(1), new Place(2), "!"], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(4, "sys_phrase_expansion", [new Skeleton("{}", [new Place(1)]), undefined, 0, new Place(2), new Place(3), new Skeleton(",", [new Place(1), new Skeleton("=", [new Place(2), new Place(3)])])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(4, "sys_phrase_expansion", [new Skeleton("{}", [new Place(1)]), undefined, 1, new Place(2), new Place(3), new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(5, "sys_phrase_expansion", [new Skeleton("\\+", [new Place(1)]), undefined, 0, new Place(2), new Place(3), new Skeleton(",", [new Skeleton("\\+", [new Place(4)]), new Skeleton("=", [new Place(2), new Place(3)])])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(1), 0, 0, new Place(2), undefined, new Place(4)])], 0));
add(new Clause(5, "sys_phrase_expansion", [new Skeleton("\\+", [new Place(1)]), undefined, 1, new Place(2), new Place(3), new Skeleton("\\+", [new Place(4)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)]), new Skeleton(new Cache("sys_phrase_expansion"), [new Place(1), 0, 0, new Place(2), undefined, new Place(4)])], 0));
add(new Clause(8, "sys_phrase_expansion", [new Place(1), undefined, undefined, new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("callable"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("=.."), [new Place(1), new Skeleton(".", [new Place(5), new Place(6)])]), new Skeleton(new Cache("append"), [new Place(6), new Skeleton(".", [new Place(2), new Skeleton(".", [new Place(3), "[]"])]), new Place(7)]), new Skeleton(new Cache("=.."), [new Place(4), new Skeleton(".", [new Place(5), new Place(7)])])], 0));
add(new Clause(1, "sys_phrase_expansion", [new Place(0), undefined, undefined, undefined, undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["callable", new Place(0)]), undefined])])], -1));
add(new Clause(1, "sys_list_expansion", [new Place(0), undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(2, "sys_list_expansion", ["[]", new Place(1), new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(5, "sys_list_expansion", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Skeleton(".", [new Place(1), new Place(4)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_list_expansion"), [new Place(2), new Place(3), new Place(4)])], 0));
add(new Clause(1, "sys_list_expansion", [new Place(0), undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["list", new Place(0)]), undefined])])], -1));
add(new Clause(8, "sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("var"), [new Place(3)]), new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("between"), [0, new Place(6), new Place(2)]), new Skeleton(new Cache("is"), [new Place(7), new Skeleton(new Cache("-"), [new Place(6), new Place(2)])]), new Skeleton(new Cache("between"), [0, new Place(7), new Place(3)]), new Skeleton(new Cache("sys_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Place(7), new Place(3)])])], 0));
add(new Clause(7, "sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("sys_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(2)]), new Place(3)])])], 0));
add(new Clause(7, "sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(5), new Place(3)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("sys_atom_match"), [new Place(1), new Place(5), new Place(2)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(2)]), new Place(3)])])], 0));
add(new Clause(8, "sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("var"), [new Place(3)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("=<"), [0, new Place(4)]), new Skeleton(new Cache("=<"), [new Place(4), new Place(6)]), new Skeleton(new Cache("is"), [new Place(7), new Skeleton(new Cache("-"), [new Place(6), new Place(4)])]), new Skeleton(new Cache("between"), [0, new Place(7), new Place(2)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("-"), [new Place(7), new Place(2)])]), new Skeleton(new Cache("sys_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)])], 0));
add(new Clause(7, "sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(4)]), new Place(3)])]), new Skeleton(new Cache("sys_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)])], 0));
add(new Clause(8, "sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(3)]), new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("=<"), [0, new Place(2)]), new Skeleton(new Cache("=<"), [new Place(2), new Place(6)]), new Skeleton(new Cache("is"), [new Place(7), new Skeleton(new Cache("-"), [new Place(6), new Place(2)])]), new Skeleton(new Cache("between"), [0, new Place(7), new Place(3)]), new Skeleton(new Cache("sys_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Place(7), new Place(3)])])], 0));
add(new Clause(7, "sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(2)]), new Place(3)])]), new Skeleton(new Cache("sys_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)])], 0));
add(new Clause(7, "sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(4)]), new Place(2)])]), new Skeleton(new Cache("sys_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)])], 0));
add(new Clause(7, "sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(5), new Place(3)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(2)]), new Place(3)])]), new Skeleton(new Cache("sys_atom_match"), [new Place(1), new Place(5), new Place(2)])], 0));
add(new Clause(6, "sub_atom", [new Place(0), new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("atom_length"), [new Place(4), new Place(2)]), new Skeleton(new Cache("atom_length"), [new Place(0), new Place(5)]), new Skeleton(new Cache("is"), [new Place(1), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(5), new Place(3)]), new Place(2)])]), new Skeleton(new Cache("sys_atom_match"), [new Place(0), new Place(4), new Place(1)])], -1));
add(new Clause(10, "last_sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("var"), [new Place(3)]), new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("between"), [0, new Place(6), new Place(7)]), new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("-"), [new Place(6), new Place(7)])]), new Skeleton(new Cache("is"), [new Place(8), new Skeleton(new Cache("-"), [new Place(6), new Place(2)])]), new Skeleton(new Cache("between"), [0, new Place(8), new Place(9)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("-"), [new Place(8), new Place(9)])]), new Skeleton(new Cache("sys_last_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Place(8), new Place(3)])])], 0));
add(new Clause(7, "last_sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("sys_last_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(2)]), new Place(3)])])], 0));
add(new Clause(7, "last_sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(5), new Place(3)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("sys_last_atom_match"), [new Place(1), new Place(5), new Place(2)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(2)]), new Place(3)])])], 0));
add(new Clause(9, "last_sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("var"), [new Place(3)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("=<"), [0, new Place(4)]), new Skeleton(new Cache("=<"), [new Place(4), new Place(6)]), new Skeleton(new Cache("is"), [new Place(7), new Skeleton(new Cache("-"), [new Place(6), new Place(4)])]), new Skeleton(new Cache("between"), [0, new Place(7), new Place(8)]), new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("-"), [new Place(7), new Place(8)])]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("-"), [new Place(7), new Place(2)])]), new Skeleton(new Cache("sys_last_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)])], 0));
add(new Clause(7, "last_sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(4)]), new Place(3)])]), new Skeleton(new Cache("sys_last_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)])], 0));
add(new Clause(9, "last_sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(3)]), new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("=<"), [0, new Place(2)]), new Skeleton(new Cache("=<"), [new Place(2), new Place(6)]), new Skeleton(new Cache("is"), [new Place(7), new Skeleton(new Cache("-"), [new Place(6), new Place(2)])]), new Skeleton(new Cache("between"), [0, new Place(7), new Place(8)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("-"), [new Place(7), new Place(8)])]), new Skeleton(new Cache("sys_last_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Place(7), new Place(3)])])], 0));
add(new Clause(7, "last_sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(2)]), new Place(3)])]), new Skeleton(new Cache("sys_last_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)])], 0));
add(new Clause(7, "last_sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(4)]), new Place(2)])]), new Skeleton(new Cache("sys_last_atom_part"), [new Place(1), new Place(2), new Place(3), new Place(5)])], 0));
add(new Clause(7, "last_sub_atom", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("var"), [new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_length"), [new Place(5), new Place(3)]), new Skeleton(new Cache("atom_length"), [new Place(1), new Place(6)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(6), new Place(2)]), new Place(3)])]), new Skeleton(new Cache("sys_last_atom_match"), [new Place(1), new Place(5), new Place(2)])], 0));
add(new Clause(6, "last_sub_atom", [new Place(0), new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("atom_length"), [new Place(4), new Place(2)]), new Skeleton(new Cache("atom_length"), [new Place(0), new Place(5)]), new Skeleton(new Cache("is"), [new Place(1), new Skeleton(new Cache("-"), [new Skeleton(new Cache("-"), [new Place(5), new Place(3)]), new Place(2)])]), new Skeleton(new Cache("sys_last_atom_match"), [new Place(0), new Place(4), new Place(1)])], -1));
add(new Clause(0, "strings", ["instantiation_error", "de", "Argument sollte keine Variable sein."], [], -1));
add(new Clause(0, "strings", ["domain_error.read_option", "de", "Leseoption erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.io_mode", "de", "Eingabe-\/Ausgabemodus (read oder write) erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.write_option", "de", "Schreiboption erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.open_option", "de", "Öffnenoption erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.boolean", "de", "Boolean (true oder false) erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.file_property", "de", "Dateieigenschaft erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.radix", "de", "Unerlaubte Zahlenbasis ~q, nicht zwischen 2 und 36."], [], -1));
add(new Clause(0, "strings", ["domain_error.character_code", "de", "Unerlaubter Kodepunkt ~q, nicht zwischen 0 und 0x10FFFF."], [], -1));
add(new Clause(0, "strings", ["domain_error.exotic", "de", "Exot erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.writer", "de", "Ausgabestrom erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.reader", "de", "Eingabestrom erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.goal", "de", "Ziel erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.clause", "de", "Klausel erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.provable", "de", "Herleitbar erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.type", "de", "Datentyp erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.timer", "de", "Zeitgeber erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.task", "de", "Aufgabe erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["existence_error.source_sink", "de", "Datei ~q nicht gefunden."], [], -1));
add(new Clause(0, "strings", ["existence_error.module", "de", "Modul ~q nicht gefunden."], [], -1));
add(new Clause(0, "strings", ["permission_error.open.source_sink", "de", "Kann Datei ~q nicht öffnen."], [], -1));
add(new Clause(0, "strings", ["permission_error.modify.compound", "de", "Kann Verbund ~q nicht ändern."], [], -1));
add(new Clause(0, "strings", ["resource_error.socket_timeout", "de", "Ein-\/Ausgabeauszeit."], [], -1));
add(new Clause(0, "strings", ["resource_error.port_error", "de", "Fehler bei Verwendung eines Port."], [], -1));
add(new Clause(0, "strings", ["resource_error.remote_error", "de", "Fehler von Entfernt erhalten."], [], -1));
add(new Clause(0, "strings", ["resource_error.io_exception", "de", "Datei nicht erstellt oder nicht zugreifbar."], [], -1));
add(new Clause(0, "strings", ["system_error.timelimit_exceeded", "de", "Ausführung abgebrochen da Zeitfrist abgelaufen."], [], -1));
add(new Clause(0, "strings", ["system_error.stack_overflow", "de", "Ausführung wegen Stapelüberlauf abgebrochen."], [], -1));
add(new Clause(0, "strings", ["system_error.out_of_memory", "de", "Ausführung wegen aufgebrauchtem Speicherplatz abgebrochen."], [], -1));
add(new Clause(0, "strings", ["system_error.user_abort", "de", "Ausführung auf Benutzerwunsch abgebrochen."], [], -1));
add(new Clause(0, "strings", ["system_error.user_exit", "de", "System auf Benutzerwunsch beendet."], [], -1));
add(new Clause(0, "strings", ["system_error.illegal_yield", "de", "Yield Instruktion momentan nicht verfügbar"], [], -1));
add(new Clause(0, "strings", ["syntax_error.directive_failed", "de", "Direktive fehlgeschlagen."], [], -1));
add(new Clause(0, "strings", ["instantiation_error", "", "Argument should not be a variable."], [], -1));
add(new Clause(0, "strings", ["domain_error.read_option", "", "Read option expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.io_mode", "", "Input\/output mode (read or write) expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.write_option", "", "Write option expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.open_option", "", "Open option expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.boolean", "", "Boolean (true or false) expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.file_property", "", "File property expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.radix", "", "Illegal number base ~q, not between 2 and 36."], [], -1));
add(new Clause(0, "strings", ["domain_error.character_code", "", "Illegal code point ~q, not between 0 and 0x10FFFF."], [], -1));
add(new Clause(0, "strings", ["domain_error.exotic", "", "Exotic expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.writer", "", "Outputstream expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.reader", "", "Inputstream expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.goal", "", "Goal expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.clause", "", "Clause expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.provable", "", "Provable expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.type", "", "Type expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.timer", "", "Timer expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.task", "", "Task expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["existence_error.source_sink", "", "File ~q not found."], [], -1));
add(new Clause(0, "strings", ["existence_error.module", "", "Module ~q not found."], [], -1));
add(new Clause(0, "strings", ["permission_error.open.source_sink", "", "Cannot open file ~q."], [], -1));
add(new Clause(0, "strings", ["permission_error.modify.compound", "", "Cannot modify compound ~q."], [], -1));
add(new Clause(0, "strings", ["resource_error.socket_timeout", "", "Input\/output timeout."], [], -1));
add(new Clause(0, "strings", ["resource_error.port_error", "", "Error using a port."], [], -1));
add(new Clause(0, "strings", ["resource_error.remote_error", "", "Got error from remote."], [], -1));
add(new Clause(0, "strings", ["resource_error.io_exception", "", "File not created or not accessible."], [], -1));
add(new Clause(0, "strings", ["system_error.timelimit_exceeded", "", "Execution aborted since time limit exceeded."], [], -1));
add(new Clause(0, "strings", ["system_error.stack_overflow", "", "Execution aborted because of stack overflow."], [], -1));
add(new Clause(0, "strings", ["system_error.out_of_memory", "", "Execution aborted because out of memory."], [], -1));
add(new Clause(0, "strings", ["system_error.user_abort", "", "Execution aborted on user request."], [], -1));
add(new Clause(0, "strings", ["system_error.user_exit", "", "System ended on user request."], [], -1));
add(new Clause(0, "strings", ["system_error.illegal_yield", "", "Yield instruction currently not available."], [], -1));
add(new Clause(0, "strings", ["syntax_error.directive_failed", "", "Directive failed."], [], -1));
add(new Clause(3, "dynamic", [new Skeleton("\/", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("must_be"), ["atom", new Place(1)]), new Skeleton(new Cache("must_be"), ["integer", new Place(2)]), new Skeleton(new Cache("sys_style_indicator"), [new Place(1), new Place(2)]), new Skeleton(new Cache("kb_pred_touch"), [new Place(1), new Place(2), 1])], 0));
add(new Clause(1, "dynamic", [new Place(0)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["predicate_indicator", new Place(0)]), undefined])])], -1));
add(new Clause(3, "prehash", [new Skeleton("\/", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("must_be"), ["atom", new Place(1)]), new Skeleton(new Cache("must_be"), ["integer", new Place(2)]), new Skeleton(new Cache("sys_style_indicator"), [new Place(1), new Place(2)]), new Skeleton(new Cache("kb_pred_touch"), [new Place(1), new Place(2), 4])], 0));
add(new Clause(1, "prehash", [new Place(0)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["predicate_indicator", new Place(0)]), undefined])])], -1));
add(new Clause(9, "asserta", [new Place(1)], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(":-", [new Place(2), new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_body"), [new Place(3), "nothing", new Place(4), 0, new Place(5), "[]"]), new Skeleton(new Cache("=.."), [new Place(2), new Skeleton(".", [new Place(6), new Place(7)])]), new Skeleton(new Cache("sys_clause_ossify"), [new Place(7), new Place(5), new Place(4), new Place(6), new Place(8)]), new Skeleton(new Cache("sys_clause_add"), [new Place(8), 1])], 0));
add(new Clause(4, "asserta", [new Place(0)], [new Skeleton(new Cache("=.."), [new Place(0), new Skeleton(".", [new Place(1), new Place(2)])]), new Skeleton(new Cache("sys_clause_ossify"), [new Place(2), "[]", "nothing", new Place(1), new Place(3)]), new Skeleton(new Cache("sys_clause_add"), [new Place(3), 1])], -1));
add(new Clause(9, "assertz", [new Place(1)], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(":-", [new Place(2), new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_trans_body"), [new Place(3), "nothing", new Place(4), 0, new Place(5), "[]"]), new Skeleton(new Cache("=.."), [new Place(2), new Skeleton(".", [new Place(6), new Place(7)])]), new Skeleton(new Cache("sys_clause_ossify"), [new Place(7), new Place(5), new Place(4), new Place(6), new Place(8)]), new Skeleton(new Cache("sys_clause_add"), [new Place(8), 3])], 0));
add(new Clause(4, "assertz", [new Place(0)], [new Skeleton(new Cache("=.."), [new Place(0), new Skeleton(".", [new Place(1), new Place(2)])]), new Skeleton(new Cache("sys_clause_ossify"), [new Place(2), "[]", "nothing", new Place(1), new Place(3)]), new Skeleton(new Cache("sys_clause_add"), [new Place(3), 3])], -1));
add(new Clause(6, "clause", [new Place(0), new Place(1)], [new Skeleton(new Cache("kb_clause_ref"), [new Place(0), 2, new Place(2)]), new Skeleton(new Cache("kb_clause_data"), [new Place(2), new Place(0), new Place(3), new Place(4)]), new Skeleton(new Cache("sys_untrans_body"), [new Place(4), new Place(3), 0, new Place(5)]), new Skeleton(new Cache("="), [new Place(5), new Place(1)])], -1));
add(new Clause(8, "retract", [new Place(1)], [new Skeleton(new Cache("nonvar"), [new Place(1)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(":-", [new Place(2), new Place(3)])]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("kb_clause_ref"), [new Place(2), 3, new Place(4)]), new Skeleton(new Cache("kb_clause_data"), [new Place(4), new Place(2), new Place(5), new Place(6)]), new Skeleton(new Cache("sys_untrans_body"), [new Place(6), new Place(5), 0, new Place(7)]), new Skeleton(new Cache("="), [new Place(7), new Place(3)]), new Skeleton(new Cache("kb_clause_remove"), [new Place(4), 0])], 0));
add(new Clause(2, "retract", [new Place(0)], [new Skeleton(new Cache("kb_clause_ref"), [new Place(0), 3, new Place(1)]), new Skeleton(new Cache("kb_clause_data"), [new Place(1), new Place(0), undefined, "[]"]), new Skeleton(new Cache("kb_clause_remove"), [new Place(1), 0])], -1));
add(new Clause(2, "retractall", [new Place(0)], [new Skeleton(new Cache("kb_clause_ref"), [new Place(0), 7, new Place(1)]), new Skeleton(new Cache("kb_clause_head"), [new Place(1), new Place(0)]), new Skeleton(new Cache("kb_clause_remove"), [new Place(1), 1]), new Cache("fail")], -1));
add(new Clause(0, "retractall", [undefined], [], -1));
add(new Clause(3, "abolish", [new Skeleton("\/", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_abolish"), [new Place(1), new Place(2)])], 0));
add(new Clause(1, "abolish", [new Place(0)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["predicate_indicator", new Place(0)]), undefined])])], -1));
add(new Clause(4, "sys_abolish", [new Place(0), new Place(1)], [new Skeleton(new Cache("kb_pred_link"), [new Place(0), new Place(1), new Place(2)]), new Skeleton(new Cache("kb_link_flags"), [new Place(2), new Place(3)]), new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(3), 1]), 0]), new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("permission_error", ["modify", "static_procedure", new Skeleton("\/", [new Place(0), new Place(1)])]), undefined])])], -1));
add(new Clause(2, "sys_abolish", [new Place(0), new Place(1)], [new Skeleton(new Cache("retractall"), [new Skeleton(new Cache("sys_predprop"), [new Place(0), new Place(1), undefined])]), new Skeleton(new Cache("kb_pred_destroy"), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("kb_pred_touch"), ["sys_predprop", 3, 1])], -1));
add(new Clause(4, "current_predicate", [new Skeleton("\/", [new Place(1), new Place(2)])], [new Skeleton(make_defined([new Clause(1, "", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)])], -1), new Clause(1, "", [undefined, new Place(0)], [new Skeleton(new Cache("var"), [new Place(0)])], -1)]), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("kb_pred_list"), [new Place(3)]), new Skeleton(new Cache("member"), [new Skeleton("\/", [new Place(1), new Place(2)]), new Place(3)])], 0));
add(new Clause(3, "current_predicate", [new Skeleton("\/", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("kb_pred_link"), [new Place(1), new Place(2), undefined])], 0));
add(new Clause(1, "current_predicate", [new Place(0)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["predicate_indicator", new Place(0)]), undefined])])], -1));
add(new Clause(4, "predicate_property", [new Skeleton("\/", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(make_defined([new Clause(1, "", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)])], -1), new Clause(1, "", [undefined, new Place(0)], [new Skeleton(new Cache("var"), [new Place(0)])], -1)]), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("current_predicate"), [new Skeleton("\/", [new Place(1), new Place(2)])]), new Skeleton(new Cache("sys_predprop_get"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(4, "predicate_property", [new Skeleton("\/", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_predprop_get"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(1, "predicate_property", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["predicate_indicator", new Place(0)]), undefined])])], -1));
add(new Clause(7, "sys_predprop_get", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("kb_pred_link"), [new Place(0), new Place(1), new Place(3)]), new Skeleton(new Cache("kb_link_flags"), [new Place(3), new Place(4)]), new Skeleton(new Cache("is"), [new Place(5), new Skeleton(new Cache("\/\\"), [new Place(4), 15])]), new Skeleton(new Cache("sys_predprop_flag"), [new Place(5), new Place(6)]), new Skeleton(new Cache("="), [new Place(2), new Place(6)])], -1));
add(new Clause(3, "sys_predprop_get", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_predprop"), [new Place(0), new Place(1), new Place(2)])], -1));
add(new Clause(1, "sys_predprop_flag", [0, "static"], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_predprop_flag", [1, "dynamic"], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "sys_predprop_flag", [undefined, "built_in"], [], -1));
run(new Goal(0, [new Frozen(new Cache("kb_pred_touch"), ["sys_emulated", 2, 1])], -1));
add(new Clause(0, "sys_emulated", ["argv", "[]"], [], -1));
add(new Clause(0, "sys_emulated", ["sys_locale", "en_GB"], [], -1));
add(new Clause(0, "sys_emulated", ["sys_color", "normal"], [], -1));
add(new Clause(3, "set_prolog_flag", [new Place(1), new Place(2)], [new Skeleton(new Cache("must_be"), ["atom", new Place(1)]), new Skeleton(new Cache("sys_prolog_flag_set"), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "set_prolog_flag", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["prolog_flag", new Place(0)]), undefined])])], -1));
add(new Clause(1, "sys_prolog_flag_set", ["argv", new Place(0)], [new Skeleton(new Cache("retractall"), [new Skeleton(new Cache("sys_emulated"), ["argv", undefined])]), new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_emulated"), ["argv", new Place(0)])])], -1));
add(new Clause(1, "sys_prolog_flag_set", ["sys_locale", new Place(0)], [new Skeleton(new Cache("retractall"), [new Skeleton(new Cache("sys_emulated"), ["sys_locale", undefined])]), new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_emulated"), ["sys_locale", new Place(0)])])], -1));
add(new Clause(1, "sys_prolog_flag_set", ["sys_color", new Place(0)], [new Skeleton(new Cache("retractall"), [new Skeleton(new Cache("sys_emulated"), ["sys_color", undefined])]), new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_emulated"), ["sys_color", new Place(0)])])], -1));
add(new Clause(1, "sys_prolog_flag_set", ["base_url", new Place(0)], [new Skeleton(new Cache("os_set_workdir"), [new Place(0)])], -1));
add(new Clause(1, "sys_prolog_flag_set", ["stage", new Place(0)], [new Skeleton(new Cache("dg_set_stage"), [new Place(0)])], -1));
add(new Clause(1, "sys_prolog_flag_set", ["partition", new Place(0)], [new Skeleton(new Cache("dg_set_partition"), [new Place(0)])], -1));
add(new Clause(1, "sys_prolog_flag_set", [new Place(0), undefined], [new Skeleton(new Cache("sys_prolog_flag_get"), [new Place(0), undefined]), new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("permission_error", ["modify", "flag", new Place(0)]), undefined])])], -1));
add(new Clause(3, "current_prolog_flag", [new Place(1), new Place(2)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_prolog_flag_get"), [new Place(1), new Place(2)])], 0));
add(new Clause(4, "current_prolog_flag", [new Place(1), new Place(2)], [new Skeleton(new Cache("must_be"), ["atom", new Place(1)]), new Skeleton(new Cache("sys_prolog_flag_get"), [new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(1, "current_prolog_flag", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["prolog_flag", new Place(0)]), undefined])])], -1));
add(new Clause(1, "sys_prolog_flag_get", ["argv", new Place(0)], [new Skeleton(new Cache("sys_emulated"), ["argv", new Place(0)])], -1));
add(new Clause(1, "sys_prolog_flag_get", ["sys_locale", new Place(0)], [new Skeleton(new Cache("sys_emulated"), ["sys_locale", new Place(0)])], -1));
add(new Clause(1, "sys_prolog_flag_get", ["sys_color", new Place(0)], [new Skeleton(new Cache("sys_emulated"), ["sys_color", new Place(0)])], -1));
add(new Clause(1, "sys_prolog_flag_get", ["base_url", new Place(0)], [new Skeleton(new Cache("os_get_workdir"), [new Place(0)])], -1));
add(new Clause(1, "sys_prolog_flag_get", ["stage", new Place(0)], [new Skeleton(new Cache("dg_get_stage"), [new Place(0)])], -1));
add(new Clause(1, "sys_prolog_flag_get", ["partition", new Place(0)], [new Skeleton(new Cache("dg_get_partition"), [new Place(0)])], -1));
add(new Clause(0, "sys_prolog_flag_get", ["single_quotes", "atom"], [], -1));
add(new Clause(0, "sys_prolog_flag_get", ["double_quotes", "codes"], [], -1));
add(new Clause(0, "sys_prolog_flag_get", ["back_quotes", "variable"], [], -1));
add(new Clause(0, "sys_prolog_flag_get", ["dialect", "dogelog"], [], -1));
add(new Clause(0, "sys_prolog_flag_get", ["version", 20205], [], -1));
add(new Clause(0, "sys_prolog_flag_get", ["use_strict", "off"], [], -1));
add(new Clause(0, "sys_prolog_flag_get", ["max_code", 1114111], [], -1));
add(new Clause(0, "sys_prolog_flag_get", ["max_arity", 2147483647n], [], -1));
add(new Clause(2, "sys_prolog_flag_get", ["async_mode", new Place(0)], [new Skeleton(new Cache("dg_get_flags"), [new Place(1)]), new Skeleton(new Cache("sys_prolog_flag_decode"), [new Place(1), 1, new Place(0)])], -1));
add(new Clause(2, "sys_prolog_flag_get", ["allow_yield", new Place(0)], [new Skeleton(new Cache("dg_get_flags"), [new Place(1)]), new Skeleton(new Cache("sys_prolog_flag_decode"), [new Place(1), 8, new Place(0)])], -1));
add(new Clause(0, "sys_prolog_flag_get", ["import_async", "on"], [], -1));
add(new Clause(0, "sys_prolog_flag_get", ["prop_async", "on"], [], -1));
add(new Clause(0, "sys_prolog_flag_get", ["read_async", "on"], [], -1));
add(new Clause(2, "sys_prolog_flag_get", ["state_async", new Place(0)], [new Skeleton(new Cache("dg_get_flags"), [new Place(1)]), new Skeleton(new Cache("sys_prolog_flag_decode"), [new Place(1), 128, new Place(0)])], -1));
add(new Clause(5, "sys_prolog_flag_get", [new Place(1), new Place(2)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("os_get_host"), [new Place(3)]), new Skeleton(new Cache("ir_object_keys"), [new Place(3), new Place(4)]), new Skeleton(new Cache("member"), [new Place(1), new Place(4)]), new Skeleton(new Cache("ir_object_current"), [new Place(3), new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_prolog_flag_get", [new Place(0), new Place(1)], [new Skeleton(new Cache("os_get_host"), [new Place(2)]), new Skeleton(new Cache("ir_object_current"), [new Place(2), new Place(0), new Place(1)])], -1));
add(new Clause(4, "sys_prolog_flag_decode", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(1), new Place(2)]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), "on"])], 0));
add(new Clause(0, "sys_prolog_flag_decode", [undefined, undefined, "off"], [], -1));
add(new Clause(4, "vars_intersection", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("vars_subtract"), [new Place(0), new Place(1), new Place(3)]), new Skeleton(new Cache("vars_subtract"), [new Place(0), new Place(3), new Place(2)])], -1));
add(new Clause(5, "vars_subtract", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("term_variables"), [new Place(1), new Place(3)]), new Skeleton(new Cache("term_variables"), [new Skeleton("+", [new Place(1), new Place(0)]), new Place(4)]), new Skeleton(new Cache("append"), [new Place(3), new Place(2), new Place(4)])], -1));
run(new Goal(0, [new Frozen(new Cache("kb_pred_touch"), ["sys_including", 3, 1])], -1));
run(new Goal(4, [new Skeleton(new Cache("os_get_gestalt"), [new Place(0)]), new Skeleton(new Cache("ir_object_current"), [new Place(0), "sys_color", new Place(1)]), new Skeleton(new Cache("set_prolog_flag"), ["sys_color", new Place(1)]), new Skeleton(new Cache("ir_object_current"), [new Place(0), "sys_locale", new Place(2)]), new Skeleton(new Cache("set_prolog_flag"), ["sys_locale", new Place(2)]), new Skeleton(new Cache("ir_object_current"), [new Place(0), "argv", new Place(3)]), new Skeleton(new Cache("set_prolog_flag"), ["argv", new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_multifile_safe"), ["sys_meta_args", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_multifile_safe"), ["strings", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_multifile_safe"), ["term_expansion", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_multifile_safe"), ["strings", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_trans_horn", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_trans_body", 6])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_trans_cut", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_trans_disj", 6])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_trans_alter", 6])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_trans_mark", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_safe_meta", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_untrans_body", 4])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_untrans_rest", 5])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_untrans_goal", 4])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_untrans_disj", 4])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_untrans_more", 5])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_untrans_alter", 5])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_untrans_split", 4])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_untrans_ambiguity", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_encode_horn", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_meta_args", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_encode_body", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_encode_goal", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_encode_disj", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_encode_link", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_encode_meta", 4])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_encode_params", 4])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_encode_param", 4])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_encode_expr", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_encode_args", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_encode_clause", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_decode_body", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_decode_goal", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_decode_disj", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_decode_meta", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_decode_params", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_decode_param", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_decode_expr", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_decode_args", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_decode_clause", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_source", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_srcprop", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["current_source", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["source_property", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["discontiguous", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["multifile", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_multifile_safe", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["include", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_include_file", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_include_native", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), [".", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["ensure_loaded", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_check_file", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_action_file", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_lastpred", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_load_file", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_loading_begin", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_loading_end", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_update_last", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_style_static", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_style_head", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_style_indicator", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_usage_predicate", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_include_stream", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_include_lines", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_next_term", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_handle_clump", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_handle_static", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_load_type", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["strings", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["true", 0])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["!", 0])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), [",", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), [";", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["->", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["\\=", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["\\+", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["once", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["repeat", 0])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["catch", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_error_handler", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_chain_head", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["throw", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_fill_stack", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_fetch_stack", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_fetch_frame", 4])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["try_call_finally", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["ignore", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["chain", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_chain_error", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_chain_raise", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_chain_concat", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["once_cleanup", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["setup_once_cleanup", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_setup_once_cleanup", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_once_cleanup", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sleep", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["call_later", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["call_later", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["call_with_time_limit", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_timeout_signal", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["create_task", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["create_task", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_frost_horn", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_host_ossify", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["member", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_member", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["select", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_select", 4])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["reverse", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_reverse", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["append", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["length", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_length", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_length", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["between", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_between", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["findall", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_find_init", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_find_next", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_find_fini", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["get_message", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["get_message", 4])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_string", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_string", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_locale_ancestor", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_multiton_keys", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_multiton_check", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_singleton_keys", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_singleton_check", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_marked_at", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["expand_term", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["phrase", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["term_expansion", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_dcg_expansion", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_phrase_expansion", 6])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_list_expansion", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sub_atom", 5])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["last_sub_atom", 5])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["strings", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["dynamic", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["prehash", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["asserta", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["assertz", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["clause", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["retract", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["retractall", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["abolish", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_abolish", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_predprop", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["current_predicate", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["predicate_property", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_predprop_get", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_predprop_flag", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_emulated", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["set_prolog_flag", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_prolog_flag_set", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["current_prolog_flag", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_prolog_flag_get", 2])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_prolog_flag_decode", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["vars_intersection", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["vars_subtract", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_including", 3])], -1));


run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_is_infix", 3])], -1));
add(new Clause(0, "sys_is_infix", ["xfx", 1, 1], [], -1));
add(new Clause(0, "sys_is_infix", ["yfx", 0, 1], [], -1));
add(new Clause(0, "sys_is_infix", ["xfy", 1, 0], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_is_prefix", 2])], -1));
add(new Clause(0, "sys_is_prefix", ["fx", 1], [], -1));
add(new Clause(0, "sys_is_prefix", ["fy", 0], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_is_postfix", 2])], -1));
add(new Clause(0, "sys_is_postfix", ["xf", 1], [], -1));
add(new Clause(0, "sys_is_postfix", ["yf", 0], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_op", 5])], -1));
run(new Goal(0, [new Frozen(new Cache("kb_pred_touch"), ["sys_op", 5, 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["current_op", 3])], -1));
add(new Clause(3, "current_op", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_op"), [new Place(2), new Place(1), new Place(0), undefined, undefined])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["op", 3])], -1));
add(new Clause(3, "op", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("must_be"), ["integer", new Place(0)]), new Skeleton(new Cache("must_be"), ["atom", new Place(1)]), new Skeleton(new Cache("must_be"), ["atom", new Place(2)]), new Skeleton(new Cache("sys_check_priority"), [new Place(0)]), new Skeleton(new Cache("sys_op_retract"), [new Place(2), new Place(1)]), new Skeleton(new Cache("sys_op_assert"), [new Place(2), new Place(1), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_check_priority", 1])], -1));
add(new Clause(1, "sys_check_priority", [new Place(0)], [new Skeleton(new Cache("<"), [new Place(0), 0]), new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["not_less_than_zero", new Place(0)]), undefined])])], -1));
add(new Clause(1, "sys_check_priority", [new Place(0)], [new Skeleton(new Cache(">"), [new Place(0), 1200]), new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["operator_priority", new Place(0)]), undefined])])], -1));
add(new Clause(0, "sys_check_priority", [undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_op_retract", 2])], -1));
add(new Clause(3, "sys_op_retract", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_is_prefix"), [new Place(2), undefined]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(make_defined([new Clause(3, "", [new Place(0)], [new Skeleton(new Cache("sys_op"), [new Place(0), new Place(1), new Place(2), undefined, undefined]), new Skeleton(new Cache("sys_is_prefix"), [new Place(1), undefined]), new Skeleton(new Cache("retract"), [new Skeleton(new Cache("sys_op"), [new Place(0), new Place(1), new Place(2), undefined, undefined])]), new Cache("fail")], -1), new Clause(0, "", [undefined], [], -1)]), [new Place(1)])], 0));
add(new Clause(3, "sys_op_retract", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_is_postfix"), [new Place(2), undefined]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(make_defined([new Clause(3, "", [new Place(0)], [new Skeleton(new Cache("sys_op"), [new Place(0), new Place(1), new Place(2), undefined, undefined]), new Skeleton(new Cache("sys_is_postfix"), [new Place(1), undefined]), new Skeleton(new Cache("retract"), [new Skeleton(new Cache("sys_op"), [new Place(0), new Place(1), new Place(2), undefined, undefined])]), new Cache("fail")], -1), new Clause(0, "", [undefined], [], -1)]), [new Place(1)])], 0));
add(new Clause(3, "sys_op_retract", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_is_infix"), [new Place(2), undefined, undefined]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(make_defined([new Clause(3, "", [new Place(0)], [new Skeleton(new Cache("sys_op"), [new Place(0), new Place(1), new Place(2), undefined, undefined]), new Skeleton(new Cache("sys_is_infix"), [new Place(1), undefined, undefined]), new Skeleton(new Cache("retract"), [new Skeleton(new Cache("sys_op"), [new Place(0), new Place(1), new Place(2), undefined, undefined])]), new Cache("fail")], -1), new Clause(0, "", [undefined], [], -1)]), [new Place(1)])], 0));
add(new Clause(1, "sys_op_retract", [undefined, new Place(0)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["operator_specifier", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_op_assert", 3])], -1));
add(new Clause(1, "sys_op_assert", [undefined, undefined, 0], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_op_assert", [new Place(0), new Place(1), undefined], [new Skeleton(new Cache("sys_is_infix"), [new Place(1), undefined, undefined]), new Skeleton(new Cache("sys_op"), [new Place(0), new Place(2), undefined, undefined, undefined]), new Skeleton(new Cache("sys_is_postfix"), [new Place(2), undefined]), new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("permission_error", ["create", "operator", new Place(0)]), undefined])])], -1));
add(new Clause(3, "sys_op_assert", [new Place(0), new Place(1), undefined], [new Skeleton(new Cache("sys_is_postfix"), [new Place(1), undefined]), new Skeleton(new Cache("sys_op"), [new Place(0), new Place(2), undefined, undefined, undefined]), new Skeleton(new Cache("sys_is_infix"), [new Place(2), undefined, undefined]), new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("permission_error", ["create", "operator", new Place(0)]), undefined])])], -1));
add(new Clause(8, "sys_op_assert", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_op_punct"), [new Place(0), new Place(3)]), new Skeleton(new Cache("sys_op_space"), [new Place(1), new Place(2), new Place(4)]), new Skeleton(new Cache("sys_op_format"), [new Place(1), new Place(2), new Place(5)]), new Skeleton(new Cache("is"), [new Place(6), new Skeleton(new Cache("\\\/"), [new Skeleton(new Cache("\\\/"), [new Place(3), new Place(4)]), new Place(5)])]), new Skeleton(new Cache("dg_get_partition"), [new Place(7)]), new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_op"), [new Place(0), new Place(1), new Place(2), new Place(6), new Place(7)])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_op_punct", 2])], -1));
add(new Clause(1, "sys_op_punct", [";", 2], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_op_punct", [",", 2], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "sys_op_punct", [undefined, 0], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_op_space", 3])], -1));
add(new Clause(2, "sys_op_space", [undefined, new Place(1), 0], [new Skeleton(new Cache(">"), [new Place(1), 699]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_op_space", [new Place(1), undefined, 1], [new Skeleton(new Cache("sys_is_prefix"), [new Place(1), undefined]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_op_space", [new Place(1), undefined, 2], [new Skeleton(new Cache("sys_is_postfix"), [new Place(1), undefined]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "sys_op_space", [undefined, undefined, 3], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_op_format", 3])], -1));
add(new Clause(4, "sys_op_format", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_is_infix"), [new Place(1), undefined, undefined]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_op_format2"), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_op_format", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_is_prefix"), [new Place(1), undefined]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_op_format3"), [new Place(2), new Place(3)])], 0));
add(new Clause(0, "sys_op_format", [undefined, undefined, 0], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_op_format2", 2])], -1));
add(new Clause(2, "sys_op_format2", [new Place(1), 12], [new Skeleton(new Cache(">"), [new Place(1), 1149]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_op_format2", [new Place(1), 8], [new Skeleton(new Cache(">"), [new Place(1), 1049]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_op_format2", [new Place(1), 4], [new Skeleton(new Cache(">"), [new Place(1), 949]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "sys_op_format2", [undefined, 0], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_op_format3", 2])], -1));
add(new Clause(2, "sys_op_format3", [new Place(1), 12], [new Skeleton(new Cache(">"), [new Place(1), 1149]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "sys_op_format3", [undefined, 0], [], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [1200, "fx", ":-"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [1200, "xfx", ":-"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [1200, "fx", "?-"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [1200, "xfx", "-->"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [1100, "xfy", ";"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [1050, "xfy", "->"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [1000, "xfy", ","])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [900, "fy", "\\+"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "is"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "="])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "\\="])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "=.."])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "<"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "=<"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "=\\="])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", ">="])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", ">"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "=:="])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "@<"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "@=<"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "\\=="])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "@>="])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "@>"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [700, "xfx", "=="])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [600, "xfy", ":"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [500, "yfx", "+"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [500, "yfx", "-"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [500, "yfx", "\/\\"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [500, "yfx", "\\\/"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [400, "yfx", "*"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [400, "yfx", "\/"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [400, "yfx", "\/\/"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [400, "yfx", "rem"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [400, "yfx", "div"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [400, "yfx", "mod"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [400, "yfx", "xor"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [400, "yfx", ">>"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [400, "yfx", "<<"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [200, "fy", "-"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [200, "fy", "\\"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [200, "xfx", "**"])], -1));
run(new Goal(0, [new Frozen(new Cache("op"), [200, "xfy", "^"])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_init_goal", 1])], -1));
run(new Goal(0, [new Frozen(new Cache("kb_pred_touch"), ["sys_init_goal", 1, 1])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["initialization", 1])], -1));
add(new Clause(1, "initialization", [new Place(0)], [new Skeleton(new Cache("assertz"), [new Skeleton(new Cache("sys_init_goal"), [new Place(0)])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_init_goals", 0])], -1));
add(new Clause(2, "sys_init_goals", [], [new Skeleton(new Cache("retract"), [new Skeleton(new Cache("sys_init_goal"), [new Place(0)])]), new Skeleton(new Cache("catch"), [new Skeleton("sys_must", [new Place(0)]), new Place(1), new Skeleton("sys_print_error", [new Place(1)])]), new Cache("fail")], -1));
add(new Clause(0, "sys_init_goals", [], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_must", 1])], -1));
add(new Clause(2, "sys_must", [new Place(1)], [new Skeleton(new Cache("call"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "sys_must", [undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("syntax_error", ["directive_failed"]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_baseline", 0])], -1));
add(new Clause(1, "sys_baseline", [], [new Skeleton(new Cache("current_prolog_flag"), ["argv", new Place(0)]), new Skeleton(new Cache("sys_baseline"), [new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_baseline", 1])], -1));
add(new Clause(2, "sys_baseline", [new Skeleton(".", ["-h", undefined])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("current_output"), [new Place(1)]), new Skeleton(new Cache("put_message"), [new Place(1), new Frozen("command", ["runtime"])]), new Cache("nl")], 0));
add(new Clause(1, "sys_baseline", [new Skeleton(".", [new Place(0), undefined])], [new Skeleton(new Cache("sub_atom"), [new Place(0), 0, undefined, undefined, "-"]), new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("system_error", ["option_command"]), undefined])])], -1));
add(new Clause(0, "sys_baseline", [undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_launch", 0])], -1));
add(new Clause(1, "sys_launch", [], [new Skeleton(new Cache("current_prolog_flag"), ["argv", new Place(0)]), new Skeleton(new Cache("sys_launch"), [new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_launch", 1])], -1));
add(new Clause(1, "sys_launch", [new Skeleton(".", ["-h", undefined])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "sys_launch", ["[]"], [new Frozen(new Cache("ensure_loaded"), [new Frozen("library", [new Frozen("\/", ["tester", "session"])])]), new Cache("version"), new Cache("prolog")], -1));
add(new Clause(1, "sys_launch", [new Skeleton(".", [new Place(0), undefined])], [new Skeleton(new Cache("ensure_loaded"), [new Place(0)]), new Cache("sys_init_goals")], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_net_request", 1])], -1));
add(new Clause(1, "sys_net_request", [new Place(0)], [new Skeleton(new Cache("sys_net_path"), [new Place(0)])], -1));
add(new Clause(1, "sys_net_request", [undefined], [new Skeleton(new Cache("current_prolog_flag"), ["base_url", new Place(0)]), new Skeleton(new Cache("sys_net_path"), [new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_net_path", 1])], -1));
add(new Clause(1, "sys_net_path", [new Place(0)], [new Skeleton(new Cache("sub_atom"), [new Place(0), 0, undefined, undefined, "http:"])], -1));
add(new Clause(1, "sys_net_path", [new Place(0)], [new Skeleton(new Cache("sub_atom"), [new Place(0), 0, undefined, undefined, "https:"])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["open", 3])], -1));
add(new Clause(3, "open", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("open"), [new Place(0), new Place(1), new Place(2), "[]"])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["open", 4])], -1));
add(new Clause(6, "open", [new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_net_request"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("ir_object_new"), [new Place(5)]), new Skeleton(new Cache("sys_open_opts"), [new Place(4), new Place(5)]), new Skeleton(new Cache("sys_open_http"), [new Place(1), new Place(2), new Place(5), new Place(3)]), new Skeleton(new Cache("sys_open_results"), [new Place(4), new Place(5)])], 0));
add(new Clause(5, "open", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("ir_object_new"), [new Place(4)]), new Skeleton(new Cache("sys_stream_opts"), [new Place(3), new Place(4)]), new Skeleton(new Cache("sys_open_file"), [new Place(0), new Place(1), new Place(4), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_open_file", 4])], -1));
add(new Clause(5, "sys_open_file", [new Place(1), "read", new Place(2), new Place(3)], [new Frozen(new Cache("current_prolog_flag"), ["read_async", "on"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("os_open_promise"), [new Place(1), new Place(2), new Place(3), new Place(4)]), new Skeleton(new Cache("$YIELD"), [new Place(4)])], 0));
add(new Clause(4, "sys_open_file", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("os_open_sync"), [new Place(0), new Place(1), new Place(2), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_open_http", 4])], -1));
add(new Clause(5, "sys_open_http", [new Place(1), "read", new Place(2), new Place(3)], [new Frozen(new Cache("current_prolog_flag"), ["read_async", "on"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("net_open_promise"), [new Place(1), new Place(2), new Place(3), new Place(4)]), new Skeleton(new Cache("$YIELD"), [new Place(4)])], 0));
add(new Clause(4, "sys_open_http", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("net_open_sync"), [new Place(0), new Place(1), new Place(2), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["close", 1])], -1));
add(new Clause(4, "close", [new Place(1)], [new Skeleton(new Cache("ir_object_current"), [new Place(1), "flags", new Place(2)]), new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(2), 2]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("os_close_promise"), [new Place(1), new Place(3)]), new Skeleton(new Cache("$YIELD"), [new Place(3)])], 0));
add(new Clause(1, "close", [new Place(0)], [new Skeleton(new Cache("os_close_sync"), [new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["nl", 0])], -1));
add(new Clause(1, "nl", [], [new Skeleton(new Cache("current_output"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(0), "\n"]), new Skeleton(new Cache("flush_output"), [new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["nl", 1])], -1));
add(new Clause(3, "nl", [new Place(1)], [new Skeleton(new Cache("ir_object_current"), [new Place(1), "flags", new Place(2)]), new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(2), 16]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), "\n"]), new Skeleton(new Cache("flush_output"), [new Place(1)])], 0));
add(new Clause(1, "nl", [new Place(0)], [new Skeleton(new Cache("put_atom"), [new Place(0), "\n"])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["flush_output", 0])], -1));
add(new Clause(1, "flush_output", [], [new Skeleton(new Cache("current_output"), [new Place(0)]), new Skeleton(new Cache("flush_output"), [new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["put_code", 1])], -1));
add(new Clause(3, "put_code", [new Place(0)], [new Skeleton(new Cache("current_output"), [new Place(1)]), new Skeleton(new Cache("char_code"), [new Place(2), new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["put_code", 2])], -1));
add(new Clause(3, "put_code", [new Place(0), new Place(1)], [new Skeleton(new Cache("char_code"), [new Place(2), new Place(1)]), new Skeleton(new Cache("put_atom"), [new Place(0), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["get_code", 1])], -1));
add(new Clause(2, "get_code", [new Place(0)], [new Skeleton(new Cache("current_input"), [new Place(1)]), new Skeleton(new Cache("get_code"), [new Place(1), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["get_code", 2])], -1));
add(new Clause(4, "get_code", [new Place(1), new Place(2)], [new Skeleton(new Cache("os_get_code"), [new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), new Place(2)])], 0));
add(new Clause(4, "get_code", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_read_buffer"), [new Place(1)]), new Skeleton(new Cache("os_get_code"), [new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), new Place(2)])], 0));
add(new Clause(1, "get_code", [undefined, new Place(0)], [new Skeleton(new Cache("="), [-1, new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["peek_code", 1])], -1));
add(new Clause(2, "peek_code", [new Place(0)], [new Skeleton(new Cache("current_input"), [new Place(1)]), new Skeleton(new Cache("peek_code"), [new Place(1), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["peek_code", 2])], -1));
add(new Clause(4, "peek_code", [new Place(1), new Place(2)], [new Skeleton(new Cache("os_peek_code"), [new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), new Place(2)])], 0));
add(new Clause(4, "peek_code", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_read_buffer"), [new Place(1)]), new Skeleton(new Cache("os_peek_code"), [new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), new Place(2)])], 0));
add(new Clause(1, "peek_code", [undefined, new Place(0)], [new Skeleton(new Cache("="), [-1, new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_buffer", 1])], -1));
add(new Clause(4, "sys_read_buffer", [new Place(1)], [new Skeleton(new Cache("ir_object_current"), [new Place(1), "flags", new Place(2)]), new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(2), 2]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("os_read_promise"), [new Place(1), new Place(3)]), new Skeleton(new Cache("$YIELD"), [new Place(3)])], 0));
add(new Clause(1, "sys_read_buffer", [new Place(0)], [new Skeleton(new Cache("os_read_sync"), [new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["put_atom", 1])], -1));
add(new Clause(2, "put_atom", [new Place(0)], [new Skeleton(new Cache("current_output"), [new Place(1)]), new Skeleton(new Cache("put_atom"), [new Place(1), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["get_atom", 2])], -1));
add(new Clause(3, "get_atom", [new Place(0), new Place(1)], [new Skeleton(new Cache("current_input"), [new Place(2)]), new Skeleton(new Cache("get_atom"), [new Place(2), new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["get_atom", 3])], -1));
add(new Clause(8, "get_atom", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_atom_opts"), [new Place(2), new Frozen("v", [10, 1, 0]), new Skeleton("v", [new Place(3), new Place(4), new Place(5)])]), new Skeleton(new Cache("sys_get_code"), [new Place(0), new Place(6), new Place(4)]), new Skeleton(new Cache("sys_get_code_list"), [new Place(6), new Place(3), new Place(5), new Place(0), new Place(7), new Place(4)]), new Skeleton(new Cache("atom_codes"), [new Place(1), new Place(7)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_code_list", 6])], -1));
add(new Clause(1, "sys_get_code_list", [-1, undefined, undefined, undefined, "[]", undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_get_code_list", [new Place(1), new Place(1), undefined, undefined, new Skeleton(".", [new Place(1), "[]"]), undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_get_code_list", [new Place(1), undefined, 1, undefined, new Skeleton(".", [new Place(1), "[]"]), undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(7, "sys_get_code_list", [new Place(1), new Place(2), 0, new Place(3), new Skeleton(".", [new Place(1), new Place(4)]), new Place(5)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_get_code"), [new Place(3), new Place(6), new Place(5)]), new Skeleton(new Cache("sys_get_code_list"), [new Place(6), new Place(2), 0, new Place(3), new Place(4), new Place(5)])], 0));
add(new Clause(8, "sys_get_code_list", [new Place(0), new Place(1), new Place(2), new Place(3), new Skeleton(".", [new Place(0), new Place(4)]), new Place(5)], [new Skeleton(new Cache("sys_get_code"), [new Place(3), new Place(6), new Place(5)]), new Skeleton(new Cache("is"), [new Place(7), new Skeleton(new Cache("-"), [new Place(2), 1])]), new Skeleton(new Cache("sys_get_code_list"), [new Place(6), new Place(1), new Place(7), new Place(3), new Place(4), new Place(5)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_code", 3])], -1));
add(new Clause(4, "sys_get_code", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(3), 1]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("get_code"), [new Place(1), new Place(2)])], 0));
add(new Clause(5, "sys_get_code", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("ir_object_current"), [new Place(0), "flags", new Place(3)]), new Skeleton(new Cache("get_code"), [new Place(0), new Place(4)]), new Skeleton(new Cache("sys_get_code_more"), [new Place(4), new Place(3), new Place(0), new Place(1), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_code_more", 5])], -1));
add(new Clause(1, "sys_get_code_more", [13, undefined, undefined, 10, undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(5, "sys_get_code_more", [10, new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(1), 1]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_get_code"), [new Place(2), new Place(3), new Place(4)])], 0));
add(new Clause(1, "sys_get_code_more", [new Place(0), undefined, undefined, new Place(0), undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_atom_opts", 3])], -1));
add(new Clause(1, "sys_atom_opts", [new Place(0), undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(6, "sys_atom_opts", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_atom_opt"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_atom_opts"), [new Place(2), new Place(5), new Place(4)])], 0));
add(new Clause(2, "sys_atom_opts", ["[]", new Place(1), new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_atom_opts", [new Place(0), undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["list", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_atom_opt", 3])], -1));
add(new Clause(1, "sys_atom_opt", [new Place(0), undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(4, "sys_atom_opt", [new Skeleton("stop", [new Place(1)]), new Skeleton("v", [undefined, new Place(2), new Place(3)]), new Skeleton("v", [new Place(1), new Place(2), new Place(3)])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(6, "sys_atom_opt", [new Skeleton("compress", [new Place(1)]), new Skeleton("v", [new Place(2), new Place(3), new Place(4)]), new Skeleton("v", [new Place(2), new Place(5), new Place(4)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_opt_boolean"), [new Place(1), 1, new Place(3), new Place(5)])], 0));
add(new Clause(4, "sys_atom_opt", [new Skeleton("max", [new Place(1)]), new Skeleton("v", [new Place(2), new Place(3), undefined]), new Skeleton("v", [new Place(2), new Place(3), new Place(1)])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_atom_opt", [new Place(0), undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["atom_option", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["write", 1])], -1));
add(new Clause(2, "write", [new Place(0)], [new Skeleton(new Cache("current_output"), [new Place(1)]), new Skeleton(new Cache("write_term"), [new Place(1), new Place(0), new Frozen(".", [new Frozen("numbervars", ["true"]), "[]"])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["write", 2])], -1));
add(new Clause(2, "write", [new Place(0), new Place(1)], [new Skeleton(new Cache("write_term"), [new Place(0), new Place(1), new Frozen(".", [new Frozen("numbervars", ["true"]), "[]"])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["writeq", 1])], -1));
add(new Clause(2, "writeq", [new Place(0)], [new Skeleton(new Cache("current_output"), [new Place(1)]), new Skeleton(new Cache("write_term"), [new Place(1), new Place(0), new Frozen(".", [new Frozen("numbervars", ["true"]), new Frozen(".", [new Frozen("quoted", ["true"]), "[]"])])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["writeq", 2])], -1));
add(new Clause(2, "writeq", [new Place(0), new Place(1)], [new Skeleton(new Cache("write_term"), [new Place(0), new Place(1), new Frozen(".", [new Frozen("numbervars", ["true"]), new Frozen(".", [new Frozen("quoted", ["true"]), "[]"])])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["write_canonical", 1])], -1));
add(new Clause(2, "write_canonical", [new Place(0)], [new Skeleton(new Cache("current_output"), [new Place(1)]), new Skeleton(new Cache("write_term"), [new Place(1), new Place(0), new Frozen(".", [new Frozen("quoted", ["true"]), new Frozen(".", [new Frozen("ignore_ops", ["true"]), "[]"])])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["write_canonical", 2])], -1));
add(new Clause(2, "write_canonical", [new Place(0), new Place(1)], [new Skeleton(new Cache("write_term"), [new Place(0), new Place(1), new Frozen(".", [new Frozen("quoted", ["true"]), new Frozen(".", [new Frozen("ignore_ops", ["true"]), "[]"])])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["write_term", 2])], -1));
add(new Clause(3, "write_term", [new Place(0), new Place(1)], [new Skeleton(new Cache("current_output"), [new Place(2)]), new Skeleton(new Cache("write_term"), [new Place(2), new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_print_error", 1])], -1));
add(new Clause(2, "sys_print_error", [new Place(0)], [new Skeleton(new Cache("current_error"), [new Place(1)]), new Skeleton(new Cache("sys_print_error"), [new Place(1), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_print_error", 2])], -1));
add(new Clause(4, "sys_print_error", [new Place(1), new Place(2)], [new Skeleton(new Cache("ir_object_current"), [new Place(1), "flags", new Place(3)]), new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(3), 12]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_fancy_problem"), [new Place(2), new Place(1)])], 0));
add(new Clause(2, "sys_print_error", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_print_problem"), [new Place(1), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_print_problem", 2])], -1));
add(new Clause(3, "sys_print_problem", [new Place(1), new Place(2)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_message"), [new Place(2), new Skeleton("exception", ["unknown", new Place(1)]), new Place(2)]), new Skeleton(new Cache("nl"), [new Place(2)])], 0));
add(new Clause(4, "sys_print_problem", [new Skeleton("cause", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_print_problem"), [new Place(1), new Place(3)]), new Skeleton(new Cache("sys_print_problem"), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_print_problem", [new Skeleton("error", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_message"), [new Place(3), new Frozen("exception", ["error"])]), new Skeleton(new Cache("put_message"), [new Place(3), new Place(1)]), new Skeleton(new Cache("nl"), [new Place(3)]), new Skeleton(new Cache("sys_print_trace"), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_print_problem", [new Skeleton("warning", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_message"), [new Place(3), new Frozen("exception", ["warning"])]), new Skeleton(new Cache("put_message"), [new Place(3), new Place(1)]), new Skeleton(new Cache("nl"), [new Place(3)]), new Skeleton(new Cache("sys_print_trace"), [new Place(2), new Place(3)])], 0));
add(new Clause(2, "sys_print_problem", [new Place(0), new Place(1)], [new Skeleton(new Cache("put_message"), [new Place(1), new Skeleton("exception", ["unknown", new Place(0)])]), new Skeleton(new Cache("nl"), [new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_print_trace", 2])], -1));
add(new Clause(3, "sys_print_trace", [new Place(1), new Place(2)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_message"), [new Place(2), new Skeleton("exception", ["context", new Place(1)])]), new Skeleton(new Cache("nl"), [new Place(2)])], 0));
add(new Clause(4, "sys_print_trace", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_message"), [new Place(3), new Place(1)]), new Skeleton(new Cache("nl"), [new Place(3)]), new Skeleton(new Cache("sys_print_trace"), [new Place(2), new Place(3)])], 0));
add(new Clause(1, "sys_print_trace", ["[]", undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_print_trace", [new Place(0), new Place(1)], [new Skeleton(new Cache("put_message"), [new Place(1), new Skeleton("exception", ["context", new Place(0)])]), new Skeleton(new Cache("nl"), [new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["read", 1])], -1));
add(new Clause(3, "read", [new Place(0)], [new Skeleton(new Cache("current_input"), [new Place(1)]), new Skeleton(new Cache("get_code"), [new Place(1), new Place(2)]), new Skeleton(new Cache("sys_read_term"), [new Place(2), new Place(1), "[]", new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["read", 2])], -1));
add(new Clause(3, "read", [new Place(0), new Place(1)], [new Skeleton(new Cache("get_code"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_read_term"), [new Place(2), new Place(0), "[]", new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["read_term", 2])], -1));
add(new Clause(4, "read_term", [new Place(0), new Place(1)], [new Skeleton(new Cache("current_input"), [new Place(2)]), new Skeleton(new Cache("get_code"), [new Place(2), new Place(3)]), new Skeleton(new Cache("sys_read_term"), [new Place(3), new Place(2), new Place(1), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["read_term", 3])], -1));
add(new Clause(4, "read_term", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("get_code"), [new Place(0), new Place(3)]), new Skeleton(new Cache("sys_read_term"), [new Place(3), new Place(0), new Place(2), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["file_property", 2])], -1));
add(new Clause(7, "file_property", [new Place(1), new Place(2)], [new Skeleton(new Cache("var"), [new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_prop_map"), [new Place(1), new Place(3)]), new Skeleton(new Cache("ir_object_keys"), [new Place(3), new Place(4)]), new Skeleton(new Cache("member"), [new Place(5), new Place(4)]), new Skeleton(new Cache("ir_object_current"), [new Place(3), new Place(5), new Place(6)]), new Skeleton(new Cache("=.."), [new Place(2), new Skeleton(".", [new Place(5), new Skeleton(".", [new Place(6), "[]"])])])], 0));
add(new Clause(7, "file_property", [new Place(1), new Place(2)], [new Skeleton(new Cache("=.."), [new Place(2), new Skeleton(".", [new Place(3), new Skeleton(".", [new Place(4), "[]"])])]), new Skeleton(new Cache("sys_prop_map"), [new Place(1), new Place(5)]), new Skeleton(new Cache("ir_object_current"), [new Place(5), new Place(3), new Place(6)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(4), new Place(6)])], 0));
add(new Clause(2, "file_property", [undefined, new Place(0)], [new Skeleton(new Cache("=.."), [new Place(0), new Skeleton(".", [new Place(1), new Skeleton(".", [undefined, "[]"])])]), new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["prolog_flag", new Place(1)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_prop_map", 2])], -1));
add(new Clause(3, "sys_prop_map", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_net_request"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_prop_http"), [new Place(1), new Place(2)])], 0));
add(new Clause(2, "sys_prop_map", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_prop_file"), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_prop_file", 2])], -1));
add(new Clause(4, "sys_prop_file", [new Place(1), new Place(2)], [new Frozen(new Cache("current_prolog_flag"), ["prop_async", "on"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("os_prop_promise"), [new Place(1), new Place(2), new Place(3)]), new Skeleton(new Cache("$YIELD"), [new Place(3)])], 0));
add(new Clause(2, "sys_prop_file", [new Place(0), new Place(1)], [new Skeleton(new Cache("os_prop_sync"), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_prop_http", 2])], -1));
add(new Clause(4, "sys_prop_http", [new Place(1), new Place(2)], [new Frozen(new Cache("current_prolog_flag"), ["prop_async", "on"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("net_prop_promise"), [new Place(1), new Place(2), new Place(3)]), new Skeleton(new Cache("$YIELD"), [new Place(3)])], 0));
add(new Clause(2, "sys_prop_http", [new Place(0), new Place(1)], [new Skeleton(new Cache("net_prop_sync"), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["set_file_property", 2])], -1));
add(new Clause(3, "set_file_property", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_net_request"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("net_cntrl_sync"), [new Place(1), new Place(2)])], 0));
add(new Clause(2, "set_file_property", [new Place(0), new Place(1)], [new Skeleton(new Cache("os_cntrl_sync"), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["file_directory_name", 2])], -1));
add(new Clause(6, "file_directory_name", [new Place(0), new Place(1)], [new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2)], [new Skeleton(new Cache("last_sub_atom"), [new Place(1), new Place(2), undefined, undefined, "\/"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(1, "", [undefined, new Place(0)], [new Skeleton(new Cache("="), [new Place(0), -1])], -1)]), [new Place(0), new Place(2)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2)], [new Skeleton(new Cache("last_sub_atom"), [new Place(1), new Place(2), undefined, undefined, "\\"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(1, "", [undefined, new Place(0)], [new Skeleton(new Cache("="), [new Place(0), -1])], -1)]), [new Place(0), new Place(3)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("max"), [new Place(2), new Place(3)])]), new Skeleton(new Cache("is"), [new Place(5), new Skeleton(new Cache("+"), [new Place(4), 1])]), new Skeleton(new Cache("sub_atom"), [new Place(0), 0, new Place(5), undefined, new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["file_base_name", 2])], -1));
add(new Clause(6, "file_base_name", [new Place(0), new Place(1)], [new Skeleton(new Cache("atom_length"), [new Place(0), new Place(2)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2), undefined], [new Skeleton(new Cache("last_sub_atom"), [new Place(1), undefined, undefined, new Place(2), "\/"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(2, "", [undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1)]), [new Place(0), new Place(3), new Place(2)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2), undefined], [new Skeleton(new Cache("last_sub_atom"), [new Place(1), undefined, undefined, new Place(2), "\\"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(2, "", [undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1)]), [new Place(0), new Place(4), new Place(2)]), new Skeleton(new Cache("is"), [new Place(5), new Skeleton(new Cache("min"), [new Place(3), new Place(4)])]), new Skeleton(new Cache("sub_atom"), [new Place(0), undefined, new Place(5), 0, new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["absolute_file_name", 2])], -1));
add(new Clause(2, "absolute_file_name", [new Place(0), new Place(1)], [new Skeleton(new Cache("absolute_file_name"), [new Place(0), new Place(1), "[]"])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["absolute_file_name", 3])], -1));
add(new Clause(7, "absolute_file_name", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("current_prolog_flag"), ["base_url", new Place(3)]), new Skeleton(new Cache("sys_absolute_opts"), [new Place(2), new Skeleton("v", ["", new Place(3)]), new Skeleton("v", [new Place(4), new Place(5)])]), new Skeleton(new Cache("sys_file_complete"), [new Place(4), new Place(0), new Place(6)]), new Skeleton(new Cache("sys_file_combine"), [new Place(5), new Place(6), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_absolute_opts", 3])], -1));
add(new Clause(1, "sys_absolute_opts", [new Place(0), undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(6, "sys_absolute_opts", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_absolute_opt"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_absolute_opts"), [new Place(2), new Place(5), new Place(4)])], 0));
add(new Clause(2, "sys_absolute_opts", ["[]", new Place(1), new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_absolute_opts", [new Place(0), undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["list", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_absolute_opt", 3])], -1));
add(new Clause(1, "sys_absolute_opt", [new Place(0), undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(3, "sys_absolute_opt", [new Skeleton("relative_to", [new Place(1)]), new Skeleton("v", [new Place(2), undefined]), new Skeleton("v", [new Place(2), new Place(1)])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_absolute_opt", [new Skeleton("extension", [new Place(1)]), new Skeleton("v", [undefined, new Place(2)]), new Skeleton("v", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_absolute_opt", [new Place(0), undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["absolute_option", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_file_complete", 3])], -1));
add(new Clause(2, "sys_file_complete", ["", new Place(1), new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_file_complete", [undefined, new Place(1), new Place(1)], [new Skeleton(new Cache("file_base_name"), [new Place(1), new Place(2)]), new Skeleton(new Cache("sub_atom"), [new Place(2), undefined, undefined, undefined, "."]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_file_complete", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("atom_concat"), [new Place(1), new Place(0), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_file_combine", 3])], -1));
add(new Clause(3, "sys_file_combine", [undefined, new Place(1), new Place(2)], [new Skeleton(new Cache("is_absolute_file_name"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(7, "sys_file_combine", [new Place(1), new Place(2), new Place(3)], [new Skeleton(make_defined([new Clause(1, "", [new Place(0)], [new Skeleton(new Cache("sub_atom"), [new Place(0), 0, undefined, undefined, "..\/"])], -1), new Clause(1, "", [new Place(0)], [new Skeleton(new Cache("sub_atom"), [new Place(0), 0, undefined, undefined, "..\\"])], -1)]), [new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sub_atom"), [new Place(2), 3, undefined, 0, new Place(4)]), new Skeleton(new Cache("file_directory_name"), [new Place(1), new Place(5)]), new Skeleton(new Cache("sub_atom"), [new Place(5), 0, undefined, 1, new Place(6)]), new Skeleton(new Cache("sys_file_combine"), [new Place(6), new Place(4), new Place(3)])], 0));
add(new Clause(4, "sys_file_combine", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("file_directory_name"), [new Place(0), new Place(3)]), new Skeleton(new Cache("atom_concat"), [new Place(3), new Place(1), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["is_absolute_file_name", 1])], -1));
add(new Clause(5, "is_absolute_file_name", [new Place(0)], [new Skeleton(new Cache("atom_length"), [new Place(0), new Place(1)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2), undefined], [new Skeleton(new Cache("sub_atom"), [new Place(1), new Place(2), undefined, undefined, "\/"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(2, "", [undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1)]), [new Place(0), new Place(2), new Place(1)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2), undefined], [new Skeleton(new Cache("sub_atom"), [new Place(1), new Place(2), undefined, undefined, "\\"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(2, "", [undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1)]), [new Place(0), new Place(3), new Place(1)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("min"), [new Place(2), new Place(3)])]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2), undefined], [new Skeleton(new Cache("=="), [new Place(1), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("<"), [new Place(1), new Place(2)])], 0), new Clause(4, "", [new Place(1), undefined, new Place(2)], [new Skeleton(new Cache("sub_atom"), [new Place(2), new Place(3), undefined, undefined, ":"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("<"), [new Place(3), new Place(1)])], 0)]), [new Place(4), new Place(1), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_file_relative", 2])], -1));
add(new Clause(1, "sys_file_relative", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(3, "sys_file_relative", [new Skeleton("library", [new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_file_compound"), [new Place(1), "liblet", ".p", new Place(2)])], 0));
add(new Clause(4, "sys_file_relative", [new Skeleton("foreign", [new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("current_prolog_flag"), ["foreign_ext", new Place(3)]), new Skeleton(new Cache("sys_file_compound"), [new Place(1), "doglet", new Place(3), new Place(2)])], 0));
add(new Clause(4, "sys_file_relative", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_file_including"), [new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("absolute_file_name"), [new Place(1), new Place(2), new Skeleton(".", [new Skeleton("relative_to", [new Place(3)]), new Frozen(".", [new Frozen("extension", [".p"]), "[]"])])])], 0));
add(new Clause(2, "sys_file_relative", [new Place(0), new Place(1)], [new Skeleton(new Cache("absolute_file_name"), [new Place(0), new Place(1), new Frozen(".", [new Frozen("extension", [".p"]), "[]"])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_file_compound", 4])], -1));
add(new Clause(7, "sys_file_compound", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_file_struct"), [new Place(0), new Place(4)]), new Skeleton(new Cache("atom_join"), [new Skeleton(".", [new Place(1), new Skeleton(".", ["\/", new Skeleton(".", [new Place(4), new Skeleton(".", [new Place(2), "[]"])])])]), new Place(5)]), new Skeleton(new Cache("current_prolog_flag"), ["system_url", new Place(6)]), new Skeleton(new Cache("sys_file_combine"), [new Place(6), new Place(5), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_file_including", 1])], -1));
add(new Clause(3, "sys_file_including", [new Place(1)], [new Skeleton(new Cache("current_task"), [new Place(2)]), new Skeleton(new Cache("sys_including"), [new Place(1), new Place(2), undefined]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("\\=="), [new Place(1), "user"])], 0));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_file_struct", 2])], -1));
add(new Clause(1, "sys_file_struct", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(5, "sys_file_struct", [new Skeleton("\/", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_file_struct"), [new Place(1), new Place(4)]), new Skeleton(new Cache("atom_join"), [new Skeleton(".", [new Place(4), new Skeleton(".", ["\/", new Skeleton(".", [new Place(2), "[]"])])]), new Place(3)])], 0));
add(new Clause(3, "sys_file_struct", [new Place(1), new Place(2)], [new Skeleton(new Cache("atom"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(1, "sys_file_struct", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["atom", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_multifile_safe"), ["strings", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["strings", 3])], -1));
add(new Clause(0, "strings", ["exception.unknown", "de", "Ausnahme unbekannt: ~q"], [], -1));
add(new Clause(0, "strings", ["exception.error", "de", "Fehler: "], [], -1));
add(new Clause(0, "strings", ["exception.warning", "de", "Warnung: "], [], -1));
add(new Clause(0, "strings", ["exception.template", "de", "Vorlage unbekannt: ~q"], [], -1));
add(new Clause(0, "strings", ["exception.context", "de", "    Kontext unbekannt: ~q"], [], -1));
add(new Clause(0, "strings", ["frame.text", "de", "~w"], [], -1));
add(new Clause(0, "strings", ["frame.offset", "de", "~t~*|^"], [], -1));
add(new Clause(0, "strings", ["frame.including", "de", "    ~q auf ~q"], [], -1));
add(new Clause(0, "strings", ["command.runtime", "de", "Benutzung: opt_1 .. opt_m [text arg_1 .. arg_n]\nFalls kein text spezifiziert ist, wird Banner gezeigt und dann\nTop-Level ausgeführt, andernfalls wird text ausgeführt.\n-h                   Diesen Hilfetext anzeigen und Vorgang beenden"], [], -1));
add(new Clause(0, "strings", ["system_error.option_command", "de", "Ungültige Befehlzeilenoption, -h für weitere Informationen."], [], -1));
add(new Clause(0, "strings", ["exception.unknown", "", "Unknown exception: ~q"], [], -1));
add(new Clause(0, "strings", ["exception.error", "", "Error: "], [], -1));
add(new Clause(0, "strings", ["exception.warning", "", "Warning: "], [], -1));
add(new Clause(0, "strings", ["exception.template", "", "Unknown template: ~q"], [], -1));
add(new Clause(0, "strings", ["exception.context", "", "    Unknown context: ~q"], [], -1));
add(new Clause(0, "strings", ["frame.text", "", "~w"], [], -1));
add(new Clause(0, "strings", ["frame.offset", "", "~t~*|^"], [], -1));
add(new Clause(0, "strings", ["frame.including", "", "    ~q at ~q"], [], -1));
add(new Clause(0, "strings", ["command.runtime", "", "Usage: opt_1 ... opt_m [text arg_1 ... arg_n]\nIf no text is specified, banner is shown and then top-level\nis executed, otherwise text is executed.\n-h                   Display this help and exit."], [], -1));
add(new Clause(0, "strings", ["system_error.option_command", "", "Invalid command line option, -h for more information."], [], -1));
add(new Clause(0, "strings", ["evaluation_error.float_overflow", "de", "Die Funktion überschreitet hier den Gleitpunktzahlbereich."], [], -1));
add(new Clause(0, "strings", ["evaluation_error.undefined", "de", "Die Funktion ist hier undefiniert."], [], -1));
add(new Clause(0, "strings", ["evaluation_error.zero_divisor", "de", "Nulldivision."], [], -1));
add(new Clause(0, "strings", ["resource_error.not_supported", "de", "Nicht unterstützte Operation."], [], -1));
add(new Clause(0, "strings", ["resource_error.interrupted_exception", "de", "Unerwartet unterbrochene Operation."], [], -1));
add(new Clause(0, "strings", ["representation_error.int", "de", "Unerlaubte Ganzzahl (nicht zwischen - 2^31 und 2^31-1)."], [], -1));
add(new Clause(0, "strings", ["representation_error.long", "de", "Unerlaubte Ganzzahl (nicht zwischen - 2^63 und 2^63-1)."], [], -1));
add(new Clause(0, "strings", ["representation_error.max_arity", "de", "Unerlaubte Stelligkeit (nicht kleiner oder gleich 2^31-1)."], [], -1));
add(new Clause(0, "strings", ["domain_error.prolog_flag", "de", "Flag erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.not_less_than_zero", "de", "Positiv oder 0 erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.operator_priority", "de", "Operatorlevel (kleiner oder gleich 1200) erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.operator_specifier", "de", "Operatormode (fx, fy, xfx, yfx, xfy, xf, yf) erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.time_format", "de", "Zeitformat erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.atom_option", "de", "Atomoption erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.absolute_option", "de", "Absolutoption erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.atom", "de", "Atom erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.number", "de", "Zahl erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.integer", "de", "Ganzzahl erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.callable", "de", "Argument sollte aufrufbar sein (Atom oder Verbund), gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.atomic", "de", "Argument sollte atomar sein, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.list", "de", "Liste ([] oder [_|_]) erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.evaluable", "de", "Berechenbaren Funktion erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.character", "de", "Zeichen erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.pair", "de", "Paar (_-_) erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.predicate_indicator", "de", "Prädikatindikator (_\/_) erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.maybe", "de", "Option (nothing oder just(_)) erwartet, gefunden ~q."], [], -1));
add(new Clause(0, "strings", ["permission_error.modify.flag", "de", "Kann schreibgeschütztes Flag ~q nicht aktualisieren."], [], -1));
add(new Clause(0, "strings", ["evaluation_error.float_overflow", "", "The function overflows the float range here."], [], -1));
add(new Clause(0, "strings", ["evaluation_error.undefined", "", "The function is undefined here."], [], -1));
add(new Clause(0, "strings", ["evaluation_error.zero_divisor", "", "Division by zero."], [], -1));
add(new Clause(0, "strings", ["resource_error.not_supported", "", "Operation not supported."], [], -1));
add(new Clause(0, "strings", ["resource_error.interrupted_exception", "", "Operation terminated unexpectedly."], [], -1));
add(new Clause(0, "strings", ["representation_error.int", "", "Illegal integer (not between - 2^31 and 2^31-1)."], [], -1));
add(new Clause(0, "strings", ["representation_error.long", "", "Illegal integer (not between - 2^63 and 2^63-1)."], [], -1));
add(new Clause(0, "strings", ["representation_error.max_arity", "", "Illegal arity (not less or equal 2^31-1)."], [], -1));
add(new Clause(0, "strings", ["domain_error.prolog_flag", "", "Flag expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.not_less_than_zero", "", "Positive or 0 expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.operator_priority", "", "Operator level (less or equal 1200) expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.operator_specifier", "", "Operator mode (fx, fy, xfx, yfx, xfy, xf, yf) expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.time_format", "", "Time format expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.atom_option", "", "Atom option expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["domain_error.absolute_option", "", "Absolute option expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.atom", "", "Atom expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.number", "", "Number expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.integer", "", "Integer expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.callable", "", "Argument should be callable (atom or compound), found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.atomic", "", "Argument should be an atomic, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.list", "", "List ([] or [_|_]) expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.evaluable", "", "Evaluable functor expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.character", "", "Character expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.pair", "", "Pair (_-_) expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.predicate_indicator", "", "Predicate indicator (_\/_) expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["type_error.maybe", "", "Maybe (nothing or just(_)) expected, found ~q."], [], -1));
add(new Clause(0, "strings", ["permission_error.modify.flag", "", "Can\'t modify read-only flag ~q."], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_code_class", 2])], -1));
add(new Clause(2, "sys_code_class", [44, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_punct"])], 0));
add(new Clause(2, "sys_code_class", [40, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_punct"])], 0));
add(new Clause(2, "sys_code_class", [41, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_punct"])], 0));
add(new Clause(2, "sys_code_class", [124, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_punct"])], 0));
add(new Clause(2, "sys_code_class", [91, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_punct"])], 0));
add(new Clause(2, "sys_code_class", [93, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_punct"])], 0));
add(new Clause(2, "sys_code_class", [123, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_punct"])], 0));
add(new Clause(2, "sys_code_class", [125, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_punct"])], 0));
add(new Clause(2, "sys_code_class", [59, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_solo"])], 0));
add(new Clause(2, "sys_code_class", [33, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_solo"])], 0));
add(new Clause(2, "sys_code_class", [39, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_solo"])], 0));
add(new Clause(2, "sys_code_class", [96, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_solo"])], 0));
add(new Clause(2, "sys_code_class", [34, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_solo"])], 0));
add(new Clause(2, "sys_code_class", [37, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_solo"])], 0));
add(new Clause(2, "sys_code_class", [8205, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_graphic"])], 0));
add(new Clause(2, "sys_code_class", [65039, new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), "is_graphic"])], 0));
add(new Clause(3, "sys_code_class", [new Place(0), new Place(1)], [new Skeleton(new Cache("code_category"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_type_class"), [new Place(2), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_type_class", 2])], -1));
add(new Clause(0, "sys_type_class", [0, "is_invalid"], [], -1));
add(new Clause(0, "sys_type_class", [1, "is_upper"], [], -1));
add(new Clause(0, "sys_type_class", [2, "is_ident"], [], -1));
add(new Clause(0, "sys_type_class", [3, "is_upper"], [], -1));
add(new Clause(0, "sys_type_class", [4, "is_ident"], [], -1));
add(new Clause(0, "sys_type_class", [5, "is_ident"], [], -1));
add(new Clause(0, "sys_type_class", [6, "is_ident"], [], -1));
add(new Clause(0, "sys_type_class", [7, "is_ident"], [], -1));
add(new Clause(0, "sys_type_class", [8, "is_ident"], [], -1));
add(new Clause(0, "sys_type_class", [9, "is_digit"], [], -1));
add(new Clause(0, "sys_type_class", [10, "is_ident"], [], -1));
add(new Clause(0, "sys_type_class", [11, "is_ident"], [], -1));
add(new Clause(0, "sys_type_class", [12, "is_blank"], [], -1));
add(new Clause(0, "sys_type_class", [13, "is_blank"], [], -1));
add(new Clause(0, "sys_type_class", [14, "is_blank"], [], -1));
add(new Clause(0, "sys_type_class", [15, "is_cntrl"], [], -1));
add(new Clause(0, "sys_type_class", [16, "is_cntrl"], [], -1));
add(new Clause(0, "sys_type_class", [18, "is_invalid"], [], -1));
add(new Clause(0, "sys_type_class", [19, "is_invalid"], [], -1));
add(new Clause(0, "sys_type_class", [20, "is_graphic"], [], -1));
add(new Clause(0, "sys_type_class", [21, "is_solo"], [], -1));
add(new Clause(0, "sys_type_class", [22, "is_solo"], [], -1));
add(new Clause(0, "sys_type_class", [23, "is_score"], [], -1));
add(new Clause(0, "sys_type_class", [24, "is_graphic"], [], -1));
add(new Clause(0, "sys_type_class", [25, "is_graphic"], [], -1));
add(new Clause(0, "sys_type_class", [26, "is_graphic"], [], -1));
add(new Clause(0, "sys_type_class", [27, "is_graphic"], [], -1));
add(new Clause(0, "sys_type_class", [28, "is_graphic"], [], -1));
add(new Clause(0, "sys_type_class", [29, "is_solo"], [], -1));
add(new Clause(0, "sys_type_class", [30, "is_solo"], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_name_class", 1])], -1));
add(new Clause(0, "sys_name_class", ["is_ident"], [], -1));
add(new Clause(0, "sys_name_class", ["is_upper"], [], -1));
add(new Clause(0, "sys_name_class", ["is_score"], [], -1));
add(new Clause(0, "sys_name_class", ["is_digit"], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_white_class", 1])], -1));
add(new Clause(0, "sys_white_class", ["is_blank"], [], -1));
add(new Clause(0, "sys_white_class", ["is_cntrl"], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_token", 3])], -1));
add(new Clause(6, "sys_get_token", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_current_code"), [new Place(3), new Place(1), new Place(4)]), new Skeleton(new Cache("sys_code_class"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_get_class"), [new Place(5), new Place(3), new Place(0), new Place(4), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_class", 5])], -1));
add(new Clause(7, "sys_get_class", ["is_ident", new Place(0), new Skeleton("atom", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_get_name"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("atom_codes"), [new Place(1), new Skeleton(".", [new Place(0), new Place(5)])]), new Skeleton(new Cache("="), [new Place(6), new Place(3)])], -1));
add(new Clause(7, "sys_get_class", ["is_upper", new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_get_name"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_make_variable"), [new Skeleton(".", [new Place(0), new Place(5)]), new Place(1)]), new Skeleton(new Cache("="), [new Place(6), new Place(3)])], -1));
add(new Clause(7, "sys_get_class", ["is_score", new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_get_name"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_make_variable"), [new Skeleton(".", [new Place(0), new Place(5)]), new Place(1)]), new Skeleton(new Cache("="), [new Place(6), new Place(3)])], -1));
add(new Clause(4, "sys_get_class", ["is_digit", new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_get_number"), [new Place(0), new Place(1), new Place(2), new Place(3)])], -1));
add(new Clause(5, "sys_get_class", ["is_punct", new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("char_code"), [new Place(1), new Place(0)]), new Skeleton(new Cache("="), [new Place(4), new Place(3)])], -1));
add(new Clause(5, "sys_get_class", ["is_graphic", new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_get_block_or_symbol"), [new Place(0), new Place(1), new Place(4), new Place(3)])], -1));
add(new Clause(4, "sys_get_class", ["is_solo", new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_get_line_or_solo"), [new Place(0), new Place(1), new Place(2), new Place(3)])], -1));
add(new Clause(4, "sys_get_class", ["is_invalid", new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_get_eof_or_error"), [new Place(0), new Place(1), new Place(2), new Place(3)])], -1));
add(new Clause(4, "sys_get_class", ["is_blank", undefined, new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_next_code"), [new Place(1), new Place(3)]), new Skeleton(new Cache("sys_get_token"), [new Place(0), new Place(3), new Place(2)])], -1));
add(new Clause(4, "sys_get_class", ["is_cntrl", undefined, new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_next_code"), [new Place(1), new Place(3)]), new Skeleton(new Cache("sys_get_token"), [new Place(0), new Place(3), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_eof_or_error", 4])], -1));
add(new Clause(3, "sys_get_eof_or_error", [-1, "end_of_file", new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(2, "sys_get_eof_or_error", [undefined, undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("syntax_error", ["illegal_unicode"]), undefined])]), new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_name", 3])], -1));
add(new Clause(8, "sys_get_name", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_current_code"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_code_class"), [new Place(1), new Place(6)]), new Skeleton(new Cache("sys_name_class"), [new Place(6)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(5), new Place(7)]), new Skeleton(new Cache("sys_get_name"), [new Place(2), new Place(7), new Place(4)])], 0));
add(new Clause(1, "sys_get_name", ["[]", new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_make_variable", 2])], -1));
add(new Clause(2, "sys_make_variable", [new Skeleton(".", [new Place(1), "[]"]), "anon"], [new Skeleton(new Cache("code_category"), [new Place(1), 23]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_make_variable", [new Place(0), new Skeleton("var", [new Place(1)])], [new Skeleton(new Cache("atom_codes"), [new Place(1), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_number", 4])], -1));
add(new Clause(7, "sys_get_number", [48, new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_current_code"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_get_special"), [new Place(5), new Place(1), new Place(6), new Place(3)])], 0));
add(new Clause(5, "sys_get_number", [new Place(0), new Skeleton("decimal", [new Skeleton(".", [new Place(0), new Place(1)])]), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_get_decimal"), [new Place(1), new Place(4), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_special", 4])], -1));
add(new Clause(5, "sys_get_special", [120, new Skeleton("radix", [new Place(1), 16]), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_get_radix"), [new Place(1), "[]", 16, new Place(4), new Place(3)])], 0));
add(new Clause(5, "sys_get_special", [111, new Skeleton("radix", [new Place(1), 8]), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_get_radix"), [new Place(1), "[]", 8, new Place(4), new Place(3)])], 0));
add(new Clause(5, "sys_get_special", [98, new Skeleton("radix", [new Place(1), 2]), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_get_radix"), [new Place(1), "[]", 2, new Place(4), new Place(3)])], 0));
add(new Clause(5, "sys_get_special", [114, new Skeleton("exotic", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_get_name"), [new Place(1), new Place(4), new Place(3)])], 0));
add(new Clause(7, "sys_get_special", [39, new Skeleton("code", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_current_code"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_get_code"), [new Place(5), new Place(1), new Place(6), new Place(3)])], 0));
add(new Clause(3, "sys_get_special", [undefined, new Skeleton("decimal", [new Skeleton(".", [48, new Place(0)])]), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_get_decimal"), [new Place(0), new Place(1), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_decimal", 3])], -1));
add(new Clause(7, "sys_get_decimal", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_current_code"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("code_category"), [new Place(1), 9]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(5), new Place(6)]), new Skeleton(new Cache("sys_get_decimal"), [new Place(2), new Place(6), new Place(4)])], 0));
add(new Clause(8, "sys_get_decimal", [new Skeleton(".", [46, new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_code"), [46, new Place(2), new Place(4)]), new Skeleton(new Cache("sys_at_code"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("code_category"), [new Place(5), 9]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(6), new Place(7)]), new Skeleton(new Cache("sys_get_fraction"), [new Place(1), new Place(7), new Place(3)])], 0));
add(new Clause(9, "sys_get_decimal", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_current_code"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_is_expo"), [new Place(1)]), new Skeleton(new Cache("sys_at_code"), [new Place(6), new Place(5), new Place(7)]), new Skeleton(new Cache("sys_is_sign_digit"), [new Place(6)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(7), new Place(8)]), new Skeleton(new Cache("sys_get_exponent"), [new Place(2), new Place(8), new Place(4)])], 0));
add(new Clause(1, "sys_get_decimal", ["[]", new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_fraction", 3])], -1));
add(new Clause(7, "sys_get_fraction", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_current_code"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("code_category"), [new Place(1), 9]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(5), new Place(6)]), new Skeleton(new Cache("sys_get_fraction"), [new Place(2), new Place(6), new Place(4)])], 0));
add(new Clause(9, "sys_get_fraction", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_current_code"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_is_expo"), [new Place(1)]), new Skeleton(new Cache("sys_at_code"), [new Place(6), new Place(5), new Place(7)]), new Skeleton(new Cache("sys_is_sign_digit"), [new Place(6)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(7), new Place(8)]), new Skeleton(new Cache("sys_get_exponent"), [new Place(2), new Place(8), new Place(4)])], 0));
add(new Clause(1, "sys_get_fraction", ["[]", new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_exponent", 3])], -1));
add(new Clause(7, "sys_get_exponent", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_current_code"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_is_sign"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(5), new Place(6)]), new Skeleton(new Cache("sys_get_rest"), [new Place(2), new Place(6), new Place(4)])], 0));
add(new Clause(3, "sys_get_exponent", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_get_rest"), [new Place(0), new Place(1), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_rest", 3])], -1));
add(new Clause(7, "sys_get_rest", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_current_code"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("code_category"), [new Place(1), 9]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(5), new Place(6)]), new Skeleton(new Cache("sys_get_rest"), [new Place(2), new Place(6), new Place(4)])], 0));
add(new Clause(1, "sys_get_rest", ["[]", new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_is_expo", 1])], -1));
add(new Clause(0, "sys_is_expo", [69], [], -1));
add(new Clause(0, "sys_is_expo", [101], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_is_sign_digit", 1])], -1));
add(new Clause(1, "sys_is_sign_digit", [new Place(0)], [new Skeleton(new Cache("sys_is_sign"), [new Place(0)])], -1));
add(new Clause(1, "sys_is_sign_digit", [new Place(0)], [new Skeleton(new Cache("code_category"), [new Place(0), 9])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_is_sign", 1])], -1));
add(new Clause(0, "sys_is_sign", [45], [], -1));
add(new Clause(0, "sys_is_sign", [43], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_block_or_symbol", 4])], -1));
add(new Clause(7, "sys_get_block_or_symbol", [47, new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_code"), [42, new Place(2), new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(4), new Place(5)]), new Skeleton(new Cache("sys_skip_block"), [new Place(5), new Place(6)]), new Skeleton(new Cache("sys_get_token"), [new Place(1), new Place(6), new Place(3)])], 0));
add(new Clause(8, "sys_get_block_or_symbol", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_get_symbol"), [new Place(4), new Place(2), new Place(5)]), new Skeleton(new Cache("sys_current_code"), [new Place(6), new Place(5), new Place(7)]), new Skeleton(new Cache("sys_make_period"), [new Place(6), new Skeleton(".", [new Place(0), new Place(4)]), new Place(1)]), new Skeleton(new Cache("="), [new Place(7), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_symbol", 3])], -1));
add(new Clause(7, "sys_get_symbol", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_current_code"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_code_class"), [new Place(1), "is_graphic"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(5), new Place(6)]), new Skeleton(new Cache("sys_get_symbol"), [new Place(2), new Place(6), new Place(4)])], 0));
add(new Clause(1, "sys_get_symbol", ["[]", new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_skip_block", 2])], -1));
add(new Clause(5, "sys_skip_block", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_current_code"), [42, new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(3), new Place(4)]), new Skeleton(new Cache("sys_skip_end"), [new Place(4), new Place(2)])], 0));
add(new Clause(3, "sys_skip_block", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_current_code"), [-1, new Place(0), new Place(2)]), new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("syntax_error", ["end_of_file_in_block_comment"]), undefined])]), new Skeleton(new Cache("="), [new Place(2), new Place(1)])], -1));
add(new Clause(3, "sys_skip_block", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_next_code"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_skip_block"), [new Place(2), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_skip_end", 2])], -1));
add(new Clause(4, "sys_skip_end", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_current_code"), [47, new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(3), new Place(2)])], 0));
add(new Clause(2, "sys_skip_end", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_skip_block"), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_make_period", 3])], -1));
add(new Clause(1, "sys_make_period", [37, new Frozen(".", [46, "[]"]), "."], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_make_period", [-1, new Frozen(".", [46, "[]"]), "."], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_make_period", [new Place(1), new Frozen(".", [46, "[]"]), "."], [new Skeleton(new Cache("sys_code_class"), [new Place(1), new Place(2)]), new Skeleton(new Cache("sys_white_class"), [new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_make_period", [undefined, new Place(0), new Skeleton("atom", [new Place(1)])], [new Skeleton(new Cache("atom_codes"), [new Place(1), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_line_or_solo", 4])], -1));
add(new Clause(7, "sys_get_line_or_solo", [39, new Skeleton("single", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_current_code"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_get_quote"), [new Place(5), new Place(1), 39, new Place(6), new Place(3)])], 0));
add(new Clause(7, "sys_get_line_or_solo", [34, new Skeleton("codes", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_current_code"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_get_quote"), [new Place(5), new Place(1), 34, new Place(6), new Place(3)])], 0));
add(new Clause(7, "sys_get_line_or_solo", [96, new Skeleton("back", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_current_code"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_get_quote"), [new Place(5), new Place(1), 96, new Place(6), new Place(3)])], 0));
add(new Clause(8, "sys_get_line_or_solo", [37, new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_current_code"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_skip_line"), [new Place(5), new Place(6), new Place(7)]), new Skeleton(new Cache("sys_get_token"), [new Place(1), new Place(7), new Place(3)])], 0));
add(new Clause(5, "sys_get_line_or_solo", [new Place(0), new Skeleton("atom", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("char_code"), [new Place(1), new Place(0)]), new Skeleton(new Cache("="), [new Place(4), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_skip_line", 3])], -1));
add(new Clause(3, "sys_skip_line", [10, new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_skip_line", [13, new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_skip_line", [-1, new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(5, "sys_skip_line", [undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("sys_next_code"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_current_code"), [new Place(3), new Place(2), new Place(4)]), new Skeleton(new Cache("sys_skip_line"), [new Place(3), new Place(4), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_quote", 5])], -1));
add(new Clause(8, "sys_get_quote", [new Place(1), new Place(2), new Place(1), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_current_code"), [new Place(6), new Place(5), new Place(7)]), new Skeleton(new Cache("sys_get_more"), [new Place(6), new Place(2), new Place(1), new Place(7), new Place(4)])], 0));
add(new Clause(8, "sys_get_quote", [92, new Skeleton(".", [92, new Place(1)]), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_current_code"), [new Place(6), new Place(5), new Place(7)]), new Skeleton(new Cache("sys_get_cont"), [new Place(6), new Place(1), new Place(2), new Place(7), new Place(4)])], 0));
add(new Clause(3, "sys_get_quote", [10, new Frozen(".", [-1, "[]"]), undefined, new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_get_quote", [13, new Frozen(".", [-1, "[]"]), undefined, new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_get_quote", [-1, new Frozen(".", [-1, "[]"]), undefined, new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(8, "sys_get_quote", [new Place(0), new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_next_code"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_current_code"), [new Place(6), new Place(5), new Place(7)]), new Skeleton(new Cache("sys_get_quote"), [new Place(6), new Place(1), new Place(2), new Place(7), new Place(4)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_more", 5])], -1));
add(new Clause(8, "sys_get_more", [new Place(1), new Skeleton(".", [new Place(1), new Skeleton(".", [new Place(1), new Place(2)])]), new Place(1), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_current_code"), [new Place(6), new Place(5), new Place(7)]), new Skeleton(new Cache("sys_get_quote"), [new Place(6), new Place(2), new Place(1), new Place(7), new Place(4)])], 0));
add(new Clause(1, "sys_get_more", [undefined, "[]", undefined, new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_code", 4])], -1));
add(new Clause(5, "sys_get_code", [39, new Skeleton(".", [39, new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_get_double"), [new Place(1), new Place(4), new Place(3)])], 0));
add(new Clause(7, "sys_get_code", [92, new Skeleton(".", [92, new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_current_code"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_get_escape"), [new Place(5), new Place(1), "[]", new Place(6), new Place(3)])], 0));
add(new Clause(3, "sys_get_code", [10, new Frozen(".", [-1, "[]"]), new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_get_code", [13, new Frozen(".", [-1, "[]"]), new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_get_code", [-1, new Frozen(".", [-1, "[]"]), new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_get_code", [new Place(0), new Skeleton(".", [new Place(0), "[]"]), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_next_code"), [new Place(1), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_double", 3])], -1));
add(new Clause(4, "sys_get_double", [new Frozen(".", [39, "[]"]), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_current_code"), [39, new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(3), new Place(2)])], 0));
add(new Clause(1, "sys_get_double", ["[]", new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_cont", 5])], -1));
add(new Clause(8, "sys_get_cont", [10, new Skeleton(".", [10, new Place(1)]), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_current_code"), [new Place(6), new Place(5), new Place(7)]), new Skeleton(new Cache("sys_get_quote"), [new Place(6), new Place(1), new Place(2), new Place(7), new Place(4)])], 0));
add(new Clause(10, "sys_get_cont", [13, new Skeleton(".", [13, new Place(1)]), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_get_skip"), [new Place(1), new Place(6), new Place(5), new Place(7)]), new Skeleton(new Cache("sys_current_code"), [new Place(8), new Place(7), new Place(9)]), new Skeleton(new Cache("sys_get_quote"), [new Place(8), new Place(6), new Place(2), new Place(9), new Place(4)])], 0));
add(new Clause(9, "sys_get_cont", [new Place(0), new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_get_escape"), [new Place(0), new Place(1), new Place(5), new Place(3), new Place(6)]), new Skeleton(new Cache("sys_current_code"), [new Place(7), new Place(6), new Place(8)]), new Skeleton(new Cache("sys_get_quote"), [new Place(7), new Place(5), new Place(2), new Place(8), new Place(4)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_skip", 4])], -1));
add(new Clause(5, "sys_get_skip", [new Skeleton(".", [10, new Place(1)]), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_code"), [10, new Place(2), new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(4), new Place(3)])], 0));
add(new Clause(2, "sys_get_skip", [new Place(0), new Place(0), new Place(1), new Place(1)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_escape", 5])], -1));
add(new Clause(8, "sys_get_escape", [120, new Skeleton(".", [120, new Place(1)]), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_get_radix"), [new Place(1), new Place(6), 16, new Place(5), new Place(7)]), new Skeleton(new Cache("sys_get_backslash"), [new Place(6), new Place(2), new Place(7), new Place(4)])], 0));
add(new Clause(9, "sys_get_escape", [new Place(1), new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("sys_is_radix"), [new Place(1), 8]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(4), new Place(6)]), new Skeleton(new Cache("sys_get_radix"), [new Place(2), new Place(7), 8, new Place(6), new Place(8)]), new Skeleton(new Cache("sys_get_backslash"), [new Place(7), new Place(3), new Place(8), new Place(5)])], 0));
add(new Clause(4, "sys_get_escape", [10, new Skeleton(".", [-1, new Place(1)]), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_get_escape", [13, new Skeleton(".", [-1, new Place(1)]), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_get_escape", [-1, new Skeleton(".", [-1, new Place(1)]), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_get_escape", [new Place(0), new Skeleton(".", [new Place(0), new Place(1)]), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_next_code"), [new Place(2), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_backslash", 4])], -1));
add(new Clause(5, "sys_get_backslash", [new Skeleton(".", [92, new Place(1)]), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_code"), [92, new Place(2), new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(4), new Place(3)])], 0));
add(new Clause(2, "sys_get_backslash", [new Place(0), new Place(0), new Place(1), new Place(1)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_get_radix", 5])], -1));
add(new Clause(9, "sys_get_radix", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4), new Place(5), new Place(6)], [new Skeleton(new Cache("sys_current_code"), [new Place(1), new Place(5), new Place(7)]), new Skeleton(new Cache("sys_is_radix"), [new Place(1), new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_code"), [new Place(7), new Place(8)]), new Skeleton(new Cache("sys_get_radix"), [new Place(2), new Place(3), new Place(4), new Place(8), new Place(6)])], 0));
add(new Clause(2, "sys_get_radix", [new Place(0), new Place(0), undefined, new Place(1), new Place(1)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_is_radix", 2])], -1));
add(new Clause(3, "sys_is_radix", [new Place(0), new Place(1)], [new Skeleton(new Cache("code_numeric"), [new Place(0), new Place(2)]), new Skeleton(new Cache("=<"), [0, new Place(2)]), new Skeleton(new Cache("<"), [new Place(2), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_is_meta", 1])], -1));
add(new Clause(0, "sys_is_meta", [39], [], -1));
add(new Clause(0, "sys_is_meta", [96], [], -1));
add(new Clause(0, "sys_is_meta", [34], [], -1));
add(new Clause(0, "sys_is_meta", [92], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_is_escape", 2])], -1));
add(new Clause(0, "sys_is_escape", [110, 10], [], -1));
add(new Clause(0, "sys_is_escape", [116, 9], [], -1));
add(new Clause(0, "sys_is_escape", [98, 8], [], -1));
add(new Clause(0, "sys_is_escape", [102, 12], [], -1));
add(new Clause(0, "sys_is_escape", [114, 13], [], -1));
add(new Clause(0, "sys_is_escape", [97, 7], [], -1));
add(new Clause(0, "sys_is_escape", [118, 11], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_current_code", 3])], -1));
add(new Clause(2, "sys_current_code", [new Place(0), new Skeleton("-", [new Place(1), new Place(0)]), new Skeleton("-", [new Place(1), new Place(0)])], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_next_code", 2])], -1));
add(new Clause(2, "sys_next_code", [new Skeleton("-", [new Place(0), undefined]), new Skeleton("-", [new Place(0), new Place(1)])], [new Skeleton(new Cache("get_code"), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_at_code", 3])], -1));
add(new Clause(3, "sys_at_code", [new Place(0), new Skeleton("-", [new Place(1), new Place(2)]), new Skeleton("-", [new Place(1), new Place(2)])], [new Skeleton(new Cache("peek_code"), [new Place(1), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_safe_space", 3])], -1));
add(new Clause(8, "sys_safe_space", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sub_atom"), [new Place(2), 0, 1, undefined, new Place(4)]), new Skeleton(new Cache("char_code"), [new Place(4), new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("ir_object_current"), [new Place(1), "last", new Place(6)]), new Skeleton(new Cache("sys_code_class"), [new Place(6), new Place(7)]), new Skeleton(new Cache("sys_safe_cases"), [new Place(7), new Place(1), new Place(6), new Place(5), new Place(3)])], 0));
add(new Clause(0, "sys_safe_space", [undefined, undefined, undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_safe_cases", 5])], -1));
add(new Clause(5, "sys_safe_cases", [new Place(1), new Place(2), new Place(3), new Place(4), undefined], [new Skeleton(new Cache("sys_name_class"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_safe_name"), [new Place(2), new Place(3), new Place(4)])], 0));
add(new Clause(5, "sys_safe_cases", ["is_graphic", new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_safe_symbol"), [new Place(1), new Place(2), new Place(3), new Place(4)])], 0));
add(new Clause(3, "sys_safe_cases", ["is_solo", new Place(1), new Place(2), new Place(2), undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_safe_quote"), [new Place(1), new Place(2)])], 0));
add(new Clause(0, "sys_safe_cases", [undefined, undefined, undefined, undefined, undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_safe_name", 3])], -1));
add(new Clause(4, "sys_safe_name", [new Place(1), undefined, new Place(2)], [new Skeleton(new Cache("sys_code_class"), [new Place(2), new Place(3)]), new Skeleton(new Cache("sys_name_class"), [new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), " "])], 0));
add(new Clause(2, "sys_safe_name", [new Place(1), 48, 39], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), " "])], 0));
add(new Clause(0, "sys_safe_name", [undefined, undefined, undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_safe_symbol", 4])], -1));
add(new Clause(3, "sys_safe_symbol", [new Place(1), undefined, new Place(2), undefined], [new Skeleton(new Cache("sys_code_class"), [new Place(2), "is_graphic"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), " "])], 0));
add(new Clause(4, "sys_safe_symbol", [new Place(1), 45, new Place(2), new Place(3)], [new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(3), 4]), 0]), new Skeleton(new Cache("code_category"), [new Place(2), 9]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), " "])], 0));
add(new Clause(0, "sys_safe_symbol", [undefined, undefined, undefined, undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_safe_quote", 2])], -1));
add(new Clause(2, "sys_safe_quote", [new Place(1), 39], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), " "])], 0));
add(new Clause(2, "sys_safe_quote", [new Place(1), 96], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), " "])], 0));
add(new Clause(2, "sys_safe_quote", [new Place(1), 34], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), " "])], 0));
add(new Clause(0, "sys_safe_quote", [undefined, undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_print_atom", 3])], -1));
add(new Clause(5, "sys_print_atom", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(3), 16]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("open_input_atom_stream"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_fancy_stream"), [new Place(4), new Place(1), ""])], 0));
add(new Clause(2, "sys_print_atom", [new Place(0), new Place(1), undefined], [new Skeleton(new Cache("put_atom"), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_convert_token", 2])], -1));
add(new Clause(4, "sys_convert_token", [new Skeleton("single", [new Place(1)]), new Skeleton("atom", [new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_convert_quote"), [new Place(3), 39, new Place(1), "[]"]), new Skeleton(new Cache("atom_codes"), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_convert_token", [new Skeleton("back", [new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_convert_quote"), [new Place(3), 96, new Place(1), "[]"]), new Skeleton(new Cache("sys_make_variable"), [new Place(3), new Place(2)])], 0));
add(new Clause(4, "sys_convert_token", [new Skeleton("decimal", [new Place(1)]), new Skeleton("const", [new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_codes"), [new Place(3), new Place(1)]), new Skeleton(new Cache("atom_number"), [new Place(3), new Place(2)])], 0));
add(new Clause(5, "sys_convert_token", [new Skeleton("radix", [new Place(1), new Place(2)]), new Skeleton("const", [new Place(3)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_codes"), [new Place(4), new Place(1)]), new Skeleton(new Cache("atom_integer"), [new Place(4), new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_convert_token", [new Skeleton("exotic", [new Place(1)]), new Skeleton("const", [new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_codes"), [new Place(3), new Place(1)]), new Skeleton(new Cache("sys_convert_exotic"), [new Place(3), new Place(2)])], 0));
add(new Clause(3, "sys_convert_token", [new Skeleton("codes", [new Place(1)]), new Skeleton("const", [new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_convert_quote"), [new Place(2), 34, new Place(1), "[]"])], 0));
add(new Clause(3, "sys_convert_token", [new Skeleton("code", [new Place(1)]), new Skeleton("const", [new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_convert_code"), [new Place(2), new Place(1), "[]"])], 0));
add(new Clause(1, "sys_convert_token", [new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_convert_quote", 4])], -1));
add(new Clause(6, "sys_convert_quote", [new Place(1), new Place(2), new Skeleton(".", [92, new Place(3)]), new Place(4)], [new Skeleton(new Cache("sys_convert_sep"), [new Place(3), new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_convert_quote"), [new Place(1), new Place(2), new Place(5), new Place(4)])], 0));
add(new Clause(5, "sys_convert_quote", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(1), new Skeleton(".", [new Place(1), new Skeleton(".", [new Place(1), new Place(3)])]), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_convert_quote"), [new Place(2), new Place(1), new Place(3), new Place(4)])], 0));
add(new Clause(2, "sys_convert_quote", [undefined, undefined, new Skeleton(".", [-1, new Place(0)]), new Place(1)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("syntax_error", ["unbalanced_quoted"]), undefined])]), new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1));
add(new Clause(9, "sys_convert_quote", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Skeleton(".", [new Place(4), new Place(5)]), new Place(6)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_code_class"), [new Place(4), new Place(7)]), new Skeleton(new Cache("sys_convert_char"), [new Place(7), new Place(4), new Place(1), new Place(5), new Place(8)]), new Skeleton(new Cache("sys_convert_quote"), [new Place(2), new Place(3), new Place(8), new Place(6)])], 0));
add(new Clause(1, "sys_convert_quote", ["[]", undefined, new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_convert_sep", 2])], -1));
add(new Clause(1, "sys_convert_sep", [new Skeleton(".", [13, new Skeleton(".", [10, new Place(0)])]), new Place(0)], [], -1));
add(new Clause(1, "sys_convert_sep", [new Skeleton(".", [10, new Place(0)]), new Place(0)], [], -1));
add(new Clause(1, "sys_convert_sep", [new Skeleton(".", [13, new Place(0)]), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_convert_code", 3])], -1));
add(new Clause(3, "sys_convert_code", [39, new Skeleton(".", [39, new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_convert_double"), [new Place(1), new Place(2)])], 0));
add(new Clause(2, "sys_convert_code", [undefined, new Skeleton(".", [-1, new Place(0)]), new Place(1)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("syntax_error", ["missing_char"]), undefined])]), new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1));
add(new Clause(5, "sys_convert_code", [new Place(0), new Skeleton(".", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("sys_code_class"), [new Place(1), new Place(4)]), new Skeleton(new Cache("sys_convert_char"), [new Place(4), new Place(1), new Place(0), new Place(2), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_convert_double", 2])], -1));
add(new Clause(3, "sys_convert_double", [new Skeleton(".", [39, new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(2, "sys_convert_double", [new Place(0), new Place(1)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("syntax_error", ["doubling_missing"]), undefined])]), new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_convert_exotic", 2])], -1));
add(new Clause(3, "sys_convert_exotic", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_atom_exotic"), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_convert_exotic", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["exotic", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_atom_exotic", 2])], -1));
add(new Clause(0, "sys_atom_exotic", ["True", true], [], -1));
add(new Clause(0, "sys_atom_exotic", ["False", false], [], -1));
add(new Clause(0, "sys_atom_exotic", ["None", null], [], -1));
add(new Clause(0, "sys_atom_exotic", ["Inf", Infinity], [], -1));
add(new Clause(0, "sys_atom_exotic", ["NaN", NaN], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_convert_char", 5])], -1));
add(new Clause(4, "sys_convert_char", ["is_graphic", 92, new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_convert_escape"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(2, "sys_convert_char", ["is_cntrl", undefined, undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("syntax_error", ["illegal_layout"]), undefined])]), new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1));
add(new Clause(2, "sys_convert_char", ["is_invalid", undefined, undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("syntax_error", ["illegal_unicode"]), undefined])]), new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1));
add(new Clause(2, "sys_convert_char", [undefined, new Place(0), new Place(0), new Place(1), new Place(1)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_convert_escape", 3])], -1));
add(new Clause(5, "sys_convert_escape", [new Place(1), new Skeleton(".", [new Place(2), new Place(3)]), new Place(4)], [new Skeleton(new Cache("sys_is_escape"), [new Place(2), new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), new Place(4)])], 0));
add(new Clause(8, "sys_convert_escape", [new Place(1), new Skeleton(".", [new Place(2), new Place(3)]), new Place(4)], [new Skeleton(new Cache("sys_is_radix"), [new Place(2), 8]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_convert_radix"), [new Place(5), 8, new Place(3), new Place(6)]), new Skeleton(new Cache("atom_codes"), [new Place(7), new Skeleton(".", [new Place(2), new Place(5)])]), new Skeleton(new Cache("atom_integer"), [new Place(7), 8, new Place(1)]), new Skeleton(new Cache("sys_convert_backslash"), [new Place(6), new Place(4)])], 0));
add(new Clause(7, "sys_convert_escape", [new Place(1), new Skeleton(".", [120, new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_convert_radix"), [new Place(4), 16, new Place(2), new Place(5)]), new Skeleton(new Cache("atom_codes"), [new Place(6), new Place(4)]), new Skeleton(new Cache("atom_integer"), [new Place(6), 16, new Place(1)]), new Skeleton(new Cache("sys_convert_backslash"), [new Place(5), new Place(3)])], 0));
add(new Clause(4, "sys_convert_escape", [new Place(1), new Skeleton(".", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("sys_is_meta"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(2, "sys_convert_escape", [undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("syntax_error", ["illegal_escape"]), undefined])]), new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_convert_backslash", 2])], -1));
add(new Clause(3, "sys_convert_backslash", [new Skeleton(".", [92, new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(2, "sys_convert_backslash", [new Place(0), new Place(1)], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Frozen("syntax_error", ["unbalanced_escape"]), undefined])]), new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_convert_radix", 4])], -1));
add(new Clause(6, "sys_convert_radix", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Skeleton(".", [new Place(1), new Place(4)]), new Place(5)], [new Skeleton(new Cache("sys_is_radix"), [new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_convert_radix"), [new Place(2), new Place(3), new Place(4), new Place(5)])], 0));
add(new Clause(1, "sys_convert_radix", ["[]", undefined, new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_stream_opts", 2])], -1));
add(new Clause(1, "sys_stream_opts", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(4, "sys_stream_opts", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_stream_opt"), [new Place(1), new Place(3)]), new Skeleton(new Cache("sys_stream_opts"), [new Place(2), new Place(3)])], 0));
add(new Clause(1, "sys_stream_opts", ["[]", undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_stream_opts", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["list", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_stream_opt", 2])], -1));
add(new Clause(1, "sys_stream_opt", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(4, "sys_stream_opt", [new Skeleton("type", [new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_check_type"), [new Place(1), new Place(3)]), new Skeleton(new Cache("ir_object_set"), [new Place(2), "encoding", new Place(3)])], 0));
add(new Clause(1, "sys_stream_opt", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["open_option", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_check_type", 2])], -1));
add(new Clause(1, "sys_check_type", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(1, "sys_check_type", ["text", "utf8"], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_check_type", ["binary", "latin1"], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_check_type", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["type", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_open_opts", 2])], -1));
add(new Clause(1, "sys_open_opts", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(4, "sys_open_opts", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_open_opt"), [new Place(1), new Place(3)]), new Skeleton(new Cache("sys_open_opts"), [new Place(2), new Place(3)])], 0));
add(new Clause(1, "sys_open_opts", ["[]", undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_open_opts", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["list", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_open_opt", 2])], -1));
add(new Clause(1, "sys_open_opt", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(3, "sys_open_opt", [new Skeleton("method", [new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("must_be"), ["atom", new Place(1)]), new Skeleton(new Cache("ir_object_set"), [new Place(2), "method", new Place(1)])], 0));
add(new Clause(4, "sys_open_opt", [new Skeleton("headers", [new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("ir_object_new"), [new Place(3)]), new Skeleton(new Cache("sys_header_opts"), [new Place(1), new Place(3)]), new Skeleton(new Cache("ir_object_set"), [new Place(2), "headers", new Place(3)])], 0));
add(new Clause(4, "sys_open_opt", [new Skeleton("body", [new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("must_be"), ["atom", new Place(1)]), new Skeleton(new Cache("ir_object_new"), [new Place(3)]), new Skeleton(new Cache("ir_object_set"), [new Place(3), "text", new Place(1)]), new Skeleton(new Cache("ir_object_set"), [new Place(2), "body", new Place(3)])], 0));
add(new Clause(5, "sys_open_opt", [new Skeleton("body", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("must_be"), ["atom", new Place(1)]), new Skeleton(new Cache("ir_object_new"), [new Place(4)]), new Skeleton(new Cache("ir_object_set"), [new Place(4), "text", new Place(1)]), new Skeleton(new Cache("sys_stream_opts"), [new Place(2), new Place(4)]), new Skeleton(new Cache("ir_object_set"), [new Place(3), "body", new Place(4)])], 0));
add(new Clause(4, "sys_open_opt", [new Skeleton("type", [new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_check_type"), [new Place(1), new Place(3)]), new Skeleton(new Cache("ir_object_set"), [new Place(2), "encoding", new Place(3)])], 0));
add(new Clause(1, "sys_open_opt", [new Skeleton("uri", [undefined]), undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_open_opt", [new Skeleton("status", [undefined]), undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_open_opt", [new Skeleton("fields", [undefined]), undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_open_opt", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["open_option", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_header_opts", 2])], -1));
add(new Clause(1, "sys_header_opts", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(4, "sys_header_opts", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_header_opt"), [new Place(1), new Place(3)]), new Skeleton(new Cache("sys_header_opts"), [new Place(2), new Place(3)])], 0));
add(new Clause(1, "sys_header_opts", ["[]", undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_header_opts", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["list", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_header_opt", 2])], -1));
add(new Clause(1, "sys_header_opt", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(4, "sys_header_opt", [new Skeleton("-", [new Place(1), new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("must_be"), ["atom", new Place(1)]), new Skeleton(new Cache("must_be"), ["atom", new Place(2)]), new Skeleton(new Cache("ir_object_set"), [new Place(3), new Place(1), new Place(2)])], 0));
add(new Clause(1, "sys_header_opt", [new Place(0), undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["pair", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_open_results", 2])], -1));
add(new Clause(3, "sys_open_results", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2)], [new Skeleton(new Cache("sys_open_result"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_open_results"), [new Place(1), new Place(2)])], -1));
add(new Clause(0, "sys_open_results", ["[]", undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_open_result", 2])], -1));
add(new Clause(0, "sys_open_result", [new Skeleton("method", [undefined]), undefined], [], -1));
add(new Clause(0, "sys_open_result", [new Skeleton("headers", [undefined]), undefined], [], -1));
add(new Clause(1, "sys_open_result", [new Skeleton("body", [undefined]), undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "sys_open_result", [new Skeleton("body", [undefined, undefined]), undefined], [], -1));
add(new Clause(0, "sys_open_result", [new Skeleton("type", [undefined]), undefined], [], -1));
add(new Clause(2, "sys_open_result", [new Skeleton("uri", [new Place(0)]), new Place(1)], [new Skeleton(new Cache("ir_object_current"), [new Place(1), "uri", new Place(0)])], -1));
add(new Clause(2, "sys_open_result", [new Skeleton("status", [new Place(0)]), new Place(1)], [new Skeleton(new Cache("ir_object_current"), [new Place(1), "status", new Place(0)])], -1));
add(new Clause(3, "sys_open_result", [new Skeleton("fields", [new Place(0)]), new Place(1)], [new Skeleton(new Cache("ir_object_current"), [new Place(1), "fields", new Place(2)]), new Skeleton(new Cache("sys_header_results"), [new Place(2), new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_header_results", 2])], -1));
add(new Clause(3, "sys_header_results", [new Place(0), new Place(1)], [new Skeleton(new Cache("ir_object_keys"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_header_results"), [new Place(2), new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_header_results", 3])], -1));
add(new Clause(0, "sys_header_results", ["[]", undefined, "[]"], [], -1));
add(new Clause(5, "sys_header_results", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Skeleton(".", [new Skeleton("-", [new Place(0), new Place(3)]), new Place(4)])], [new Skeleton(new Cache("ir_object_current"), [new Place(2), new Place(0), new Place(3)]), new Skeleton(new Cache("sys_header_results"), [new Place(1), new Place(2), new Place(4)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_opts", 3])], -1));
add(new Clause(1, "sys_write_opts", [new Place(0), undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(6, "sys_write_opts", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_opt"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_write_opts"), [new Place(2), new Place(5), new Place(4)])], 0));
add(new Clause(2, "sys_write_opts", ["[]", new Place(1), new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_write_opts", [new Place(0), undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["list", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_opt", 3])], -1));
add(new Clause(1, "sys_write_opt", [new Place(0), undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(5, "sys_write_opt", [new Skeleton("variable_names", [new Place(1)]), new Skeleton("h", [undefined, new Place(2), new Place(3), new Place(4)]), new Skeleton("h", [new Place(1), new Place(2), new Place(3), new Place(4)])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(5, "sys_write_opt", [new Skeleton("anonymous", [new Place(1)]), new Skeleton("h", [new Place(2), undefined, new Place(3), new Place(4)]), new Skeleton("h", [new Place(2), new Place(1), new Place(3), new Place(4)])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(7, "sys_write_opt", [new Skeleton("quoted", [new Place(1)]), new Skeleton("h", [new Place(2), new Place(3), new Place(4), new Place(5)]), new Skeleton("h", [new Place(2), new Place(3), new Place(6), new Place(5)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_opt_boolean"), [new Place(1), 1, new Place(4), new Place(6)])], 0));
add(new Clause(7, "sys_write_opt", [new Skeleton("ignore_ops", [new Place(1)]), new Skeleton("h", [new Place(2), new Place(3), new Place(4), new Place(5)]), new Skeleton("h", [new Place(2), new Place(3), new Place(6), new Place(5)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_opt_boolean"), [new Place(1), 2, new Place(4), new Place(6)])], 0));
add(new Clause(7, "sys_write_opt", [new Skeleton("numbervars", [new Place(1)]), new Skeleton("h", [new Place(2), new Place(3), new Place(4), new Place(5)]), new Skeleton("h", [new Place(2), new Place(3), new Place(6), new Place(5)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_opt_boolean"), [new Place(1), 8, new Place(4), new Place(6)])], 0));
add(new Clause(5, "sys_write_opt", [new Skeleton("priority", [new Place(1)]), new Skeleton("h", [new Place(2), new Place(3), new Place(4), undefined]), new Skeleton("h", [new Place(2), new Place(3), new Place(4), new Place(1)])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(7, "sys_write_opt", [new Skeleton("format", [new Place(1)]), new Skeleton("h", [new Place(2), new Place(3), new Place(4), new Place(5)]), new Skeleton("h", [new Place(2), new Place(3), new Place(6), new Place(5)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_opt_boolean"), [new Place(1), 4, new Place(4), new Place(6)])], 0));
add(new Clause(7, "sys_write_opt", [new Skeleton("colorize", [new Place(1)]), new Skeleton("h", [new Place(2), new Place(3), new Place(4), new Place(5)]), new Skeleton("h", [new Place(2), new Place(3), new Place(6), new Place(5)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_opt_boolean"), [new Place(1), 16, new Place(4), new Place(6)])], 0));
add(new Clause(1, "sys_write_opt", [new Place(0), undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["write_option", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_opts", 3])], -1));
add(new Clause(1, "sys_read_opts", [new Place(0), undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(6, "sys_read_opts", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_read_opt"), [new Place(1), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_read_opts"), [new Place(2), new Place(5), new Place(4)])], 0));
add(new Clause(2, "sys_read_opts", ["[]", new Place(1), new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(1, "sys_read_opts", [new Place(0), undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("type_error", ["list", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_opt", 3])], -1));
add(new Clause(1, "sys_read_opt", [new Place(0), undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(2, "sys_read_opt", [new Skeleton("variable_names", [undefined]), new Place(1), new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_read_opt", [new Skeleton("singletons", [undefined]), new Place(1), new Place(1)], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_read_opt", [new Skeleton("priority", [new Place(1)]), new Skeleton("z", [undefined, new Place(2)]), new Skeleton("z", [new Place(1), new Place(2)])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(5, "sys_read_opt", [new Skeleton("end_of_file", [new Place(1)]), new Skeleton("z", [new Place(2), new Place(3)]), new Skeleton("z", [new Place(2), new Place(4)])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_opt_boolean"), [new Place(1), 1, new Place(3), new Place(4)])], 0));
add(new Clause(1, "sys_read_opt", [new Place(0), undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["read_option", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_results", 2])], -1));
add(new Clause(3, "sys_read_results", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2)], [new Skeleton(new Cache("sys_read_result"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_read_results"), [new Place(1), new Place(2)])], -1));
add(new Clause(0, "sys_read_results", ["[]", undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_result", 2])], -1));
add(new Clause(2, "sys_read_result", [new Skeleton("variable_names", [new Place(0)]), new Skeleton("s", [new Place(1), undefined])], [new Skeleton(new Cache("reverse"), [new Place(1), new Place(0)])], -1));
add(new Clause(2, "sys_read_result", [new Skeleton("singletons", [new Place(0)]), new Skeleton("s", [undefined, new Place(1)])], [new Skeleton(new Cache("reverse"), [new Place(1), new Place(0)])], -1));
add(new Clause(0, "sys_read_result", [new Skeleton("priority", [undefined]), undefined], [], -1));
add(new Clause(0, "sys_read_result", [new Skeleton("end_of_file", [undefined]), undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_opt_boolean", 4])], -1));
add(new Clause(1, "sys_opt_boolean", [new Place(0), undefined, undefined, undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(4, "sys_opt_boolean", ["true", new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("\\\/"), [new Place(2), new Place(1)])])], 0));
add(new Clause(4, "sys_opt_boolean", ["false", new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("\/\\"), [new Place(2), new Skeleton(new Cache("\\"), [new Place(1)])])])], 0));
add(new Clause(1, "sys_opt_boolean", [new Place(0), undefined, undefined, undefined], [new Skeleton(new Cache("throw"), [new Skeleton("error", [new Skeleton("domain_error", ["boolean", new Place(0)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_proper_atom", 1])], -1));
add(new Clause(3, "sys_proper_atom", [new Skeleton(".", [new Place(0), new Place(1)])], [new Skeleton(new Cache("sys_code_class"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_proper_atom"), [new Place(2), new Skeleton(".", [new Place(0), new Place(1)])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_proper_atom", 2])], -1));
add(new Clause(1, "sys_proper_atom", ["is_ident", new Skeleton(".", [undefined, new Place(0)])], [new Skeleton(new Cache("sys_proper_atom_name"), [new Place(0)])], -1));
add(new Clause(1, "sys_proper_atom", ["is_graphic", new Frozen(".", [46, "[]"])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0));
add(new Clause(1, "sys_proper_atom", ["is_graphic", new Skeleton(".", [47, new Skeleton(".", [42, undefined])])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0));
add(new Clause(1, "sys_proper_atom", ["is_graphic", new Skeleton(".", [undefined, new Place(0)])], [new Skeleton(new Cache("sys_proper_atom_graphic"), [new Place(0)])], -1));
add(new Clause(1, "sys_proper_atom", ["is_solo", new Frozen(".", [39, "[]"])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0));
add(new Clause(1, "sys_proper_atom", ["is_solo", new Frozen(".", [96, "[]"])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0));
add(new Clause(1, "sys_proper_atom", ["is_solo", new Frozen(".", [34, "[]"])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0));
add(new Clause(1, "sys_proper_atom", ["is_solo", new Frozen(".", [37, "[]"])], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0));
add(new Clause(0, "sys_proper_atom", ["is_solo", new Skeleton(".", [undefined, "[]"])], [], -1));
add(new Clause(1, "sys_proper_atom", ["is_punct", new Frozen(".", [91, new Frozen(".", [93, "[]"])])], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "sys_proper_atom", ["is_punct", new Frozen(".", [123, new Frozen(".", [125, "[]"])])], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_proper_atom_name", 1])], -1));
add(new Clause(4, "sys_proper_atom_name", [new Skeleton(".", [new Place(1), new Place(2)])], [new Skeleton(new Cache("sys_code_class"), [new Place(1), new Place(3)]), new Skeleton(new Cache("sys_name_class"), [new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_proper_atom_name"), [new Place(2)])], 0));
add(new Clause(0, "sys_proper_atom_name", ["[]"], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_proper_atom_graphic", 1])], -1));
add(new Clause(3, "sys_proper_atom_graphic", [new Skeleton(".", [new Place(1), new Place(2)])], [new Skeleton(new Cache("sys_code_class"), [new Place(1), "is_graphic"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_proper_atom_graphic"), [new Place(2)])], 0));
add(new Clause(0, "sys_proper_atom_graphic", ["[]"], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_escape_codes", 3])], -1));
add(new Clause(6, "sys_escape_codes", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_code_class"), [new Place(0), new Place(4)]), new Skeleton(new Cache("sys_escape_code"), [new Place(4), new Place(0), new Place(2), new Place(5)]), new Skeleton(new Cache("sys_escape_codes"), [new Place(1), new Place(5), new Place(3)])], -1));
add(new Clause(1, "sys_escape_codes", ["[]", new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_escape_code", 4])], -1));
add(new Clause(5, "sys_escape_code", ["is_cntrl", new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_is_escape"), [new Place(4), new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Skeleton(".", [92, new Skeleton(".", [new Place(4), new Place(3)])])])], 0));
add(new Clause(4, "sys_escape_code", ["is_cntrl", new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_escape_code2"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_escape_code", ["is_solo", new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_is_meta"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Skeleton(".", [92, new Skeleton(".", [new Place(1), new Place(3)])])])], 0));
add(new Clause(4, "sys_escape_code", ["is_graphic", new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_is_meta"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Skeleton(".", [92, new Skeleton(".", [new Place(1), new Place(3)])])])], 0));
add(new Clause(4, "sys_escape_code", ["is_invalid", new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_escape_code2"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(2, "sys_escape_code", [undefined, new Place(0), new Skeleton(".", [new Place(0), new Place(1)]), new Place(1)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_escape_code2", 3])], -1));
add(new Clause(8, "sys_escape_code2", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("=<"), [new Place(1), 511]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_integer"), [new Place(4), 8, new Place(1)]), new Skeleton(new Cache("atom_codes"), [new Place(4), new Place(5)]), new Skeleton(new Cache("="), [new Place(2), new Skeleton(".", [92, new Place(6)])]), new Skeleton(new Cache("sys_escape_codes2"), [new Place(5), new Place(6), new Place(7)]), new Skeleton(new Cache("="), [new Place(7), new Skeleton(".", [92, new Place(3)])])], 0));
add(new Clause(7, "sys_escape_code2", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("atom_integer"), [new Place(3), 16, new Place(0)]), new Skeleton(new Cache("atom_codes"), [new Place(3), new Place(4)]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(".", [92, new Skeleton(".", [120, new Place(5)])])]), new Skeleton(new Cache("sys_escape_codes2"), [new Place(4), new Place(5), new Place(6)]), new Skeleton(new Cache("="), [new Place(6), new Skeleton(".", [92, new Place(2)])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_escape_codes2", 3])], -1));
add(new Clause(6, "sys_escape_codes2", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), new Skeleton(".", [new Place(1), new Place(5)])]), new Skeleton(new Cache("sys_escape_codes2"), [new Place(2), new Place(5), new Place(4)])], 0));
add(new Clause(1, "sys_escape_codes2", ["[]", new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_numbervars_name", 2])], -1));
add(new Clause(4, "sys_numbervars_name", [new Place(1), new Place(2)], [new Skeleton(new Cache("<"), [new Place(1), 26]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("+"), [new Place(1), 65])]), new Skeleton(new Cache("char_code"), [new Place(2), new Place(3)])], 0));
add(new Clause(6, "sys_numbervars_name", [new Place(0), new Place(1)], [new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("+"), [new Skeleton(new Cache("rem"), [new Place(0), 26]), 65])]), new Skeleton(new Cache("char_code"), [new Place(3), new Place(2)]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("+"), [new Skeleton(new Cache("\/\/"), [new Place(0), 26]), 1])]), new Skeleton(new Cache("atom_integer"), [new Place(5), 10, new Place(4)]), new Skeleton(new Cache("atom_concat"), [new Place(3), new Place(5), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_fill_line", 2])], -1));
add(new Clause(1, "sys_fill_line", [new Place(0), undefined], [new Skeleton(new Cache("var"), [new Place(0)]), new Skeleton(new Cache("throw"), [new Skeleton("error", ["instantiation_error", undefined])])], -1));
add(new Clause(3, "sys_fill_line", [new Skeleton("error", [undefined, new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_fetch_line"), [new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_fill_line", [new Skeleton("warning", [undefined, new Place(1)]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_fetch_line"), [new Place(1), new Place(2)])], 0));
add(new Clause(0, "sys_fill_line", [undefined, undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_fetch_line", 2])], -1));
add(new Clause(11, "sys_fetch_line", [new Place(1), new Place(2)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("ir_object_current"), [new Place(2), "buf", new Place(3)]), new Skeleton(new Cache("ir_object_current"), [new Place(2), "pos", new Place(4)]), new Skeleton(new Cache("ir_atom_offset"), [new Place(3), new Place(5), new Place(4)]), new Skeleton(new Cache("is"), [new Place(6), new Skeleton(new Cache("-"), [new Place(5), 1])]), new Skeleton(new Cache("sys_fetch_start_end"), [new Place(3), new Place(6), new Place(7), new Place(8)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sub_atom"), [new Place(3), new Place(7), undefined, new Place(8), new Place(9)]), new Skeleton(new Cache("is"), [new Place(10), new Skeleton(new Cache("-"), [new Place(6), new Place(7)])]), new Skeleton(new Cache("="), [new Place(1), new Skeleton(".", [new Skeleton("frame", ["text", new Place(9)]), new Skeleton(".", [new Skeleton("frame", ["offset", new Place(10)]), undefined])])])], 0));
add(new Clause(0, "sys_fetch_line", [undefined, undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_fetch_start_end", 4])], -1));
add(new Clause(10, "sys_fetch_start_end", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sub_atom"), [new Place(0), 0, new Place(1), undefined, new Place(4)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2)], [new Skeleton(new Cache("last_sub_atom"), [new Place(1), new Place(2), undefined, undefined, "\r"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(1, "", [undefined, new Place(0)], [new Skeleton(new Cache("="), [new Place(0), -1])], -1)]), [new Place(4), new Place(5)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2)], [new Skeleton(new Cache("last_sub_atom"), [new Place(1), new Place(2), undefined, undefined, "\n"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(1, "", [undefined, new Place(0)], [new Skeleton(new Cache("="), [new Place(0), -1])], -1)]), [new Place(4), new Place(6)]), new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("+"), [new Skeleton(new Cache("max"), [new Place(5), new Place(6)]), 1])]), new Skeleton(new Cache("sub_atom"), [new Place(0), new Place(1), undefined, 0, new Place(7)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2)], [new Skeleton(new Cache("sub_atom"), [new Place(1), undefined, undefined, new Place(2), "\r"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(1, "", [undefined, new Place(0)], [new Skeleton(new Cache("="), [new Place(0), -1])], -1)]), [new Place(7), new Place(8)]), new Skeleton(make_defined([new Clause(3, "", [new Place(1), new Place(2)], [new Skeleton(new Cache("sub_atom"), [new Place(1), undefined, undefined, new Place(2), "\n"]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0), new Clause(1, "", [undefined, new Place(0)], [new Skeleton(new Cache("="), [new Place(0), -1])], -1)]), [new Place(7), new Place(9)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("+"), [new Skeleton(new Cache("max"), [new Place(8), new Place(9)]), 1])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_multifile_safe"), ["strings", 3])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["strings", 3])], -1));
add(new Clause(0, "strings", ["syntax_error.illegal_number", "de", "Keine Nummer."], [], -1));
add(new Clause(0, "strings", ["syntax_error.illegal_date", "de", "Kein Datum."], [], -1));
add(new Clause(0, "strings", ["syntax_error.illegal_layout", "de", "Unerlaubtes Druckbildzeichen in Zeichenkette."], [], -1));
add(new Clause(0, "strings", ["syntax_error.illegal_unicode", "de", "Unerlaubtes Unicodezeichen im Text."], [], -1));
add(new Clause(0, "strings", ["syntax_error.illegal_escape", "de", "Unerlaubte Steuersequenz in Zeichenkette."], [], -1));
add(new Clause(0, "strings", ["syntax_error.unbalanced_escape", "de", "Steuersequenz nicht abgeschlossen."], [], -1));
add(new Clause(0, "strings", ["syntax_error.end_of_file_in_block_comment", "de", "Blockkommentar nicht geschlossen."], [], -1));
add(new Clause(0, "strings", ["syntax_error.singleton_var", "de", "Alleinstehende Variable(n) ~q."], [], -1));
add(new Clause(0, "strings", ["syntax_error.multiton_var", "de", "Mehrfache markierte Variable(n) ~q."], [], -1));
add(new Clause(0, "strings", ["syntax_error.bracket_balance", "de", "Rechte eckige Klammer (\"]\") fehlt."], [], -1));
add(new Clause(0, "strings", ["syntax_error.brace_balance", "de", "Rechte geschweifte Klammer (\"}\") fehlt."], [], -1));
add(new Clause(0, "strings", ["syntax_error.parenthesis_balance", "de", "Rechte runde Klammer (\")\") fehlt."], [], -1));
add(new Clause(0, "strings", ["syntax_error.end_of_clause_expected", "de", "Überflüssiges Token."], [], -1));
add(new Clause(0, "strings", ["syntax_error.operator_clash", "de", "Runde Klammer (\"(\") vor Operator fehlt."], [], -1));
add(new Clause(0, "strings", ["syntax_error.cannot_start_term", "de", "Term fehlt."], [], -1));
add(new Clause(0, "strings", ["syntax_error.doubling_missing", "de", "Anführungszeichen nicht zweifach."], [], -1));
add(new Clause(0, "strings", ["syntax_error.unbalanced_quoted", "de", "Zeichenkette nicht abgeschlossen."], [], -1));
add(new Clause(0, "strings", ["syntax_error.missing_char", "de", "Zeichen fehlt."], [], -1));
add(new Clause(0, "strings", ["syntax_error.illegal_number", "", "Not a number."], [], -1));
add(new Clause(0, "strings", ["syntax_error.illegal_date", "", "Not a date."], [], -1));
add(new Clause(0, "strings", ["syntax_error.illegal_layout", "", "Illegal layout character in string."], [], -1));
add(new Clause(0, "strings", ["syntax_error.illegal_unicode", "", "Illegal Unicode character in text."], [], -1));
add(new Clause(0, "strings", ["syntax_error.illegal_escape", "", "Illegal escape sequence in string."], [], -1));
add(new Clause(0, "strings", ["syntax_error.unbalanced_escape", "", "Escape sequence not closed."], [], -1));
add(new Clause(0, "strings", ["syntax_error.end_of_file_in_block_comment", "", "Block comment not closed."], [], -1));
add(new Clause(0, "strings", ["syntax_error.singleton_var", "", "Singleton variable(s) ~q."], [], -1));
add(new Clause(0, "strings", ["syntax_error.multiton_var", "", "Multiton marked variable(s) ~q."], [], -1));
add(new Clause(0, "strings", ["syntax_error.bracket_balance", "", "Right bracket (\"]\") missing."], [], -1));
add(new Clause(0, "strings", ["syntax_error.brace_balance", "", "Right brace (\"}\") missing."], [], -1));
add(new Clause(0, "strings", ["syntax_error.parenthesis_balance", "", "Right parenthesis (\")\") missing."], [], -1));
add(new Clause(0, "strings", ["syntax_error.end_of_clause_expected", "", "Superfluous token."], [], -1));
add(new Clause(0, "strings", ["syntax_error.operator_clash", "", "Parenthesis (\"(\") before operator missing."], [], -1));
add(new Clause(0, "strings", ["syntax_error.cannot_start_term", "", "Term missing."], [], -1));
add(new Clause(0, "strings", ["syntax_error.doubling_missing", "", "Quote not doubled."], [], -1));
add(new Clause(0, "strings", ["syntax_error.unbalanced_quoted", "", "String not closed."], [], -1));
add(new Clause(0, "strings", ["syntax_error.missing_char", "", "Character missing."], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["write_term", 3])], -1));
add(new Clause(7, "write_term", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_write_opts"), [new Place(2), new Frozen("h", ["[]", "[]", 0, 1200]), new Skeleton("h", [new Place(3), new Place(4), new Place(5), new Place(6)])]), new Skeleton(new Cache("ir_object_set"), [new Place(0), "last", -1]), new Skeleton(new Cache("sys_write_priority"), [new Place(1), new Skeleton("w", [1, new Place(6), 0]), new Skeleton("v", [new Place(0), new Place(5), new Place(3), new Place(4)])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_priority", 3])], -1));
add(new Clause(5, "sys_write_priority", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("ir_is_site"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("ir_site_name"), [new Place(1), new Place(4)]), new Skeleton(new Cache("sys_write_priority"), [new Place(4), new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_write_priority", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_var"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_write_priority", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("number"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_number"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_write_priority", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("atom"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_atom"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(5, "sys_write_priority", [new Skeleton("$VAR", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_flags"), [new Place(3), new Place(4)]), new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(4), 8]), 0]), new Skeleton(new Cache("integer"), [new Place(1)]), new Skeleton(new Cache(">="), [new Place(1), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_numbervars"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(5, "sys_write_priority", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_flags"), [new Place(3), new Place(4)]), new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(4), 2]), 0]), new Skeleton(new Cache("compound"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_compound"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(6, "sys_write_priority", [new Skeleton(".", [new Place(1), new Place(2)]), new Skeleton("w", [undefined, undefined, new Place(3)]), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_current_stream"), [new Place(4), new Place(5)]), new Skeleton(new Cache("put_atom"), [new Place(5), "["]), new Skeleton(new Cache("sys_write_priority"), [new Place(1), new Skeleton("w", [1, 999, new Place(3)]), new Place(4)]), new Skeleton(new Cache("sys_write_list"), [new Place(2), new Place(3), new Place(4)]), new Skeleton(new Cache("put_atom"), [new Place(5), "]"])], 0));
add(new Clause(5, "sys_write_priority", [new Skeleton("{}", [new Place(1)]), new Skeleton("w", [undefined, undefined, new Place(2)]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_current_stream"), [new Place(3), new Place(4)]), new Skeleton(new Cache("put_atom"), [new Place(4), "{"]), new Skeleton(new Cache("sys_write_priority"), [new Place(1), new Skeleton("w", [1, 1200, new Place(2)]), new Place(3)]), new Skeleton(new Cache("put_atom"), [new Place(4), "}"])], 0));
add(new Clause(9, "sys_write_priority", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("functor"), [new Place(1), new Place(4), 1]), new Skeleton(new Cache("sys_op"), [new Place(4), new Place(5), new Place(6), new Place(7), undefined]), new Skeleton(new Cache("sys_is_prefix"), [new Place(5), new Place(8)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_prefix"), [new Place(1), new Place(2), new Place(3), new Place(6), new Place(7), new Place(8)])], 0));
add(new Clause(9, "sys_write_priority", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("functor"), [new Place(1), new Place(4), 1]), new Skeleton(new Cache("sys_op"), [new Place(4), new Place(5), new Place(6), new Place(7), undefined]), new Skeleton(new Cache("sys_is_postfix"), [new Place(5), new Place(8)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_postfix"), [new Place(1), new Place(2), new Place(3), new Place(6), new Place(7), new Place(8)])], 0));
add(new Clause(10, "sys_write_priority", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("functor"), [new Place(1), new Place(4), 2]), new Skeleton(new Cache("sys_op"), [new Place(4), new Place(5), new Place(6), new Place(7), undefined]), new Skeleton(new Cache("sys_is_infix"), [new Place(5), new Place(8), new Place(9)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_infix"), [new Place(1), new Place(2), new Place(3), new Place(6), new Place(7), new Place(8), new Place(9)])], 0));
add(new Clause(4, "sys_write_priority", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("compound"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_compound"), [new Place(1), new Place(2), new Place(3)])], 0));
add(new Clause(3, "sys_write_priority", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_write_exotic"), [new Place(0), new Place(1), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_number", 3])], -1));
add(new Clause(7, "sys_write_number", [new Place(1), new Skeleton("w", [new Place(2), undefined, undefined]), new Place(3)], [new Skeleton(new Cache("float"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_number"), [new Place(4), new Place(1)]), new Skeleton(new Cache("sys_current_stream"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_safe_space"), [new Place(5), new Place(4), new Place(2)]), new Skeleton(new Cache("sys_current_flags"), [new Place(3), new Place(6)]), new Skeleton(new Cache("sys_print_atom"), [new Place(5), new Place(4), new Place(6)])], 0));
add(new Clause(7, "sys_write_number", [new Place(1), new Skeleton("w", [new Place(2), undefined, undefined]), new Place(3)], [new Skeleton(new Cache("integer"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_integer"), [new Place(4), 10, new Place(1)]), new Skeleton(new Cache("sys_current_stream"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_safe_space"), [new Place(5), new Place(4), new Place(2)]), new Skeleton(new Cache("sys_current_flags"), [new Place(3), new Place(6)]), new Skeleton(new Cache("sys_print_atom"), [new Place(5), new Place(4), new Place(6)])], 0));
add(new Clause(4, "sys_write_number", [-Infinity, new Skeleton("w", [new Place(1), undefined, undefined]), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_current_stream"), [new Place(2), new Place(3)]), new Skeleton(new Cache("put_atom"), [new Place(3), "-"]), new Skeleton(new Cache("sys_put_exotic"), [Infinity, new Place(1), new Place(2)])], 0));
add(new Clause(4, "sys_write_number", [new Place(1), new Skeleton("w", [new Place(2), undefined, undefined]), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_put_exotic"), [new Place(1), new Place(2), new Place(3)])], 0));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_atom", 3])], -1));
add(new Clause(6, "sys_write_atom", [new Place(1), new Skeleton("w", [new Place(2), undefined, undefined]), new Place(3)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(2), 1]), 0]), new Skeleton(new Cache("sys_op"), [new Place(1), new Place(4), undefined, undefined, undefined]), new Skeleton(new Cache("sys_is_prefix"), [new Place(4), undefined]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_current_stream"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_put_lparen"), [new Place(5), 1, 0, 1200, new Place(2), undefined]), new Skeleton(new Cache("sys_put_ident"), [new Place(1), 0, new Place(3), undefined]), new Skeleton(new Cache("put_atom"), [new Place(5), ")"])], 0));
add(new Clause(3, "sys_write_atom", [new Place(0), new Skeleton("w", [new Place(1), undefined, undefined]), new Place(2)], [new Skeleton(new Cache("sys_put_ident"), [new Place(0), new Place(1), new Place(2), undefined])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_exotic", 3])], -1));
add(new Clause(3, "sys_write_exotic", [new Place(0), new Skeleton("w", [new Place(1), undefined, undefined]), new Place(2)], [new Skeleton(new Cache("sys_put_exotic"), [new Place(0), new Place(1), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_numbervars", 3])], -1));
add(new Clause(6, "sys_write_numbervars", [new Place(0), new Skeleton("w", [new Place(1), undefined, undefined]), new Place(2)], [new Skeleton(new Cache("sys_numbervars_name"), [new Place(0), new Place(3)]), new Skeleton(new Cache("sys_current_stream"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_safe_space"), [new Place(4), new Place(3), new Place(1)]), new Skeleton(new Cache("sys_current_flags"), [new Place(2), new Place(5)]), new Skeleton(new Cache("sys_print_atom"), [new Place(4), new Place(3), new Place(5)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_prefix", 6])], -1));
add(new Clause(18, "sys_write_prefix", [new Place(0), new Skeleton("w", [new Place(1), new Place(2), new Place(3)]), new Place(4), new Place(5), new Place(6), new Place(7)], [new Skeleton(new Cache("=.."), [new Place(0), new Skeleton(".", [new Place(8), new Skeleton(".", [new Place(9), "[]"])])]), new Skeleton(new Cache("sys_current_stream"), [new Place(4), new Place(10)]), new Skeleton(new Cache("sys_current_flags"), [new Place(4), new Place(11)]), new Skeleton(new Cache("sys_put_lparen"), [new Place(10), new Place(7), new Place(2), new Place(5), new Place(1), new Place(12)]), new Skeleton(new Cache("sys_put_adjust"), [new Place(3), new Place(11), new Place(6), new Place(13)]), new Skeleton(new Cache("sys_oper_minus"), [new Place(8), new Place(12), new Place(14)]), new Skeleton(new Cache("sys_put_ident"), [new Place(8), new Place(12), new Place(4), undefined]), new Skeleton(new Cache("sys_put_rspace"), [new Place(10), new Place(6), new Place(14), new Place(15)]), new Skeleton(new Cache("is"), [new Place(16), new Skeleton(new Cache("-"), [new Place(5), new Place(7)])]), new Skeleton(new Cache("is"), [new Place(17), new Skeleton(new Cache("\/\\"), [new Place(15), new Frozen(new Cache("\\"), [8])])]), new Skeleton(new Cache("sys_write_priority"), [new Place(9), new Skeleton("w", [new Place(17), new Place(16), new Place(13)]), new Place(4)]), new Skeleton(new Cache("sys_put_rparen"), [new Place(10), new Place(7), new Place(2), new Place(5), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_postfix", 6])], -1));
add(new Clause(15, "sys_write_postfix", [new Place(0), new Skeleton("w", [new Place(1), new Place(2), new Place(3)]), new Place(4), new Place(5), new Place(6), new Place(7)], [new Skeleton(new Cache("=.."), [new Place(0), new Skeleton(".", [new Place(8), new Skeleton(".", [new Place(9), "[]"])])]), new Skeleton(new Cache("sys_current_stream"), [new Place(4), new Place(10)]), new Skeleton(new Cache("sys_put_lparen"), [new Place(10), 1, new Place(2), new Place(5), new Place(1), new Place(11)]), new Skeleton(new Cache("sys_oper_escape"), [new Place(8), new Place(11), new Place(12)]), new Skeleton(new Cache("sys_oper_side"), [new Place(7), new Place(12), new Place(13)]), new Skeleton(new Cache("is"), [new Place(14), new Skeleton(new Cache("-"), [new Place(5), new Place(7)])]), new Skeleton(new Cache("sys_write_priority"), [new Place(9), new Skeleton("w", [new Place(13), new Place(14), new Place(3)]), new Place(4)]), new Skeleton(new Cache("sys_put_lspace"), [new Place(10), new Place(6)]), new Skeleton(new Cache("sys_write_oper"), [new Place(8), new Place(4), undefined]), new Skeleton(new Cache("sys_put_rparen"), [new Place(10), 1, new Place(2), new Place(5), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_infix", 7])], -1));
add(new Clause(22, "sys_write_infix", [new Place(0), new Skeleton("w", [new Place(1), new Place(2), new Place(3)]), new Place(4), new Place(5), new Place(6), new Place(7), new Place(8)], [new Skeleton(new Cache("=.."), [new Place(0), new Skeleton(".", [new Place(9), new Skeleton(".", [new Place(10), new Skeleton(".", [new Place(11), "[]"])])])]), new Skeleton(new Cache("sys_current_stream"), [new Place(4), new Place(12)]), new Skeleton(new Cache("sys_current_flags"), [new Place(4), new Place(13)]), new Skeleton(new Cache("sys_put_lparen"), [new Place(12), new Place(8), new Place(2), new Place(5), new Place(1), new Place(14)]), new Skeleton(new Cache("sys_put_indent"), [new Place(12), new Place(3), new Place(13), new Place(6), new Place(8), new Place(2), new Place(5), new Place(1), new Place(15)]), new Skeleton(new Cache("sys_oper_escape"), [new Place(9), new Place(14), new Place(16)]), new Skeleton(new Cache("sys_oper_side"), [new Place(7), new Place(16), new Place(17)]), new Skeleton(new Cache("is"), [new Place(18), new Skeleton(new Cache("-"), [new Place(5), new Place(7)])]), new Skeleton(new Cache("sys_write_priority"), [new Place(10), new Skeleton("w", [new Place(17), new Place(18), new Place(15)]), new Place(4)]), new Skeleton(new Cache("sys_put_lformat"), [new Place(12), new Place(15), new Place(13), new Place(6)]), new Skeleton(new Cache("sys_write_oper"), [new Place(9), new Place(4), new Place(19)]), new Skeleton(new Cache("sys_put_rformat"), [new Place(12), new Place(15), new Place(13), new Place(6), new Place(19), new Place(14)]), new Skeleton(new Cache("is"), [new Place(20), new Skeleton(new Cache("-"), [new Place(5), new Place(8)])]), new Skeleton(new Cache("is"), [new Place(21), new Skeleton(new Cache("\/\\"), [new Place(14), new Frozen(new Cache("\\"), [14])])]), new Skeleton(new Cache("sys_write_priority"), [new Place(11), new Skeleton("w", [new Place(21), new Place(20), new Place(15)]), new Place(4)]), new Skeleton(new Cache("sys_put_rparen"), [new Place(12), new Place(8), new Place(2), new Place(5), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_oper", 3])], -1));
add(new Clause(3, "sys_write_oper", [",", new Place(1), ","], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_current_stream"), [new Place(1), new Place(2)]), new Skeleton(new Cache("put_atom"), [new Place(2), ","])], 0));
add(new Clause(3, "sys_write_oper", ["|", new Place(1), "|"], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_current_stream"), [new Place(1), new Place(2)]), new Skeleton(new Cache("put_atom"), [new Place(2), "|"])], 0));
add(new Clause(3, "sys_write_oper", [".", new Place(1), "."], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_current_stream"), [new Place(1), new Place(2)]), new Skeleton(new Cache("put_atom"), [new Place(2), "."])], 0));
add(new Clause(3, "sys_write_oper", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_put_ident"), [new Place(0), 0, new Place(1), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_list", 3])], -1));
add(new Clause(5, "sys_write_list", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_current_stream"), [new Place(3), new Place(4)]), new Skeleton(new Cache("put_atom"), [new Place(4), "|"]), new Skeleton(new Cache("sys_write_priority"), [new Place(1), new Skeleton("w", [1, 999, new Place(2)]), new Place(3)])], 0));
add(new Clause(6, "sys_write_list", [new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_current_stream"), [new Place(4), new Place(5)]), new Skeleton(new Cache("put_atom"), [new Place(5), ", "]), new Skeleton(new Cache("sys_write_priority"), [new Place(1), new Skeleton("w", [1, 999, new Place(3)]), new Place(4)]), new Skeleton(new Cache("sys_write_list"), [new Place(2), new Place(3), new Place(4)])], 0));
add(new Clause(1, "sys_write_list", ["[]", undefined, undefined], [new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(4, "sys_write_list", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_current_stream"), [new Place(2), new Place(3)]), new Skeleton(new Cache("put_atom"), [new Place(3), "|"]), new Skeleton(new Cache("sys_write_priority"), [new Place(0), new Skeleton("w", [1, 999, new Place(1)]), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_compound", 3])], -1));
add(new Clause(8, "sys_write_compound", [new Place(0), new Skeleton("w", [new Place(1), undefined, new Place(2)]), new Place(3)], [new Skeleton(new Cache("=.."), [new Place(0), new Skeleton(".", [new Place(4), new Skeleton(".", [new Place(5), new Place(6)])])]), new Skeleton(new Cache("sys_current_stream"), [new Place(3), new Place(7)]), new Skeleton(new Cache("sys_put_symbol"), [new Place(4), new Place(1), new Place(3)]), new Skeleton(new Cache("put_atom"), [new Place(7), "("]), new Skeleton(new Cache("sys_write_priority"), [new Place(5), new Skeleton("w", [1, 999, new Place(2)]), new Place(3)]), new Skeleton(new Cache("sys_write_args"), [new Place(6), new Place(2), new Place(3)]), new Skeleton(new Cache("put_atom"), [new Place(7), ")"])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_symbol", 3])], -1));
add(new Clause(4, "sys_put_symbol", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("atom"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_put_ident"), [new Place(1), new Place(2), new Place(3), undefined])], 0));
add(new Clause(3, "sys_put_symbol", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_put_exotic"), [new Place(0), new Place(1), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_args", 3])], -1));
add(new Clause(5, "sys_write_args", [new Skeleton(".", [new Place(0), new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_stream"), [new Place(3), new Place(4)]), new Skeleton(new Cache("put_atom"), [new Place(4), ", "]), new Skeleton(new Cache("sys_write_priority"), [new Place(0), new Skeleton("w", [1, 999, new Place(2)]), new Place(3)]), new Skeleton(new Cache("sys_write_args"), [new Place(1), new Place(2), new Place(3)])], -1));
add(new Clause(0, "sys_write_args", ["[]", undefined, undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_var", 3])], -1));
add(new Clause(6, "sys_write_var", [new Place(1), new Skeleton("w", [new Place(2), undefined, undefined]), new Place(3)], [new Skeleton(new Cache("sys_current_names"), [new Place(3), new Place(4)]), new Skeleton(new Cache("sys_find_var"), [new Place(1), new Place(4), new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_name"), [new Place(5), new Place(2), new Place(3)])], 0));
add(new Clause(5, "sys_write_var", [new Place(1), new Skeleton("w", [new Place(2), undefined, undefined]), new Place(3)], [new Skeleton(new Cache("sys_current_anons"), [new Place(3), new Place(4)]), new Skeleton(new Cache("sys_find_sing"), [new Place(1), new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_write_name"), ["_", new Place(2), new Place(3)])], 0));
add(new Clause(8, "sys_write_var", [new Place(0), new Skeleton("w", [new Place(1), undefined, undefined]), new Place(2)], [new Skeleton(new Cache("term_hash"), [new Place(0), new Place(3)]), new Skeleton(new Cache("atom_integer"), [new Place(4), 10, new Place(3)]), new Skeleton(new Cache("atom_concat"), ["_", new Place(4), new Place(5)]), new Skeleton(new Cache("sys_current_stream"), [new Place(2), new Place(6)]), new Skeleton(new Cache("sys_safe_space"), [new Place(6), new Place(5), new Place(1)]), new Skeleton(new Cache("sys_current_flags"), [new Place(2), new Place(7)]), new Skeleton(new Cache("sys_print_atom"), [new Place(6), new Place(5), new Place(7)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_find_var", 3])], -1));
add(new Clause(5, "sys_find_var", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("member"), [new Skeleton("=", [new Place(3), new Place(4)]), new Place(2)]), new Skeleton(new Cache("=="), [new Place(1), new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_find_sing", 2])], -1));
add(new Clause(4, "sys_find_sing", [new Place(1), new Place(2)], [new Skeleton(new Cache("member"), [new Place(3), new Place(2)]), new Skeleton(new Cache("=="), [new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_write_name", 3])], -1));
add(new Clause(6, "sys_write_name", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_current_flags"), [new Place(2), new Place(3)]), new Skeleton(new Cache("sys_var_quoted"), [new Place(0), new Place(3), new Place(4)]), new Skeleton(new Cache("sys_current_stream"), [new Place(2), new Place(5)]), new Skeleton(new Cache("sys_safe_space"), [new Place(5), new Place(4), new Place(1)]), new Skeleton(new Cache("sys_print_atom"), [new Place(5), new Place(4), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_var_quoted", 3])], -1));
add(new Clause(6, "sys_var_quoted", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(2), 1]), 0]), new Skeleton(new Cache("atom_codes"), [new Place(1), new Place(4)]), new Skeleton(make_defined([new Clause(2, "", [new Place(1)], [new Skeleton(new Cache("sys_proper_var"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0), new Clause(0, "", [undefined], [], -1)]), [new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_escape_codes"), [new Place(4), new Place(5), new Frozen(".", [96, "[]"])]), new Skeleton(new Cache("atom_codes"), [new Place(3), new Skeleton(".", [96, new Place(5)])])], 0));
add(new Clause(1, "sys_var_quoted", [new Place(0), undefined, new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_proper_var", 1])], -1));
add(new Clause(3, "sys_proper_var", [new Skeleton(".", [new Place(0), new Place(1)])], [new Skeleton(new Cache("sys_code_class"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_proper_var"), [new Place(2), new Skeleton(".", [new Place(0), new Place(1)])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_proper_var", 2])], -1));
add(new Clause(1, "sys_proper_var", ["is_upper", new Skeleton(".", [undefined, new Place(0)])], [new Skeleton(new Cache("sys_proper_atom_name"), [new Place(0)])], -1));
add(new Clause(1, "sys_proper_var", ["is_score", new Skeleton(".", [undefined, new Place(0)])], [new Skeleton(new Cache("sys_proper_atom_name"), [new Place(0)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_adjust", 4])], -1));
add(new Clause(3, "sys_put_adjust", [new Place(1), new Place(2), undefined, new Place(1)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(2), 4]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(4, "sys_put_adjust", [new Place(1), undefined, new Place(2), new Place(3)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(2), 12]), 12]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("+"), [new Place(1), 3])])], 0));
add(new Clause(1, "sys_put_adjust", [new Place(0), undefined, undefined, new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_indent", 9])], -1));
add(new Clause(3, "sys_put_indent", [undefined, new Place(1), new Place(2), undefined, undefined, undefined, undefined, undefined, new Place(1)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(2), 4]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(3, "sys_put_indent", [undefined, new Place(1), undefined, new Place(2), undefined, undefined, undefined, undefined, new Place(1)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(2), 12]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(4, "sys_put_indent", [undefined, new Place(1), undefined, new Place(2), undefined, undefined, undefined, undefined, new Place(3)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(2), 12]), 12]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("+"), [new Place(1), 3])])], 0));
add(new Clause(8, "sys_put_indent", [new Place(1), new Place(2), undefined, undefined, new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)], [new Skeleton(new Cache("sys_needs_paren"), [new Place(3), new Place(4), new Place(5), new Place(6)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("tab"), [new Place(1), 2]), new Skeleton(new Cache("is"), [new Place(7), new Skeleton(new Cache("+"), [new Place(2), 3])])], 0));
add(new Clause(1, "sys_put_indent", [undefined, new Place(0), undefined, undefined, undefined, undefined, undefined, undefined, new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_lparen", 6])], -1));
add(new Clause(7, "sys_put_lparen", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5), new Place(6)], [new Skeleton(new Cache("sys_needs_paren"), [new Place(2), new Place(3), new Place(4), new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_put_lparen2"), [new Place(1), new Place(5), new Place(6)])], 0));
add(new Clause(1, "sys_put_lparen", [undefined, undefined, undefined, undefined, new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_lparen2", 3])], -1));
add(new Clause(4, "sys_put_lparen2", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(2), 2]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), " ("]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("\\\/"), [new Skeleton(new Cache("\/\\"), [new Place(2), new Frozen(new Cache("\\"), [6])]), 1])])], 0));
add(new Clause(3, "sys_put_lparen2", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("put_atom"), [new Place(0), "("]), new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("\\\/"), [new Place(1), 1])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_rparen", 5])], -1));
add(new Clause(6, "sys_put_rparen", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("sys_needs_paren"), [new Place(2), new Place(3), new Place(4), new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), ")"])], 0));
add(new Clause(0, "sys_put_rparen", [undefined, undefined, undefined, undefined, undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_needs_paren", 4])], -1));
add(new Clause(3, "sys_needs_paren", [undefined, new Place(1), new Place(2), undefined], [new Skeleton(new Cache("<"), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_needs_paren", [0, new Place(0), new Place(0), new Place(1)], [new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(1), 8]), 0])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_lformat", 4])], -1));
add(new Clause(4, "sys_put_lformat", [new Place(1), undefined, new Place(2), new Place(3)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(2), 4]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_put_lspace"), [new Place(1), new Place(3)])], 0));
add(new Clause(3, "sys_put_lformat", [new Place(1), undefined, undefined, new Place(2)], [new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(2), 12]), 8]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_put_lspace"), [new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_put_lformat", [new Place(0), new Place(1), undefined, undefined], [new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("-"), [new Place(1), 3])]), new Skeleton(new Cache("nl"), [new Place(0)]), new Skeleton(new Cache("tab"), [new Place(0), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_rformat", 6])], -1));
add(new Clause(5, "sys_put_rformat", [new Place(1), undefined, new Place(2), new Place(3), undefined, new Place(4)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(2), 4]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_put_rspace"), [new Place(1), new Place(3), new Place(4), undefined])], 0));
add(new Clause(4, "sys_put_rformat", [new Place(1), undefined, undefined, new Place(2), undefined, new Place(3)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(2), 12]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_put_rspace"), [new Place(1), new Place(2), new Place(3), undefined])], 0));
add(new Clause(4, "sys_put_rformat", [new Place(1), new Place(2), undefined, new Place(3), undefined, undefined], [new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(3), 12]), 8]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("nl"), [new Place(1)]), new Skeleton(new Cache("tab"), [new Place(1), new Place(2)])], 0));
add(new Clause(4, "sys_put_rformat", [new Place(0), undefined, undefined, undefined, new Place(1), undefined], [new Skeleton(new Cache("atom_length"), [new Place(1), new Place(2)]), new Skeleton(new Cache("is"), [new Place(3), new Skeleton(new Cache("-"), [3, new Place(2)])]), new Skeleton(new Cache("tab"), [new Place(0), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_lspace", 2])], -1));
add(new Clause(3, "sys_put_lspace", [new Place(1), new Place(2)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(2), 2]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), " "])], 0));
add(new Clause(0, "sys_put_lspace", [undefined, undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_rspace", 4])], -1));
add(new Clause(5, "sys_put_rspace", [new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("=:="), [new Skeleton(new Cache("\/\\"), [new Place(2), 1]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("put_atom"), [new Place(1), " "]), new Skeleton(new Cache("is"), [new Place(4), new Skeleton(new Cache("\/\\"), [new Place(3), new Frozen(new Cache("\\"), [6])])])], 0));
add(new Clause(2, "sys_put_rspace", [undefined, undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("is"), [new Place(1), new Skeleton(new Cache("\\\/"), [new Place(0), 2])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_oper_side", 3])], -1));
add(new Clause(3, "sys_oper_side", [0, new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("\\\/"), [new Place(1), 8])])], 0));
add(new Clause(2, "sys_oper_side", [undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("is"), [new Place(1), new Skeleton(new Cache("\/\\"), [new Place(0), new Frozen(new Cache("\\"), [8])])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_oper_minus", 3])], -1));
add(new Clause(3, "sys_oper_minus", ["-", new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("\\\/"), [new Place(1), 4])])], 0));
add(new Clause(2, "sys_oper_minus", [undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("is"), [new Place(1), new Skeleton(new Cache("\/\\"), [new Place(0), new Frozen(new Cache("\\"), [4])])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_oper_escape", 3])], -1));
add(new Clause(3, "sys_oper_escape", [",", new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("\\\/"), [new Place(1), 1])])], 0));
add(new Clause(3, "sys_oper_escape", ["|", new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("\\\/"), [new Place(1), 1])])], 0));
add(new Clause(2, "sys_oper_escape", [undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("is"), [new Place(1), new Skeleton(new Cache("\/\\"), [new Place(0), new Frozen(new Cache("\\"), [1])])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_current_stream", 2])], -1));
add(new Clause(1, "sys_current_stream", [new Skeleton("v", [new Place(0), undefined, undefined, undefined]), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_current_flags", 2])], -1));
add(new Clause(1, "sys_current_flags", [new Skeleton("v", [undefined, new Place(0), undefined, undefined]), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_current_names", 2])], -1));
add(new Clause(1, "sys_current_names", [new Skeleton("v", [undefined, undefined, new Place(0), undefined]), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_current_anons", 2])], -1));
add(new Clause(1, "sys_current_anons", [new Skeleton("v", [undefined, undefined, undefined, new Place(0)]), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_ident", 4])], -1));
add(new Clause(6, "sys_put_ident", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_flags"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_atom_quoted"), [new Place(0), new Place(4), new Place(3)]), new Skeleton(new Cache("sys_current_stream"), [new Place(2), new Place(5)]), new Skeleton(new Cache("sys_safe_space"), [new Place(5), new Place(3), new Place(1)]), new Skeleton(new Cache("sys_print_atom"), [new Place(5), new Place(3), new Place(4)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_atom_quoted", 3])], -1));
add(new Clause(6, "sys_atom_quoted", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(2), 1]), 0]), new Skeleton(new Cache("atom_codes"), [new Place(1), new Place(4)]), new Skeleton(make_defined([new Clause(2, "", [new Place(1)], [new Skeleton(new Cache("sys_proper_atom"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Cache("fail")], 0), new Clause(0, "", [undefined], [], -1)]), [new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_escape_codes"), [new Place(4), new Place(5), new Frozen(".", [39, "[]"])]), new Skeleton(new Cache("atom_codes"), [new Place(3), new Skeleton(".", [39, new Place(5)])])], 0));
add(new Clause(1, "sys_atom_quoted", [new Place(0), undefined, new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_put_exotic", 3])], -1));
add(new Clause(7, "sys_put_exotic", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_current_flags"), [new Place(2), new Place(3)]), new Skeleton(new Cache("sys_unconvert_exotic"), [new Place(4), new Place(0)]), new Skeleton(new Cache("sys_exotic_quoted"), [new Place(4), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_current_stream"), [new Place(2), new Place(6)]), new Skeleton(new Cache("sys_safe_space"), [new Place(6), new Place(5), new Place(1)]), new Skeleton(new Cache("sys_print_atom"), [new Place(6), new Place(5), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_unconvert_exotic", 2])], -1));
add(new Clause(3, "sys_unconvert_exotic", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_atom_exotic"), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(2, "sys_unconvert_exotic", ["Special", new Place(1)], [new Skeleton(new Cache("number"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)])], 0));
add(new Clause(0, "sys_unconvert_exotic", ["Reference", undefined], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_exotic_quoted", 3])], -1));
add(new Clause(4, "sys_exotic_quoted", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(2), 1]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("atom_concat"), ["0r", new Place(1), new Place(3)])], 0));
add(new Clause(1, "sys_exotic_quoted", [new Place(0), undefined, new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_term", 4])], -1));
add(new Clause(9, "sys_read_term", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_read_opts"), [new Place(2), new Frozen("z", [1200, 0]), new Skeleton("z", [new Place(4), new Place(5)])]), new Skeleton(new Cache("sys_next_token"), [new Skeleton("t", ["-", new Place(5), new Skeleton("r", [new Place(1), new Place(0)]), new Frozen("s", ["[]", "[]"])]), new Place(6)]), new Skeleton(new Cache("sys_read_optional"), [new Place(7), new Place(4), new Place(6), new Skeleton("t", [undefined, undefined, undefined, new Place(8)])]), new Skeleton(new Cache("sys_read_results"), [new Place(2), new Place(8)]), new Skeleton(new Cache("="), [new Place(3), new Place(7)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_optional", 4])], -1));
add(new Clause(4, "sys_read_optional", ["end_of_file", undefined, new Place(1), new Place(2)], [new Skeleton(new Cache("sys_current_token"), ["end_of_file", new Place(1), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(3), new Place(2)])], 0));
add(new Clause(5, "sys_read_optional", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_read_priority"), [new Place(0), new Place(1), new Place(2), new Place(4)]), new Skeleton(new Cache("sys_read_end_of_term"), [new Place(4), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_end_of_term", 2])], -1));
add(new Clause(5, "sys_read_end_of_term", [new Place(1), new Place(2)], [new Skeleton(new Cache("sys_current_options"), [new Place(3), new Place(1), new Place(4)]), new Skeleton(new Cache("=\\="), [new Skeleton(new Cache("\/\\"), [new Place(3), 1]), 0]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_read_end"), ["end_of_file", new Place(4), new Place(2)])], 0));
add(new Clause(2, "sys_read_end_of_term", [new Place(0), new Place(1)], [new Skeleton(new Cache("sys_read_end"), [".", new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_priority", 4])], -1));
add(new Clause(11, "sys_read_priority", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_token"), [new Place(4), new Place(2), new Place(5)]), new Skeleton(new Cache("sys_read_factor"), [new Place(4), new Place(6), new Place(1), new Place(7), new Place(5), new Place(8)]), new Skeleton(new Cache("sys_current_token"), [new Place(9), new Place(8), new Place(10)]), new Skeleton(new Cache("sys_read_secondary"), [new Place(9), new Place(6), new Place(0), new Place(1), new Place(7), new Place(10), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_secondary", 7])], -1));
add(new Clause(8, "sys_read_secondary", [new Skeleton("atom", [new Place(1)]), new Place(2), new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_read_infix"), [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)])], 0));
add(new Clause(8, "sys_read_secondary", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)], [new Skeleton(new Cache("="), [new Place(1), ","]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_read_infix"), [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)])], 0));
add(new Clause(8, "sys_read_secondary", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)], [new Skeleton(new Cache("="), [new Place(1), "|"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_read_infix"), [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)])], 0));
add(new Clause(2, "sys_read_secondary", [undefined, new Place(0), new Place(0), undefined, undefined, new Place(1), new Place(1)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_infix", 7])], -1));
add(new Clause(20, "sys_read_infix", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)], [new Skeleton(new Cache("sys_op"), [new Place(1), new Place(8), new Place(9), undefined, undefined]), new Skeleton(new Cache("sys_is_infix"), [new Place(8), new Place(10), new Place(11)]), new Skeleton(new Cache(">="), [new Place(4), new Place(9)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_token"), [new Place(6), new Place(12)]), new Skeleton(make_defined([new Clause(6, "", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("<"), [new Skeleton(new Cache("-"), [new Place(1), new Place(2)]), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_sync_throw"), [new Skeleton("error", [new Frozen("syntax_error", ["operator_clash"]), undefined]), new Place(4), new Place(5)])], 0), new Clause(2, "", [undefined, undefined, undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1)]), [new Place(9), new Place(10), new Place(5), new Place(12), new Place(13)]), new Skeleton(new Cache("is"), [new Place(14), new Skeleton(new Cache("-"), [new Place(9), new Place(11)])]), new Skeleton(new Cache("sys_read_priority"), [new Place(15), new Place(14), new Place(13), new Place(16)]), new Skeleton(new Cache("=.."), [new Place(17), new Skeleton(".", [new Place(1), new Skeleton(".", [new Place(2), new Skeleton(".", [new Place(15), "[]"])])])]), new Skeleton(new Cache("sys_current_token"), [new Place(18), new Place(16), new Place(19)]), new Skeleton(new Cache("sys_read_secondary"), [new Place(18), new Place(17), new Place(3), new Place(4), new Place(9), new Place(19), new Place(7)])], 0));
add(new Clause(16, "sys_read_infix", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5), new Place(6), new Place(7)], [new Skeleton(new Cache("sys_op"), [new Place(1), new Place(8), new Place(9), undefined, undefined]), new Skeleton(new Cache("sys_is_postfix"), [new Place(8), new Place(10)]), new Skeleton(new Cache(">="), [new Place(4), new Place(9)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_token"), [new Place(6), new Place(11)]), new Skeleton(make_defined([new Clause(6, "", [new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("<"), [new Skeleton(new Cache("-"), [new Place(1), new Place(2)]), new Place(3)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_sync_throw"), [new Skeleton("error", [new Frozen("syntax_error", ["operator_clash"]), undefined]), new Place(4), new Place(5)])], 0), new Clause(2, "", [undefined, undefined, undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1)]), [new Place(9), new Place(10), new Place(5), new Place(11), new Place(12)]), new Skeleton(new Cache("=.."), [new Place(13), new Skeleton(".", [new Place(1), new Skeleton(".", [new Place(2), "[]"])])]), new Skeleton(new Cache("sys_current_token"), [new Place(14), new Place(12), new Place(15)]), new Skeleton(new Cache("sys_read_secondary"), [new Place(14), new Place(13), new Place(3), new Place(4), new Place(9), new Place(15), new Place(7)])], 0));
add(new Clause(2, "sys_read_infix", [undefined, new Place(0), new Place(0), undefined, undefined, new Place(1), new Place(1)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_lookup_var", 4])], -1));
add(new Clause(7, "sys_lookup_var", [new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("sys_current_vars"), [new Place(5), new Place(3), new Place(6)]), new Skeleton(new Cache("member"), [new Skeleton("=", [new Place(1), new Place(2)]), new Place(5)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_remove_anon"), [new Place(1), new Place(6), new Place(4)])], 0));
add(new Clause(9, "sys_lookup_var", [new Place(0), new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_vars"), [new Place(4), new Place(2), new Place(5)]), new Skeleton(new Cache("sys_set_vars"), [new Skeleton(".", [new Skeleton("=", [new Place(0), new Place(1)]), new Place(4)]), new Place(5), new Place(6)]), new Skeleton(new Cache("sys_current_sings"), [new Place(7), new Place(6), new Place(8)]), new Skeleton(new Cache("sys_set_sings"), [new Skeleton(".", [new Skeleton("=", [new Place(0), new Place(1)]), new Place(7)]), new Place(8), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_remove_anon", 3])], -1));
add(new Clause(7, "sys_remove_anon", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_sings"), [new Place(4), new Place(2), new Place(5)]), new Skeleton(new Cache("select"), [new Skeleton("=", [new Place(1), undefined]), new Place(4), new Place(6)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_set_sings"), [new Place(6), new Place(5), new Place(3)])], 0));
add(new Clause(1, "sys_remove_anon", [undefined, new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_current_token", 3])], -1));
add(new Clause(4, "sys_current_token", [new Place(0), new Skeleton("t", [new Place(0), new Place(1), new Place(2), new Place(3)]), new Skeleton("t", [new Place(0), new Place(1), new Place(2), new Place(3)])], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_current_options", 3])], -1));
add(new Clause(4, "sys_current_options", [new Place(0), new Skeleton("t", [new Place(1), new Place(0), new Place(2), new Place(3)]), new Skeleton("t", [new Place(1), new Place(0), new Place(2), new Place(3)])], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_current_vars", 3])], -1));
add(new Clause(5, "sys_current_vars", [new Place(0), new Skeleton("t", [new Place(1), new Place(2), new Place(3), new Skeleton("s", [new Place(0), new Place(4)])]), new Skeleton("t", [new Place(1), new Place(2), new Place(3), new Skeleton("s", [new Place(0), new Place(4)])])], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_set_vars", 3])], -1));
add(new Clause(5, "sys_set_vars", [new Place(0), new Skeleton("t", [new Place(1), new Place(2), new Place(3), new Skeleton("s", [undefined, new Place(4)])]), new Skeleton("t", [new Place(1), new Place(2), new Place(3), new Skeleton("s", [new Place(0), new Place(4)])])], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_current_sings", 3])], -1));
add(new Clause(5, "sys_current_sings", [new Place(0), new Skeleton("t", [new Place(1), new Place(2), new Place(3), new Skeleton("s", [new Place(4), new Place(0)])]), new Skeleton("t", [new Place(1), new Place(2), new Place(3), new Skeleton("s", [new Place(4), new Place(0)])])], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_set_sings", 3])], -1));
add(new Clause(5, "sys_set_sings", [new Place(0), new Skeleton("t", [new Place(1), new Place(2), new Place(3), new Skeleton("s", [new Place(4), undefined])]), new Skeleton("t", [new Place(1), new Place(2), new Place(3), new Skeleton("s", [new Place(4), new Place(0)])])], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_reach_code", 3])], -1));
add(new Clause(5, "sys_reach_code", [new Place(0), new Skeleton("t", [new Place(1), new Place(2), new Skeleton("r", [new Place(3), new Place(0)]), new Place(4)]), new Skeleton("t", [new Place(1), new Place(2), new Skeleton("r", [new Place(3), new Place(0)]), new Place(4)])], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_reach_stream", 3])], -1));
add(new Clause(5, "sys_reach_stream", [new Place(0), new Skeleton("t", [new Place(1), new Place(2), new Skeleton("r", [new Place(0), new Place(3)]), new Place(4)]), new Skeleton("t", [new Place(1), new Place(2), new Skeleton("r", [new Place(0), new Place(3)]), new Place(4)])], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_factor", 6])], -1));
add(new Clause(10, "sys_read_factor", [new Skeleton("atom", [new Place(1)]), new Place(2), new Place(3), new Place(4), new Place(5), new Place(6)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_reach_code"), [new Place(7), new Place(5), new Place(8)]), new Skeleton(new Cache("sys_next_token"), [new Place(8), new Place(9)]), new Skeleton(new Cache("sys_read_atom"), [new Place(7), new Place(1), new Place(2), new Place(3), new Place(4), new Place(9), new Place(6)])], 0));
add(new Clause(3, "sys_read_factor", ["anon", undefined, undefined, 0, new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_token"), [new Place(1), new Place(2)])], 0));
add(new Clause(6, "sys_read_factor", [new Skeleton("var", [new Place(1)]), new Place(2), undefined, 0, new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_lookup_var"), [new Place(1), new Place(2), new Place(3), new Place(5)]), new Skeleton(new Cache("sys_next_token"), [new Place(5), new Place(4)])], 0));
add(new Clause(9, "sys_read_factor", ["[", new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_token"), [new Place(4), new Place(6)]), new Skeleton(new Cache("sys_current_token"), [new Place(7), new Place(6), new Place(8)]), new Skeleton(new Cache("sys_read_list"), [new Place(7), new Place(1), new Place(2), new Place(3), new Place(8), new Place(5)])], 0));
add(new Clause(9, "sys_read_factor", ["{", new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_token"), [new Place(4), new Place(6)]), new Skeleton(new Cache("sys_current_token"), [new Place(7), new Place(6), new Place(8)]), new Skeleton(new Cache("sys_read_set"), [new Place(7), new Place(1), new Place(2), new Place(3), new Place(8), new Place(5)])], 0));
add(new Clause(7, "sys_read_factor", ["(", new Place(1), undefined, 0, new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_token"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_read_priority"), [new Place(1), 1200, new Place(4), new Place(5)]), new Skeleton(new Cache("sys_read_end"), [")", new Place(5), new Place(6)]), new Skeleton(new Cache("sys_next_token"), [new Place(6), new Place(3)])], 0));
add(new Clause(4, "sys_read_factor", [new Skeleton("const", [new Place(1)]), new Place(1), undefined, 0, new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_token"), [new Place(2), new Place(3)])], 0));
add(new Clause(2, "sys_read_factor", [undefined, undefined, undefined, undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("sys_sync_throw"), [new Skeleton("error", [new Frozen("syntax_error", ["cannot_start_term"]), undefined]), new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_atom", 7])], -1));
add(new Clause(13, "sys_read_atom", [40, new Place(1), new Place(2), undefined, 0, new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_token"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_read_priority"), [new Place(6), 999, new Place(5), new Place(7)]), new Skeleton(new Cache("sys_current_token"), [new Place(8), new Place(7), new Place(9)]), new Skeleton(new Cache("sys_read_args"), [new Place(8), new Place(10), new Place(9), new Place(11)]), new Skeleton(new Cache("sys_read_end"), [")", new Place(11), new Place(12)]), new Skeleton(new Cache("=.."), [new Place(2), new Skeleton(".", [new Place(1), new Skeleton(".", [new Place(6), new Place(10)])])]), new Skeleton(new Cache("sys_next_token"), [new Place(12), new Place(4)])], 0));
add(new Clause(11, "sys_read_atom", [new Place(1), "-", new Place(2), new Place(3), new Place(4), new Place(5), new Place(6)], [new Skeleton(new Cache("sys_code_class"), [new Place(1), "is_digit"]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_current_token"), [new Place(7), new Place(5), new Place(8)]), new Skeleton(new Cache("sys_read_factor"), [new Place(7), new Place(9), new Place(3), new Place(4), new Place(8), new Place(10)]), new Skeleton(new Cache("sys_read_neg"), [new Place(9), new Place(2), new Place(10), new Place(6)])], 0));
add(new Clause(12, "sys_read_atom", [undefined, new Place(1), new Place(2), new Place(3), new Place(4), new Place(5), new Place(6)], [new Skeleton(new Cache("sys_op"), [new Place(1), new Place(7), new Place(8), undefined, undefined]), new Skeleton(new Cache("sys_is_prefix"), [new Place(7), new Place(9)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_current_token"), [new Place(10), new Place(5), new Place(11)]), new Skeleton(new Cache("sys_read_prefix"), [new Place(10), new Place(2), new Place(1), new Place(3), new Place(8), new Place(9), new Place(4), new Place(11), new Place(6)])], 0));
add(new Clause(2, "sys_read_atom", [undefined, new Place(0), new Place(0), undefined, 0, new Place(1), new Place(1)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_prefix", 9])], -1));
add(new Clause(4, "sys_read_prefix", [",", new Place(1), new Place(1), undefined, undefined, undefined, 0, new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_read_prefix", ["|", new Place(1), new Place(1), undefined, undefined, undefined, 0, new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_read_prefix", [")", new Place(1), new Place(1), undefined, undefined, undefined, 0, new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_read_prefix", ["]", new Place(1), new Place(1), undefined, undefined, undefined, 0, new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_read_prefix", ["}", new Place(1), new Place(1), undefined, undefined, undefined, 0, new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_read_prefix", [".", new Place(1), new Place(1), undefined, undefined, undefined, 0, new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(11, "sys_read_prefix", [undefined, new Place(0), new Place(1), new Place(2), new Place(3), new Place(4), new Place(3), new Place(5), new Place(6)], [new Skeleton(make_defined([new Clause(5, "", [new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("<"), [new Place(1), new Place(2)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_sync_throw"), [new Skeleton("error", [new Frozen("syntax_error", ["operator_clash"]), undefined]), new Place(3), new Place(4)])], 0), new Clause(2, "", [undefined, undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("="), [new Place(0), new Place(1)])], -1)]), [new Place(2), new Place(3), new Place(5), new Place(7)]), new Skeleton(new Cache("is"), [new Place(8), new Skeleton(new Cache("-"), [new Place(3), new Place(4)])]), new Skeleton(new Cache("sys_read_priority"), [new Place(9), new Place(8), new Place(7), new Place(10)]), new Skeleton(new Cache("=.."), [new Place(0), new Skeleton(".", [new Place(1), new Skeleton(".", [new Place(9), "[]"])])]), new Skeleton(new Cache("="), [new Place(10), new Place(6)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_neg", 4])], -1));
add(new Clause(5, "sys_read_neg", [new Place(1), new Place(2), new Place(3), new Place(4)], [new Skeleton(new Cache("number"), [new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("is"), [new Place(2), new Skeleton(new Cache("-"), [new Place(1)])]), new Skeleton(new Cache("="), [new Place(3), new Place(4)])], 0));
add(new Clause(2, "sys_read_neg", [undefined, undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("sys_sync_throw"), [new Skeleton("error", [new Frozen("syntax_error", ["illegal_number"]), undefined]), new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_args", 4])], -1));
add(new Clause(9, "sys_read_args", [",", new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_token"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_read_priority"), [new Place(1), 999, new Place(5), new Place(6)]), new Skeleton(new Cache("sys_current_token"), [new Place(7), new Place(6), new Place(8)]), new Skeleton(new Cache("sys_read_args"), [new Place(7), new Place(2), new Place(8), new Place(4)])], 0));
add(new Clause(1, "sys_read_args", [undefined, "[]", new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_list", 6])], -1));
add(new Clause(9, "sys_read_list", ["]", new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_reach_code"), [new Place(6), new Place(4), new Place(7)]), new Skeleton(new Cache("sys_next_token"), [new Place(7), new Place(8)]), new Skeleton(new Cache("sys_read_atom"), [new Place(6), "[]", new Place(1), new Place(2), new Place(3), new Place(8), new Place(5)])], 0));
add(new Clause(9, "sys_read_list", [undefined, new Skeleton(".", [new Place(0), new Place(1)]), undefined, 0, new Place(2), new Place(3)], [new Skeleton(new Cache("sys_read_priority"), [new Place(0), 999, new Place(2), new Place(4)]), new Skeleton(new Cache("sys_current_token"), [new Place(5), new Place(4), new Place(6)]), new Skeleton(new Cache("sys_read_rest"), [new Place(5), new Place(1), new Place(6), new Place(7)]), new Skeleton(new Cache("sys_read_end"), ["]", new Place(7), new Place(8)]), new Skeleton(new Cache("sys_next_token"), [new Place(8), new Place(3)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_rest", 4])], -1));
add(new Clause(9, "sys_read_rest", [",", new Skeleton(".", [new Place(1), new Place(2)]), new Place(3), new Place(4)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_token"), [new Place(3), new Place(5)]), new Skeleton(new Cache("sys_read_priority"), [new Place(1), 999, new Place(5), new Place(6)]), new Skeleton(new Cache("sys_current_token"), [new Place(7), new Place(6), new Place(8)]), new Skeleton(new Cache("sys_read_rest"), [new Place(7), new Place(2), new Place(8), new Place(4)])], 0));
add(new Clause(5, "sys_read_rest", ["|", new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_next_token"), [new Place(2), new Place(4)]), new Skeleton(new Cache("sys_read_priority"), [new Place(1), 999, new Place(4), new Place(3)])], 0));
add(new Clause(1, "sys_read_rest", [undefined, "[]", new Place(0), new Place(0)], [], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_set", 6])], -1));
add(new Clause(9, "sys_read_set", ["}", new Place(1), new Place(2), new Place(3), new Place(4), new Place(5)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_reach_code"), [new Place(6), new Place(4), new Place(7)]), new Skeleton(new Cache("sys_next_token"), [new Place(7), new Place(8)]), new Skeleton(new Cache("sys_read_atom"), [new Place(6), "{}", new Place(1), new Place(2), new Place(3), new Place(8), new Place(5)])], 0));
add(new Clause(5, "sys_read_set", [undefined, new Skeleton("{}", [new Place(0)]), undefined, 0, new Place(1), new Place(2)], [new Skeleton(new Cache("sys_read_priority"), [new Place(0), 1200, new Place(1), new Place(3)]), new Skeleton(new Cache("sys_read_end"), ["}", new Place(3), new Place(4)]), new Skeleton(new Cache("sys_next_token"), [new Place(4), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_read_end", 3])], -1));
add(new Clause(5, "sys_read_end", [new Place(1), new Place(2), new Place(3)], [new Skeleton(new Cache("sys_current_token"), [new Place(1), new Place(2), new Place(4)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(4), new Place(3)])], 0));
add(new Clause(3, "sys_read_end", [".", new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_sync_throw"), [new Skeleton("error", [new Frozen("syntax_error", ["end_of_clause_expected"]), undefined]), new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_read_end", ["end_of_file", new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_sync_throw"), [new Skeleton("error", [new Frozen("syntax_error", ["end_of_clause_expected"]), undefined]), new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_read_end", [")", new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_sync_throw"), [new Skeleton("error", [new Frozen("syntax_error", ["parenthesis_balance"]), undefined]), new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_read_end", ["}", new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("sys_sync_throw"), [new Skeleton("error", [new Frozen("syntax_error", ["brace_balance"]), undefined]), new Place(1), new Place(2)])], 0));
add(new Clause(2, "sys_read_end", ["]", new Place(0), new Place(1)], [new Skeleton(new Cache("sys_sync_throw"), [new Skeleton("error", [new Frozen("syntax_error", ["bracket_balance"]), undefined]), new Place(0), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_next_token", 2])], -1));
add(new Clause(8, "sys_next_token", [new Skeleton("t", [undefined, new Place(0), new Skeleton("r", [new Place(1), new Place(2)]), new Place(3)]), new Skeleton("t", [new Place(4), new Place(0), new Skeleton("r", [new Place(1), new Place(5)]), new Place(3)])], [new Skeleton(new Cache("sys_get_token"), [new Place(6), new Skeleton("-", [new Place(1), new Place(2)]), new Skeleton("-", [undefined, new Place(5)])]), new Skeleton(new Cache("sys_trap"), [new Skeleton("sys_convert_token", [new Place(6), new Place(4)]), new Place(7), new Skeleton("sys_sync_raise", [new Place(7), new Skeleton("t", [new Place(6), new Place(0), new Skeleton("r", [new Place(1), new Place(5)]), new Place(3)]), undefined])])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_sync_throw", 3])], -1));
add(new Clause(5, "sys_sync_throw", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_reach_stream"), [new Place(3), new Place(1), new Place(4)]), new Skeleton(new Cache("sys_fill_line"), [new Place(0), new Place(3)]), new Skeleton(new Cache("sys_fill_stack"), [new Place(0)]), new Skeleton(new Cache("sys_sync_raise"), [new Place(0), new Place(4), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_sync_raise", 3])], -1));
add(new Clause(6, "sys_sync_raise", [new Place(0), new Place(1), new Place(2)], [new Skeleton(new Cache("sys_current_token"), [new Place(3), new Place(1), new Place(4)]), new Skeleton(new Cache("sys_sync_tokens"), [new Place(3), new Place(4), new Place(5)]), new Skeleton(new Cache("sys_raise"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(5), new Place(2)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_sync_tokens", 3])], -1));
add(new Clause(4, "sys_sync_tokens", [new Skeleton("single", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("member"), [-1, new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_sync_tokens", [new Skeleton("codes", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("member"), [-1, new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_sync_tokens", [new Skeleton("back", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("member"), [-1, new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(4, "sys_sync_tokens", [new Skeleton("code", [new Place(1)]), new Place(2), new Place(3)], [new Skeleton(new Cache("member"), [-1, new Place(1)]), new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(2), new Place(3)])], 0));
add(new Clause(3, "sys_sync_tokens", [".", new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(3, "sys_sync_tokens", ["end_of_file", new Place(1), new Place(2)], [new Skeleton(new Cache("$CUT"), [new Place(0)]), new Skeleton(new Cache("="), [new Place(1), new Place(2)])], 0));
add(new Clause(5, "sys_sync_tokens", [undefined, new Place(0), new Place(1)], [new Skeleton(new Cache("sys_sync_token"), [new Place(0), new Place(2)]), new Skeleton(new Cache("sys_current_token"), [new Place(3), new Place(2), new Place(4)]), new Skeleton(new Cache("sys_sync_tokens"), [new Place(3), new Place(4), new Place(1)])], -1));
run(new Goal(0, [new Frozen(new Cache("sys_usage_predicate"), ["sys_sync_token", 2])], -1));
add(new Clause(6, "sys_sync_token", [new Skeleton("t", [undefined, new Place(0), new Skeleton("r", [new Place(1), new Place(2)]), new Place(3)]), new Skeleton("t", [new Place(4), new Place(0), new Skeleton("r", [new Place(1), new Place(5)]), new Place(3)])], [new Skeleton(new Cache("sys_get_token"), [new Place(4), new Skeleton("-", [new Place(1), new Place(2)]), new Skeleton("-", [undefined, new Place(5)])])], -1));










export {add, set, 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}

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_gc_time() {
    return gc_time;
}
export function get_gc_maxinfs() {
    return gc_maxinfs;
}
export function get_bootbase() {
    return bootbase;
}

export {make_special, make_arithmetic, check_atomic, is_frozen,
    make_check, cont, make_error, check_clause, register_interrupt,
    check_nonvar, check_atom, fs, url, register_signal, MAX_ARITY,
    check_number, check_integer, check_callable, Item, check_nil,
    real_time, gc_major, Frozen, stack_push, stack_peek,
    call, set_temp_display, os,
    stack_pop, is_compound, check_provable, is_logical,
    size_peek, is_stick, Place, Skeleton, is_skeleton}

export {Variable, Compound, is_variable, is_structure,
    is_atom, is_number, is_integer, is_float,
    exec_deref, is_pending, norm_float, walk_compute,
    union_find, union_add, union_undo, walk_vars,
    VAR_MASK_SEEN, VAR_MASK_SERNO, VAR_MASK_STATE,
    equal_term, bind, exec_unify, variable_serno,
    Triple, is_triple, set_to_list, unify,
    deref, copy_term, exec_eval, exec_build,
    objects_list, list_objects, walk_uncompute}

export {Source, Sink, stream_close, stream_flush,
    check_source, check_sink, put_atom,
    MASK_DST_FEAT, MASK_DST_LINE,
    MASK_SRC_AREAD, get_encoding, map_stream_error,
    set_bootbase, set_codebase, file_read_promise}

export {post, perform, goto_async, FFI_FUNC, register,
    instrument_document_async, perform_async}

export {is_bigint, norm_smallint, widen_bigint, is_special,
    norm_bigint, narrow_float, char_count, object_hash_code}

export {fiddle_out, fiddle_in_promise, html_send, html_encode,
    set_cursor, set_caret_wait, set_input, fiddle_flush}