Make multiply great again
This commit is contained in:
parent
957e484db5
commit
2057d2b14f
10
polymani.pl
10
polymani.pl
@ -210,7 +210,13 @@ do_process_input(simplify(PT)) :-
|
|||||||
do_process_input(multiply(TN, PT)) :-
|
do_process_input(multiply(TN, PT)) :-
|
||||||
polynomial_tree_to_polynomial(TN, N),
|
polynomial_tree_to_polynomial(TN, N),
|
||||||
polynomial_tree_to_polynomial(PT, P),
|
polynomial_tree_to_polynomial(PT, P),
|
||||||
scalepoly(N, P, P2),
|
(
|
||||||
|
not(number(N)),
|
||||||
|
scalepoly(N, P, P2)
|
||||||
|
;
|
||||||
|
number(N),
|
||||||
|
scalepoly(P, N, P2)
|
||||||
|
),
|
||||||
simpoly(P2, SP),
|
simpoly(P2, SP),
|
||||||
write(SP),
|
write(SP),
|
||||||
nl.
|
nl.
|
||||||
@ -552,7 +558,7 @@ parse_command(simplify(T)) -->
|
|||||||
parse_polynomial(T).
|
parse_polynomial(T).
|
||||||
parse_command(multiply(TN, TP)) -->
|
parse_command(multiply(TN, TP)) -->
|
||||||
[multiply],
|
[multiply],
|
||||||
parse_number(TN),
|
parse_polynomial(TN),
|
||||||
[by],
|
[by],
|
||||||
parse_polynomial(TP).
|
parse_polynomial(TP).
|
||||||
parse_command(op(-, TN, TP)) -->
|
parse_command(op(-, TN, TP)) -->
|
||||||
|
Reference in New Issue
Block a user