What is a Prolog predicate that helps show a wasteful presentation of Prolog terms?
addition
In addition to Prolog SO's earlier answer, IIRC by mat , he used the Prolog predicate to parse the term Prolog and show how overly complex it was.
Especially for a term like
[op(add),[[number(0)],[op(add),[[number(1)],[number(1)]]]]]
it has shown that it matters to many [].
I searched my questions on the Prolog and looked through the answers twice, but still can not find them. I also remind you that this was not in the SWI Prolog, but in another Prolog, so instead of setting another Prolog, I was able to use the predicate with the online version of the Prolog.
If you read in the comments, you will see that the mat identified the post I was looking for.
What i was looking for
I have one last comment on the choice of representation . Please try the following using, for example, GNU Prolog or any other appropriate Prolog system:
| ? - write_canonical ([op (add), [Left, Right]]).
'.' (op (add), '.' ('.' (_ 18, '.' (_ 19, [])), []))
This shows that this is a rather wasteful view and at the same time prevents the uniform processing of all the expressions you generate, combining several drawbacks.
, , Left+Right, , , , op_arguments(add, [Left,Right]), op_arguments(number, [1]) ..
, , , .
.
x + 0 + sin(y)
, AST
add(add(X,0),sin(Y))
AST, , . .: / , / , /AST-
, - , , , 3.30 , , .
, /2, , , ,
add(add(X,0),sin(Y))
, /3, , , , " ",
op(add,(op(add,X,0),op(sin,Y)))
, .
, , . , , , , .
, , , .
GNU Prolog tutorialspoint.com
:- initialization(main).
main :- write_canonical([op(add),[Left,Right]]).
sh-4.3$ gprolog
GNU Prolog 1.4.4 (64 bits)
Compiled Aug 16 2014, 23:07:54 with gcc
By Daniel Diaz
Copyright (C) 1999-2013 Daniel Diaz
compiling /home/cg/root/main.pg for byte code...
/home/cg/root/main.pg:2: warning: singleton variables [Left,Right] for main/0
/home/cg/root/main.pg compiled, 2 lines read - 524 bytes written, 9 ms
'.'(op(add),'.'('.'(_39,'.'(_41,[])),[]))| ?-

Prolog, :
?
, . , defaulty, spring , "default" "faulty". , " ", , . , - . ! .