Merged cenas com hugo

This commit is contained in:
Diogo Cordeiro 2018-12-10 17:37:34 +00:00
parent ea80d57ef9
commit aafef78100

View File

@ -155,11 +155,25 @@ is_number_in_predicate(C, F) :-
/*******************************
* NLP *
*******************************/
/* DCG */
separator --> ["and"].
separator --> ["by"].
command --> ["show"].
command --> ["multiply"].
command --> ["simplify"].
command --> ["add"].
command --> ["forget"].
expression(A,B,C):-writeln("oi"),writeln(A),writeln(B),writeln(C),writeln("bye").
instruction(Left_expr, Right_expr) --> command, expression(Left_expr), separator, expression(Right_expr).
polyplay :-
write("> "),
read(R),
read_line_to_codes(user_input, R),
(
R = bye,
writeln(R),
R = "bye",
write("See ya")
;
(
@ -173,8 +187,9 @@ polyplay :-
).
nlp_understand(R, P, I) :-
split_string(R, "\n", "\r\t ", RL),
(
R = simplify_x_squared,
RL = "simplify x squared",
P = simplify,
I = x^2
;
@ -307,9 +322,6 @@ parse_expression(TL, TL-TR) --> parse_number(void, TR), { TR \= void, TL \= void
%% ?- parse_expression(T, [two, times, times, two], _).
%@ false.
/*******************************
* BACKEND *
*******************************/