- Understanding Analysis - Stephen Abott
- BV Rao's notes on Analysis I
| {-# LANGUAGE NoMonomorphismRestriction #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| import Diagrams.Prelude | |
| import Diagrams.Backend.SVG.CmdLine | |
| rules :: Diagram B | |
| rules = foldr1 (<>) hands | |
| where |
| module Lib where | |
| import Data.Graph | |
| import Data.Vector | |
| import Data.Map | |
| newtype State = State Int | |
| data Transition = Transition { addV :: [Int], | |
| toState :: State |
| import requests | |
| import json | |
| # replace the access_token with your own. You can get one at https://developers.facebook.com/tools/explorer/?method=GET&path=cmiconfessionz%2Ffeed&version=v3.0 | |
| starturl = "https://graph.facebook.com/v3.0/cmiconfessionz/feed?access_token=" | |
| cururl = starturl | |
| confessionData = [] |
| {-# OPTIONS_GHC -Wall #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE FunctionalDependencies #-} | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE RankNTypes #-} |
| public static void main(String[] args) | |
| { | |
| int l = 3; | |
| Conveyor conveyor = new Conveyor(); | |
| Thread nonHazardous[] = new Thread[l]; | |
| Thread hazardous[] = new Thread[l]; | |
| //populate | |
| for (int i = 0; i < l; i++){ | |
| nonHazardous[i] = new Thread(new Item(conveyor, i*10, 3000, false)); |
Objective: To understand the basic philosophy of Haskell, to know the distinction between functional programming and other paradigms of programming, setting up the haskell interpreter, getting acquinted to the basic syntax, basic understanding of the type system, currying
Read any one of these (but not necessarily all three)
| -- Just an utility function to calculate [root(x)] | |
| intSqrt :: Integer -> Integer | |
| intSqrt n = acc 1 n n | |
| where | |
| acc a b n | |
| | a == (b-1) = a | |
| | m*m > n = acc a m n | |
| | m*m <= n = acc m b n | |
| where |
| Diag = {M | M does not accept M} | |
| HP = {(M, x) | M accepts x} | |
| Co-Univ = {M | there exists w such that M does not accept w} | |
| Claim: HP <= Diag <= Co-Univ | |
| Reduction from HP to Diag | |
| Say HP has input (M, x) | |
| Design Turing Machine N such that: |
We viewed computation just as the process of rewriting. Is this notion powerful enough? Can we use such a model to compute whatever we like?
In class, we defined plus in terms of succ.
mult standing for multiplication, in terms of plus
C