Changeset 11
- Timestamp:
- Nov 15, 2012, 12:16:02 AM (13 years ago)
- Location:
- sizechecking
- Files:
-
- 4 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sizechecking/Examples.hs
r10 r11 262 262 if P.not s then 263 263 M.return [name] 264 else264 else 265 265 M.return [] 266 266 … … 268 268 if List.null f then 269 269 P.putStrLn "All ok." 270 else do270 else do 271 271 P.putStr $ "\n\nFailed test cases: " 272 272 P.putStrLn $ List.intercalate ", " f 273 -
sizechecking/README.html
r5 r11 9 9 <body> 10 10 <h2 id="prerequisites">Prerequisites</h2> 11 <p>You need at least version 2011.4.0.0 of haskell platform and the package value-supply. If you have haskell platform installed you can install value-supply by typing</p>11 <p>You need at least version 2011.4.0.0 of the Haskell platform, an installed <a href="http://research.microsoft.com/en-us/um/redmond/projects/z3/">Z3</a> and the package value-supply. If you have a working Haskell platform installed you can install value-supply by typing</p> 12 12 <pre><code>cabal install value-supply</code></pre> 13 13 <h2 id="source-files">Source files</h2> … … 27 27 </dl> 28 28 <h2 id="using-the-examples">Using the examples</h2> 29 <pre><code>$ ghci Examples.hs 29 <pre><code>$ ghci Examples.hs 30 30 GHCi, version 7.0.4: http://www.haskell.org/ghc/ :? for help 31 31 Loading package ghc-prim ... linking ... done. … … 38 38 [4 of 4] Compiling Main ( Examples.hs, interpreted ) 39 39 Ok, modules loaded: Lambda, SizedExp, Constraints, Main. 40 *Main> 41 <p>Type â<code>runTests</code>â to run all test cases or type â<code>prove map</code>âto prove the function named map.</p>40 *Main></code></pre> 41 <p>Type "<code>runTests</code>" to run all test cases or type "<code>prove map</code>" to prove the function named map.</p> 42 42 <h2 id="under-windows">Under Windows</h2> 43 43 <p>It is not perfect, and you will see a box after every special character, but at least it works.</p> … … 65 65 4 where body f l = match l (nil) 66 66 5 ( \x xs -> cons `app` (f `app` x) `app` (map `app` f `app` xs ))</code></pre> 67 <p>Here line 3 tells us map is a top-level binding, where the body of the function is defined in line 4 â5 and its size expression is in line 1. Unfortunately the size expression language has not yet been embedded, so it is a bit difficult to read. Type <code>smap</code> in the GHC console to get a pretty printed form.</p>67 <p>Here line 3 tells us map is a top-level binding, where the body of the function is defined in line 4--5 and its size expression is in line 1. Unfortunately the size expression language has not yet been embedded, so it is a bit difficult to read. Type <code>smap</code> in the GHC console to get a pretty printed form.</p> 68 68 <pre><code>*Main> smap 69 69 λf.Îs,g.List s (λi.f (g i))</code></pre> -
sizechecking/README.txt
r5 r11 2 2 ------------- 3 3 4 You need at least version 2011.4.0.0 of haskell platform and the package 5 value-supply. If you have haskell platform installed you can install 6 value-supply by typing 4 You need at least version 2011.4.0.0 of the Haskell platform, an installed 5 [Z3](http://research.microsoft.com/en-us/um/redmond/projects/z3/) 6 and the packages `sbv` and `value-supply`. If you have a working Haskell platform installed you can 7 install value-supply by typing 7 8 8 cabal install value-supply 9 cabal install value-supply sbv 9 10 10 11 … … 25 26 26 27 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 $ ghci Examples.hs 28 $ ghci Examples.hs 28 29 GHCi, version 7.0.4: http://www.haskell.org/ghc/ :? for help 29 30 Loading package ghc-prim ... linking ... done. … … 36 37 [4 of 4] Compiling Main ( Examples.hs, interpreted ) 37 38 Ok, modules loaded: Lambda, SizedExp, Constraints, Main. 38 *Main> 39 *Main> 39 40 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 41 … … 79 80 func $ a b 80 81 ~~~~~~~~~~~~~~ 81 82 82 83 83 … … 130 130 : embedding of the function application of our language to haskell 131 131 132 There is also a function called `true` to denote we do not want to prove that132 There is also a function called `true` to denote that we do not want to prove that 133 133 branch. 134 135 -
sizechecking/SizedExp.hs
r5 r11 172 172 putStrLn "QED" 173 173 return True 174 else do174 else do 175 175 putStrLn "------------" 176 176 putStrLn "Cannot prove: "
Note: See TracChangeset
for help on using the changeset viewer.