At times it is useful to consider a function whose derivative is a given function. We look at the general idea of reversing the differentiation process and its applications to rectilinear motion.
The document discusses using self-balancing binary search trees like 2-3-4 trees, red-black trees, or AVL trees as an alternative to hashing-based solutions for dynamic dictionaries. These tree-based structures support common dictionary operations like add, lookup, and delete in logarithmic time, as well as predecessor and successor operations that are difficult for hashing approaches. The trees maintain balance, allowing logarithmic-time performance for updates and searches.
Processing data with Python, using standard library modules you (probably) ne...gjcross
Tutorial #2 from PyCon AU 2012
You have data.
You have Python.
You also have a lot of choices about the best way to work with that data...
Ever wondered when you would use a tuple, list, dictionary, set, ordered dictionary, bucket, queue, counter or named tuple? Phew!
Do you know when to use a loop, iterator or generator to work through a data container?
Why are there so many different "containers" to hold data?
What are the best ways to work with these data containers?
This tutorial will give you all the basics to effectively working with data containers and iterators in Python. Along the way we will cover some very useful modules from the standard library that you may not have used before and will end up wondering how you ever did without them.
This tutorial is aimed at Python beginners. Bring along your laptop so you can interactively work through some of the examples in the tutorial. If you can, install ipython (http://ipython.org/) as we will use it for the demonstrations.
This document outlines the key topics in mathematical methods including:
- Matrices and linear systems of equations, eigen values and vectors, and real/complex matrices.
- Fourier series, Fourier transforms, and partial differential equations.
It provides textbooks and references for further study. The unit focuses on Fourier series, covering properties of even and odd functions, Euler's formulae, and half-range expansions. It also introduces Fourier integrals and transforms, discussing cosine, sine, and complex forms.
Lesson 26: The Fundamental Theorem of Calculus (slides)Matthew Leingang
The document discusses the Fundamental Theorem of Calculus, which has two parts. The first part states that if a function f is continuous on an interval, then the derivative of the integral of f is equal to f. This is proven using Riemann sums. The second part relates the integral of a function f to the integral of its derivative F'. Examples are provided to illustrate how the area under a curve relates to these concepts.
This document summarizes built-in predicates in Prolog including:
- Utility goals like help and halt
- Loading and testing types of Prolog programs
- Arithmetic, equality, and database manipulation predicates
- Input/output predicates for writing, reading, and file handling
- Control predicates for negation, conjunction, disjunction
- Finding all solutions with findall, bagof, and setof
The document discusses Python lists, tuples, and dictionaries. It provides examples of how to create, access, modify, and loop through each of these data types. Lists are ordered and changeable collections that allow duplicate elements. Tuples are ordered and unchangeable collections that allow duplicate elements. Dictionaries are unordered collections of key-value pairs that do not allow duplicate keys. The document demonstrates various methods and operations available for each data type, such as appending and removing elements from lists, accessing elements by index in lists and tuples, and adding or modifying elements in dictionaries.
On Spaces of Entire Functions Having Slow Growth Represented By Dirichlet SeriesIOSR Journals
In this paper spaces of entire function represented by Dirichlet Series have been considered. A
norm has been introduced and a metric has been defined. Properties of this space and a characterization of
continuous linear functionals have been established.
At times it is useful to consider a function whose derivative is a given function. We look at the general idea of reversing the differentiation process and its applications to rectilinear motion.
The document discusses using self-balancing binary search trees like 2-3-4 trees, red-black trees, or AVL trees as an alternative to hashing-based solutions for dynamic dictionaries. These tree-based structures support common dictionary operations like add, lookup, and delete in logarithmic time, as well as predecessor and successor operations that are difficult for hashing approaches. The trees maintain balance, allowing logarithmic-time performance for updates and searches.
Processing data with Python, using standard library modules you (probably) ne...gjcross
Tutorial #2 from PyCon AU 2012
You have data.
You have Python.
You also have a lot of choices about the best way to work with that data...
Ever wondered when you would use a tuple, list, dictionary, set, ordered dictionary, bucket, queue, counter or named tuple? Phew!
Do you know when to use a loop, iterator or generator to work through a data container?
Why are there so many different "containers" to hold data?
What are the best ways to work with these data containers?
This tutorial will give you all the basics to effectively working with data containers and iterators in Python. Along the way we will cover some very useful modules from the standard library that you may not have used before and will end up wondering how you ever did without them.
This tutorial is aimed at Python beginners. Bring along your laptop so you can interactively work through some of the examples in the tutorial. If you can, install ipython (http://ipython.org/) as we will use it for the demonstrations.
This document outlines the key topics in mathematical methods including:
- Matrices and linear systems of equations, eigen values and vectors, and real/complex matrices.
- Fourier series, Fourier transforms, and partial differential equations.
It provides textbooks and references for further study. The unit focuses on Fourier series, covering properties of even and odd functions, Euler's formulae, and half-range expansions. It also introduces Fourier integrals and transforms, discussing cosine, sine, and complex forms.
Lesson 26: The Fundamental Theorem of Calculus (slides)Matthew Leingang
The document discusses the Fundamental Theorem of Calculus, which has two parts. The first part states that if a function f is continuous on an interval, then the derivative of the integral of f is equal to f. This is proven using Riemann sums. The second part relates the integral of a function f to the integral of its derivative F'. Examples are provided to illustrate how the area under a curve relates to these concepts.
This document summarizes built-in predicates in Prolog including:
- Utility goals like help and halt
- Loading and testing types of Prolog programs
- Arithmetic, equality, and database manipulation predicates
- Input/output predicates for writing, reading, and file handling
- Control predicates for negation, conjunction, disjunction
- Finding all solutions with findall, bagof, and setof
The document discusses Python lists, tuples, and dictionaries. It provides examples of how to create, access, modify, and loop through each of these data types. Lists are ordered and changeable collections that allow duplicate elements. Tuples are ordered and unchangeable collections that allow duplicate elements. Dictionaries are unordered collections of key-value pairs that do not allow duplicate keys. The document demonstrates various methods and operations available for each data type, such as appending and removing elements from lists, accessing elements by index in lists and tuples, and adding or modifying elements in dictionaries.
On Spaces of Entire Functions Having Slow Growth Represented By Dirichlet SeriesIOSR Journals
In this paper spaces of entire function represented by Dirichlet Series have been considered. A
norm has been introduced and a metric has been defined. Properties of this space and a characterization of
continuous linear functionals have been established.
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)Matthew Leingang
The exponential function is pretty much the only function whose derivative is itself. The derivative of the natural logarithm function is also beautiful as it fills in an important gap. Finally, the technique of logarithmic differentiation allows us to find derivatives without the product rule.
The document discusses OTTER, a theorem prover that uses resolution style proofs. It provides background on OTTER, describing it as a resolution style theorem prover and discussing its clause representation and main strategies like restriction strategies, direction strategies, and look-ahead strategies. Examples are given of using OTTER to solve problems like the 15 puzzle and analyzing its complexity.
This document proposes a linear programming (LP) based approach for solving maximum a posteriori (MAP) estimation problems on factor graphs that contain multiple-degree non-indicator functions. It presents an existing LP method for problems with single-degree functions, then introduces a transformation to handle multiple-degree functions by introducing auxiliary variables. This allows applying the existing LP method. As an example, it applies this to maximum likelihood decoding for the Gaussian multiple access channel. Simulation results demonstrate the LP approach decodes correctly with polynomial complexity.
NumPy is a Python library used for working with multidimensional arrays and matrices for scientific computing. It allows fast operations on arrays through optimized C code and is the foundation of the Python scientific computing stack. NumPy arrays can be created in many ways and support operations like indexing, slicing, broadcasting, and universal functions. NumPy provides many useful features for linear algebra, Fourier transforms, random number generation and more.
Runtime Analysis of Population-based Evolutionary AlgorithmsPK Lehre
Populations are at the heart of evolutionary algorithms (EAs). They provide the genetic variation which selection acts upon. A complete picture of EAs can only be obtained if we understand their population dynamics. A rich theory on runtime analysis (also called time-complexity analysis) of EAs has been developed over the last 20 years. The goal of this theory is to show, via rigorous mathematical means, how the performance of EAs depends on their parameter settings and the characteristics of the underlying fitness landscapes. Initially, runtime analysis of EAs was mostly restricted to simplified EAs that do not employ large populations, such as the (1+1) EA. This tutorial introduces more recent techniques that enable runtime analysis of EAs with realistic population sizes.
The tutorial begins with a brief overview of the population‐based EAs that are covered by the techniques. We recall the common stochastic selection mechanisms and how to measure the selection pressure they induce. The main part of the tutorial covers in detail widely applicable techniques tailored to the analysis of populations. We discuss random family trees and branching processes, drift and concentration of measure in populations, and level‐based analyses.
To illustrate how these techniques can be applied, we consider several fundamental questions: When are populations necessary for efficient optimisation with EAs? What is the appropriate balance between exploration and exploitation and how does this depend on relationships between mutation and selection rates? What determines an EA's tolerance for uncertainty, e.g. in form of noisy or partially available fitness?
This tutorial was presented at the 2015 IEEE Congress on Evolutionary Computation at Sendai, Japan, May 25th 2015.
Haskell is a pure functional programming language that was created in 1987 by a committee of researchers. It features lazy evaluation, pattern matching, list comprehensions, and type polymorphism. Haskell does not use variables or loops, instead relying on recursion. It has evolved over time from Haskell 1.0 to the current Haskell 2010 standard. For beginners, Hugs is a good starting point, while Haskell Platform is recommended for developers.
Ejercicios de estilo en la programaciónSoftware Guru
El escritor francés Raymond Queneau escribió a mediados del siglo XX un libro llamado "Ejercicios de Estilo" donde mostraba una misma historia corta, redactada de 99 formas distintas.
En esta plática realizaremos el mismo ejercicio con un programa de software. Abarcaremos distintos estilos y paradigmas: programación monolítica, orientada a objetos, relacional, orientada a aspectos, monadas, map-reduce, y muchos otros, a través de los cuales podremos apreciar la riqueza del pensamiento humano aplicado a la computación.
Esto va mucho más allá de un ejercicio académico; el diseño de sistemas de gran escala se alimenta de esta variedad de estilos. También platicaremos sobre los peligros de quedar atrapado bajo un conjunto reducido de estilos a lo largo de tu carrera, y la necesidad de verdaderamente entender distintos estilos al diseñar arquitecturas de sistemas de software.
Semblanza del conferencista:
Crista Lopez es profesora en la Facultad de Ciencias Computacionales de la Universidad de California en Irvine. Su investigación se enfoca en prácticas de ingeniería de software para sistemas de gran escala. Previamente, fue miembro fundador del equipo en Xerox PARC creador del paradigma de programación orientado a aspectos (AOP). Crista es una de las desarrolladoras principales de OpenSimulator, una plataforma open source para crear mundos virtuales 3D. También es fundadora de Encitra, empresa especializada en la utilización de la realidad virtual para proyectos de desarrollo urbano sustentable. @cristalopes
The document discusses the Pi-calculus, a formal system for describing processes that communicate via channels. It provides an overview of the history and motivation for Pi-calculus, its basic elements like variables, channels, and processes, examples of how it can model processes and lambda calculus, and rules for reducing Pi-calculus expressions. Pi-calculus is used to describe concurrent and distributed systems formally and can describe processes that change over time through communication.
This document provides an introduction to functional programming concepts in Haskell, including:
- Defining functions and evaluating expressions through reduction sequences.
- Currying and partial application of functions.
- Pattern matching and defining functions through multiple cases.
The document discusses probability distributions and their natural parameters. It provides examples of several common distributions including the Bernoulli, multinomial, Gaussian, and gamma distributions. For each distribution, it derives the natural parameter representation and shows how to write the distribution in the form p(x|η) = h(x)g(η)exp{η^T μ(x)}. Maximum likelihood estimation for these distributions is also briefly discussed.
This document summarizes key points from a lecture on Lévy processes and stochastic calculus. It discusses filtrations and how they allow consideration of events up to a given time. It defines Markov processes and their transition probabilities. It also discusses martingales and how Lévy processes with zero mean are martingales. Important martingale examples related to Lévy processes are presented.
This document provides an overview of the CLAIRE programming language. It describes CLAIRE as an object-oriented, functional language that supports rule-based and set-based programming. It also discusses CLAIRE's capabilities such as polymorphism, logical assertions with rules, set expressions, and tree search tools. The document uses examples like an airline scheduling problem to illustrate how CLAIRE can be applied to combinatorial optimization problems.
This document outlines a talk on using category theory concepts in functional programming. It begins by introducing the definition of a category from category theory and using Scala examples to demonstrate how types and functions in Scala satisfy this definition. It then defines functors, natural transformations, and monads from category theory and provides examples showing how options, lists, and functions in Scala form a monad. It proves that the category theory definition of a monad is equivalent to the definition used in functional programming. The document suggests category theory concepts help formalize design patterns and make code more refactorable.
This document presents theorems and results regarding hypercyclic operators on the space Hbc(E), where E is a Banach space. Theorem 3.1 shows that the collection of functions {eφ : φ ∈ E*} forms an independently linear subset of Hbc(E). Theorem 3.2 proves that the span of {eφ : φ ∈ U} is dense in Hbc(E), where U is an open subset of E*. Theorem 3.3 demonstrates that if φ is an entire function of exponential type, then the operator φα(D) is hypercyclic on Hbc(E). The document also provides two corollaries: if E has a separable dual, then
Integration by substitution is the chain rule in reverse.
NOTE: the final location is section specific. Section 1 (morning) is in SILV 703, Section 11 (afternoon) is in CANT 200
This document contains a presentation by Abhijeet Anand on NumPy. It introduces NumPy as a Python library for working with arrays, which aims to provide array objects that are faster than traditional Python lists. NumPy arrays benefit from being stored continuously in memory, unlike lists. The presentation covers 1D, 2D and 3D arrays in NumPy and basic array properties and operations like shape, size, dtype, copying, sorting, addition, subtraction and more.
1. The document introduces the concept of a T-pre-compact space using a pre-operator T on a topological space (X,Γ,T). A subset A of X is T-pre-compact if every T-pre-open cover of A has a finite subcover.
2. Properties of T-pre-compact spaces are studied, including that every T-pre-compact space is also T-compact, and the union of two T-pre-compact sets is T-pre-compact. The notion of "good pre-operators" is introduced.
3. Relationships between T-pre-compact spaces and T-separation axioms are examined. It is shown that
Slides originating from a talk I gave at ScalaMUC on 2013-12-17. The corresponding code can be found at https://github.com/afwlehmann/iteratee-tutorial .
Here are the solutions to the problem statements:
1. arr = np.arange(13,25).reshape(3,4)
2.
i) P = P + 10
ii) R = P * Q
iii) Q = Q / 7
iv) P = np.log(P)
v) Q = np.round(Q)
vi) R = P % 7
vii) Q = np.sqrt(Q)
Break Free with Managed Functional Programming: An Introduction to F#Dave Fancher
Originally developed by Microsoft Research, Cambridge, F# is an open-source, functional-first language in the ML family. Despite its lofty position as a first-class Visual Studio language for the past two releases and its cross-platform availability it hasn't seen widespread adoption in the business world. These slides take you on an introductory tour of F#, exploring how its constructs and terse syntax can allow you to write more stable, maintainable code while keeping you focused on the problem rather than the plumbing.
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)Matthew Leingang
The exponential function is pretty much the only function whose derivative is itself. The derivative of the natural logarithm function is also beautiful as it fills in an important gap. Finally, the technique of logarithmic differentiation allows us to find derivatives without the product rule.
The document discusses OTTER, a theorem prover that uses resolution style proofs. It provides background on OTTER, describing it as a resolution style theorem prover and discussing its clause representation and main strategies like restriction strategies, direction strategies, and look-ahead strategies. Examples are given of using OTTER to solve problems like the 15 puzzle and analyzing its complexity.
This document proposes a linear programming (LP) based approach for solving maximum a posteriori (MAP) estimation problems on factor graphs that contain multiple-degree non-indicator functions. It presents an existing LP method for problems with single-degree functions, then introduces a transformation to handle multiple-degree functions by introducing auxiliary variables. This allows applying the existing LP method. As an example, it applies this to maximum likelihood decoding for the Gaussian multiple access channel. Simulation results demonstrate the LP approach decodes correctly with polynomial complexity.
NumPy is a Python library used for working with multidimensional arrays and matrices for scientific computing. It allows fast operations on arrays through optimized C code and is the foundation of the Python scientific computing stack. NumPy arrays can be created in many ways and support operations like indexing, slicing, broadcasting, and universal functions. NumPy provides many useful features for linear algebra, Fourier transforms, random number generation and more.
Runtime Analysis of Population-based Evolutionary AlgorithmsPK Lehre
Populations are at the heart of evolutionary algorithms (EAs). They provide the genetic variation which selection acts upon. A complete picture of EAs can only be obtained if we understand their population dynamics. A rich theory on runtime analysis (also called time-complexity analysis) of EAs has been developed over the last 20 years. The goal of this theory is to show, via rigorous mathematical means, how the performance of EAs depends on their parameter settings and the characteristics of the underlying fitness landscapes. Initially, runtime analysis of EAs was mostly restricted to simplified EAs that do not employ large populations, such as the (1+1) EA. This tutorial introduces more recent techniques that enable runtime analysis of EAs with realistic population sizes.
The tutorial begins with a brief overview of the population‐based EAs that are covered by the techniques. We recall the common stochastic selection mechanisms and how to measure the selection pressure they induce. The main part of the tutorial covers in detail widely applicable techniques tailored to the analysis of populations. We discuss random family trees and branching processes, drift and concentration of measure in populations, and level‐based analyses.
To illustrate how these techniques can be applied, we consider several fundamental questions: When are populations necessary for efficient optimisation with EAs? What is the appropriate balance between exploration and exploitation and how does this depend on relationships between mutation and selection rates? What determines an EA's tolerance for uncertainty, e.g. in form of noisy or partially available fitness?
This tutorial was presented at the 2015 IEEE Congress on Evolutionary Computation at Sendai, Japan, May 25th 2015.
Haskell is a pure functional programming language that was created in 1987 by a committee of researchers. It features lazy evaluation, pattern matching, list comprehensions, and type polymorphism. Haskell does not use variables or loops, instead relying on recursion. It has evolved over time from Haskell 1.0 to the current Haskell 2010 standard. For beginners, Hugs is a good starting point, while Haskell Platform is recommended for developers.
Ejercicios de estilo en la programaciónSoftware Guru
El escritor francés Raymond Queneau escribió a mediados del siglo XX un libro llamado "Ejercicios de Estilo" donde mostraba una misma historia corta, redactada de 99 formas distintas.
En esta plática realizaremos el mismo ejercicio con un programa de software. Abarcaremos distintos estilos y paradigmas: programación monolítica, orientada a objetos, relacional, orientada a aspectos, monadas, map-reduce, y muchos otros, a través de los cuales podremos apreciar la riqueza del pensamiento humano aplicado a la computación.
Esto va mucho más allá de un ejercicio académico; el diseño de sistemas de gran escala se alimenta de esta variedad de estilos. También platicaremos sobre los peligros de quedar atrapado bajo un conjunto reducido de estilos a lo largo de tu carrera, y la necesidad de verdaderamente entender distintos estilos al diseñar arquitecturas de sistemas de software.
Semblanza del conferencista:
Crista Lopez es profesora en la Facultad de Ciencias Computacionales de la Universidad de California en Irvine. Su investigación se enfoca en prácticas de ingeniería de software para sistemas de gran escala. Previamente, fue miembro fundador del equipo en Xerox PARC creador del paradigma de programación orientado a aspectos (AOP). Crista es una de las desarrolladoras principales de OpenSimulator, una plataforma open source para crear mundos virtuales 3D. También es fundadora de Encitra, empresa especializada en la utilización de la realidad virtual para proyectos de desarrollo urbano sustentable. @cristalopes
The document discusses the Pi-calculus, a formal system for describing processes that communicate via channels. It provides an overview of the history and motivation for Pi-calculus, its basic elements like variables, channels, and processes, examples of how it can model processes and lambda calculus, and rules for reducing Pi-calculus expressions. Pi-calculus is used to describe concurrent and distributed systems formally and can describe processes that change over time through communication.
This document provides an introduction to functional programming concepts in Haskell, including:
- Defining functions and evaluating expressions through reduction sequences.
- Currying and partial application of functions.
- Pattern matching and defining functions through multiple cases.
The document discusses probability distributions and their natural parameters. It provides examples of several common distributions including the Bernoulli, multinomial, Gaussian, and gamma distributions. For each distribution, it derives the natural parameter representation and shows how to write the distribution in the form p(x|η) = h(x)g(η)exp{η^T μ(x)}. Maximum likelihood estimation for these distributions is also briefly discussed.
This document summarizes key points from a lecture on Lévy processes and stochastic calculus. It discusses filtrations and how they allow consideration of events up to a given time. It defines Markov processes and their transition probabilities. It also discusses martingales and how Lévy processes with zero mean are martingales. Important martingale examples related to Lévy processes are presented.
This document provides an overview of the CLAIRE programming language. It describes CLAIRE as an object-oriented, functional language that supports rule-based and set-based programming. It also discusses CLAIRE's capabilities such as polymorphism, logical assertions with rules, set expressions, and tree search tools. The document uses examples like an airline scheduling problem to illustrate how CLAIRE can be applied to combinatorial optimization problems.
This document outlines a talk on using category theory concepts in functional programming. It begins by introducing the definition of a category from category theory and using Scala examples to demonstrate how types and functions in Scala satisfy this definition. It then defines functors, natural transformations, and monads from category theory and provides examples showing how options, lists, and functions in Scala form a monad. It proves that the category theory definition of a monad is equivalent to the definition used in functional programming. The document suggests category theory concepts help formalize design patterns and make code more refactorable.
This document presents theorems and results regarding hypercyclic operators on the space Hbc(E), where E is a Banach space. Theorem 3.1 shows that the collection of functions {eφ : φ ∈ E*} forms an independently linear subset of Hbc(E). Theorem 3.2 proves that the span of {eφ : φ ∈ U} is dense in Hbc(E), where U is an open subset of E*. Theorem 3.3 demonstrates that if φ is an entire function of exponential type, then the operator φα(D) is hypercyclic on Hbc(E). The document also provides two corollaries: if E has a separable dual, then
Integration by substitution is the chain rule in reverse.
NOTE: the final location is section specific. Section 1 (morning) is in SILV 703, Section 11 (afternoon) is in CANT 200
This document contains a presentation by Abhijeet Anand on NumPy. It introduces NumPy as a Python library for working with arrays, which aims to provide array objects that are faster than traditional Python lists. NumPy arrays benefit from being stored continuously in memory, unlike lists. The presentation covers 1D, 2D and 3D arrays in NumPy and basic array properties and operations like shape, size, dtype, copying, sorting, addition, subtraction and more.
1. The document introduces the concept of a T-pre-compact space using a pre-operator T on a topological space (X,Γ,T). A subset A of X is T-pre-compact if every T-pre-open cover of A has a finite subcover.
2. Properties of T-pre-compact spaces are studied, including that every T-pre-compact space is also T-compact, and the union of two T-pre-compact sets is T-pre-compact. The notion of "good pre-operators" is introduced.
3. Relationships between T-pre-compact spaces and T-separation axioms are examined. It is shown that
Slides originating from a talk I gave at ScalaMUC on 2013-12-17. The corresponding code can be found at https://github.com/afwlehmann/iteratee-tutorial .
Here are the solutions to the problem statements:
1. arr = np.arange(13,25).reshape(3,4)
2.
i) P = P + 10
ii) R = P * Q
iii) Q = Q / 7
iv) P = np.log(P)
v) Q = np.round(Q)
vi) R = P % 7
vii) Q = np.sqrt(Q)
Break Free with Managed Functional Programming: An Introduction to F#Dave Fancher
Originally developed by Microsoft Research, Cambridge, F# is an open-source, functional-first language in the ML family. Despite its lofty position as a first-class Visual Studio language for the past two releases and its cross-platform availability it hasn't seen widespread adoption in the business world. These slides take you on an introductory tour of F#, exploring how its constructs and terse syntax can allow you to write more stable, maintainable code while keeping you focused on the problem rather than the plumbing.
The document describes a small functional programming language called Little Quilt that manipulates geometric objects. Little Quilt includes basic values like squares and operations like turning and sewing squares together. It then discusses types in functional programming including basic types, product types, list types, and operations on types. The document also covers function declarations and applications, recursive functions, approaches to expression evaluation, type checking, and overloading.
Proper unit testing involves identifying the smallest pieces of testable code and ensuring that they function properly. Testing these units effectively generally requires somehow isolating them from the rest of the code base. There are a number of frameworks that help with this isolation but the Fakes isolation framework goes beyond interfaces and virtual methods by allowing us to detour any framework method. In this session we’ll explore how stubs and shims can help us isolate testable units regardless of whether we control the dependencies.
New Era's 59Fifty baseball cap line originated in the early 1900s but saw most of its growth and popularity in the 1980s and 1990s. As the official cap of Major League Baseball, 59Fifty caps gained widespread adoption first by baseball players and then fans seeking to express team affiliation. Over time, 59Fifty expanded its designs beyond professional sports to include styles featuring cartoons, schools, and elements of popular culture. Today, 59Fifty has become a dominant brand in street fashion due to its versatility and high quality, with its logo appearing frequently in public.
The French Revolution began in 1789 due to various economic and social causes including high debts, an outdated feudal system, and Enlightenment ideas promoting liberty, equality and reason. The Storming of the Bastille on July 14th, 1789 marked the start of the revolution. Key events that followed included the formation of the National Assembly, the abolition of feudal privileges, and the Declaration of the Rights of Man and Citizen establishing natural rights and liberties. The revolution deeply transformed French society and government.
Presentation of GetTogether on Functional ProgrammingFilip De Sutter
This document discusses functional programming and provides examples in Haskell, F# and C#. It begins with an introduction to the author and their background in functional programming languages like Prolog, Haskell and F#. It then covers various functional programming concepts like recursion, pattern matching, avoiding side effects, strong typing and type inference. Examples are provided for sorting lists, calculating factorials and other common functional programming tasks. The document emphasizes the declarative nature of functional programming and compares approaches in Haskell, F# and C#.
Basic Knowledge Representation in First Order Logic.pptAshfaqAhmed693399
This document provides an overview of basic knowledge representation in first-order logic (FOL). It discusses objects, properties, classes, and relations that can be modeled in FOL. It also covers the syntax of FOL, including predicates, terms, quantifiers, and scopes. Translation of English sentences to FOL formulas is demonstrated. Semantics such as domains, interpretations, models, validity, and logical consequence are defined. Representing change over time using the situation calculus is briefly discussed.
This document provides an overview of basic knowledge representation in first-order logic (FOL). It describes how FOL can be used to model objects, properties, classes, and relations in the world. It explains the syntax of FOL, including predicates, terms, quantifiers, and scopes. It also discusses translating English sentences to FOL representations and the semantics and model theory of FOL. Finally, it briefly introduces higher-order logic and the situation calculus for representing change over time.
We can define the area of a curved region by a process similar to that by which we determined the slope of a curve: approximation by what we know and a limit.
This document provides an overview of Dirichlet processes and their applications. It begins with background on probability mass functions and density functions. It then discusses the probability simplex and the Dirichlet distribution. The Dirichlet process is defined as a distribution over distributions that allows modeling probability distributions over infinite sample spaces. An example application involves using Dirichlet processes to learn hierarchical morphology paradigms by modeling stems and suffixes as being generated independently from Dirichlet processes. References for further reading are also provided.
Functional Programming by Examples using Haskellgoncharenko
The document discusses functional programming concepts in Haskell compared to traditional imperative languages like C++. It provides:
1) An example of quicksort implemented in both C++ and Haskell to illustrate the differences in approach and syntax between the two paradigms. The Haskell version is much more concise, using only 5 lines compared to 14 lines in C++.
2) Explanations of key functional programming concepts in Haskell including pure functions, recursion, pattern matching, and higher-order functions like map and fold.
3) Examples and definitions of commonly used Haskell functions and data types to summarize lists, sorting, and traversing elements - highlighting the more declarative style of functional programming.
Image sciences, image processing, image restoration, photo manipulation. Image and videos representation. Digital versus analog imagery. Quantization and sampling. Sources and models of noises in digital CCD imagery: photon, thermal and readout noises. Sources and models of blurs. Convolutions and point spread functions. Overview of other standard models, problems and tasks: salt-and-pepper and impulse noises, half toning, inpainting, super-resolution, compressed sensing, high dynamic range imagery, demosaicing. Short introduction to other types of imagery: SAR, Sonar, ultrasound, CT and MRI. Linear and ill-posed restoration problems.
Algorithms and Complexity: Cryptography TheoryAlex Prut
This document discusses algorithms and complexity in cryptography. It begins by defining function problems in computational complexity theory as computational problems where the expected output is more complex than a simple yes or no answer. It then discusses one-way functions, which are easy to compute but believed to be hard to invert. The document provides examples of one-way functions based on integer multiplication, discrete logarithms, and the RSA cryptosystem. It argues that the existence of one-way functions separates the complexity classes P and UP, and that cryptography relies on the assumption that stronger versions of one-way functions exist.
This document provides an overview of logic programming and the logic programming language Prolog. It discusses key concepts in logic programming like predicates, clauses, resolution, and backward chaining. It also describes the basic syntax and execution model of Prolog, including how it uses unification, backtracking, and trace to evaluate queries against a knowledge base of facts and rules.
The Newton-Raphson method is an iterative method used to find approximations of the roots, or zeros, of a real-valued function. It uses the function's derivative to improve its guess for the root during each iteration. The method starts with an initial guess and iteratively computes better approximations until the root is found within a specified tolerance. The algorithm involves calculating the slope of the tangent line to the function at each guess and using the x-intercept of this line as the next guess. The process repeats until convergence within the tolerance is reached. The method is efficient and fast compared to other root-finding algorithms.
This document defines and explains basic functions. It states that a function takes one or more variables as input and produces an output variable. The domain is the set of all possible inputs and the range is the set of all possible outputs, with each input corresponding to a specific output. Some common functions are listed such as squaring, cubing, and exponential functions. The document also provides a formal definition of a function as an ordered triple consisting of a domain, codomain, and set of ordered pairs. Additionally, it notes that the concept of a function dates back to the 12th century mathematician Sharaf al-Din al-Tusi.
This document provides an introduction to functions and their representations. It defines what a function is and gives examples of functions expressed through formulas, numerically, graphically and verbally. It also covers properties of functions including monotonicity, symmetry, even and odd functions. Key examples are used throughout to illustrate concepts.
Fortran is a general-purpose programming language, mainly intended for mathematical computations in
science applications
this chapter is the third chapter
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)Mel Anthony Pepito
This document provides an overview of the key points covered in a calculus lecture on derivatives of logarithmic and exponential functions:
1) It discusses the derivatives of exponential functions with any base, as well as the derivatives of logarithmic functions with any base.
2) It covers using the technique of logarithmic differentiation to find derivatives of functions involving products, quotients, and/or exponentials.
3) The document provides examples of finding derivatives of various logarithmic and exponential functions.
This document provides an introduction to predicate logic and quantifiers. It begins with terminology like propositional functions, arguments, and universe of discourse. It then defines and provides examples of quantifiers like universal and existential quantifiers. It discusses how to mix quantifiers and their truth values. It also covers binding variables, scope, and negation of quantified statements. Finally, it provides a brief introduction to Prolog, a logic programming language based on predicate logic.
1. The document discusses maximum likelihood estimation and Bayesian parameter estimation for machine learning problems involving parametric densities like the Gaussian.
2. Maximum likelihood estimation finds the parameter values that maximize the probability of obtaining the observed training data. For Gaussian distributions with unknown mean and variance, MLE returns the sample mean and variance.
3. Bayesian parameter estimation treats the parameters as random variables and uses prior distributions and observed data to obtain posterior distributions over the parameters. This allows incorporation of prior knowledge with the training data.
The Newton-Raphson method ( also known as Newton's method) is a way to quickly find a good approximation for the root of a real-valued function f (x) = 0f (x) = 0. It uses the idea that a nonstop and differentiable function can be approached by a straight line tangent to it.
This slide includes the basic descriptions and function determinations ideas.
This document discusses the universal approximation theorem for deep neural networks. It begins by motivating deep learning as a way to automatically learn complex decision boundaries without manual feature engineering. It then introduces the universal approximation theorem, which states that a multi-layer perceptron can represent any given function, allowing deep neural networks to theoretically learn anything given enough data. The document proceeds to provide mathematical definitions and proofs related to functional analysis, topology, and linear algebra in order to prove the universal approximation theorem. It concludes by stating the theorem can extend to any measurable activation function and probability measure.
First-order logic (FOL) extends propositional logic by allowing the representation of objects, properties, relations, and functions. It can represent more complex statements than propositional logic. FOL uses constants to represent objects, predicates to represent properties and relations between objects, and quantifiers like "all" and "some" to make generalized statements. Well-formed formulas in FOL contain terms formed from constants and variables, atomic sentences using predicates on terms, and complex sentences combining atomic sentences with logical connectives and quantifiers so that all variables are bound. FOL allows powerful representation of natural language statements about relationships between objects in a domain.
Similar to Expressiveness and Model of the Polymorphic λ Calculus (20)
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...University of Maribor
Slides from:
11th International Conference on Electrical, Electronics and Computer Engineering (IcETRAN), Niš, 3-6 June 2024
Track: Artificial Intelligence
https://www.etran.rs/2024/en/home-english/
The ability to recreate computational results with minimal effort and actionable metrics provides a solid foundation for scientific research and software development. When people can replicate an analysis at the touch of a button using open-source software, open data, and methods to assess and compare proposals, it significantly eases verification of results, engagement with a diverse range of contributors, and progress. However, we have yet to fully achieve this; there are still many sociotechnical frictions.
Inspired by David Donoho's vision, this talk aims to revisit the three crucial pillars of frictionless reproducibility (data sharing, code sharing, and competitive challenges) with the perspective of deep software variability.
Our observation is that multiple layers — hardware, operating systems, third-party libraries, software versions, input data, compile-time options, and parameters — are subject to variability that exacerbates frictions but is also essential for achieving robust, generalizable results and fostering innovation. I will first review the literature, providing evidence of how the complex variability interactions across these layers affect qualitative and quantitative software properties, thereby complicating the reproduction and replication of scientific studies in various fields.
I will then present some software engineering and AI techniques that can support the strategic exploration of variability spaces. These include the use of abstractions and models (e.g., feature models), sampling strategies (e.g., uniform, random), cost-effective measurements (e.g., incremental build of software configurations), and dimensionality reduction methods (e.g., transfer learning, feature selection, software debloating).
I will finally argue that deep variability is both the problem and solution of frictionless reproducibility, calling the software science community to develop new methods and tools to manage variability and foster reproducibility in software systems.
Exposé invité Journées Nationales du GDR GPL 2024
hematic appreciation test is a psychological assessment tool used to measure an individual's appreciation and understanding of specific themes or topics. This test helps to evaluate an individual's ability to connect different ideas and concepts within a given theme, as well as their overall comprehension and interpretation skills. The results of the test can provide valuable insights into an individual's cognitive abilities, creativity, and critical thinking skills
What is greenhouse gasses and how many gasses are there to affect the Earth.moosaasad1975
What are greenhouse gasses how they affect the earth and its environment what is the future of the environment and earth how the weather and the climate effects.
The debris of the ‘last major merger’ is dynamically youngSérgio Sacani
The Milky Way’s (MW) inner stellar halo contains an [Fe/H]-rich component with highly eccentric orbits, often referred to as the
‘last major merger.’ Hypotheses for the origin of this component include Gaia-Sausage/Enceladus (GSE), where the progenitor
collided with the MW proto-disc 8–11 Gyr ago, and the Virgo Radial Merger (VRM), where the progenitor collided with the
MW disc within the last 3 Gyr. These two scenarios make different predictions about observable structure in local phase space,
because the morphology of debris depends on how long it has had to phase mix. The recently identified phase-space folds in Gaia
DR3 have positive caustic velocities, making them fundamentally different than the phase-mixed chevrons found in simulations
at late times. Roughly 20 per cent of the stars in the prograde local stellar halo are associated with the observed caustics. Based
on a simple phase-mixing model, the observed number of caustics are consistent with a merger that occurred 1–2 Gyr ago.
We also compare the observed phase-space distribution to FIRE-2 Latte simulations of GSE-like mergers, using a quantitative
measurement of phase mixing (2D causticality). The observed local phase-space distribution best matches the simulated data
1–2 Gyr after collision, and certainly not later than 3 Gyr. This is further evidence that the progenitor of the ‘last major merger’
did not collide with the MW proto-disc at early times, as is thought for the GSE, but instead collided with the MW disc within
the last few Gyr, consistent with the body of work surrounding the VRM.
Or: Beyond linear.
Abstract: Equivariant neural networks are neural networks that incorporate symmetries. The nonlinear activation functions in these networks result in interesting nonlinear equivariant maps between simple representations, and motivate the key player of this talk: piecewise linear representation theory.
Disclaimer: No one is perfect, so please mind that there might be mistakes and typos.
dtubbenhauer@gmail.com
Corrected slides: dtubbenhauer.com/talks.html
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...AbdullaAlAsif1
The pygmy halfbeak Dermogenys colletei, is known for its viviparous nature, this presents an intriguing case of relatively low fecundity, raising questions about potential compensatory reproductive strategies employed by this species. Our study delves into the examination of fecundity and the Gonadosomatic Index (GSI) in the Pygmy Halfbeak, D. colletei (Meisner, 2001), an intriguing viviparous fish indigenous to Sarawak, Borneo. We hypothesize that the Pygmy halfbeak, D. colletei, may exhibit unique reproductive adaptations to offset its low fecundity, thus enhancing its survival and fitness. To address this, we conducted a comprehensive study utilizing 28 mature female specimens of D. colletei, carefully measuring fecundity and GSI to shed light on the reproductive adaptations of this species. Our findings reveal that D. colletei indeed exhibits low fecundity, with a mean of 16.76 ± 2.01, and a mean GSI of 12.83 ± 1.27, providing crucial insights into the reproductive mechanisms at play in this species. These results underscore the existence of unique reproductive strategies in D. colletei, enabling its adaptation and persistence in Borneo's diverse aquatic ecosystems, and call for further ecological research to elucidate these mechanisms. This study lends to a better understanding of viviparous fish in Borneo and contributes to the broader field of aquatic ecology, enhancing our knowledge of species adaptations to unique ecological challenges.
Travis Hills' Endeavors in Minnesota: Fostering Environmental and Economic Pr...Travis Hills MN
Travis Hills of Minnesota developed a method to convert waste into high-value dry fertilizer, significantly enriching soil quality. By providing farmers with a valuable resource derived from waste, Travis Hills helps enhance farm profitability while promoting environmental stewardship. Travis Hills' sustainable practices lead to cost savings and increased revenue for farmers by improving resource efficiency and reducing waste.
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...Ana Luísa Pinho
Functional Magnetic Resonance Imaging (fMRI) provides means to characterize brain activations in response to behavior. However, cognitive neuroscience has been limited to group-level effects referring to the performance of specific tasks. To obtain the functional profile of elementary cognitive mechanisms, the combination of brain responses to many tasks is required. Yet, to date, both structural atlases and parcellation-based activations do not fully account for cognitive function and still present several limitations. Further, they do not adapt overall to individual characteristics. In this talk, I will give an account of deep-behavioral phenotyping strategies, namely data-driven methods in large task-fMRI datasets, to optimize functional brain-data collection and improve inference of effects-of-interest related to mental processes. Key to this approach is the employment of fast multi-functional paradigms rich on features that can be well parametrized and, consequently, facilitate the creation of psycho-physiological constructs to be modelled with imaging data. Particular emphasis will be given to music stimuli when studying high-order cognitive mechanisms, due to their ecological nature and quality to enable complex behavior compounded by discrete entities. I will also discuss how deep-behavioral phenotyping and individualized models applied to neuroimaging data can better account for the subject-specific organization of domain-general cognitive systems in the human brain. Finally, the accumulation of functional brain signatures brings the possibility to clarify relationships among tasks and create a univocal link between brain systems and mental functions through: (1) the development of ontologies proposing an organization of cognitive processes; and (2) brain-network taxonomies describing functional specialization. To this end, tools to improve commensurability in cognitive science are necessary, such as public repositories, ontology-based platforms and automated meta-analysis tools. I will thus discuss some brain-atlasing resources currently under development, and their applicability in cognitive as well as clinical neuroscience.
Phenomics assisted breeding in crop improvementIshaGoswami9
As the population is increasing and will reach about 9 billion upto 2050. Also due to climate change, it is difficult to meet the food requirement of such a large population. Facing the challenges presented by resource shortages, climate
change, and increasing global population, crop yield and quality need to be improved in a sustainable way over the coming decades. Genetic improvement by breeding is the best way to increase crop productivity. With the rapid progression of functional
genomics, an increasing number of crop genomes have been sequenced and dozens of genes influencing key agronomic traits have been identified. However, current genome sequence information has not been adequately exploited for understanding
the complex characteristics of multiple gene, owing to a lack of crop phenotypic data. Efficient, automatic, and accurate technologies and platforms that can capture phenotypic data that can
be linked to genomics information for crop improvement at all growth stages have become as important as genotyping. Thus,
high-throughput phenotyping has become the major bottleneck restricting crop breeding. Plant phenomics has been defined as the high-throughput, accurate acquisition and analysis of multi-dimensional phenotypes
during crop growing stages at the organism level, including the cell, tissue, organ, individual plant, plot, and field levels. With the rapid development of novel sensors, imaging technology,
and analysis methods, numerous infrastructure platforms have been developed for phenotyping.
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptxMAGOTI ERNEST
Although Artemia has been known to man for centuries, its use as a food for the culture of larval organisms apparently began only in the 1930s, when several investigators found that it made an excellent food for newly hatched fish larvae (Litvinenko et al., 2023). As aquaculture developed in the 1960s and ‘70s, the use of Artemia also became more widespread, due both to its convenience and to its nutritional value for larval organisms (Arenas-Pardo et al., 2024). The fact that Artemia dormant cysts can be stored for long periods in cans, and then used as an off-the-shelf food requiring only 24 h of incubation makes them the most convenient, least labor-intensive, live food available for aquaculture (Sorgeloos & Roubach, 2021). The nutritional value of Artemia, especially for marine organisms, is not constant, but varies both geographically and temporally. During the last decade, however, both the causes of Artemia nutritional variability and methods to improve poorquality Artemia have been identified (Loufi et al., 2024).
Brine shrimp (Artemia spp.) are used in marine aquaculture worldwide. Annually, more than 2,000 metric tons of dry cysts are used for cultivation of fish, crustacean, and shellfish larva. Brine shrimp are important to aquaculture because newly hatched brine shrimp nauplii (larvae) provide a food source for many fish fry (Mozanzadeh et al., 2021). Culture and harvesting of brine shrimp eggs represents another aspect of the aquaculture industry. Nauplii and metanauplii of Artemia, commonly known as brine shrimp, play a crucial role in aquaculture due to their nutritional value and suitability as live feed for many aquatic species, particularly in larval stages (Sorgeloos & Roubach, 2021).
The binding of cosmological structures by massless topological defectsSérgio Sacani
Assuming spherical symmetry and weak field, it is shown that if one solves the Poisson equation or the Einstein field
equations sourced by a topological defect, i.e. a singularity of a very specific form, the result is a localized gravitational
field capable of driving flat rotation (i.e. Keplerian circular orbits at a constant speed for all radii) of test masses on a thin
spherical shell without any underlying mass. Moreover, a large-scale structure which exploits this solution by assembling
concentrically a number of such topological defects can establish a flat stellar or galactic rotation curve, and can also deflect
light in the same manner as an equipotential (isothermal) sphere. Thus, the need for dark matter or modified gravity theory is
mitigated, at least in part.
2. Motivation
• V. Vene in APLAS 2004 [GUV04] gave a new
proof of shortcut deforestation because it was
only proved “informally by theorem-for free.”
• But what’s wrong with theorem for free?
• So I studied polymorphism and realised that
there is a lot I did not know...
Friday, April 11, 14
3. Parametricity, or the
“theorems for free.”
• Informally known by functional programmers
as the “theorems for free.”
• A polymorphic function’s type induces a
“theorem”.
• E.g. hd . map f = f . hd, for all hd:: [a]→a,
regradless of its actual definition.
• The word “theorem” may be mis-leading,
however.
[Wad89]
Friday, April 11, 14
4. In this talk
• Review some members of the λ calculus
family:
• Untyped λ calculus: λx . x
• Simply-typed λ calculus: λx:Int . x
• Polymorphic λ calculus: Λα.(λx:α . x),
Δα.α--->τ, f [a] x
• Consider their termination property,
expressiveness, and model.
Friday, April 11, 14
5. Untyped λ calculus
• Not always terminating: (λx.(x x))(λx.(x x))
• Recursion: Y f = (λx . f (x x))(λx . f (x x))
• Equivalent to Turing machine (Church &
Kleene).
• Denotational model not trivial: requires Scott
domains.
Friday, April 11, 14
6. Simply-typed λ calculus
• Strongly normalisable: all well-typed
expression terminates. Y combinator cannot
be typed.
• Computes total functions only!
• Has a simple model of total functions and
sets.
• Apparently cannot define some useful
functions. But exactly how expressive?
Friday, April 11, 14
8. Primitive recursion
• A function that can be implemented using
only for-loops (math world). It always
terminate.
• Zero: 0, succ: (1+), projection: (x1,...,xn)= xi.
• Composition: f o g.
• Primitive recursion:
h(0,x) = f(x)
h(n+1,x) = g (h(n),n,x)
Friday, April 11, 14
9. Primitive recursion
• A function that can be implemented using
only for-loops (math world). It always
terminate.
• Zero: 0, succ: (1+), projection: (x1,...,xn)= xi.
• Composition: f o g.
• Primitive recursion:
h(0,x) = f(x)
h(n+1,x) = g (h(n),n,x)
h(0) = c
h(n+1) = g (h(n),n)
Familiar? It’s paramorphism! [Mee90]
Friday, April 11, 14
10. Partial and total recursion
• Partial recursive functions: primitive
recursion plus unbounded search:
μf z = least x such that f(x,z) = 0.
• The search may not terminate, thus
introduces the partiality.
• Partial rec. fn. is equiv. to Turing machine.
• Total recursive functions: the subset of parital
rec. fn. that is total. It’s bigger than primitive
recursive functions! (eg. Ackermann’s
function.)
Friday, April 11, 14
11. Elementary recursion
• Also called Kalmar elementary functions.
Functions definable by 1, +, x, -., and
SUM f (x,n) = Σn
i=0
f(x,i)
PRO f (x,n) = Πn
i=0
f(x,i)
• Definable functions include: mod, div,
isPrime, etc.
Friday, April 11, 14
12. Representing natural num.
• Rep. of n over domain τ:
λf:τ--->τ . λx:τ . f (... (f x)) with n occur. of f.
• If we allow different instantiation of τ, we
can define addition, multiplication, exp(Ii+1-->
Ii---> Ii), predecessor(Ii+3---> Ii)... but not
subtraction.
• Therefore simply-typed calculus is weaker
than elementary functions. Moreover, its
value is bound by elementary fns.
Friday, April 11, 14
13. • Use the type Δα.(α--->α)--->(α--->α) to
represent natural numbers.
• addition, multiplication, subtraction,pairs,..
• primrec = Δα.λg:N--->α--->α.λc:α.
λn:N.snd(n[Nxα]
(λz:Nxα.<1+fst z,g (fst z) (snd z)>) <0,c>)
Polymorphism enhances
expressiveness
Friday, April 11, 14
14. • Use the type Δα.(α--->α)--->(α--->α) to
represent natural numbers.
• addition, multiplication, subtraction,pairs,..
• primrec = Δα.λg:N--->α--->α.λc:α.
λn:N.snd(n[Nxα]
(λz:Nxα.<1+fst z,g (fst z) (snd z)>) <0,c>)
Polymorphism enhances
expressiveness
primrec = Δα.λg.λc.
λn.snd
(n (λz.<1+fst z,g (fst z) (snd z)>) <0,c>)
Friday, April 11, 14
15. Ackermann’s function!
Define ack
without recursion?
[Rey85]
ack 0 n = n+1
ack (m+1) 0 = ack m 1
ack (m+1) (n+1) = ack m (ack (m+1) n)
• Guess: ack = λm. m aug (1+)
therefore ack (m+1) = aug (ack m)
• ack (m+1) (n+1) = aug (ack m) (n+1) =
ack m (aug (ack m) n) = ack m (ack (m+1) n)
• We want aug f 0 = f 1 and
aug f (n+1) = f (aug f n)
• Solution: aug = λf. λn. (n+1) f 1
Friday, April 11, 14
16. Simulating data structures
• Let list a = Δβ.(a--->β--->β) ---> β ---> β
nil = Λβ.λf.λa.a
cons x xs = Λβ.λf.λa. f x (xs f a)
• append xs ys = xs cons ys
• append = λxs:list a. λys:list a .
xs[list a] (λx:a.λzs:list a . cons x zs) ys
[Rey85]
Friday, April 11, 14
17. Simulating data structures
• Let list a = Δβ.(a--->β--->β) ---> β ---> β
nil = Λβ.λf.λa.a
cons x xs = Λβ.λf.λa. f x (xs f a)
• append xs ys = xs cons ys
• append = λxs:list a. λys:list a .
xs[list a] (λx:a.λzs:list a . cons x zs) ys
! nil = Λβ.λf:a--->β--->β.λa:a.a
cons x xs = Λβ.λf:a--->β--->β.λa:a. f x (xs f a)
[Rey85]
Friday, April 11, 14
18. Where does it stand?
partial recursive (functions)
total recursive
primitive recursive
elementry recursive
Polymorphic λ
Simply-typed λ
Friday, April 11, 14
19. Fundamental sequence
• Define f0(x) = x+1
• fn+1(x)= fx
n(x) = fn(fn...(fn(x))..)... x
applications.
• f1(x)=2x, f2(x)=2x
×x
• fΘ(x)=fΘ[x](x) for limit ordinal Θ.
• Limit ordinals: ω is the size of natural
numbers, ε0 is the limit of ω, ωω
, ωωω
.....
Friday, April 11, 14
20. Hierarchy characterised by
rate of growth
• Running time of elementary functions are
bounded by fn
2(x) for some n.
• Time of primitive recursive functions are
bounded by fn(x) for some n< ω.
• Ackermann’s function is essentially fω(x).
• fε0(x) is representable in polymorphic λ
calculus!
• It represents exactly the functions provably
recursive in 2nd-order arithmetic -- a much
larger class than fε0(x).
[FLD83]
Friday, April 11, 14
21. Termination
• Still, every function defined in poly-λ
terminates.
• However, the termination cannot be proved
in Peano arithmetic!
• Peano arithmetic: 0, (1+), addition,
induction... covering most techniques we
use in proofs of programs.
• Godel’s incompleteness theorem stated that
there are true theorems not provable in PA.
This was the first “interesting” example.
[FLD83]
Friday, April 11, 14
22. Model for poly. λ calculus?
• Untyped λ: not terminating, needs domain.
• Simple-typed λ: terminating, set-theoretic.
• λx:Int.x is the id for Int, λx:Char.x for Char.
• Poly. λ: can we avoid using domains?
• First try: a polymorphic function is a
collection of functions indexed by type.
• Λα.λx:α.x is a collection of identity fns.
• However, that would include some ad-hoc
functions.
Friday, April 11, 14
23. Parametricity
• Reynolds restricts polymorphic objects to
parametric values:
• Let p: Δα.τ. It is parametric if for all set
assignments s1, s2, and r s1×s2:
〈p s1, p s2〉 [id|α:r]#
τ
• Which later became “theorem for free”.
• Reynolds [Rey83] believed that there is a set-
theoretic model for poly. λ where poly.
objects represent parametric values.
• He then falsified his conjecture [Rey84].
[Wad89]
Friday, April 11, 14
24. No simple model!
• Bool can be represented by B=Δα.α--->α--->α
• Let Ts = (s--->B)--->B for all type s, and Tf =
λh.λg.h(g o f) (for all f: s--->t, Tf: Ts--->Tt).
• Let P=(((s--->B)--->B)--->s)--->s. We can construct a
h: TP--->P s.t. the diagram commutes for all f.
• In fact h is an initial algebra!
• But that would make TP isomorphic to P,
which is a contradiction (they have diff.
cardinalities unless |B|=1).
h
P TP
s Ts
Tgg
f
[Rey84]Polymor
phism is not
set-theoretic.
f. g.
Friday, April 11, 14
25. Later models
• Using topos [Pit87]Poly. is set-theoretic, constructively.
• Frame [BM84][MM85][Wad89].
• Functorial approach [BFS90].
• Operational aspects [Pit00].
• Used to prove short-cut fusion [Joh03].
Friday, April 11, 14
26. What’s the use of
parametricity?
• It’s still a key concept! Recall representation
of lists: llist a = Δβ.(a--->β--->β) ---> β ---> β.
• In general, the least fixed-point of functor F
(or the inital F-algebra) can be represented by
Δβ.(F β--->β) ---> β... iff parametricity holds!
• Types defined as least-fixed-points are called
inductive.
• nil = Λβ.λf.λa.a, cons x xs = Λβ.λf.λa. f x
(xs f a), x = cons 1 (cons 2 (cons 3 nil).
[Has94]
Friday, April 11, 14
27. Inductive and coinductive
datatypes
• The greatest fixed-point of functor F can be
represented by ∃x.(x → F x, x), iff
parametricity holds. It’s called coinductive.
• from n = (λm.Right (m,m+1), n) :: glist a
• When least and greatest fixed-points
coincide (i.e. exists a force:: glist a →llist a),
we can do hylomorphism.
[Has94]
[How96]
Friday, April 11, 14
28. Pointed types
• In a model where parametricity and
extensionality holds, the following are
equivalent:
• Inductive and coinductive types coincide;
• Exists a fixed-point operator for values;
• Exists a fixed-point operator for types.
[Has94] ?
Friday, April 11, 14
29. Conclusion
Termination Expressiveness Model
Untyped NO = Turing
machine
domain
Simply typed YES < elementry fn. set &
functio
n
Polymorphic
YES but not
provable in
PA
> Ackermann
domain or
non-trivial
sets
Friday, April 11, 14
30. What I learnt from this history
study...
• Adding polymorphism to a language strongly
enhances its power.
• The concept of fold, etc., finds its root in very
fundamental research.
• Category theory has played an important
role in early stage of computing science.
• Parametricity is an important assumption
leading to many useful properties.
Friday, April 11, 14
31. References
• [FLD83] S.Fortune, D. Leivant, M. O’Donnell, The expressiveness of
simple and second-order type structures. In Journal of the ACM, 30(1), pp
151-185.
• [Rey83] J.C. Reynolds. Types, abstractions and parametric polymorphism.
In Information Processing 83, pp 513-523.
• [BM84]K.B. Bruce, A.R. Meyer, The semantics of second-order
polymorphic lambda calculus. In Semantics of Data Types, LNCS 173.
• [Rey84] J.C. Reynolds, Polymorphism is not set theoretic. In Semantics of
data Types, LNCS 173, pp 145-156.
• [MM85] J.C. Mitchell, A.R. Meyer, Second-order logical relations. In
Logics of Programs, LNCS 193.
• [Rey85] J.C. Reynolds, Three approaches to type structure. In
Mathematical Foundations of Software Development, LNCS 185.
Friday, April 11, 14
32. References
• [Pit87] A.M. Pitts, Polymorphism is set theoretic, constructively. In
Category Theory and Computer Science, LNCS 283, pp 12-39.
• [Wad89] P. Wadler, Theorems for free! In Int. Sym. on Functional
Programming Languages and Computer Architecture, ‘89.
• [BFS90] E.S. Bainbridge, P.J. Freyd, A. Scedrov, P.J. Scott, Functorial
polymorphism. In Theoretical computer science v.70, pp 36-54.
• [Mee90] L. Meertens, Paramorphisms. In Formal Aspects of Computing.
• [Has94] R. Hasegawa. Categorical data types in parametric
polymorphism. Math. Structures in Computer Science, March 1994.
• [How96] B.T. Howard. Inductive, coinductive, and pointed types. ICFP 96.
• [Pit00] A.M. Pitts, Parametric polymorphism and operational equivalence.
In Math. Struct. in Comp. Science v.10, pp 1-39.
• [Joh03] P. Johann, Short cut fusion is correct. In J. Functional Programming
v.13, pp 797-814.
• [GUV04]N. Ghani, T. Uustalu, V, Vene, Build, augment and destory. In
APLAS 2004, LNCS 3002, pp 327-347.
Friday, April 11, 14