09ma6cHW1

09ma6cHW1 - Ma/CS 6c Assignment #1 Due Wednesday, April 7...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Ma/CS 6c Assignment #1 Due Wednesday, April 7 at 1 p.m. (40%) 1 * . (a) Prove the correctness of the following algorithm for recognizing when a given string S is a P -wff: If S = s 1 s 2 ...s n , compute w ( s n ) ,w ( s n )+ w ( s n - 1 ) ,...,w ( s n )+ w ( s n - 1 )+ ··· + w ( s 1 ) = w ( S ). If all these sums are 1 and w ( S ) = 1, then S is a P -wff; otherwise, it is not. (Recall that w ( p ) = 1 , w ( ¬ ) = 0 , w ( * ) = - 1, if * = , , , .) Apply this algorithm to the strings: (i) qp ⇒ ¬ ttr ⇒ ∧¬ stuv ; (ii) ⇒⇔ ¬ ∧ pq ∨ ¬ p ¬ qs . If any of these strings is a P -wff, write down the corresponding wff. (40%) 2. Show that unique readability holds for the formal language described below (whose grammatically correct strings we call
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online