Semester project for CSCI658 using prolog with nlp.
Place both top_down.pl
and bottom_up.pl
into the same directory.
Using a terminal navigate to the directory with both Prolog files.
To switch between .pl databases type in halt.
then Enter
. Then follow the provided instructions.
- Type
swipl
then selectEnter
to enter the SWI-Prolog interpreter. - Once in the SWI-Prolog interpreter type in
[top_down].
then pressEnter
to load the top_down database. - Type in
re(X,[]).
then pressEnter
to view all valid strings. Select the;
key to go to the next string if one exists. - To check a string input type in
re([A,B,C,...,n],[]).
where A,B,C,n are all characters then pressEnter
. - A return of
true
will occur if the string is valid.
- Type
swipl
then selectEnter
to enter the SWI-Prolog interpreter. - Once in the SWI-Prolog interpreter type in
op(255,xfx,--->).
then pressEnter
to define the new operator. - Next type in
[bottom_up].
then pressEnter
to load the top_down database. - To test a string type in
post_order_traverse([A,B,C,...,n]).
where A,B,C,n are all characters then pressEnter
. - A return of
true
will occur if the string is valid. - To view the trace of the program as it executes type
trace
then pressEnter
. - To test a string type in
post_order_traverse([A,B,C,...,n]).
where A,B,C,n are all characters then pressEnter
. - A return of
true
will occur if the string is valid.