DUE: Feb 4 by midnight
You are to complete as many of the following as you can. You have 10 days from the date of assignment. This is individual work BUT you may discuss it in general terms (NOT lines of code)
E-mail your answers to me (drkriggs ...) by the due date.
POSTING: I will post all submitted code solutions by the 5th (no late work allowed!)
CRITIQUE: You will then have six days (Midnight 11th) to look for errors / shortcomings in the code of others (for extra credit for each significant error reported by e-mail!)
Report (a version of "control break processing")
Given facts of the sort:
STORE FACT ::= '(' 'store' NAME ( ('sale' AMOUNT) | ('expense' AMOUNT) ) + ')'
where
AMOUNT ::= number
NAME ::= identifier
Calculate and printout:
The profit for each store (å sales -å expenses)
The profit for all stores
Given facts of the sort:
MATELE ::= '(' 'ele' MAT ROW COL VAL ')'
where
MAT ::= 'A' | 'B' | 'C' // "A[r][c] . ($B[r][c] Ù $C[r][c] .C[r][c] = A[r][c]+B[r][c])
ROW ::= integer
COL ::= integer
VAL ::= number
Find and Printout the array C in the normal rectangular display:
Given facts of the sort "(value $?anything)"
Determine if the 'anything' is valid by the following grammar:
PROP ::= ATOM | PROP NOT | PROP PROP BINOP
ATOM ::= 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
NOT ::= 'not'
BINOP ::= 'and' | 'or' | 'if' | 'iff'
Printout t "valid" or "in-valid" as the case may be
Given facts of the sorts:START ::= '(' 'start' NAME)GOAL ::= '(' 'end' NAME ')'NODE ::= '(' 'node' NAME ')' // 1 per graph nodeEDGE ::= '(' 'edge' SRC TRGT COST ')' // edge 'goes' SRC to TRGT at COSTwhereSRC, TRGT ::= NAMENAME ::= symbolCOST ::= numberIf there is a path from start to endthen print "path " <start> " to " <end> " costs " <cost>else print "no path" <start> " to " <end>