Q0 Get code : In the usual place : svn export http://unbox.org/wisp/var/timm/10/310/src/lisp/2/b For each of the following questions, add lines like this to "run" printf "\n===== 2/b/q1 ========================\n\n" cat myCodeThatAnswersThisQuestion.lisp execute : where "execute" is the "test" command shown below. Q1 (very simple) Write : Run the standard grammar Test : clisp main1.lisp Q2 (very simple) Write : copy main1.lisp to main2.lisp and alter it so it runs grammar2, not : grammar1. Test : nice -n 1 clisp -q main2.lisp Q3 Write : Port the grammar you wrote for Homework 1/a/q3 to a file : grammar3.lisp : Generate five stories. Hint: : The file grammar3.lisp shows how to do tricks like Modlist : sometimes returning nothing. Also, you will note some syntax changes Syntax change: Variables are no longer upper case : now, a variable is anything on the LHS Syntax change: options are no longer seperate rules : now, a head with >1 rule has a list of RHS atoms. e.g. : (a => b c d) means b OR c OR d. Syntax change: conjunctions are now in brackets : now, (a => (b c d)) means that (b c d ) is a : conjunction of things that will be explored in turn. Test : nice -n 1 clisp -q main3.lisp Q4 Write : Write a lisp program that prints out (one per line) all the : right "variables" (i.e. : non-terminals"). Hints: : The definition of a "variable" has changed since the awk projects. : In Lisp, all symbols are stored in upper case, so "variables" are : now anything that can be rewritten; i.e. anything on the LHS of a : production. Test : nice -n 1 clisp -q rhs.lisp Q5: (skip. irrelevant) Q6 Write : Write a lisp program that prints out (one per line) all the : right-hand-side "terminals"; i.e. any symbol that is not found on the : left hand side. Notes : RHS structures can be atoms or list. Your search needs to recurse : now on both the car and cdr of the RHS. Hint : Edit your grammar. Add in errors. Test : nice -n 1 clisp -q badright.lisp Q7 (skip. irrelevant)