% % parser.pl % % Name: % % % Comments: % % % some "nice" prolog settings... see assignment 8's % description for the details on what these do % -- but it's not crucial to know the details of these Prolog internals :- set_prolog_flag( prompt_alternatives_on, groundness ). :- set_prolog_flag(toplevel_print_options, [quoted(true), portray(true), attributes(portray), max_depth(999), priority(699)]). % to run your parse-checker % make sure you have the grammar files % g0.pl % g1.pl % g2.pl % g3.pl % in your directory with parse.pl % % Then run % % :- [part4]. % :- [g0]. % or whatever grammar you'd like to check % % :- parse([s], [1, +]). % % No % % :- parse([s], [1, +, 0, +, 1]). % % Yes % % don't let parse get too big! % you'll need relatively few lines of code here: