ECS 140A Programming LanguagesAbout This AssignmentThis assignment asks you to complete programming tasks using the GNU Common Lisp programming language.You are only allowed to use the subset of lisp that we have discussed in class. For example, using loop constructs or other built-in functions is not allowed. You will get no credit for a solution that uses these functions in your solution. Please use Piazza for any clarifications regarding this issue.To complete the assignment (i) download hw3-handout.zip from Canvas, (ii) modify the .lisp files in the hw3-handout directory as per the instructions in this document, and (iii) zip the hw3-handout directory into hw3-handout.zip and upload this zip file to Canvas by the due date.Do not change the file names, create new files, or change the directory structure inhw3-handout.This assignment has to be worked on individually.We will be using the GNU CLISP implementation of Common Lisp, version 2.49, which can be installed from https://clisp.sourceforge.io/.Use the command clisp –version to verify that you have the correct version in- stalled:$ clisp –versionGNU CLISP 2.49
chable from the state 0 via the input sequence abababa.The state 1 is not reachable from the state 0 via the input sequence ababab.The state 2 is reachable from state 0 via the input sequence abababa.Complete the definition of the function reachable in hw3-handout/nfa/nfa.lisp, which returns true if a final state is reachable from the start state after reading an input sequence of symbols, and nil, otherwise.The transition function for the NFA described above is represented by theexpTransitions function in hw3-handout/nfa/nfa test.lisp.> (reachable ’expTransitions 0 0 ’(A B)) T> (reachable ’expTransitions 0 0 ’(A A)) nilUse the following commands to run the unit tests provided inhw3-handout/nfa/nfa test.lisp:$ cd hw3-handout/nfa/$ clisp nfa_test.lispmatrix (30 points)Suppose we represent a matrix in LISP as a list of lists. For example, ((a b) (c d)) would represent a 2*2 matrix whose first row contains the elements a and b, and whose second row contains the elements c and d. You may assume that the matrices are well-formed, compatible, and not empty.Complete the definition of the function matrix-addin hw3-handout/matrix/matrix.lisp, which takes two matrices as input and outputs the sum of the two matrices.> (matrix-add ’((1 2) (2 1)) ’((1 2) (3 4)))((2 4) (5 5))Complete the definition of the function matrix-multiplyin hw3-handout/matrix/matrix.lisp, which takes two matrices as input and mul- tiplies them and outputs the resultant. You may assume that the matrices are well- formed, compatible, and not empty.> (matrix-multiply ((1 2) (2 1)) ’((3 1) (1 3)))((5 7) (7 5))Complete the definition of the function matrix-transposein hw3-handout/matrix/matrix.lisp, which takes a matrix as input, and outputs its transpose. You may assume that the matrix is well-formed, and not empty.> (matrix-transpose ’((1 2 3) (4 5 6)))((1 4) (2 5) (3 6))Use the following commands to run the unit tests provided inhw3-handout/matrix/matrix test.lisp:$ cd hw3-handout/matrix/
$ clisp matrix_test.lisp