Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@gitlab:/home/dmiles/logicmoo_workspace/packs_usr/wam_common_lisp/prolog/wam_cl# cls ; swipl block_tagbody.pl
- Installed packages (38):
- i clause_attvars@1.1.118 - An alternate interface to the clause database to allow attributed variables to be asserted
- i dictoo@1.1.118 - Dict-like OO Syntax
- i each_call_cleanup@1.1.118 - Each Call Redo Setup and Cleanup
- i eggdrop@1.1.118 - Hook up to an existing IRC Client called an Eggdrop
- i file_scope@1.1.118 - File local scoped efects
- i fluxplayer-prolog-engine@0.0.1 - Prolog interface to Slack http://www.slack.com
- i gvar_syntax@1.1.118 - Global Variable Syntax
- i hook_hybrid@1.1.118 - Hook assert retract call of *specific* predicates
- i instant_prolog_docs@1.1.118 - Magically document prolog source files based on predicate and variable naming conventions
- i lib_atts@1.1.118 - Common atts.pl interface like https://sicstus.sics.se/sicstus/docs/4.0.0/html/sicstus/lib_002datts.html
- i logicmoo_base@1.1.118 - LogicMOO - Extends Prolog Programming to support Dynamic Epistemic Logic (DEL) with Constraints
- i logicmoo_experimental@1.1.118 - Various experimental packages - warning: HUGE amount of test data
- i logicmoo_nlu@1.1.114 - Various English to Logic Convertors - warning: HUGE amount of test data
- i logicmoo_packages@1.1.118 - Various packages - warning: HUGE amount of test data
- i logicmoo_planner@1.1.118 - Various PDDLish planners - warning: HUGE amount of test data
- i logicmoo_planners@1.1.118 - Various Hybrid HTN Planners speaking PDDLish and OCLh
- i logicmoo_utils@1.1.118 - Common predicates used by external Logicmoo Utils and Base
- i loop_check@1.1.118 - New simple loop checking
- i mpi@1.0 - Porting of the LAMMPI library of Yap Prolog to SWI-Prolog
- i multimodal_dcg@1.1.118 - Reduce floundering of DCGs by constraining and narrowing search
- i multivar@1.1.118 - User defined datatypes
- i must_trace@1.1.118 - Trace with your eyeballs instead of your fingers
- i no_repeats@1.1.118 - New ways to avoid duplicate solutions
- i pfc@1.1.118 - Pfc -- a package for forward chaining in Prolog
- i predicate_streams@1.1.118 - Implement your own Abstract Predicate Streams
- i prologmud@1.1.118 - Online text adventure game - MUD Server
- i prologmud_samples@1.1.118 - Online text adventure game - Sample
- i s_expression@1.1.118 - Utilities for Handling of S-Expression Lisp/Scheme-Like forms and parsing of KIF, GDL, PDDL, CLIF
- i slack_prolog@1.1.118 - Prolog interface to Slack http://www.slack.com
- i subclause_expansion@1.1.118 - More use specific versions of term/goal expansion hooks
- i tabling_dra@1.1.118 - SWI-Prolog interface to Table-handling procedures for the "dra" interpreter. Written by Feliks Kluzniak at UTD (March 2009)
- i transpiler@0.1 - A universal translator for programming languages
- i trill@4.1.0 - A tableau probabilistic reasoner in three different versions
- i wam_common_lisp@1.1.118 - ANSI Common Lisp implemented in Prolog
- i with_open_options@1.1.118 - Utilities to open various objects for read/write
- i with_thread_local@1.1.118 - Call a Goal with local assertions
- i xlisting@1.1.118 - Selective Interactive Non-Deterministic Tracing
- i xlisting_web@1.1.118 - Manipulate and browse prolog runtime over www
- index(zip/3,[1,2,3])
- index(zip_with/4,[1,2,4])
- optimize(zip/3)
- optimize(zip_with/4)
- /*
- :- ( second(l)<<==first(rest(l))
- ).
- */
- /*
- second(L_In, First_Ret) :- !,
- Env=[[bv(l, [L_In|__])]],
- sym_arg_val_env(l, L_In, L_Thru, Env),
- rest(L_Thru, Rest_Ret),
- first(Rest_Ret, First_Ret).
- */
- /*
- second(L_In, First_Ret) :-
- fail,
- ( [second, l]<<==[first, [rest, l]]
- ).
- */
- /*
- :- ( third(l)<<==first(rest(rest(l)))
- ).
- */
- /*
- third(L_In, First_Ret) :- !,
- Env=[[bv(l, [L_In|__])]],
- sym_arg_val_env(l, L_In, L_Thru, Env),
- rest(L_Thru, Rest_Ret),
- rest(Rest_Ret, Rest_Ret7),
- first(Rest_Ret7, First_Ret).
- */
- /*
- third(L_In, First_Ret) :-
- fail,
- ( [third, l]<<==[first, [rest, [rest, l]]]
- ).
- */
- /*
- :- ( list_1(a)<<==cons(a, nil)
- ).
- */
- /*
- list_1(A_In, RET) :- !,
- Env=[[bv(a, [A_In|__])]],
- sym_arg_val_env(a, A_In, A_Thru, Env),
- RET=[A_Thru].
- */
- /*
- list_1(A_In, RET) :-
- fail,
- ( [list_1, a]<<==[cons, a, nil]
- ).
- */
- /*
- :- ( list_2(a, b)<<==cons(a, list_1(b))
- ).
- */
- /*
- list_2(A_In, B_In, RET) :- !,
- Env=[[bv(a, [A_In|__]), bv(b, [B_In|__9])]],
- sym_arg_val_env(a, A_In, A_Thru, Env),
- sym_arg_val_env(b, B_In, B_Thru, Env),
- list_1(B_Thru, List_1_Ret),
- RET=[A_Thru|List_1_Ret].
- */
- /*
- list_2(A_In, B_In, RET) :-
- fail,
- ( [list_2, a, b]<<==[cons, a, [list_1, b]]
- ).
- */
- /*
- :- ( list_3(a, b, c)<<==cons(a, list_2(b, c))
- ).
- */
- /*
- list_3(A_In, B_In, C_In, RET) :- !,
- Env=[[bv(a, [A_In|__]), bv(b, [B_In|__10]), bv(c, [C_In|__13])]],
- sym_arg_val_env(a, A_In, A_Thru, Env),
- sym_arg_val_env(b, B_In, B_Thru, Env),
- sym_arg_val_env(c, C_In, C_Thru, Env),
- list_2(B_Thru, C_Thru, List_2_Ret),
- RET=[A_Thru|List_2_Ret].
- */
- /*
- list_3(A_In, B_In, C_In, RET) :-
- fail,
- ( [list_3, a, b, c]<<==[cons, a, [list_2, b, c]]
- ).
- */
- /*
- :- ( lisp_append(l1, l2)<<==if(null(l1), l2, cons(first(l1), lisp_append(rest(l1), l2)))
- ).
- */
- /*
- lisp_append(L1_In13, L2_In16, RET) :- !,
- Env=[[bv(l1, [L1_In13|__]), bv(l2, [L2_In16|__9])]],
- sym_arg_val_env(l1, L1_In13, L1_Thru, Env),
- ( L1_Thru==[]
- -> sym_arg_val_env(l2, L2_In16, L2_Thru, Env),
- RET=L2_Thru
- ; symbol_value(l1, Env, L1_Thru11),
- first(L1_Thru11, First_Ret),
- symbol_value(l1, Env, L1_Thru14),
- rest(L1_Thru14, Rest_Ret),
- symbol_value(l2, Env, L2_Thru17),
- lisp_append(Rest_Ret, L2_Thru17, Lisp_append_Ret),
- _1830=[First_Ret|Lisp_append_Ret],
- RET=_1830
- ).
- */
- /*
- lisp_append(L1_In13, L2_In16, RET) :-
- fail,
- ( [lisp_append, l1, l2]<<==[if, [null, l1], l2, [cons, [first, l1], [lisp_append, [rest, l1], l2]]]
- ).
- */
- /*
- :- ( mapcar(func, l)<<==if(null(l), nil, cons(lisp_apply(func, list_1(first(l))), mapcar(func, rest(l))))
- ).
- */
- /*
- mapcar(Func_In15, L_In18, RET) :- !,
- Env=[[bv(func, [Func_In15|__9]), bv(l, [L_In18|__])]],
- sym_arg_val_env(l, L_In18, L_Thru, Env),
- ( L_Thru==[]
- -> RET=[]
- ; sym_arg_val_env(func, Func_In15, Func_Thru, Env),
- symbol_value(l, Env, L_Thru11),
- first(L_Thru11, First_Ret),
- list_1(First_Ret, List_1_Ret),
- lisp_apply(Func_Thru, List_1_Ret, Lisp_apply_Ret),
- symbol_value(func, Env, Func_Thru16),
- symbol_value(l, Env, L_Thru19),
- rest(L_Thru19, Rest_Ret),
- mapcar(Func_Thru16, Rest_Ret, Mapcar_Ret),
- _1836=[Lisp_apply_Ret|Mapcar_Ret],
- RET=_1836
- ).
- */
- /*
- mapcar(Func_In15, L_In18, RET) :-
- fail,
- ( [mapcar, func, l]<<==[if, [null, l], nil, [cons, [lisp_apply, func, [list_1, [first, l]]], [mapcar, func, [rest, l]]]]
- ).
- */
- /*
- :- ( stream_first(stream)<<==first(stream)
- ).
- */
- /*
- stream_first(Stream_In, First_Ret) :- !,
- Env=[[bv(stream, [Stream_In|__])]],
- sym_arg_val_env(stream, Stream_In, Stream_Thru, Env),
- first(Stream_Thru, First_Ret).
- */
- /*
- stream_first(Stream_In, First_Ret) :-
- fail,
- ( [stream_first, stream]<<==[first, stream]
- ).
- */
- /*
- :- ( stream_rest(stream)<<==lisp_apply(second(stream), [])
- ).
- */
- /*
- stream_rest(Stream_In, Lisp_apply_Ret) :- !,
- Env=[[bv(stream, [Stream_In|__])]],
- sym_arg_val_env(stream, Stream_In, Stream_Thru, Env),
- second(Stream_Thru, Second_Ret),
- lisp_apply(Second_Ret, [], Lisp_apply_Ret).
- */
- /*
- stream_rest(Stream_In, Lisp_apply_Ret) :-
- fail,
- ( [stream_rest, stream]<<==[lisp_apply, [second, stream], []]
- ).
- */
- /*
- :- ( stream_cons(a, b)<<==list_2(a, b)
- ).
- */
- /*
- stream_cons(A_In, B_In, List_2_Ret) :- !,
- Env=[[bv(a, [A_In|__]), bv(b, [B_In|__9])]],
- sym_arg_val_env(a, A_In, A_Thru, Env),
- sym_arg_val_env(b, B_In, B_Thru, Env),
- list_2(A_Thru, B_Thru, List_2_Ret).
- */
- /*
- stream_cons(A_In, B_In, List_2_Ret) :-
- fail,
- ( [stream_cons, a, b]<<==[list_2, a, b]
- ).
- */
- /*
- :- ( stream_null(stream)<<==null(stream)
- ).
- */
- /*
- stream_null(Stream_In, Null_Ret) :- !,
- Env=[[bv(stream, [Stream_In|__])]],
- sym_arg_val_env(stream, Stream_In, Stream_Thru, Env),
- null(Stream_Thru, Null_Ret).
- */
- /*
- stream_null(Stream_In, Null_Ret) :-
- fail,
- ( [stream_null, stream]<<==[null, stream]
- ).
- */
- /*
- :- ( stream_take(n, stream)<<==if(or(equalp(n, 0), stream_null(stream)), [], cons(stream_first(stream), stream_take(minus(n, 1), stream_rest(stream))))
- ).
- */
- /*
- stream_take(N_In17, Stream_In20, RET) :- !,
- Env=[[bv(n, [N_In17|__]), bv(stream, [Stream_In20|__10])]],
- sym_arg_val_env(n, N_In17, N_Thru, Env),
- equalp(N_Thru, 0, Equalp_Ret),
- sym_arg_val_env(stream, Stream_In20, Stream_Thru, Env),
- stream_null(Stream_Thru, Stream_null_Ret),
- or(Equalp_Ret, Stream_null_Ret, Or_Ret),
- ( Or_Ret\=[]
- -> RET=[]
- ; symbol_value(stream, Env, Stream_Thru14),
- stream_first(Stream_Thru14, Stream_first_Ret),
- symbol_value(n, Env, N_Thru18),
- minus(N_Thru18, 1, Minus_Ret),
- symbol_value(stream, Env, Stream_Thru21),
- stream_rest(Stream_Thru21, Stream_rest_Ret),
- stream_take(Minus_Ret, Stream_rest_Ret, Stream_take_Ret),
- _1980=[Stream_first_Ret|Stream_take_Ret],
- RET=_1980
- ).
- */
- /*
- stream_take(N_In17, Stream_In20, RET) :-
- fail,
- ( [stream_take, n, stream]<<==[if, [or, [equalp, n, 0], [stream_null, stream]], [], [cons, [stream_first, stream], [stream_take, [minus, n, 1], [stream_rest, stream]]]]
- ).
- */
- /*
- :- ( stream_drop(n, stream)<<==if(or(equalp(n, 0), stream_null(stream)), stream, stream_drop(minus(n, 1), stream_rest(stream)))
- ).
- */
- /*
- stream_drop(N_In16, Stream_In19, RET) :- !,
- Env=[[bv(n, [N_In16|__]), bv(stream, [Stream_In19|__10])]],
- sym_arg_val_env(n, N_In16, N_Thru, Env),
- equalp(N_Thru, 0, Equalp_Ret),
- sym_arg_val_env(stream, Stream_In19, Stream_Thru, Env),
- stream_null(Stream_Thru, Stream_null_Ret),
- or(Equalp_Ret, Stream_null_Ret, Or_Ret),
- ( Or_Ret\=[]
- -> symbol_value(stream, Env, Stream_Thru14),
- RET=Stream_Thru14
- ; symbol_value(n, Env, N_Thru17),
- minus(N_Thru17, 1, Minus_Ret),
- symbol_value(stream, Env, Stream_Thru20),
- stream_rest(Stream_Thru20, Stream_rest_Ret),
- stream_drop(Minus_Ret, Stream_rest_Ret, Stream_drop_Ret),
- RET=Stream_drop_Ret
- ).
- */
- /*
- stream_drop(N_In16, Stream_In19, RET) :-
- fail,
- ( [stream_drop, n, stream]<<==[if, [or, [equalp, n, 0], [stream_null, stream]], stream, [stream_drop, [minus, n, 1], [stream_rest, stream]]]
- ).
- */
- /*
- :- ( stream_interval(low, high)<<==if(equalp(low, high), [], stream_cons(low, function(lambda([], stream_interval(plus(low, 1), high)))))
- ).
- */
- /*
- stream_interval(Low_In13, High_In16, RET) :- !,
- Env=[[bv(low, [Low_In13|__]), bv(high, [High_In16|__9])]],
- sym_arg_val_env(low, Low_In13, Low_Thru, Env),
- sym_arg_val_env(high, High_In16, High_Thru, Env),
- equalp(Low_Thru, High_Thru, Equalp_Ret),
- ( Equalp_Ret\=[]
- -> RET=[]
- ; symbol_value(low, Env, Low_Thru12),
- stream_cons(Low_Thru12,
- [ closure,
- [],
- [LEnv, Stream_interval_Ret]^(symbol_value(low, LEnv, Low_Thru14), plus(Low_Thru14, 1, Plus_Ret), symbol_value(high, LEnv, High_Thru17), stream_interval(Plus_Ret, High_Thru17, Stream_interval_Ret)),
- Env
- ],
- Stream_cons_Ret),
- RET=Stream_cons_Ret
- ).
- */
- /*
- stream_interval(Low_In13, High_In16, RET) :-
- fail,
- ( [stream_interval, low, high]<<==[if, [equalp, low, high], [], [stream_cons, low, [function, [lambda, [], [stream_interval, [plus, low, 1], high]]]]]
- ).
- */
- /*
- :- ( stream_ints_from(n)<<==stream_cons(n, function(lambda([], stream_ints_from(plus(n, 1)))))
- ).
- */
- /*
- stream_ints_from(N_In6, Stream_cons_Ret) :- !,
- Env=[[bv(n, [N_In6|__])]],
- sym_arg_val_env(n, N_In6, N_Thru, Env),
- stream_cons(N_Thru,
- [ closure,
- [],
- [LEnv, Stream_ints_from_Ret]^(symbol_value(n, LEnv, N_Thru7), plus(N_Thru7, 1, Plus_Ret), stream_ints_from(Plus_Ret, Stream_ints_from_Ret)),
- Env
- ],
- Stream_cons_Ret).
- */
- /*
- stream_ints_from(N_In6, Stream_cons_Ret) :-
- fail,
- ( [stream_ints_from, n]<<==[stream_cons, n, [function, [lambda, [], [stream_ints_from, [plus, n, 1]]]]]
- ).
- */
- /*
- :- ( t1<<==stream_take(3, stream_interval(1, 5))
- ).
- */
- /*
- t1(Stream_take_Ret) :- !,
- Env=[[]],
- stream_interval(1, 5, Stream_interval_Ret),
- stream_take(3, Stream_interval_Ret, Stream_take_Ret).
- */
- /*
- t1(Stream_take_Ret) :-
- fail,
- ( t1<<==[stream_take, 3, [stream_interval, 1, 5]]
- ).
- */
- /*
- :- ( t2<<==stream_take(5, stream_drop(10, stream_ints_from(1)))
- ).
- */
- /*
- t2(Stream_take_Ret) :- !,
- Env=[[]],
- stream_ints_from(1, Stream_ints_from_Ret),
- stream_drop(10, Stream_ints_from_Ret, Stream_drop_Ret),
- stream_take(5, Stream_drop_Ret, Stream_take_Ret).
- */
- /*
- t2(Stream_take_Ret) :-
- fail,
- ( t2<<==[stream_take, 5, [stream_drop, 10, [stream_ints_from, 1]]]
- ).
- */
- /*
- :- ( simple(x)<<==x
- ).
- */
- /*
- simple(X_In, X_Thru) :- !,
- Env=[[bv(x, [X_In|__])]],
- sym_arg_val_env(x, X_In, X_Thru, Env).
- */
- /*
- simple(X_In, X_Thru) :-
- fail,
- ( [simple, x]<<==x
- ).
- */
- /*
- :- ( lisp_append_2(l1, l2)<<==cond([[null(l1), l2], [t, cons(first(l1), lisp_append_2(rest(l1), l2))]])
- ).
- */
- /*
- lisp_append_2(L1_In14, L2_In17, RET) :- !,
- Env=[[bv(l1, [L1_In14|__]), bv(l2, [L2_In17|__10])]],
- sym_arg_val_env(l1, L1_In14, L1_Thru, Env),
- null(L1_Thru, Null_Ret),
- ( Null_Ret\=[]
- -> sym_arg_val_env(l2, L2_In17, L2_Thru, Env),
- RET=L2_Thru
- ; ( t\=[]
- -> symbol_value(l1, Env, L1_Thru12),
- first(L1_Thru12, First_Ret),
- symbol_value(l1, Env, L1_Thru15),
- rest(L1_Thru15, Rest_Ret),
- symbol_value(l2, Env, L2_Thru18),
- lisp_append_2(Rest_Ret, L2_Thru18, Lisp_append_2_Ret),
- _2190=[First_Ret|Lisp_append_2_Ret],
- _2174=_2190
- ; _2174=[]
- ),
- RET=_2174
- ).
- */
- /*
- lisp_append_2(L1_In14, L2_In17, RET) :-
- fail,
- ( [lisp_append_2, l1, l2]<<==[cond, [[[null, l1], l2], [t, [cons, [first, l1], [lisp_append_2, [rest, l1], l2]]]]]
- ).
- */
- /*
- :- ( lisp_error(x)<<==setq(y, 5)
- ).
- */
- /*
- lisp_error(X, 5) :- !,
- Env=[[bv(x, [X|_2986])]],
- symbol_setter(setq, y, 5, Env).
- */
- /*
- lisp_error(X, 5) :-
- fail,
- ( [lisp_error, x]<<==[setq, y, 5]
- ).
- */
- /*
- :- ( lisp_let()<<==let([bind(x, 3), bind(y, 5)], progn(x, y))
- ).
- */
- /*
- lisp_let(Y_Thru) :- !,
- Env=[[]],
- LETENV=[[bv(x, [3|_4278]), bv(y, [5|_4358])]|Env],
- sym_arg_val_env(x, X_In, X_Thru, LETENV),
- sym_arg_val_env(y, Y_In, Y_Thru, LETENV).
- */
- /*
- lisp_let(Y_Thru) :-
- fail,
- ( [lisp_let]<<==[let, [[bind, x, 3], [bind, y, 5]], [progn, x, y]]
- ).
- */
- /*
- :- ( lisp_let1()<<==let([bind(x, 3), bind(y, 5)], x, y)
- ).
- */
- /*
- lisp_let1(Y_Thru) :- !,
- Env=[[]],
- LETENV=[[bv(x, [3|_10774]), bv(y, [5|_10854])]|Env],
- sym_arg_val_env(x, X_In, X_Thru, LETENV),
- sym_arg_val_env(y, Y_In, Y_Thru, LETENV).
- */
- /*
- lisp_let1(Y_Thru) :-
- fail,
- ( [lisp_let1]<<==[let, [[bind, x, 3], [bind, y, 5]], x, y]
- ).
- */
- /*
- :- ( mapfirst(l)<<==mapcar(function(first), l)
- ).
- */
- /*
- mapfirst(L_In, Mapcar_Ret) :- !,
- Env=[[bv(l, [L_In|__])]],
- sym_arg_val_env(l, L_In, L_Thru, Env),
- mapcar([function, first], L_Thru, Mapcar_Ret).
- */
- /*
- mapfirst(L_In, Mapcar_Ret) :-
- fail,
- ( [mapfirst, l]<<==[mapcar, [function, first], l]
- ).
- */
- /*
- :- ( <<==defvar(fred, 13)
- ).
- */
- /*
- :- symbol_setter(defvar, fred, 13, toplevel).
- */
- /*
- :- ( <<==defvar(george)
- ).
- */
- /*
- :- symbol_setter(defvar, george, [], toplevel).
- */
- /*
- :- ( reset_george(val)<<==setq(george, val)
- ).
- */
- /*
- reset_george(Val_In, Val_Thru) :- !,
- Env=[[bv(val, [Val_In|__])]],
- sym_arg_val_env(val, Val_In, Val_Thru, Env),
- symbol_setter(setq, george, Val_Thru, Env).
- */
- /*
- reset_george(Val_In, Val_Thru) :-
- fail,
- ( [reset_george, val]<<==[setq, george, val]
- ).
- */
- /*
- :- ( make_adder(x)<<==function(lambda([y], plus(x, y)))
- ).
- */
- /*
- make_adder(X_In, [closure, [y], [LEnv, Plus_Ret]^(((sym_arg_val_env(x, X_In, avar(X_Thru, att(initState, t, [])), LEnv), sym_arg_val_env(y, avar(Y_In, att(initState, t, [])), avar(Y_Thru, att(initState, t, [])), LEnv), true), plus(avar(X_Thru, att(initState, t, [])), avar(Y_Thru, att(initState, t, [])), Plus_Ret)), true), Env]) :- !,
- Env=[[bv(x, [X_In|__])]].
- */
- /*
- make_adder(X_In, [closure, [y], [LEnv, Plus_Ret]^(((sym_arg_val_env(x, X_In, avar(X_Thru, att(initState, t, [])), LEnv), sym_arg_val_env(y, avar(Y_In, att(initState, t, [])), avar(Y_Thru, att(initState, t, [])), LEnv), true), plus(avar(X_Thru, att(initState, t, [])), avar(Y_Thru, att(initState, t, [])), Plus_Ret)), true), Env]) :-
- fail,
- ( [make_adder, x]<<==[function, [lambda, [y], [plus, x, y]]]
- ).
- */
- /*
- :- ( scale_list(xs, scale)<<==let([bind(fred, function(lambda([num], times(scale, num))))], mapcar(fred, xs))
- ).
- */
- /*
- scale_list(Xs_In, Scale_In, Mapcar_Ret) :- !,
- Env=[[bv(xs, [Xs_In|__18]), bv(scale, [Scale_In|__])]],
- LETENV=[[bv(fred, [[closure, [num], [LEnv, Times_Ret]^(sym_arg_val_env(scale, Scale_In, Scale_Thru, LEnv), sym_arg_val_env(num, Num_In, Num_Thru, LEnv), times(Scale_Thru, Num_Thru, Times_Ret)), Env]|_1890])]|Env],
- sym_arg_val_env(fred, Fred_In, Fred_Thru, LETENV),
- sym_arg_val_env(xs, Xs_In, Xs_Thru, LETENV),
- mapcar(Fred_Thru, Xs_Thru, Mapcar_Ret).
- */
- /*
- scale_list(Xs_In, Scale_In, Mapcar_Ret) :-
- fail,
- ( [scale_list, xs, scale]<<==[let, [[bind, fred, [function, [lambda, [num], [times, scale, num]]]]], [mapcar, fred, xs]]
- ).
- */
- /*
- :- ( make_summer(total)<<==function(lambda([n], setq(total, plus(total, n))))
- ).
- */
- /*
- make_summer(Total_In, [closure, [n], [LEnv, Plus_Ret]^((((sym_arg_val_env(total, Total_In, avar(Total_Thru, att(initState, t, [])), LEnv), sym_arg_val_env(n, avar(N_In, att(initState, t, [])), avar(N_Thru, att(initState, t, [])), LEnv), true), plus(avar(Total_Thru, att(initState, t, [])), avar(N_Thru, att(initState, t, [])), Plus_Ret)), symbol_setter(setq, total, Plus_Ret, LEnv)), true), Env]) :- !,
- Env=[[bv(total, [Total_In|__])]].
- */
- /*
- make_summer(Total_In, [closure, [n], [LEnv, Plus_Ret]^((((sym_arg_val_env(total, Total_In, avar(Total_Thru, att(initState, t, [])), LEnv), sym_arg_val_env(n, avar(N_In, att(initState, t, [])), avar(N_Thru, att(initState, t, [])), LEnv), true), plus(avar(Total_Thru, att(initState, t, [])), avar(N_Thru, att(initState, t, [])), Plus_Ret)), symbol_setter(setq, total, Plus_Ret, LEnv)), true), Env]) :-
- fail,
- ( [make_summer, total]<<==[function, [lambda, [n], [setq, total, [plus, total, n]]]]
- ).
- */
- /*
- :- ( sum_with_map(xs)<<==let([bind(running_total, 0)], let([bind(summer, function(lambda([n], setq(running_total, plus(running_total, n)))))], mapcar(summer, xs), running_total))
- ).
- */
- /*
- sum_with_map(Xs_In, Running_total_Thru21) :- !,
- Env=[[bv(xs, [Xs_In|__])]],
- LETENV=[[bv(running_total, [0|_2046])]|Env],
- LETENV13=[[bv(summer, [[closure, [n], [LEnv, Plus_Ret]^(sym_arg_val_env(running_total, Running_total_In, Running_total_Thru, LEnv), sym_arg_val_env(n, N_In, N_Thru, LEnv), plus(Running_total_Thru, N_Thru, Plus_Ret), symbol_setter(setq, running_total, Plus_Ret, LEnv)), LETENV]|_2460])]|LETENV],
- sym_arg_val_env(summer, Summer_In, Summer_Thru, LETENV13),
- sym_arg_val_env(xs, Xs_In, Xs_Thru, LETENV13),
- mapcar(Summer_Thru, Xs_Thru, Mapcar_Ret),
- sym_arg_val_env(running_total,
- Running_total_In20,
- Running_total_Thru21,
- LETENV13).
- */
- /*
- sum_with_map(Xs_In, Running_total_Thru21) :-
- fail,
- ( [sum_with_map, xs]<<==[let, [[bind, running_total, 0]], [let, [[bind, summer, [function, [lambda, [n], [setq, running_total, [plus, running_total, n]]]]]], [mapcar, summer, xs], running_total]]
- ).
- */
- /*
- :- fact==lambda([n], if(n=0, 1, n*fact(sub1(n)))).
- */
- /*
- fact(N_In9, RET) :- !,
- Env=[[bv(n, [N_In9|__])]],
- sym_arg_val_env(n, N_In9, N_Thru, Env),
- =(N_Thru, 0, Vv_c61__Ret),
- ( Vv_c61__Ret\=[]
- -> RET=1
- ; symbol_value(n, Env, N_Thru8),
- symbol_value(n, Env, N_Thru10),
- sub1(N_Thru10, Sub1_Ret),
- fact(Sub1_Ret, Fact_Ret),
- mult(N_Thru8, Fact_Ret, Mult_Ret),
- RET=Mult_Ret
- ).
- */
- /*
- fact(N_In9, RET) :-
- fail,
- ( [fact, n]<<==[if, [=, n, 0], 1, [*, n, [fact, [sub1, n]]]]
- ).
- */
- /*
- :- add1==lambda([n], n+1).
- */
- /*
- add1(N_In, Plus_Ret) :- !,
- Env=[[bv(n, [N_In|__])]],
- sym_arg_val_env(n, N_In, N_Thru, Env),
- plus(N_Thru, 1, Plus_Ret).
- */
- /*
- add1(N_In, Plus_Ret) :-
- fail,
- ( [add1, n]<<==[+, n, 1]
- ).
- */
- /*
- :- sub1==lambda([n], n-1).
- */
- /*
- sub1(N_In, Minus_Ret) :- !,
- Env=[[bv(n, [N_In|__])]],
- sym_arg_val_env(n, N_In, N_Thru, Env),
- minus(N_Thru, 1, Minus_Ret).
- */
- /*
- sub1(N_In, Minus_Ret) :-
- fail,
- ( [sub1, n]<<==[-, n, 1]
- ).
- */
- /*
- :- mapcar==lambda([fun, l], if(null(l), nil, cons(fun(car(l)), mapcar(fun, cdr(l))))).
- */
- /*
- mapcar1(Fun_In14, L_In17, RET) :- !,
- Env=[[bv(fun, [Fun_In14|__9]), bv(l, [L_In17|__])]],
- sym_arg_val_env(l, L_In17, L_Thru, Env),
- ( L_Thru==[]
- -> RET=[]
- ; sym_arg_val_env(fun, Fun_In14, Fun_Thru, Env),
- symbol_value(l, Env, L_Thru11),
- car(L_Thru11, Car_Ret),
- funcall(Fun_Thru, Car_Ret, Funcall_Ret),
- symbol_value(fun, Env, Fun_Thru15),
- symbol_value(l, Env, L_Thru18),
- cdr(L_Thru18, Cdr_Ret),
- mapcar1(Fun_Thru15, Cdr_Ret, Mapcar1_Ret),
- _1792=[Funcall_Ret|Mapcar1_Ret],
- RET=_1792
- ).
- */
- /*
- mapcar1(Fun_In14, L_In17, RET) :-
- fail,
- ( [mapcar1, fun, l]<<==[if, [null, l], nil, [cons, [fun, [car, l]], [mapcar1, fun, [cdr, l]]]]
- ).
- */
- /*
- :- length==lambda([l], if(null(l), 0, add1(length(cdr(l))))).
- */
- /*
- length1(L_In6, RET) :- !,
- Env=[[bv(l, [L_In6|__])]],
- sym_arg_val_env(l, L_In6, L_Thru, Env),
- ( L_Thru==[]
- -> RET=0
- ; symbol_value(l, Env, L_Thru7),
- cdr(L_Thru7, Cdr_Ret),
- length1(Cdr_Ret, Length1_Ret),
- add1(Length1_Ret, Add1_Ret),
- RET=Add1_Ret
- ).
- */
- /*
- length1(L_In6, RET) :-
- fail,
- ( [length1, l]<<==[if, [null, l], 0, [add1, [length1, [cdr, l]]]]
- ).
- */
- /*
- :- append==lambda([l1, l2], if(null(l1), l2, cons(car(l1), append(cdr(l1), l2)))).
- */
- /*
- append1(L1_In13, L2_In16, RET) :- !,
- Env=[[bv(l1, [L1_In13|__]), bv(l2, [L2_In16|__9])]],
- sym_arg_val_env(l1, L1_In13, L1_Thru, Env),
- ( L1_Thru==[]
- -> sym_arg_val_env(l2, L2_In16, L2_Thru, Env),
- RET=L2_Thru
- ; symbol_value(l1, Env, L1_Thru11),
- car(L1_Thru11, Car_Ret),
- symbol_value(l1, Env, L1_Thru14),
- cdr(L1_Thru14, Cdr_Ret),
- symbol_value(l2, Env, L2_Thru17),
- append1(Cdr_Ret, L2_Thru17, Append1_Ret),
- _1830=[Car_Ret|Append1_Ret],
- RET=_1830
- ).
- */
- /*
- append1(L1_In13, L2_In16, RET) :-
- fail,
- ( [append1, l1, l2]<<==[if, [null, l1], l2, [cons, [car, l1], [append1, [cdr, l1], l2]]]
- ).
- */
- /*
- :- filter==lambda([fun, s], if('emptyStream?'(s), s, if(fun(head(s)), consStream(head(s), filter(fun, tail(s))), filter(fun, tail(s))))).
- */
- /*
- filter1(Fun_In28, S_In30, RET) :- !,
- Env=[[bv(fun, [Fun_In28|__12]), bv(s, [S_In30|__])]],
- sym_arg_val_env(s, S_In30, S_Thru, Env),
- 'emptyStream?'(S_Thru, EmptyStream_c63__Ret),
- ( EmptyStream_c63__Ret\=[]
- -> symbol_value(s, Env, S_Thru9),
- RET=S_Thru9
- ; sym_arg_val_env(fun, Fun_In28, Fun_Thru, Env),
- symbol_value(s, Env, S_Thru14),
- head(S_Thru14, Head_Ret),
- funcall(Fun_Thru, Head_Ret, Funcall_Ret),
- ( Funcall_Ret\=[]
- -> symbol_value(s, Env, S_Thru18),
- head(S_Thru18, Head_Ret19),
- symbol_value(fun, Env, Fun_Thru21),
- symbol_value(s, Env, S_Thru24),
- tail(S_Thru24, Tail_Ret),
- filter1(Fun_Thru21, Tail_Ret, Filter1_Ret),
- consStream(Head_Ret19, Filter1_Ret, ConsStream_Ret),
- _1782=ConsStream_Ret
- ; symbol_value(fun, Env, Fun_Thru29),
- symbol_value(s, Env, S_Thru31),
- tail(S_Thru31, Tail_Ret32),
- filter1(Fun_Thru29, Tail_Ret32, Filter1_Ret33),
- _1782=Filter1_Ret33
- ),
- RET=_1782
- ).
- */
- /*
- filter1(Fun_In28, S_In30, RET) :-
- fail,
- ( [filter1, fun, s]<<==[if, ['emptyStream?', s], s, [if, [fun, [head, s]], [consStream, [head, s], [filter1, fun, [tail, s]]], [filter1, fun, [tail, s]]]]
- ).
- */
- /*
- :- ( from(n)<<==consStream(n, from(n+1))
- ).
- */
- /*
- from(N_In6, ConsStream_Ret) :- !,
- Env=[[bv(n, [N_In6|__])]],
- sym_arg_val_env(n, N_In6, N_Thru, Env),
- symbol_value(n, Env, N_Thru7),
- plus(N_Thru7, 1, Plus_Ret),
- from(Plus_Ret, From_Ret),
- consStream(N_Thru, From_Ret, ConsStream_Ret).
- */
- /*
- from(N_In6, ConsStream_Ret) :-
- fail,
- ( [from, n]<<==[consStream, n, [from, [+, n, 1]]]
- ).
- */
- /*
- :- nthStream==lambda([s, n], if(n=1, head(s), nthStream(tail(s), n-1))).
- */
- /*
- nthStream(S_In12, N_In16, RET) :- !,
- Env=[[bv(s, [S_In12|__10]), bv(n, [N_In16|__])]],
- sym_arg_val_env(n, N_In16, N_Thru, Env),
- =(N_Thru, 1, Vv_c61__Ret),
- ( Vv_c61__Ret\=[]
- -> sym_arg_val_env(s, S_In12, S_Thru, Env),
- head(S_Thru, Head_Ret),
- RET=Head_Ret
- ; symbol_value(s, Env, S_Thru13),
- tail(S_Thru13, Tail_Ret),
- symbol_value(n, Env, N_Thru17),
- minus(N_Thru17, 1, Minus_Ret),
- nthStream(Tail_Ret, Minus_Ret, NthStream_Ret),
- RET=NthStream_Ret
- ).
- */
- /*
- nthStream(S_In12, N_In16, RET) :-
- fail,
- ( [nthStream, s, n]<<==[if, [=, n, 1], [head, s], [nthStream, [tail, s], [-, n, 1]]]
- ).
- */
- /*
- :- integers==from(1).
- */
- /*
- :- ssip_define(integers, from(1)).
- */
- /*
- :- makeCounter==lambda([], begin(counter==0, lambda([], setq(counter, 1+counter)))).
- */
- /*
- makeCounter(Begin_Ret) :- !,
- Env=[[]],
- sym_arg_val_env(counter, Counter_In, Counter_Thru, Env),
- ==(Counter_Thru, 0, Vv_c61__c61__Ret),
- begin(Vv_c61__c61__Ret,
- [ closure,
- [],
- [LEnv, Plus_Ret]^(sym_arg_val_env(counter, Counter_In5, Counter_Thru6, LEnv), plus(1, Counter_Thru6, Plus_Ret), symbol_setter(setq, counter, Plus_Ret, LEnv)),
- Env
- ],
- Begin_Ret).
- */
- /*
- makeCounter(Begin_Ret) :-
- fail,
- ( makeCounter<<==[begin, [==, counter, 0], [lambda, [], [setq, counter, [+, 1, counter]]]]
- ).
- */
- /*
- :- caaaar==lambda([x], car(car(car(car(x))))).
- */
- /*
- caaaar(X_In, Car_Ret9) :- !,
- Env=[[bv(x, [X_In|__])]],
- sym_arg_val_env(x, X_In, X_Thru, Env),
- car(X_Thru, Car_Ret),
- car(Car_Ret, Car_Ret7),
- car(Car_Ret7, Car_Ret8),
- car(Car_Ret8, Car_Ret9).
- */
- /*
- caaaar(X_In, Car_Ret9) :-
- fail,
- ( [caaaar, x]<<==[car, [car, [car, [car, x]]]]
- ).
- */
- /*
- :- caar==lambda([x], car(car(x))).
- */
- /*
- caar(X_In, Car_Ret7) :- !,
- Env=[[bv(x, [X_In|__])]],
- sym_arg_val_env(x, X_In, X_Thru, Env),
- car(X_Thru, Car_Ret),
- car(Car_Ret, Car_Ret7).
- */
- /*
- caar(X_In, Car_Ret7) :-
- fail,
- ( [caar, x]<<==[car, [car, x]]
- ).
- */
- /*
- :- reverse==lambda([l], if(null(l), l, append(reverse(cdr(l)), cons(car(l), nil)))).
- */
- /*
- reverse1(L_In12, RET) :- !,
- Env=[[bv(l, [L_In12|__])]],
- sym_arg_val_env(l, L_In12, L_Thru, Env),
- ( L_Thru==[]
- -> symbol_value(l, Env, L_Thru7),
- RET=L_Thru7
- ; symbol_value(l, Env, L_Thru9),
- cdr(L_Thru9, Cdr_Ret),
- reverse1(Cdr_Ret, Reverse1_Ret),
- symbol_value(l, Env, L_Thru13),
- car(L_Thru13, Car_Ret),
- _7460=[Car_Ret],
- append(Reverse1_Ret, _7460, Append_Ret),
- RET=Append_Ret
- ).
- */
- /*
- reverse1(L_In12, RET) :-
- fail,
- ( [reverse1, l]<<==[if, [null, l], l, [append, [reverse1, [cdr, l]], [cons, [car, l], nil]]]
- ).
- */
- Warning: /home/dmiles/logicmoo_workspace/packs_usr/wam_common_lisp/prolog/wam_cl/block_tagbody.pl:497:
- Singleton variables: [Temp_one_In,Temp_two_In,Temp_one_In13,Temp_one_In17,Temp_two_In20]
- Welcome to WAM-CL!
- This is a miniscule Lisp interpreter, written in Prolog
- >
- > prolog
- ?- compile_test(X,Y,Z,Q),dbmsg(Y),call(Y),dbmsg(Y).
- /*
- :- lisp_compiled_eval(
- [ let,
- [b],
- [ tagbody,
- [setq, b, 2],
- [go, tag2],
- [setq, a, 1],
- tag1,
- [setq, b, 3],
- [go, tag3],
- tag2,
- [setq, a, 4],
- [go, tag1],
- tag3,
- [print, ['1+', [plus, a, b]]]
- ],
- b
- ]).
- */
- ( let ( b ) ( tagbody ( setq b 2 ) ( go tag2 ) ( setq a 1 ) tag1 ( setq b 3 ) ( go tag3 ) tag2 ( setq a 4 ) ( go tag1 ) tag3 ( print ( 1+ ( plus a b ) ) ) ) b )
- /*
- :- GoEnvLETENV=[[bv(b, [[]|_238])]|toplevel],
- call_addr_block(GoEnvLETENV,
- (symbol_setter(setq, b, 2, GoEnvLETENV), goto(tag2, [], GoEnvLETENV)),
- [ addr(tag1,
- '$used',
- _600,
- (symbol_setter(setq, b, 3, _600), goto(tag3, [], _600))),
- addr(tag2,
- '$used',
- _604,
- (symbol_setter(setq, a, 4, _604), goto(tag1, [], _604))),
- addr(tag3,
- '$used',
- _616,
- (sym_arg_val_env(a, _618, _620, _616), sym_arg_val_env(b, _622, _624, _616), plus(_620, _624, _626), '1+'(_626, _628), print(_628, _632)))
- ],
- _GORES18),
- sym_arg_val_env(b, B_In20, B_Thru21, GoEnvLETENV).
- */
- 8
- /*
- :- [[bv(b, [2|_238])]|toplevel]=[[bv(b, [2|_238])]|toplevel],
- call_addr_block([[bv(b, [2|_238])]|toplevel],
- (symbol_setter(setq, b, 2, [[bv(b, [2|_238])]|toplevel]), goto(tag2, [], [[bv(b, [2|_238])]|toplevel])),
- [ addr(tag1,
- '$used',
- _600,
- (symbol_setter(setq, b, 3, _600), goto(tag3, [], _600))),
- addr(tag2,
- '$used',
- _604,
- (symbol_setter(setq, a, 4, _604), goto(tag1, [], _604))),
- addr(tag3,
- '$used',
- _616,
- (sym_arg_val_env(a, _618, _620, _616), sym_arg_val_env(b, _622, _624, _616), plus(_620, _624, _626), '1+'(_626, _628), print(_628, _632)))
- ],
- []),
- sym_arg_val_env(b, 2, 2, [[bv(b, [2|_238])]|toplevel]).
- */
- X = tagbody_let3,
- Y = ([[bv(b, [2|_238])]|toplevel]=[[bv(b, [2|_238])]|toplevel], call_addr_block([[bv(b, [2|_238])]|toplevel], (symbol_setter(setq, b, 2, [[bv(b, [2|...])]|toplevel]), goto(tag2, [], [[bv(b, [2|...])]|toplevel])), [addr(tag1, '$used', _600, (symbol_setter(setq, b, 3, _600), goto(tag3, [], _600))), addr(tag2, '$used', _604, (symbol_setter(setq, a, 4, _604), goto(tag1, [], _604))), addr(tag3, '$used', _616, (sym_arg_val_env(a, _618, _620, _616), sym_arg_val_env(..., ..., ..., ...), ..., ...))], []), sym_arg_val_env(b, 2, 2, [[bv(b, [2|_238])]|toplevel])),
- Z = 2,
- Q = 3 ;
- /*
- :- lisp_compiled_eval(
- [ tagbody,
- [setq, b, 2],
- [go, tag2],
- [setq, a, 1],
- tag1,
- [setq, b, 3],
- [go, tag3],
- tag2,
- [setq, a, 4],
- [go, tag1],
- tag3,
- [print, ['1+', [plus, a, b]]]
- ]).
- */
- ( tagbody ( setq b 2 ) ( go tag2 ) ( setq a 1 ) tag1 ( setq b 3 ) ( go tag3 ) tag2 ( setq a 4 ) ( go tag1 ) tag3 ( print ( 1+ ( plus a b ) ) ) )
- /*
- :- call_addr_block(toplevel,
- (symbol_setter(setq, b, 2, toplevel), goto(tag2, [], toplevel)),
- [ addr(tag1,
- '$used',
- _530,
- (symbol_setter(setq, b, 3, _530), goto(tag3, [], _530))),
- addr(tag2,
- '$used',
- _534,
- (symbol_setter(setq, a, 4, _534), goto(tag1, [], _534))),
- addr(tag3,
- '$used',
- _536,
- (sym_arg_val_env(a, _538, _540, _536), sym_arg_val_env(b, _542, _544, _536), plus(_538, _542, _544), '1+'(_544, _546), print(_546, _548)))
- ],
- _GORES16).
- */
- 8
- /*
- :- call_addr_block(toplevel,
- (symbol_setter(setq, b, 2, toplevel), goto(tag2, [], toplevel)),
- [ addr(tag1,
- '$used',
- _530,
- (symbol_setter(setq, b, 3, _530), goto(tag3, [], _530))),
- addr(tag2,
- '$used',
- _532,
- (symbol_setter(setq, a, 4, _532), goto(tag1, [], _532))),
- addr(tag3,
- '$used',
- _534,
- (sym_arg_val_env(a, _536, _538, _534), sym_arg_val_env(b, _540, _542, _534), plus(_538, _542, _544), '1+'(_544, _546), print(_546, _548)))
- ],
- []).
- */
- X = tagbody7_prints_8,
- Y = call_addr_block(toplevel, (symbol_setter(setq, b, 2, toplevel), goto(tag2, [], toplevel)), [addr(tag1, '$used', _530, (symbol_setter(setq, b, 3, _530), goto(tag3, [], _530))), addr(tag2, '$used', _532, (symbol_setter(setq, a, 4, _532), goto(tag1, [], _532))), addr(tag3, '$used', _534, (sym_arg_val_env(a, _536, _538, _534), sym_arg_val_env(b, _540, _542, _534), plus(_538, _542, _544), '1+'(..., ...), print(..., ...)))], []),
- Z = [],
- Q = 7 ;
- /*
- :- lisp_compiled_eval(
- [ do,
- [ ['temp-one', 1, ['1+', 'temp-one']],
- ['temp-two', 0, ['1-', 'temp-two']]
- ],
- [[>, [-, 'temp-one', 'temp-two'], 5], 'temp-one']
- ]).
- */
- ( do ( ( temp-one 1 ( 1+ temp-one ) ) ( temp-two 0 ( 1- temp-two ) ) ) ( ( > ( - temp-one temp-two ) 5 ) temp-one ) )
- /*
- :- call_addr_block(toplevel,
- goto(enter([]), [], toplevel),
- [ addr(enter([]),
- '$used',
- _1662,
- (_1688=[[bv('temp-one', [1|_1722]), bv('temp-two', [0|_1740])]|_1662], call_addr_block(_1688, (push_label(dosym1), sym_arg_val_env('temp-one', _1782, _1796, _1688), sym_arg_val_env('temp-two', _1826, _1840, _1688), minus(_1796, _1840, _1868), greaterThan(_1868, 5, _1896), (_1896\=[]->sym_arg_val_env('temp-one', _1950, _1964, _1688), goto(exit([]), _1964, _1688), _1992=_1998;sym_arg_val_env('temp-one', _2028, _2042, _1688), '1+'(_2042, _2068), sym_arg_val_env('temp-two', _2098, _2112, _1688), '1-'(_2112, _2138), symbol_setter(psetq, 'temp-one', _1466, _1412), symbol_setter(psetq, 'temp-two', _1478, _1412), _1450=[[_1466, _1478]]), goto(dosym1, [], _1412)), [addr(dosym1, '$unused', _1480, (sym_arg_val_env('temp-one', _1482, _1484, _1480), sym_arg_val_env('temp-two', _1486, _1488, _1480), minus(_1484, _1488, _1490), greaterThan(_1490, 5, _1494), (_1494\=[]->sym_arg_val_env('temp-one', _1498, _1502, _1480), goto(exit([]), _1502, _1480), _1504=_1506;sym_arg_val_env('temp-one', _1510, _1514, _1480), '1+'(_1514, _1516), sym_arg_val_env('temp-two', _1520, _1524, _1480), '1-'(_1524, _1526), symbol_setter(psetq, 'temp-one', _1516, _1480), symbol_setter(psetq, 'temp-two', _1526, _1480), _1504=[[_1516, _1526]]), goto(dosym1, [], _1480)))], _1530), goto(exit([]), [], _1408))),
- addr(exit([]), '$used', _1532, true)
- ],
- []).
- */
- /*
- :- call_addr_block(toplevel,
- goto(enter([]), [], toplevel),
- [ addr(enter([]),
- '$used',
- _1406,
- (_1408=[[bv('temp-one', [1|_1410]), bv('temp-two', [0|_1412])]|_1406], call_addr_block(_1408, (push_label(dosym1), sym_arg_val_env('temp-one', _1414, _1416, _1408), sym_arg_val_env('temp-two', _1418, _1420, _1408), minus(_1416, _1420, _1422), greaterThan(_1422, 5, _1424), (_1424\=[]->sym_arg_val_env('temp-one', _1426, _1428, _1408), goto(exit([]), _1428, _1408), _1430=_1432;sym_arg_val_env('temp-one', _1434, _1436, _1408), '1+'(_1436, _1438), sym_arg_val_env('temp-two', _1440, _1442, _1408), '1-'(_1442, _1444), symbol_setter(psetq, 'temp-one', _1438, _1408), symbol_setter(psetq, 'temp-two', _1444, _1408), _1430=[[_1438, _1444]]), goto(dosym1, [], _1408)), [addr(dosym1, '$unused', _1446, (sym_arg_val_env('temp-one', _1448, _1450, _1446), sym_arg_val_env('temp-two', _1452, _1454, _1446), minus(_1450, _1454, _1456), greaterThan(_1456, 5, _1458), (_1458\=[]->sym_arg_val_env('temp-one', _1460, _1462, _1446), goto(exit([]), _1462, _1446), _1464=_1466;sym_arg_val_env('temp-one', _1468, _1470, _1446), '1+'(_1470, _1472), sym_arg_val_env('temp-two', _1474, _1476, _1446), '1-'(_1476, _1478), symbol_setter(psetq, 'temp-one', _1472, _1446), symbol_setter(psetq, 'temp-two', _1478, _1446), _1464=[[_1472, _1478]]), goto(dosym1, [], _1446)))], _1480), goto(exit([]), [], _1406))),
- addr(exit([]), '$used', _1482, true)
- ],
- []).
- */
- X = do(0.0),
- Y = call_addr_block(toplevel, goto(enter([]), [], toplevel), [addr(enter([]), '$used', _1406, (_1408=[[bv('temp-one', [1|...]), bv('temp-two', [...|...])]|_1406], call_addr_block(_1408, (push_label(dosym1), sym_arg_val_env('temp-one', _1414, _1416, _1408), sym_arg_val_env(..., ..., ..., ...), ..., ...), [addr(dosym1, '$unused', _1446, (sym_arg_val_env(..., ..., ..., ...), ..., ...))], _1480), goto(exit([]), [], _1406))), addr(exit([]), '$used', _1482, true)], []),
- Z = [],
- Q = 4 ;
- /*
- :- lisp_compiled_eval(
- [ do,
- [ ['temp-one', 1, ['1+', 'temp-one']],
- ['temp-two', 0, ['1+', 'temp-one']]
- ],
- [[=, 3, 'temp-two'], 'temp-one']
- ]).
- */
- ( do ( ( temp-one 1 ( 1+ temp-one ) ) ( temp-two 0 ( 1+ temp-one ) ) ) ( ( = 3 temp-two ) temp-one ) )
- /*
- :- call_addr_block(toplevel,
- goto(enter([]), [], toplevel),
- [ addr(enter([]),
- '$used',
- _1484,
- (_1510=[[bv('temp-one', [1|_1544]), bv('temp-two', [0|_1562])]|_1484], call_addr_block(_1510, (push_label(dosym2), sym_arg_val_env('temp-two', _1604, _1618, _1510), =(3, _1618, _1646), (_1646\=[]->sym_arg_val_env('temp-one', _1700, _1714, _1510), goto(exit([]), _1714, _1510), _1742=_1748;sym_arg_val_env('temp-one', _1778, _1792, _1510), '1+'(_1792, _1818), sym_arg_val_env('temp-one', _1848, _1862, _1510), '1+'(_1862, _1888), symbol_setter(psetq, 'temp-one', _1818, _1510), symbol_setter(psetq, 'temp-two', _1888, _1510), _1742=[[_1818, _1888]]), goto(dosym2, [], _1510)), [addr(dosym2, '$unused', _1976, (sym_arg_val_env('temp-two', _1990, _1992, _1976), =(3, _1992, _2012), (_2012\=[]->sym_arg_val_env('temp-one', _2058, _2066, _1976), goto(exit([]), _2066, _1976), _2094=_2096;sym_arg_val_env('temp-one', _2116, _2130, _1976), '1+'(_2130, _2152), sym_arg_val_env('temp-one', _2172, _2186, _1976), '1+'(_2186, _2212), symbol_setter(psetq, 'temp-one', _2152, _1976), symbol_setter(psetq, 'temp-two', _2212, _1976), _2094=[[_2152, _2212]]), goto(dosym2, [], _1976)))], _2290), goto(exit([]), [], _1484))),
- addr(exit([]), '$used', _2322, true)
- ],
- []).
- */
- /*
- :- call_addr_block(toplevel,
- goto(enter([]), [], toplevel),
- [ addr(enter([]),
- '$used',
- _1250,
- (_1254=[[bv('temp-one', [1|_1256]), bv('temp-two', [0|_1258])]|_1250], call_addr_block(_1254, (push_label(dosym2), sym_arg_val_env('temp-two', _1262, _1266, _1254), =(3, _1266, _1270), (_1270\=[]->sym_arg_val_env('temp-one', _1274, _1278, _1254), goto(exit([]), _1278, _1254), _1280=_1284;sym_arg_val_env('temp-one', _1288, _1292, _1254), '1+'(_1292, _1296), sym_arg_val_env('temp-one', _1300, _1304, _1254), '1+'(_1304, _1308), symbol_setter(psetq, 'temp-one', _1296, _1254), symbol_setter(psetq, 'temp-two', _1308, _1254), _1280=[[_1296, _1308]]), goto(dosym2, [], _1254)), [addr(dosym2, '$unused', _1310, (sym_arg_val_env('temp-two', _1312, _1314, _1310), =(3, _1314, _1318), (_1318\=[]->sym_arg_val_env('temp-one', _1320, _1324, _1310), goto(exit([]), _1324, _1310), _1326=_1328;sym_arg_val_env('temp-one', _1332, _1336, _1310), '1+'(_1336, _1338), sym_arg_val_env('temp-one', _1304, _1306, _1282), '1+'(_1306, _1308), symbol_setter(psetq, 'temp-one', _1302, _1282), symbol_setter(psetq, 'temp-two', _1308, _1282), _1294=[[_1302, _1308]]), goto(dosym2, [], _1282)))], _1310), goto(exit([]), [], _1248))),
- addr(exit([]), '$used', _1312, true)
- ],
- []).
- */
- X = do(0.1),
- Y = call_addr_block(toplevel, goto(enter([]), [], toplevel), [addr(enter([]), '$used', _1248, (_1250=[[bv('temp-one', [1|...]), bv('temp-two', [...|...])]|_1248], call_addr_block(_1250, (push_label(dosym2), sym_arg_val_env('temp-two', _1256, _1258, _1250), =(..., ..., ...), ..., ...), [addr(dosym2, '$unused', _1282, (sym_arg_val_env(..., ..., ..., ...), ..., ...))], _1310), goto(exit([]), [], _1248))), addr(exit([]), '$used', _1312, true)], []),
- Z = [],
- Q = 3 ;
- /*
- :- lisp_compiled_eval(
- [ tagbody,
- [setq, b, 2],
- [go, tag1],
- [setq, a, 1],
- tag1,
- [setq, a, 4],
- [print, [plus, a, b]]
- ]).
- */
- ( tagbody ( setq b 2 ) ( go tag1 ) ( setq a 1 ) tag1 ( setq a 4 ) ( print ( plus a b ) ) )
- /*
- :- call_addr_block(toplevel,
- (symbol_setter(setq, b, 2, toplevel), goto(tag1, [], toplevel)),
- [ addr(tag1,
- '$used',
- _486,
- (symbol_setter(setq, a, 4, _486), sym_arg_val_env(a, _488, _490, _486), sym_arg_val_env(b, _492, _494, _486), plus(_490, _494, _496), print(_496, _498)))
- ],
- Z).
- */
- 6
- /*
- :- call_addr_block(toplevel,
- (symbol_setter(setq, b, 2, toplevel), goto(tag1, [], toplevel)),
- [ addr(tag1,
- '$used',
- _486,
- (symbol_setter(setq, a, 4, _486), sym_arg_val_env(a, _488, _490, _486), sym_arg_val_env(b, _492, _494, _486), plus(_490, _494, _496), print(_496, _498)))
- ],
- []).
- */
- X = tagbody1,
- Y = call_addr_block(toplevel, (symbol_setter(setq, b, 2, toplevel), goto(tag1, [], toplevel)), [addr(tag1, '$used', _486, (symbol_setter(setq, a, 4, _486), sym_arg_val_env(a, _488, _490, _486), sym_arg_val_env(b, _492, _494, _486), plus(_490, _494, _496), print(_496, _498)))], []),
- Z = Q, Q = [] ;
- /*
- :- lisp_compiled_eval(
- [ block,
- block3,
- [setq, b, 2],
- [go, tag1],
- [setq, a, 1],
- tag1,
- [setq, a, 4],
- [print, [plus, a, b]],
- ['return-from', block3, [plus, a, b]]
- ]).
- */
- ( block block3 ( setq b 2 ) ( go tag1 ) ( setq a 1 ) tag1 ( setq a 4 ) ( print ( plus a b ) ) ( return-from block3 ( plus a b ) ) )
- /*
- :- call_addr_block(toplevel,
- goto(enter(block3), [], toplevel),
- [ addr(enter(block3),
- '$used',
- _14970,
- (symbol_setter(setq, b, 2, _14970), goto(tag1, [], _14970))),
- addr(tag1,
- '$used',
- _706,
- (symbol_setter(setq, a, 4, _706), sym_arg_val_env(a, _708, _710, _706), sym_arg_val_env(b, _712, _714, _706), plus(_710, _714, _716), print(_716, _718), sym_arg_val_env(a, _722, _726, _706), sym_arg_val_env(b, _730, _734, _706), plus(_726, _734, _738), goto(exit(block3), _738, _706))),
- addr(exit(block3), '$used', _740, true)
- ],
- []).
- */
- 6
- /*
- :- call_addr_block(toplevel,
- goto(enter(block3), [], toplevel),
- [ addr(enter(block3),
- '$used',
- _704,
- (symbol_setter(setq, b, 2, _704), goto(tag1, [], _704))),
- addr(tag1,
- '$used',
- _706,
- (symbol_setter(setq, a, 4, _706), sym_arg_val_env(a, _708, _710, _706), sym_arg_val_env(b, _712, _714, _706), plus(_710, _714, _716), print(_716, _718), sym_arg_val_env(a, _722, _726, _706), sym_arg_val_env(b, _730, _734, _706), plus(_726, _734, _738), goto(exit(block3), _738, _706))),
- addr(exit(block3), '$used', _740, true)
- ],
- []).
- */
- X = block3,
- Y = call_addr_block(toplevel, goto(enter(block3), [], toplevel), [addr(enter(block3), '$used', _640, (symbol_setter(setq, b, 2, _640), goto(tag1, [], _640))), addr(tag1, '$used', _642, (symbol_setter(setq, a, 4, _642), sym_arg_val_env(a, _644, _646, _642), sym_arg_val_env(b, _648, _650, _642), plus(_646, _650, _652), print(..., ...), ..., ...)), addr(exit(block3), '$used', _666, true)], []),
- Z = [],
- Q = 6 ;
- /*
- :- lisp_compiled_eval([defun, let_simple, [], [let, [val], val]]).
- */
- ( defun let_simple NIL ( let ( val ) val ) )
- /*
- dbmsg(asserta, let_simple(RETVal_Thru)) :-
- fail,
- ( [let_simple]<<==[[let, [val], val]]
- ).
- dbmsg(asserta, let_simple(RETVal_Thru)) :- !,
- DEnv=[[]],
- LETENV=[[bv(val, [[]|_260])]|DEnv],
- sym_arg_val_env(val, Val_In, RETVal_Thru, LETENV).
- */
- /*
- dbmsg(asserta, let_simple(RETVal_Thru)) :-
- fail,
- ( [let_simple]<<==[[let, [val], val]]
- ).
- dbmsg(asserta, let_simple(RETVal_Thru)) :- !,
- DEnv=[[]],
- LETENV=[[bv(val, [[]|_260])]|DEnv],
- sym_arg_val_env(val, Val_In, RETVal_Thru, LETENV).
- */
- X = Z, Z = let_simple,
- Y = (asserta((let_simple(_326):-fail, ([let_simple]<<==[[let, [val], val]]))), asserta((let_simple(_326):-!, _256=[[]], _262=[[bv(..., ...)]|_256], sym_arg_val_env(val, _330, _326, _262)))),
- Q = [] ;
- /*
- :- lisp_compiled_eval([defun, let_simple1, [], [let, [[val, 1]], val]]).
- */
- ( defun let_simple1 NIL ( let ( ( val 1 ) ) val ) )
- /*
- dbmsg(asserta, let_simple1(RETVal_Thru)) :-
- fail,
- ( [let_simple1]<<==[[let, [[val, 1]], val]]
- ).
- dbmsg(asserta, let_simple1(RETVal_Thru)) :- !,
- DEnv=[[]],
- LETENV=[[bv(val, [1|_8900])]|DEnv],
- sym_arg_val_env(val, Val_In, RETVal_Thru, LETENV).
- */
- /*
- dbmsg(asserta, let_simple1(RETVal_Thru)) :-
- fail,
- ( [let_simple1]<<==[[let, [[val, 1]], val]]
- ).
- dbmsg(asserta, let_simple1(RETVal_Thru)) :- !,
- DEnv=[[]],
- LETENV=[[bv(val, [1|_242])]|DEnv],
- sym_arg_val_env(val, Val_In, RETVal_Thru, LETENV).
- */
- X = Z, Z = let_simple1,
- Y = (asserta((let_simple1(_308):-fail, ([let_simple1]<<==[[let, [[...|...]], val]]))), asserta((let_simple1(_308):-!, _238=[[]], _244=[[bv(..., ...)]|_238], sym_arg_val_env(val, _312, _308, _244)))),
- Q = 1 ;
- /*
- :- lisp_compiled_eval(
- [ defun,
- fifteen,
- [],
- [ let,
- [val],
- [ tagbody,
- [setq, val, 1],
- [go, 'point-a'],
- [incf, val, 16],
- 'point-c',
- [incf, val, 4],
- [go, 'point-b'],
- [incf, val, 32],
- 'point-a',
- 'point-u',
- [incf, val, 2],
- [go, 'point-c'],
- [incf, val, 64],
- 'point-b',
- [incf, val, 8]
- ],
- val
- ]
- ]).
- */
- ( defun fifteen NIL ( let ( val ) ( tagbody ( setq val 1 ) ( go point-a ) ( incf val 16 ) point-c ( incf val 4 ) ( go point-b ) ( incf val 32 ) point-a point-u ( incf val 2 ) ( go point-c ) ( incf val 64 ) point-b ( incf val 8 ) ) val ) )
- /*
- dbmsg(asserta, fifteen(RETVal_Thru)) :-
- fail,
- ( [fifteen]<<==[[let, [val], [tagbody, [setq, val, 1], [go, 'point-a'], [incf, val, 16], 'point-c', [incf, val, 4], [go, 'point-b'], [incf, val, 32], 'point-a', 'point-u', [incf, val, 2], [go, 'point-c'], [incf, val, 64], 'point-b', [incf, val, 8]], val]]
- ).
- dbmsg(asserta, fifteen(RETVal_Thru)) :- !,
- DEnv=[[]],
- GoEnvLETENV=[[bv(val, [[]|_240])]|DEnv],
- call_addr_block(GoEnvLETENV,
- (symbol_setter(setq, val, 1, GoEnvLETENV), goto('point-a', [], GoEnvLETENV)),
- [ addr('point-c',
- '$used',
- _504,
- (place_op(incf, val, [4], _504, _506), goto('point-b', [], _504))),
- addr('point-a',
- '$used',
- _510,
- (push_label('point-u'), place_op(incf, val, [2], _510, _522), goto('point-c', [], _510))),
- addr('point-u',
- '$unused',
- _526,
- (place_op(incf, val, [2], _526, _538), goto('point-c', [], _526))),
- addr('point-b',
- '$used',
- _540,
- place_op(incf, val, [8], _540, _544))
- ],
- _GORES14),
- sym_arg_val_env(val, Val_In, RETVal_Thru, GoEnvLETENV).
- */
- /*
- dbmsg(asserta, fifteen(RETVal_Thru)) :-
- fail,
- ( [fifteen]<<==[[let, [val], [tagbody, [setq, val, 1], [go, 'point-a'], [incf, val, 16], 'point-c', [incf, val, 4], [go, 'point-b'], [incf, val, 32], 'point-a', 'point-u', [incf, val, 2], [go, 'point-c'], [incf, val, 64], 'point-b', [incf, val, 8]], val]]
- ).
- dbmsg(asserta, fifteen(RETVal_Thru)) :- !,
- DEnv=[[]],
- GoEnvLETENV=[[bv(val, [[]|_240])]|DEnv],
- call_addr_block(GoEnvLETENV,
- (symbol_setter(setq, val, 1, GoEnvLETENV), goto('point-a', [], GoEnvLETENV)),
- [ addr('point-c',
- '$used',
- _504,
- (place_op(incf, val, [4], _504, _506), goto('point-b', [], _504))),
- addr('point-a',
- '$used',
- _510,
- (push_label('point-u'), place_op(incf, val, [2], _510, _522), goto('point-c', [], _510))),
- addr('point-u',
- '$unused',
- _526,
- (place_op(incf, val, [2], _526, _538), goto('point-c', [], _526))),
- addr('point-b',
- '$used',
- _540,
- place_op(incf, val, [8], _540, _544))
- ],
- _GORES14),
- sym_arg_val_env(val, Val_In, RETVal_Thru, GoEnvLETENV).
- */
- X = let_tagbody,
- Y = (asserta((fifteen(_584):-fail, ([fifteen]<<==[[let, [val], [...|...]|...]]))), asserta((fifteen(_584):-!, _236=[[]], _490=[[bv(..., ...)]|_236], call_addr_block(_490, (symbol_setter(..., ..., ..., ...), goto(..., ..., ...)), [addr(..., ..., ..., ...)|...], _348), sym_arg_val_env(val, _586, _584, _490)))),
- Z = fifteen,
- Q = 15.
- ?- ^D
- root@gitlab:/home/dmiles/logicmoo_workspace/packs_usr/wam_common_lisp/prolog/wam_cl#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement