1 / 15

Formal Models of Computation

Formal Models of Computation. Running Haskell Programs – power. How functional programs work…. We have seen simple programs such as Let’s now see how they are executed Given the program above, we get the following: But how?. power x 0 = 1 power x (n+1) = x * (power x n). power 2 3 8.

forbes
Download Presentation

Formal Models of Computation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Formal Models of Computation Running Haskell Programs – power

  2. How functional programs work… We have seen simple programs such as Let’s now see how they are executed Given the program above, we get the following: But how? power x 0 = 1 power x (n+1) = x * (power x n) power 2 3 8 formal models of computation

  3. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3 formal models of computation

  4. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) 3matches(n+1), assigning 2 to n power 23 formal models of computation

  5. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3  2 * (power 2 2) formal models of computation

  6. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3  2 * (power 2 2) formal models of computation

  7. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3  2 * (power 2 2) 2matches(n+1), assigning 1 to n formal models of computation

  8. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3  2 * (2 * (power 2 1)) formal models of computation

  9. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3  2 * (2 * (power 2 1)) formal models of computation

  10. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3  2 * (2 * (power 2 1)) 1matches(n+1), assigning 0 to n formal models of computation

  11. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3  2 * (2 * (2 * (power 2 0))) formal models of computation

  12. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3  2 * (2 * (2 * (power 2 0))) formal models of computation

  13. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3  2 * (2 * (2 * (power 2 0))) formal models of computation

  14. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3  2 * (2 * (2 * (1))) formal models of computation

  15. How functional programs work… Execution: power x 0 = 1 power x (n+1) = x * (power x n) power 2 3  8 formal models of computation

More Related