User:Pengo/comp

Source: Wikipedia, the free encyclopedia.
Flag of Earth Peter Halasz (talk) ?

Subpages: /dia | /missing | /org | /pages | /photo | /quotes

Ideas: /rants | /ite | /R | /teletaxo

Subjects: /bot | /comp | /ee | /eco | /fringe | /micro | /sd | /zoo

Incubator: /ownimg | /teletaxotest | /self

Computer science and related topics

Haskell

Codata

from the paper Codata and Comonads in Haskell [1] (pdf)

Computer theory

Automata theory

Pushdown automata theory

Turing theory

Types and Programming Languages

Not covered

  • Denotational and axiomatic approaches to semantics, denotation, axiom, semantics
  • The rich connections between type systems and logic
  • dependent types
    (mentioned in passing)
  • intersection type (mentioned in passing)
  • Curry-Howard correspondence
    (mentioned in passing)

Introduction

Untyped arithmetic expressions

Definition styles

Symantics styles

ML
example (ch4)

The Untyped Lambda-calculus

Alternatives:

Free variables and bound variables:

  • free variable
  • bound variable

Evaluation strategies:

  • beta-reduction
    (any redex at any time)
  • normal order strategy (normal order), leftmost, outermost redex is always reduced first
  • call-by-name
    , no reductions inside abstractions. non-strict (lazy)
  • call by need
    (Haskell). non-strict (lazy)
  • call-by-value
    (most languages). strict (arguments always evaluated)

Lambda calculus grammmar:

t ::=            terms:
       x         variable
       λx.t      abstraction or lambda-abstraction
       t t       application

Language levels:

Capture:

  • capture-avoiding substitution
  • alpha-conversion

Free variables:

  • FV(t) is the set of free variables of term t.
  • FV(x) = {x}
  • FV(λx.t1) = FV(t1)\{x}
  • FV(t1 t2) = FV(t1) ∪ FV(t2)

Nameless representation of types

Capture (cont):

Nicholas de Bruijn:

Explicit substitution:

Typed Arithmetic Expressions

Safety = Progress + Preservation

Simply typed lambda-calculus

Type assignment system:

symbols:

  • Γ ⊢ t:T "the
    closed term t has type T under the empty set
    of assumptions."
  • (not from book)inference, reduces to. x ⊢ y means y is derived from x
  • Table of mathematical symbols
  • Γ ⊢ x : R, then x:R ∈ Γ (the type assumed for x in Γ is R)
  • dom(Γ) gives the set of variables bound by Γ

context:

  • Γ is context
  • Γ is the set of assumptions about the types of the free variables in t.
  • Γ ⊢ ... "using the context Γ ..."
  • type environment
T ::=            types:
       T→T       type of functions

Γ ::=            contexts:
       ∅        empty context
       Γ,x:T     term variable binding

more lemmas:

Curry-Howard Correspondence:

Logic Programming languages
propositions types
proposition P ⊃ Q type P → Q
proposition P ∧ Q type P × Q
proof of proposition P term t of type P
proposition P is provable type P is inhabited (by some term)

Thorough discussions of this correspondence:

  • Girard, Lafont, and Laylot (1989)
  • Gallier (1993)
  • Sørensen and Urzyczyn (1998)
  • Pfenning (2001)
  • Goubault-Larrecq and Mackie (1997)
  • Simmons (2000)

Erasure and Typability

  • erasure
  • typability
  • Curry-style (terms, then symantics) used also for implicitly typed syntax
  • Church-style (terms, then identify the well-types terms, then semantics to types)

Simple extensions

e.g.

Addr = <physical:PhysicalAddr, virtual:VirtualAddr>;
a = <physical:pa> as Addr;

also for null-able types:

OptionalNat = <none:Unit, some:Nat>;

e.g.

EuroAmount = <euros:Float>;

Normalization