background preloader

Lambda calculus

Lambda calculus
The lowercase lambda, the 11th letter of the Greek alphabet, is used to symbolize the lambda calculus. Because of the importance of the notion of variable binding and substitution, there is not just one system of lambda calculus, and in particular there are typed and untyped variants. Historically, the most important system was the untyped lambda calculus, in which function application has no restrictions (so the notion of the domain of a function is not built into the system). In the Church–Turing Thesis, the untyped lambda calculus is claimed to be capable of computing all effectively calculable functions. The typed lambda calculus is a variety that restricts function application, so that functions can only be applied if they are capable of accepting the given input's "type" of data. Lambda calculus in history of mathematics[edit] Informal description[edit] Motivation[edit] Computable functions are a fundamental concept within computer science and mathematics. (read as "the pair of and ").

Deterministic finite-state machine An example of a deterministic finite automaton that accepts only binary numbers that are multiples of 3. The state S0 is both the start state and an accept state. In automata theory, a branch of theoretical computer science, a deterministic finite automaton (DFA)—also known as deterministic finite state machine—is a finite state machine that accepts/rejects finite strings of symbols and only produces a unique computation (or run) of the automaton for each input string.[1] 'Deterministic' refers to the uniqueness of the computation. In search of simplest models to capture the finite state machines, McCulloch and Pitts were among the first researchers to introduce a concept similar to finite automaton in 1943.[2][3] A DFA is defined as an abstract mathematical concept, but due to the deterministic nature of a DFA, it is implementable in hardware and software for solving various specific problems. Formal definition[edit] Let w = a1a2 ... an be a string over the alphabet Σ. Example[edit] . .

Haskell (programming language) Haskell /ˈhæskəl/[19] is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry. In Haskell, "a function is a first-class citizen" of the programming language.[22] As a functional programming language, the primary control construct is the function. The first version of Haskell ("Haskell 1.0") was defined in 1990. The committee's efforts resulted in a series of language definitions (1.0, 1.1, 1.2, 1.3, 1.4). In February 1999, the Haskell 98 language standard was originally published as "The Haskell 98 Report". In early 2006, the process of defining a successor to the Haskell 98 standard, informally named Haskell Prime, began.[25] This is an ongoing incremental process to revise the language definition, producing a new revision up to once per year. The following is a Hello world program written in Haskell (note that all but the last line can be omitted): JVM-based:

Extended Backus–Naur Form In computer science, Extended Backus–Naur Form (EBNF) is a family of metasyntax notations, any of which can be used to express a context-free grammar. EBNF is used to make a formal description of a formal language which can be a computer programming language. They are extensions of the basic Backus–Naur Form (BNF) metasyntax notation. Basics[edit] EBNF is a code that expresses the grammar of a formal language. digit excluding zero = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; digit = "0" | digit excluding zero ; This production rule defines the nonterminal digit which is on the left side of the assignment. A production rule can also include a sequence of terminals or nonterminals, each separated by a comma: twelve = "1", "2" ; two hundred one = "2", "0", "1" ; three hundred twelve = "3", twelve ; twelve thousand two hundred one = twelve, two hundred one ; Expressions that may be omitted or repeated can be represented through curly braces { ... }: Table of symbols[edit] 1. 2. 3.

Lambda-Kalkül Geschichte[Bearbeiten] Alonzo Church benutzte ihn, um 1936 sowohl eine negative Antwort auf das Entscheidungsproblem zu geben als auch eine Fundierung eines logischen Systems zu finden, wie es Russells und Whiteheads Principia Mathematica zugrunde lag. Mittels des untypisierten Lambda-Kalküls kann man klar definieren, was eine berechenbare Funktion ist. Die Frage, ob zwei Lambda-Ausdrücke (s. u.) äquivalent sind, kann im Allgemeinen nicht algorithmisch entschieden werden. In seiner typisierten Form kann der Kalkül benutzt werden, um Logik höherer Stufe darzustellen. Meilensteine der Entwicklung waren im Einzelnen: Der untypisierte Lambda-Kalkül[Bearbeiten] Motivation[Bearbeiten] Gehen wir von einem mathematischen Term aus, so lässt sich daraus die Funktion bilden, die auf abbildet. . den Term schreiben. durch -Abstraktion gebunden wird. Man kann auch -Abstraktion nach einer Variablen vornehmen, die in dem Term gar nicht vorkommt: z.B. . -Ausdruck bezeichnet dann die Funktion, die jedes abbildet.

Church–Turing thesis Several independent attempts were made in the first half of the 20th century to formalize the notion of computability: American mathematician Alonzo Church created a method for defining functions called the λ-calculus,British mathematician Alan Turing created a theoretical model for machines, now called Turing machines, that could carry out calculations from inputs,Austrian-American mathematician Kurt Gödel, with Jacques Herbrand, created a formal definition of a class of functions whose values could be calculated by recursion. All three computational processes (recursion, the λ-calculus, and the Turing machine) were shown to be equivalent—all three approaches define the same class of functions.[2][3] This has led mathematicians and computer scientists to believe that the concept of computability is accurately characterized by these three equivalent processes. Formal statement[edit] J. The thesis can be stated as follows: Every effectively calculable function is a computable function.[8]

