COCS3308 Program-7 Propositional Logic Validity Checker Due: 11/20/2006 Consider a set of logical formulas consisting of: NOT AND OR IMP EQU NAND NOR Predicate literals (where each literal consists of one or more letters/digits the first of which must be a letter) Task: Write a SNOBOL program to check the validity of each input formula. Requirements: 1. You can modify the "Wang" function of Snobol Example-9 so that a. Each Operand must start with a letter followed by any number of letters and/or digits. b. Both operators and operands are case-insensitive. c. Extra pairs of parentheses do not affect the validity at all. d. Three more operators are to be included: NOR NAND EQU 2. For each input formula, output the following: The input formula. Indication of whether the formula is valid or invalid. 3. Use the following eleven input formulas: OR(ABC,((not(ABC)))) OR(12A,NOT(12A)) OR(NAND(ABC,D),AND(D,ABC)) IMP(((AND(IMP(A,BB),IMP(BB,C)))),IMP(A,C)) IMP(IMP(IMP(A,B),C),IMP(A,IMP(B,C))) IMP(IMP(A,IMP(B,C)),IMP(IMP(A,B),C)) IMP(NOR(A,AND(B,C)),NAND(A,OR(C,D))) IMP(NAND(A,OR(C,D)),NOR(A,AND(B,C))) EQU(EQU(A,B),AND(IMP(A,B),IMP(B,A))) ((EQU(OR(A,B),OR(A,AND(NOT(A),B))))) EQU(OR(A,OR(B,C)),OR(A,AND(NOT(A),B))) 4. Submit the following: a. Hardcopy Listing of your program and b. Hardcopy printout of required outputs. Notes: 1. NOT(A).B ---> C B ---> C + A 2. (A.B).C ---> D A.B.C ---> D 3. (A+B).C ---> D (A.C ---> D).(B.C ---> D) 4. (A ---> B).C ---> D (C--->D+A).(C.B--->D) 5. (A<-->B).C ---> D (C--->D+A+B).(C.A.B--->D) 6. A ---> NOT(C) + B A.C ---> B 7. A ---> B.C + D (A ---> B + D) . (A ---> C + D) 8. A ---> (B ---> C) + D A.B ---> C + D 9. A ---> (B + C) + D A ---> B + C + D 10.A ---> (B <--> C) + D (A B ---> C+D).(A C ---> B+D)