{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture18StrongInduction - Lecture 18 CS 2603 Applied Logic...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma 1 Lecture 18 — CS 2603 Applied Logic for Hardware and Software Strong Induction Induction at a Discount or Bringing in the Cavalry to Prove P(n)
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Examples deal [1, 2, 3, 4, 5, 6] = ( [1, 3, 5], [2, 4, 6] ) deal [1, 2, 3, 4, 5, 6, 7] = ( [1, 3, 5, 7], [2, 4, 6] ) Informal specification deal :: [a] −> ( [a], [a] ) deal [x 1 , x 2 , … x 2n ] = ( [x 1 , x 3 , … x 2n-1 ], [x 2 , x 4 , … x 2n ] ) deal [x 1 , x 2 , … x 2n+1 ] = ( [x 1 , x 3 , … x 2n+1 ], [x 2 , x 4 , … x 2n ] ) Axioms ( x1: ys , x2: zs ) deal (x1: (x2: xs)) = deal [ ] = ( [ ], [ ] ) deal — a way to split a sequence in half deal [x] = ( [x], [ ] ) where (ys, zs) = deal xs ( x1: ys x2: zs ( x1: ys, x2: zs ) What equation changes if we want the extra element (if there is one) to go into the list in the second component? CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma 2
Image of page 2