Add simplify_polynomial_list()

This commit is contained in:
Diogo Cordeiro 2018-11-18 19:37:26 +00:00
parent ff8971c141
commit f89fad686c

View File

@ -249,6 +249,21 @@ simplify_polynomial(P + M, P2 + M2) :-
simplify_polynomial(P, P2),
simplify_term(M, M2).
%% simplify_polynomial_list(+L1,-L3) is det
%
% Simplifies a list of polynomials
%
simplify_polynomial_list([L1], L3) :-
simplify_polynomial(L1, L2),
L3 = [L2].
simplify_polynomial_list([L1|L2],L3) :-
simplify_polynomial(L1, P1),
simplify_polynomial_list(L2, P2),
L3 = [P1|P2],
% There is nothing further to compute at this point
!.
closure_simplify_polynomial(P, P) :-
simplify_polynomial(P, P2),
P==P2,