Fixed small derp

This commit is contained in:
Hugo Sales 2018-12-19 23:33:49 +00:00
parent e9a739b33e
commit d5d86bee62

View File

@ -118,12 +118,12 @@ do_process_input(show(void, T)) :-
nl.
do_process_input(store(P, T)) :-
assertz(polynomial_store(P, T)).
%% do_process_input(show(store(P, T))) :-
%% assertz(polynomial_store(P, T)),
%% write(P),
%% write(" = "),
%% print_polynomial_tree(T),
%% nl.
do_process_input(show(store(P), T)) :-
assertz(polynomial_store(P, T)),
write(P),
write(" = "),
print_polynomial_tree(T),
nl.
do_process_input(forget(P)) :-
retract(polynomial_store(P, _)).
do_process_input(simplify(PT)) :-
@ -417,9 +417,7 @@ parse_polynomial_explicit(void-_, T) -->
parse_command(show_stored_polynomials) -->
[show, stored, polynomials].
parse_command(show(P, T),
command(store(P, T),
void)) -->
parse_command(show(store(P, T), T)) -->
[show],
parse_polynomial(T),
[as],
@ -430,7 +428,7 @@ parse_command(forget(P)) -->
parse_command(show(load(P), void)) -->
[show],
parse_stored_variable(P).
parse_command(show(void, T)) --> %% NOTE Probably easier if the tree is always binary
parse_command(show(void, T)) -->
[show],
parse_polynomial(T),
{ nonvar(T) }.