Added pointless function requested by spec and the partial ability to parse polynomials with normal ops
This commit is contained in:
parent
fffe104684
commit
f9d579c494
12
polymani.pl
12
polymani.pl
@ -90,6 +90,12 @@ polyplay :-
|
|||||||
),
|
),
|
||||||
!.
|
!.
|
||||||
|
|
||||||
|
text2poly(S, P) :-
|
||||||
|
split_string(S, " ", "\r\t", LS),
|
||||||
|
parse_polynomial(T, LS, []),
|
||||||
|
polynomial_tree_to_polynomial(T, P1),
|
||||||
|
simpoly(P1, P).
|
||||||
|
|
||||||
%% process_input(+Tree) is det
|
%% process_input(+Tree) is det
|
||||||
%
|
%
|
||||||
% Execute the commands from the parse tree
|
% Execute the commands from the parse tree
|
||||||
@ -553,9 +559,9 @@ parse_power(TB) -->
|
|||||||
%
|
%
|
||||||
% Associate an operator with a word
|
% Associate an operator with a word
|
||||||
%
|
%
|
||||||
parse_operation(-) --> [minus].
|
parse_operation(-) --> [minus] | [-].
|
||||||
parse_operation(+) --> [plus].
|
parse_operation(+) --> [plus] | [+].
|
||||||
parse_operation(*) --> [times].
|
parse_operation(*) --> [times] | [*].
|
||||||
|
|
||||||
%% parse_polynomial_operand(-tree) is det
|
%% parse_polynomial_operand(-tree) is det
|
||||||
%
|
%
|
||||||
|
Reference in New Issue
Block a user