| Did you know ... | Search Documentation: |
| Pack prolog_library_collection -- prolog/tree.pl |
Support library for working with tree data structures.
A tree is represented by a compound term with the following components:
Here are some examples of tree terms:
tree(leaf, 'Electra', [])
tree(father,
'Agamemnon',
[tree(leaf, 'Electra', []),
tree(leaf, 'Orestes', [])])
tree('Modus ponens',
'Socrates is mortal',
[tree(premise, 'Sorcrates is a man', []),
tree(premise, 'Men are mortal', [])])
The depth of a tree is defined inductively: