Fix polynomial_tree_to_polynomial
This commit is contained in:
parent
a6c2073209
commit
b984b0efd4
15
polymani.pl
15
polymani.pl
@ -102,14 +102,17 @@ print_polynomial_tree(op(Op, TL, TR)) :-
|
||||
print_polynomial_tree(T) :-
|
||||
write(T).
|
||||
|
||||
polynomial_tree_to_polynomial(op(Op, TL, TR), P) :-
|
||||
polynomial_tree_to_polynomial(TL,A),
|
||||
polynomial_tree_to_polynomial(TR,B),
|
||||
polynomial_tree_to_polynomial(A,B) :-
|
||||
polynomial_tree_to_atomic_polynomial(A,Pa),
|
||||
term_to_atom(B, Pa).
|
||||
|
||||
polynomial_tree_to_atomic_polynomial(op(Op, TL, TR), P) :-
|
||||
polynomial_tree_to_atomic_polynomial(TL,A),
|
||||
polynomial_tree_to_atomic_polynomial(TR,B),
|
||||
atom_concat(A, Op, AOp),
|
||||
atom_concat(AOp, B, Pa),
|
||||
term_to_atom(P,Pa),
|
||||
atom_concat(AOp, B, P),
|
||||
!.
|
||||
polynomial_tree_to_polynomial(A,A).
|
||||
polynomial_tree_to_atomic_polynomial(A,A).
|
||||
|
||||
%% nlp_number(?W:Atom, ?D:Int) is det
|
||||
%
|
||||
|
Reference in New Issue
Block a user