Haskell (Programmiersprache) Haskell ist eine rein funktionale Programmiersprache, benannt nach dem US-amerikanischen Mathematiker Haskell Brooks Curry, dessen Arbeiten zur mathematischen Logik eine Grundlage funktionaler Programmiersprachen bilden. Haskell basiert auf dem Lambda-Kalkül, weshalb auch der griechische Buchstabe Lambda als Logo verwendet wird. Die wichtigste Implementierung ist der Glasgow Haskell Compiler (GHC). first x y = x quadrat x = x * x Die Funktion first liefert bei Eingabe zweier Parameter den ersten als Ergebnis zurück. Die Funktion quadrat berechnet bei Eingabe eines Parameters dessen Quadrat. Die Bedarfsauswertung ist vor allem wegen der strengen Einhaltung des funktionalen Konzepts möglich. Die Bedarfsauswertung erlaubt das Arbeiten mit undefinierten Werten und potentiell unendlich großen Datenmengen. Die Funktion map wendet eine beliebige Funktion auf die Elemente einer Liste an. map :: (a -> b) -> [a] -> [b] map toUpper :: [Char] -> [Char] Funktionen erlauben Currying. oder kann man auch

Regular expression The regular expression(?<=\.) {2,}(?=[A-Z]) matches at least two spaces occurring after period (.) and before an upper case letter as highlighted in the text above. Each character in a regular expression is either understood to be a metacharacter with its special meaning, or a regular character with its literal meaning. Together, they can be used to identify textual material of a given pattern, or process a number of instances of it that can vary from a precise equality to a very general similarity of the pattern. The pattern sequence itself is an expression that is a statement in a language designed specifically to represent prescribed targets in the most concise and flexible way to direct the automation of text processing of general text files, specific textual forms, or of random input strings. History[edit] Regular expressions originated in 1956, when mathematician Stephen Cole Kleene described regular languages using his mathematical notation called regular sets. Basic concepts[edit]

Monade (Informatik) In der funktionalen Programmierung sind Monaden ein abstrakter Datentyp. Wesentliche Eigenschaft von Monaden ist die Fähigkeit der Übertragung von Werten und Berechnungen in einem „einfacheren” Typ zu Berechnungen in einem „höheren Typ”, der mittels eines Typkonstruktors aus dem einfacheren Typ hervorgeht, sowie die Verknüpfung mehrerer solcher Übertragungen zu einer einzigen. Die übliche Formulierung einer Monade in der Programmierung hat folgende Komponenten: Ein Typkonstruktor, der für jeden zugrunde liegenden Typ definiert, wie der korrespondierende Monadentyp zu erhalten ist. Die folgenden Operationen sind typisch für Monaden und können für deren Definition Verwendung finden: Die Einheitsfunktion Der bind-Operator (>>=) :: m a -> (a -> m b) -> m b erlaubt, einen monadischen Typ an eine Funktion zu übergeben, die nur den zugrundeliegenden Typ verwendet. (dabei steht m für den Typkonstruktor) Diese Operationen müssen folgenden Gesetzen gehorchen: ma >>= f = (join . auf einen Vektorraum .

Turing machine An artistic representation of a Turing machine (Rules table not represented) A Turing machine is a hypothetical device that manipulates symbols on a strip of tape according to a table of rules. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any computer algorithm, and is particularly useful in explaining the functions of a CPU inside a computer. The "Turing" machine was invented in 1936 by Alan Turing[1] who called it an "a-machine" (automatic machine). The Turing machine is not intended as practical computing technology, but rather as a hypothetical device representing a computing machine. Turing gave a succinct definition of the experiment in his 1948 essay, "Intelligent Machinery". ...an unlimited memory capacity obtained in the form of an infinite tape marked out into squares, on each of which a symbol could be printed. Informal description[edit] The Turing machine mathematically models a machine that mechanically operates on a tape. where to

Monad (functional programming) Formally, a monad consists of a type constructor M and two operations, bind and return (where return is often also called unit). The operations must fulfill several properties to allow the correct composition of monadic functions (i.e. functions that use values from the monad as their arguments or return value). The return operation takes a value from a plain type and puts it into a monadic container using the constructor, creating a monadic value. The bind operation performs the reverse process, extracting the original value from the container and passing it to the associated next function in the pipeline, possibly with additional checks and transformations. Because a monad can insert additional operations around a program's domain logic, monads can be considered a sort of aspect-oriented programming.[7] The domain logic can be defined by the application programmer in the pipeline, while required aside bookkeeping operations can be handled by a pre-defined monad built in advance.

Floating point A diagram showing a representation of a decimal floating-point number using a mantissa and an exponent. In computing, floating point describes a method of representing an approximation of a real number in a way that can support a wide range of values. The numbers are, in general, represented approximately to a fixed number of significant digits (the significand) and scaled using an exponent. The base for the scaling is normally 2, 10 or 16. The typical number that can be represented exactly is of the form: Significant digits × baseexponent The term floating point refers to the fact that a number's radix point (decimal point, or, more commonly in computers, binary point) can "float"; that is, it can be placed anywhere relative to the significant digits of the number. Over the years, a variety of floating-point representations have been used in computers. Overview[edit] There are several mechanisms by which strings of digits can represent numbers. Symbolically, this final value is

Related: