Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.14 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.14 KB

The goal of this project is to solve Project Euler problems in a fast, proven-correct, and readable manner, priotized in that order.

The general structure of a solution will be:

-- The problem stated as clearly as possible, abstracted to take some notion of
-- input. This will normally be a ℕ representing an upper limit.
problem′ : A -- The problem filled in with the example given in the problem statement. Note
-- that not all problems have appropriate examples.
example :-- A proof that the example matches the expected value, as a sort of smoke test
-- of our problem description.
example-correct : example ≡ n

-- The problem with the specific input desired.
problem :-- The fast solution, again abstracted over the input.
solution′ : A -- A proof that for all inputs, our solution matches the problem.
solution-correct : problem′ ≗ solution′

-- The solution instantiated at the particular input the problem statement
-- calls for.
solution :-- Output the solution.
open import Data.Nat.Show
open import IO
import IO.Primitive as Prim

main : Prim.IO _
main = run (putStrLn (show solution))