Maar hoe moet het dan?


 Maurice Nelson
 1 years ago
 Views:
Transcription
1 Maar hoe moet het dan? Onderzoek naar feedback in interactieve leeromgevingen bij de Faculteit Informatica Johan Jeuring Met bijdragen van Alex Gerdes, Bastiaan Heeren, Josje Lodder, Harrie Passier, Sylvia Stuurman Open Universiteit Nederland Touwdag 2012, Amsterdam November 2012
2 Software technology for learning and teaching The software technology group has worked on interactive learning environments since 2005: The logic tutor Feedback in mathematical learning environments AskElle: a programming tutor for Haskell
3 Demos!
4 Main ideas behind AskElle A teacher specifies model solutions for an exercise, and possibly adapts the feedback AskElle compares possibly partial student solutions against model solutions As long as a student follows a model solution, AskElle can give hints
5 And what if a student makes an error, or takes a step that the tutor doesn t recognize? You have made a, possibly incorrect, step that does not follow the strategy.
6 And what if a student makes an error, or takes a step that the tutor doesn t recognize? You have made a, possibly incorrect, step that does not follow the strategy.
7 Our goals Increase the number of recognized good programs Report more errors, as precisely as possible
8 Report more errors, as precisely as possible Specify the properties a solution should satisfy Test the properties using QuickCheck Express the properties a solution should satisfy as a contract Use contract inference to infer contracts for userdefined functions Use contract checking to report property violations as precisely as possible
9 The problem Write a function that sorts a list sort :: Ord a => [a] > [a] For example: Data.List> sort [1,2,1,3,2,4] [1,1,2,2,3,4]
10 Sorting: a model solution sort = foldr insert [ ] insert x [ ] = [x] insert x (y : ys) x y = x : y : ys otherwise = y : insert x ys
11 An error in sorting sort = foldr insert [ ] insert x [ ] = [x] insert x (y : ys) x y = y : x : ys otherwise = y : insert x ys
12 Sorting: a property propsort xs = isnondesc (sort xs) isnondesc (x : y : xs) = x y isnondesc (y : xs) isnondesc = True
13 Running QuickCheck main = do quickcheck propsort *Main> main *** Failed! Falsifiable (after...): [0,1] But where is the error?
14 Running QuickCheck main = do quickcheck propsort *Main> main *** Failed! Falsifiable (after...): [0,1] But where is the error?
15 Contracts... Contracts to the rescue.
16 A contracted sort sortc = assert ([true] { zs isnondesc zs }) (λxs sort xs)
17 Blaming blamesort = sortc 0 [0, 1] *** Exception: contract failed: the expression sort is to blame. But where is the error?
18 Blaming blamesort = sortc 0 [0, 1] *** Exception: contract failed: the expression sort is to blame. But where is the error?
19 A more precise location To get a more precise location for the error: replace all functions in the definition of sort by their contracted counterparts.
20 A contracted insert insertc = assert (true { xs isnondesc xs } { xs isnondesc xs }) (λx λxs insert x xs)
21 A contracted foldr foldrc ca cb = assert ((ca cb cb) cb [ca] cb) (λf λe λxs foldr (λa λb f 1 a 2 b) e xs)
22 Blaming II blamesort = sortc 0 [0, 1] *** Exception: contract failed: the expression insert is to blame.
23 But wait In the context of the tutor, we only know the contract for sort A student can implement sort in many different ways We want to infer the contracts for the components of a function
24 The inferring contracts problem: Given A welltyped program A contract for the toplevel function determine the contracts for the components of the function.
25 range Write a function which enumerates all numbers contained in a given range. range :: Int Int [Int] For example, range 2 5 gives [2, 3, 4, 5]
26 Some solutions for range range 1 x y = if x y then [x] else x : range 1 (x + 1) y range 2 x y = if y x then [x] else x : range 2 (x + 1) y range 3 x y = if x y then x : range 3 (x + 1) y else [x] range 4 x y = if y x then x : range 4 (x + 1) y else [x] range 5 x y = if x y then x : range 5 (1 + x) y else [x]  and the 3 variants range 6 x = λy if x y then [x] else x : range 6 (x + 1) y  and the 7 variants range 7 = λx λy if x y then [x] else x : range 7 (x + 1) y  and the 7 variants
27 A procedure for determining equality A procedure for determining whether or not two programs are equal is necessarily going to have some limitations But surely each pair of range programs can pass the test How can determine many of these equalities? What program transformations can I specify to steer this procedure?
28 I need a normal form! Remove syntactic sugar Normalization by Evaluation normalizes based on types, so a function of type a b c always has the form λx λy... Normal forms for integer expressions, boolean expressions, string expressions, taking into account algebraic properties of the operators Inlining? let duplicate x = [x, x] in concatmap duplicate concatmap (λx [x, x]) Fusion? map f. map g = map (f. g)
29 The functional programming normal form problem Highlevel: how can I determine equality of (functional) programs? What is a normal form of a program? What sequence of steps do I use for determining a normal form of a program? How can I influence the computation of a normal form of a program?
30 Conclusions Interesting problems remain to be solved for AskElle: Inferring contracts Normal forms of programs More info: General information: Experiment online:
Monads for functional programming
Monads for functional programming Philip Wadler, University of Glasgow Department of Computing Science, University of Glasgow, G12 8QQ, Scotland (wadler@dcs.glasgow.ac.uk) Abstract. The use of monads to
More informationHow Old Are They? This problem gives you the chance to: form expressions form and solve an equation to solve an age problem. Will is w years old.
How Old Are They? This problem gives you the chance to: form expressions form and solve an equation to solve an age problem Will is w years old. Ben is 3 years older. 1. Write an expression, in terms of
More informationPerformance Assessment Task Which Shape? Grade 3. Common Core State Standards Math  Content Standards
Performance Assessment Task Which Shape? Grade 3 This task challenges a student to use knowledge of geometrical attributes (such as angle size, number of angles, number of sides, and parallel sides) to
More informationMEP Y9 Practice Book A
1 Base Arithmetic 1.1 Binary Numbers We normally work with numbers in base 10. In this section we consider numbers in base 2, often called binary numbers. In base 10 we use the digits 0, 1, 2, 3, 4, 5,
More informationIntroduction to. Hypothesis Testing CHAPTER LEARNING OBJECTIVES. 1 Identify the four steps of hypothesis testing.
Introduction to Hypothesis Testing CHAPTER 8 LEARNING OBJECTIVES After reading this chapter, you should be able to: 1 Identify the four steps of hypothesis testing. 2 Define null hypothesis, alternative
More informationRevised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)
Chapter 23 Squares Modulo p Revised Version of Chapter 23 We learned long ago how to solve linear congruences ax c (mod m) (see Chapter 8). It s now time to take the plunge and move on to quadratic equations.
More informationProgramming with Arrows
Programming with Arrows John Hughes Department of Computer Science and Engineering, Chalmers University of Technology, S41296 Sweden. 1 Introduction 1.1 Pointfree programming Consider this simple Haskell
More informationWelltyped programs can t be blamed
Welltyped programs can t be blamed Philip Wadler University of Edinburgh Robert Bruce Findler University of Chicago Abstract We introduce the blame calculus, which adds the notion of blame from Findler
More information= 2 + 1 2 2 = 3 4, Now assume that P (k) is true for some fixed k 2. This means that
Instructions. Answer each of the questions on your own paper, and be sure to show your work so that partial credit can be adequately assessed. Credit will not be given for answers (even correct ones) without
More informationProgramming up to Congruence (Extended version)
Programming up to Congruence (Extended version) Vilhelm Sjöberg Stephanie Weirich University of Pennsylvania, Philadelphia, PA, USA {vilhelm,sweirich}@cis.upenn.edu Abstract This paper presents the design
More informationWhich Has More? by Marilyn Burns From Online Newsletter Issue Number 3, Fall 2002
Which Has More? by Marilyn Burns From Online Newsletter Issue Number 3, Fall 2002 Lessons for Introducing Multiplication, Grade 3 is a revision that replaces Multiplication, Grade 3, the Math By All Means
More informationDependent Types at Work
Dependent Types at Work Ana Bove and Peter Dybjer Chalmers University of Technology, Göteborg, Sweden {bove,peterd}@chalmers.se Abstract. In these lecture notes we give an introduction to functional programming
More informationAbstract. 1. Introduction. Butler W. Lampson Xerox Palo Alto Research Center David D. Redell Xerox Business Systems
Experience with Processes and Monitors in Mesa 1 Abstract Butler W. Lampson Xerox Palo Alto Research Center David D. Redell Xerox Business Systems The use of monitors for describing concurrency has been
More informationIf A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C?
Problem 3 If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C? Suggested Questions to ask students about Problem 3 The key to this question
More informationDependently Typed Programming in Agda
Dependently Typed Programming in Agda Ulf Norell 1 and James Chapman 2 1 Chalmers University, Gothenburg ulfn@chalmers.se 2 Institute of Cybernetics, Tallinn james@cs.ioc.ee 1 Introduction In HindleyMilner
More informationOn Understanding Types, Data Abstraction, and Polymorphism
1 Computing Surveys, Vol 17 n. 4, pp 471522, December 1985 On Understanding Types, Data Abstraction, and Polymorphism Luca Cardelli AT&T Bell Laboratories, Murray Hill, NJ 07974 (current address: DEC
More informationJust want the standards alone? You can find the standards alone at http://corestandards.org/thestandards
4 th Grade Mathematics Unpacked Content For the new Common Core State Standards that will be effective in all North Carolina schools in the 201213 school year. This document is designed to help North
More informationAsymptotic Improvement of Computations over Free Monads
Asymptotic Improvement of Computations over Free Monads Janis Voigtländer Institut für Theoretische Informatik Technische Universität Dresden 01062 Dresden, Germany janis.voigtlaender@acm.org Abstract.
More information(0, 0) : order 1; (0, 1) : order 4; (0, 2) : order 2; (0, 3) : order 4; (1, 0) : order 2; (1, 1) : order 4; (1, 2) : order 2; (1, 3) : order 4.
11.01 List the elements of Z 2 Z 4. Find the order of each of the elements is this group cyclic? Solution: The elements of Z 2 Z 4 are: (0, 0) : order 1; (0, 1) : order 4; (0, 2) : order 2; (0, 3) : order
More informationIntroduction to Objective Caml
Introduction to Objective Caml Jason Hickey DRAFT. DO NOT REDISTRIBUTE. Copyright Jason Hickey, 2008. This book has been submitted for publication by Cambridge University Press. This draft may be used
More informationCommon Core State Standards for Mathematical Practice 4. Model with mathematics. 7. Look for and make use of structure.
Who Sends the Most Text Messages? Written by: Anna Bargagliotti and Jeanie Gibson (for ProjectSET) Loyola Marymount University and Hutchison School abargagl@lmu.edu, jgibson@hutchisonschool.org, www.projectset.com
More informationHow to Study Mathematics Written by Paul Dawkins
How to Study Mathematics Written by Paul Dawkins Before I get into the tips for how to study math let me first say that everyone studies differently and there is no one right way to study for a math class.
More informationOn Understanding Types, Data Abstraction, and Polymorphism
On Understanding Types, Data Abstraction, and Polymorphism LUCA CARDELLI AT&T Bell Laboratories, Murray Hill, N. J. 07974 PETER WEGNER Department of Computer Science, Brown University, Providence, R. I.
More informationNCSS Statistical Software
Chapter 06 Introduction This procedure provides several reports for the comparison of two distributions, including confidence intervals for the difference in means, twosample ttests, the ztest, the
More information1. Graphing Linear Inequalities
Notation. CHAPTER 4 Linear Programming 1. Graphing Linear Inequalities x apple y means x is less than or equal to y. x y means x is greater than or equal to y. x < y means x is less than y. x > y means
More informationAll You Ever Wanted to Know About Dynamic Taint Analysis and Forward Symbolic Execution (but might have been afraid to ask)
All You Ever Wanted to Know About Dynamic Taint Analysis and Forward Symbolic Execution (but might have been afraid to ask) Edward J. Schwartz, Thanassis Avgerinos, David Brumley Carnegie Mellon University
More informationHow to Make Ad Hoc Proof Automation Less Ad Hoc
How to Make Ad Hoc Proof Automation Less Ad Hoc Georges Gonthier Microsoft Research gonthier@microsoft.com Beta Ziliani MPISWS beta@mpisws.org Aleksandar Nanevski IMDEA Software Institute aleks.nanevski@imdea.org
More informationExamples of DIVISION RELATIONAL ALGEBRA and SQL. r s is used when we wish to express queries with all :
Examples of DIVISION RELATIONAL ALGEBRA and SQL r s is used when we wish to express queries with all : Ex. Which persons have a loyal customer's card at ALL the clothing boutiques in town X? Which persons
More informationProgramming Your Calculator Casio fx7400g PLUS
Programming Your Calculator Casio fx7400g PLUS Barry Kissane Programming Your Calculator: Casio fx7400g PLUS Published by Shriro Australia Pty Limited 7274 Gibbes Street, Chatswood NSW 2067, Australia
More informationWHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?
WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT? introduction Many students seem to have trouble with the notion of a mathematical proof. People that come to a course like Math 216, who certainly
More information