diff --git a/polimani.pl b/polimani.pl index cb4fea0..2f21b4a 100644 --- a/polimani.pl +++ b/polimani.pl @@ -29,6 +29,52 @@ */ :- use_module(library(clpfd)). + /******************************* + * USER INTERFACE * + *******************************/ + +/* + poly2list/2 transforms a list representing a polynomial (second + argument) into a polynomial represented as an expression (first argu- + ment) and vice-versa. +*/ +poly2list(P, L) :- + polynomial_to_list(P,L). + +/* + simpolylist/2 simplifies a polynomial represented as a list into + another polynomial as a list. +*/ +simpoly_list(L, S) :- + simplify_polynomial_list(L, S). + +/* + simpoly/2 that simplifies a polynomial represented as an expression + as another polynomial as an expression. +*/ +simpoly(P, S) :- + simplify_polynomial(P, S). + +/* + scalepoly/3 that multiplies one polynomial as expression by a scalar + resulting in a second polynomial. The two first arguments are assumed to + be ground. The polynomial resulting from the sum is in simplified form. +*/ +scalepoly(P1, P2, S) :- + scale_polynomial(P1, P2, S). + +/* + addpoly/3 that adds two polynomials as expressions resulting in a + third one. The two first arguments are assumed to be ground. + The polynomial resulting from the sum is in simplified form. +*/ +addpoly(P1, P2, S) :- + add_polynomial(P1, P2, S). + + /******************************* + * BACKEND * + *******************************/ + %% polynomial_variable_list(-List) is det % % List of possible polynomial variables