-


- - . 23


expand(Tree1,Tree).
Tree - ,
G Tree1.
3. .
domains
s=symbol
list=s*
a=arca(s,s)
tree=a*
predicates
member(a,tree)
arca(s,s)
osttree(a,tree)
expand(tree,tree)
ap_arca(tree,tree)
node(s,tree)
clauses
arca(a,b). arca(b,c). arca(c,d). arca(b,d).
member(X,[X|_]).
member(X,[_|Tail]):-member(X,Tail).
osttree(arca(A,B),Tree) :- expand([arca(A,B)],Tree).
expand(Tree1,Tree) :- ap_arca(Tree1,Tree2), expand(Tree2,Tree).
expand(Tree,Tree) :-not(ap_arca(Tree,_)).
ap_arca(Tree,[arca(A,B)|Tree]) :- arca(A,B), node(A,Tree), not(node(B,Tree));
arca(A,B),node(B,Tree), not(node(A,Tree)).
node(A,Tree) :- member(arca(A,_),Tree); member(arca(_,A),Tree).
5.3.
1. , .
2. ,
.
3. , .
4. .
5. , .. .
6. ,
.
7. .
.
8. .
, . . , .
9. . ,
A B .
10.  



- -  - -  - -