Advertisement
logicmoo

Untitled

Dec 3rd, 2017
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 3.80 KB | None | 0 0
  1. > (defun my-do-ansi () (do ((alfa   0.0)) (nil) (return (list alfa))))
  2. % assert_if_new(soops:o_p_v(u_my_do_ansi, classof, claz_symbol)).
  3. % assert_if_new(soops:o_p_v(u_my_do_ansi, name, "MY-DO-ANSI")).
  4. % assert_if_new(soops:o_p_v(u_my_do_ansi, package, pkg_user)).
  5. % assert_if_new(soops:o_p_v(u_alfa, classof, claz_symbol)).
  6. % assert_if_new(soops:o_p_v(u_alfa, name, "ALFA")).
  7. % assert_if_new(soops:o_p_v(u_alfa, package, pkg_user)).
  8. :- lisp_compiled_eval(
  9.                       [ defun,
  10.                         u_my_do_ansi,
  11.                         [],
  12.                         [do, [[u_alfa, 0.0]], [[]], [return, [list, u_alfa]]]
  13.                       ]).
  14. % COMPILER
  15. addr_tagbody_1_addr_enter_1(Env) :-
  16.         (   []\==[]
  17.         ->  throw(block_exit([], [])),
  18.             _3774=[]
  19.         ;   symbol_value(Env, u_alfa, U_alfa_Get),
  20.             cl_list([U_alfa_Get], RetResult15),
  21.             throw(block_exit([], RetResult15)),
  22.             cl_psetq(Psetq_Ret),
  23.             _3774=Psetq_Ret
  24.         ),
  25.         addr_tagbody_1_dosymu_my_do_ansi1(Env).
  26. addr_tagbody_1_dosymu_my_do_ansi1(BlockExitEnv) :-
  27.         (   []\==[]
  28.         ->  throw(block_exit([], [])),
  29.             _4410=[]
  30.         ;   symbol_value(BlockExitEnv, u_alfa, U_alfa_Get28),
  31.             cl_list([U_alfa_Get28], RetResult27),
  32.             throw(block_exit([], RetResult27)),
  33.             cl_psetq(Psetq_Ret32),
  34.             _4410=Psetq_Ret32
  35.         ),
  36.         addr_tagbody_1_dosymu_my_do_ansi1(BlockExitEnv).
  37. /*
  38. alphas=[u_alfa].
  39. type=ctx.
  40. var_tracker(u_alfa)=rw{name:u_alfa, p:0, r:2, ret:0, u:0, vars:[U_alfa_Get, U_alfa_Get28], w:0}.
  41.  */
  42. % inlined(addr_tagbody_1_addr_enter_1(LETENV)) :-
  43. %       (   []\==[]
  44. %       ->  throw(block_exit([], [])),
  45. %           true
  46. %       ;   symbol_value(LETENV, u_alfa, _22088),
  47. %           cl_list([_22088], _22100),
  48. %           throw(block_exit([], _22100)),
  49. %           cl_psetq(_22132),
  50. %           true
  51. %       ),
  52. %       addr_tagbody_1_dosymu_my_do_ansi1(LETENV).
  53. % 302,349 inferences, 0.086 CPU in 0.087 seconds (100% CPU, 3497028 Lips)
  54. wl:arglist_info(f_u_my_do_ansi, [], [], arginfo{all:0, allow_other_keys:0, aux:0, complex:0, env:0, key:0, names:[], opt:0, req:0, rest:0}).
  55. user:function_lambda(defun(u_my_do_ansi), f_u_my_do_ansi, [], [[do, [[u_alfa, 0.0]], [[]], [return, [list, u_alfa]]]]).
  56. user:f_u_my_do_ansi(MResult) :-
  57.         Env=[],
  58.         catch(( catch(( LETENV=[[bv(u_alfa, 0.0)]|Env],
  59.                         (   []\==[]
  60.                         ->  throw(block_exit([], []))
  61.                         ;   symbol_value(LETENV, u_alfa, _22088),
  62.                             cl_list([_22088], _22100),
  63.                             throw(block_exit([], _22100)),
  64.                             cl_psetq(_22132)
  65.                         ),
  66.                         addr_tagbody_1_dosymu_my_do_ansi1(LETENV),
  67.                         []=_1224
  68.                       ),
  69.                       block_exit([], _1224),
  70.                       true),
  71.                 _1224=MResult
  72.               ),
  73.               block_exit(u_my_do_ansi, MResult),
  74.               true).
  75. :- set_opv(f_u_my_do_ansi, classof, claz_compiled_function),
  76.    set_opv(u_my_do_ansi, compile_as, kw_function),
  77.    set_opv(u_my_do_ansi, function, f_u_my_do_ansi).
  78. % EXEC
  79. % assert_if_new(soops:o_p_v(f_u_my_do_ansi, classof, claz_compiled_function)).
  80. % assert_if_new(soops:o_p_v(u_my_do_ansi, compile_as, kw_function)).
  81. % assert_if_new(soops:o_p_v(u_my_do_ansi, function, f_u_my_do_ansi)).
  82. % 27,453 inferences, 0.011 CPU in 0.011 seconds (100% CPU, 2511007 Lips)
  83. MY-DO-ANSI
  84. > (MY-DO-ANSI)
  85. :- lisp_compiled_eval([u_my_do_ansi]).
  86. % COMPILER
  87. % 6,866 inferences, 0.002 CPU in 0.002 seconds (100% CPU, 3494870 Lips)
  88. :- f_u_my_do_ansi(U_my_do_ansi_Ret).
  89. % EXEC
  90. % 71 inferences, 0.000 CPU in 0.000 seconds (99% CPU, 1623302 Lips)
  91. (0.0)
  92. >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement