chasing bottoms
play

Chasing Bottoms Nils Anders Danielsson Patrik Jansson Chalmers - PowerPoint PPT Presentation

Chasing Bottoms Nils Anders Danielsson Patrik Jansson Chalmers Chasing Bottoms p.1/7 Context Cover project. Verification of real Haskell programs. Haskell non-strict partial and infinite values relatively common. Chasing Bottoms


  1. Chasing Bottoms Nils Anders Danielsson Patrik Jansson Chalmers Chasing Bottoms – p.1/7

  2. Context Cover project. Verification of real Haskell programs. Haskell non-strict ⇒ partial and infinite values relatively common. Chasing Bottoms – p.2/7

  3. Proof methods Fixpoint induction. The approximation lemma. Coinduction. Fusion. Chasing Bottoms – p.3/7

  4. Caveats η -equality is not valid. ⊥ � = λ x . ⊥ No surjective pairing. ( fst ⊥ , snd ⊥ ) = ( ⊥ , ⊥ ) � = ⊥ Strange pattern matching semantics. λ True x . x � = λ True .λ x . x Typical Monad instances not monads. = return = λ x . ⊥ � = ⊥ ⊥ > > Chasing Bottoms – p.4/7

  5. Testing partial values isBottom :: a → Bool Several flavours of bottom: Non-termination. error "..." Pattern match failure. ( isBottom :: a → IO Bool ) = , ˆ ˆ ⊑ :: Data a ⇒ a → a → Bool Chasing Bottoms – p.5/7

  6. Testing infinite values approx :: Nat → T → T approx 3 = ���� ���� ���� ���� � � ������ � � ���� � � � � � � ���� ���� ���� ���� ���� ���� ���� ���� � � � � � � � � � � � � � � � � ���� ���� � ���� ���� ���� ���� ���� ���� ���� ���� � ���� ���� ���� ���� ���� ���� � � � � � � � � � � � � � � ���� ���� ���� ���� ���� ���� � ���� ���� ⊥ ⊥ ⊥ ⊥ � � � � � � � ���� ���� ���� ���� ���� ���� � ���� ���� � � � � � � � ���� ���� ���� ���� ���� ���� ���� ���� The approximation lemma: iff t 1 = t 2 ∀ n :: Nat . approx n t 1 = approx n t 2 Chasing Bottoms – p.6/7

  7. Conclusions Can test and prove, but tricky. Approximate semantics might be nice. ⊥ ≈ λ x . ⊥ For more details, see MPC2004 paper. Chasing Bottoms – p.7/7

Recommend


More recommend