| 1 | |
|---|
| 2 | :- protocol(hierarchyp). |
|---|
| 3 | |
|---|
| 4 | :- info([ |
|---|
| 5 | version is 1.0, |
|---|
| 6 | author is 'Paulo Moura', |
|---|
| 7 | date is 2000/7/24, |
|---|
| 8 | comment is 'Common hierarchy protocol for prototype and class hierarchies.']). |
|---|
| 9 | |
|---|
| 10 | :- public(ancestor/1). |
|---|
| 11 | :- mode(ancestor(?object), zero_or_more). |
|---|
| 12 | :- info(ancestor/1, [ |
|---|
| 13 | comment is 'Returns, by backtracking, all object ancestors.', |
|---|
| 14 | argnames is ['Ancestor']]). |
|---|
| 15 | |
|---|
| 16 | :- public(ancestors/1). |
|---|
| 17 | :- mode(ancestors(-list), one). |
|---|
| 18 | :- info(ancestors/1, [ |
|---|
| 19 | comment is 'List of all object ancestors.', |
|---|
| 20 | argnames is ['Ancestors']]). |
|---|
| 21 | |
|---|
| 22 | :- public(leaf/1). |
|---|
| 23 | :- mode(leaf(?object), zero_or_more). |
|---|
| 24 | :- info(leaf/1, [ |
|---|
| 25 | comment is 'Returns, by backtracking, all object leaves.', |
|---|
| 26 | argnames is ['Leaf']]). |
|---|
| 27 | |
|---|
| 28 | :- public(leaves/1). |
|---|
| 29 | :- mode(leaves(-list), one). |
|---|
| 30 | :- info(leaves/1, [ |
|---|
| 31 | comment is 'List of all object leaves.', |
|---|
| 32 | argnames is ['Leaves']]). |
|---|
| 33 | |
|---|
| 34 | :- public(descendant/1). |
|---|
| 35 | :- mode(descendant(?object), zero_or_more). |
|---|
| 36 | :- info(descendant/1, [ |
|---|
| 37 | comment is 'Returns, by backtracking, all object descendants.', |
|---|
| 38 | argnames is ['Descendant']]). |
|---|
| 39 | |
|---|
| 40 | :- public(descendants/1). |
|---|
| 41 | :- mode(descendants(-list), one). |
|---|
| 42 | :- info(descendants/1, [ |
|---|
| 43 | comment is 'List of all object descendants.', |
|---|
| 44 | argnames is ['Descendants']]). |
|---|
| 45 | |
|---|
| 46 | :- end_protocol. |
|---|