A little helper function to see compiled expressions.

Example from ordered binary tree notebook:

    ?- sjc(tree_add_Ee, `pop swap rolldown rrest ccons`).
    func(tree_add_Ee, [_, [_, _|C], A, B|D], [[A, B|C]|D]).
    true .
This commit is contained in:
Simon Forman 2019-07-16 09:46:55 -07:00
parent 6d92b8801f
commit efeaa7b8e1
1 changed files with 2 additions and 0 deletions

View File

@ -211,6 +211,8 @@ jcmpl(Name, Expression, Rule) :-
rule(Head, [], Head ).
rule(Head, [A|B], Head :- maplist(call, [A|B])).
sjc(Name, InputString) :- phrase(joy_parse(E), InputString), show_joy_compile(Name, E).
% Simple DCGs to expand/contract definitions.