Logtalk 2.30.1 files.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1903 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
pmoura
2007-06-12 10:39:47 +00:00
parent 84f478c301
commit 6b4bde14e1
475 changed files with 6213 additions and 6424 deletions

View File

@@ -2,69 +2,56 @@
:- category(class_hierarchy,
implements(class_hierarchyp)).
:- info([
version is 1.1,
author is 'Paulo Moura',
date is 2006/2/20,
comment is 'Class hierarchy predicates.']).
class(Class) :-
self(Self),
instantiates_class(Self, Class).
classes(Classes) :-
self(Self),
findall(Class, instantiates_class(Self, Class), Classes).
ancestor(Ancestor) :-
self(Self),
ancestor(Self, Ancestor).
ancestor(Self, Ancestor) :-
instantiates_class(Self, Ancestor).
ancestor(Self, Ancestor) :-
instantiates_class(Self, Class),
superclass(Class, Ancestor).
ancestors(Ancestors) :-
self(Self),
findall(Ancestor, ancestor(Self, Ancestor), Ancestors).
instance(Instance) :-
self(Self),
instantiates_class(Instance, Self).
instances(Instances) :-
self(Self),
findall(Instance, instantiates_class(Instance, Self), Instances).
subclass(Subclass) :-
self(Self),
specializes_class(Subclass, Self).
subclasses(Subclasses) :-
self(Self),
findall(Subclass, specializes_class(Subclass, Self), Subclasses).
superclass(Superclass) :-
self(Self),
superclass(Self, Superclass).
superclass(Self, Superclass) :-
specializes_class(Self, Superclass).
superclass(Self, Superclass) :-
specializes_class(Self, Class),
superclass(Class, Superclass).
@@ -73,27 +60,22 @@
self(Self),
findall(Superclass, specializes_class(Self, Superclass), Superclasses).
leaf(Leaf) :-
self(Self),
leaf(Self, Leaf).
leaf(Self, Leaf) :-
instantiates_class(Leaf, Self),
\+ instantiates_class(_, Leaf),
\+ specializes_class(_, Leaf).
leaf(Self, Leaf) :-
specializes_class(Leaf, Self),
\+ instantiates_class(_, Leaf),
\+ specializes_class(_, Leaf).
leaf(Self, Leaf) :-
specializes_class(Subclass, Self),
leaf(Subclass, Leaf).
leaves(Leaves) :-
self(Self),
( setof(Leaf, leaf(Self, Leaf), Leaves) ->
@@ -101,21 +83,17 @@
; Leaves = []
).
leaf_instance(Leaf) :-
self(Self),
leaf_instance(Self, Leaf).
leaf_instance(Self, Leaf) :-
instantiates_class(Leaf, Self),
\+ instantiates_class(_, Leaf).
leaf_instance(Self, Leaf) :-
specializes_class(Subclass, Self),
leaf_instance(Subclass, Leaf).
leaf_instances(Leaves) :-
self(Self),
( setof(Leaf, leaf_instance(Self, Leaf), Leaves) ->
@@ -123,7 +101,6 @@
; Leaves = []
).
leaf_class(Leaf) :-
self(Self),
leaf_class(Self, Leaf).
@@ -131,7 +108,6 @@
leaf_class(Self, Leaf) :-
specializes_class(Leaf, Self),
\+ specializes_class(_, Leaf).
leaf_class(Self, Leaf) :-
specializes_class(Subclass, Self),
leaf_class(Subclass, Leaf).
@@ -143,24 +119,19 @@
; Leaves = []
).
descendant(Descendant) :-
self(Self),
descendant(Self, Descendant).
descendant(Self, Descendant) :-
instantiates_class(Descendant, Self).
descendant(Self, Descendant) :-
specializes_class(Descendant, Self),
\+ instantiates_class(Descendant, Self).
descendant(Self, Descendant) :-
specializes_class(Subclass, Self),
descendant(Subclass, Descendant).
descendants(Descendants) :-
self(Self),
( setof(Descendant, descendant(Self, Descendant), Descendants) ->
@@ -168,20 +139,16 @@
; Descendants = []
).
descendant_class(Descendant) :-
self(Self),
descendant_class(Self, Descendant).
descendant_class(Self, Descendant) :-
specializes_class(Descendant, Self).
descendant_class(Self, Descendant) :-
specializes_class(Subclass, Self),
descendant_class(Subclass, Descendant).
descendant_classes(Descendants) :-
self(Self),
( setof(Descendant, descendant_class(Self, Descendant), Descendants) ->
@@ -189,20 +156,16 @@
; Descendants = []
).
descendant_instance(Descendant) :-
self(Self),
descendant_instance(Self, Descendant).
descendant_instance(Self, Descendant) :-
instantiates_class(Descendant, Self).
descendant_instance(Self, Descendant) :-
specializes_class(Subclass, Self),
descendant_instance(Subclass, Descendant).
descendant_instances(Descendants) :-
self(Self),
( setof(Descendant, descendant_instance(Self, Descendant), Descendants) ->
@@ -210,5 +173,4 @@
; Descendants = []
).
:- end_category.