SlideServe
Menu
Préférences
© SlideServe · v2026

Understanding Symbolic Evaluation and Program Correctness in Functional Programming

waylon avatar
11 diapositives · 266 Views · Jul 30, 2014

This document delves into the concepts of symbolic evaluation and program correctness within the context of functional programming, particularly using Haskell. It examines definitions, evaluation techniques, and general properties like length functions. It discusses how symbolic evaluation allows for reasoning about program behavior without specific values and emphasizes the significance of inductive reasoning for recursive functions. Examples illustrate lazy evaluation in Haskell, where expressions are computed only when necessary. Additionally, it provides practical guidance on installing necessary Haskell packages for assignments.

Understanding Symbolic Evaluation and Program Correctness in Functional Programming - slide 1
01 / 11Understanding Symbolic Evaluation and Program Correctness in Functional Programming
1 / 17

Télécharger la présentation

Understanding Symbolic Evaluation and Program Correctness in Functional Programming
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Programming Paradigms CPSC 449 Week 5 Prepared by : Mona Hosseinkhani, ArashAfshar Winter 2014 Department of Computer Science, University of Calgary

  2. Understanding definitions • Alternatives • Evaluate on particular inputs • Using an implementation (e.g. GHCi) • By hand (by performing a line by line calculation) • Argue about how it behaves in general • Example

  3. Evaluation on particular inputs

  4. Analyze the behavior in general • Find general properties of length • length [x] = 1 • length (xs ++ ys) = length xs + length ys • We could show • This is called Symbolic Evaluation. • Rather than evaluating length at a particular value, we used a variable x. So for all values of x:

  5. Understanding definitions • Symbolic evaluation is an important part of the proofs. • But we also need another principle: induction to do most proofs for recursive functions • Note that understanding and describing definitions in imperative languages (e.g. Pascal) is very difficult

  6. Program correctness: recall • Test on inputs • Property-based test • Proof

  7. Total correctness (proof)

  8. Example • No termination

  9. Lazy evaluation • Evaluate • Haskell evaluates an expression only if its value is actually needed.

  10. Questions hossem@ucalgary.ca

  11. Install bmp package for next assignment • http://hackage.haskell.org/package/bmp • $ cabal update • $ cabal install cabal-install • if the last step is successful execute the following • $ cabal install bmp