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:
parent
6d92b8801f
commit
efeaa7b8e1
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue