SlideShare una empresa de Scribd logo
1 de 65
Descargar para leer sin conexión
The Axes of Abstraction
The Axes of Generalization
"Give me six hours to generalize
and I will spend the first four
sharpening the axis."
Paul Phillips
Lambdaconf 2017
Boulder, CO
Situation
— Trend: axioms, logic, inference, laws
— Math abstractions (e.g. monoids) succeeding
— Domain abstractions remain mostly ad hoc
— "More art than science"
— That's a euphemism for "not science"
Thesis
There is science we can apply.
We can infer more.
We can derive more.
We can mine what is for what must be.
We can resist adhocicity.
Axes
noun: axis, plural: axes
"an imaginary line that divides something into equal or
roughly equal halves"
x^2 = -1? NOW what?
-- Heron of Alexandria
Some imagination, Carl.
-- Gauss's kindergarten teacher
Hold my beer.
— W.R. Hamilton (paraphrased)
The axis of axis exoticity
I initially thought I'd talk about axes like:
- Parametricity # giver of free theorems
- Arity # size polymorphism
- Orderity # kind polymorphism
- Opacity # "boxity" says @xeno-by
- Inductivity # data vs. codata
Algebraic axes
Or algebraic properties:
- Associativity # category theory
- Commutativity # CRDTs
- Distributivity # belief propagation
- Idempotency # lattices
- Invertibility # isomorphisms
- Selectivity # idempotent-er
Yet more exoticity
Other candidates:
- Longevity # Lifetimes
- Evitability # evaluation strategy
- Classity # "first class" is like "power"
- Quotidity # macro depth polymorphism
Forget it!
Instead, I discovered something new (to me.)
I think it deserves a wider audience.
But first...
Generalization
by weakening
Generalization
def f(x: 5): 10 = x + x // it's 10!
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
def f[A: Ring](x: A): A = x + x // Don't assume * is commutative
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
def f[A: Ring](x: A): A = x + x // Don't assume * is commutative
def f[A: Rng](x: A): A = x + x // Don't assume * has identity
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
def f[A: Ring](x: A): A = x + x // Don't assume * is commutative
def f[A: Rng](x: A): A = x + x // Don't assume * has identity
def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
def f[A: Ring](x: A): A = x + x // Don't assume * is commutative
def f[A: Rng](x: A): A = x + x // Don't assume * has identity
def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists
def f[A: Group](x: A): A = x + x // Don't assume + is commutative
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
def f[A: Ring](x: A): A = x + x // Don't assume * is commutative
def f[A: Rng](x: A): A = x + x // Don't assume * has identity
def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists
def f[A: Group](x: A): A = x + x // Don't assume + is commutative
def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
def f[A: Ring](x: A): A = x + x // Don't assume * is commutative
def f[A: Rng](x: A): A = x + x // Don't assume * has identity
def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists
def f[A: Group](x: A): A = x + x // Don't assume + is commutative
def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse
def f[A: Semigroup](x: A): A = x + x // Don't assume + has identity
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
def f[A: Ring](x: A): A = x + x // Don't assume * is commutative
def f[A: Rng](x: A): A = x + x // Don't assume * has identity
def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists
def f[A: Group](x: A): A = x + x // Don't assume + is commutative
def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse
def f[A: Semigroup](x: A): A = x + x // Don't assume + has identity
def f[A: Magma](x: A): A = x + x // Don't assume + is associative
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
def f[A: Ring](x: A): A = x + x // Don't assume * is commutative
def f[A: Rng](x: A): A = x + x // Don't assume * has identity
def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists
def f[A: Group](x: A): A = x + x // Don't assume + is commutative
def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse
def f[A: Semigroup](x: A): A = x + x // Don't assume + has identity
def f[A: Magma](x: A): A = x + x // Don't assume + is associative
def f[A](x: A): A = x // Assume nothing
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
def f[A: Ring](x: A): A = x + x // Don't assume * is commutative
def f[A: Rng](x: A): A = x + x // Don't assume * has identity
def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists
def f[A: Group](x: A): A = x + x // Don't assume + is commutative
def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse
def f[A: Semigroup](x: A): A = x + x // Don't assume + has identity
def f[A: Magma](x: A): A = x + x // Don't assume + is associative
def f[A](x: A): A = x // Assume nothing
Generalization
def f(x: 5): 10 = x + x // it's 10!
def f(x: Int): Int = x + x // Don't assume 5
def f[A <: Number](x: A): A = x + x // Don't assume integer
def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
def f[A: Ring](x: A): A = x + x // Don't assume * is commutative
def f[A: Rng](x: A): A = x + x // Don't assume * has identity
def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists
def f[A: Group](x: A): A = x + x // Don't assume + is commutative
def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse
def f[A: Semigroup](x: A): A = x + x // Don't assume + has identity
def f[A: Magma](x: A): A = x + x // Don't assume + is associative
def f[A](x: A): A = x // Assume nothing
Abstraction
v. Generalization
Abstraction
SAGREDO: This is a marvelous idea! It suggests that when we try to
understand nature, we should look at the phenomena as if they were
messages to be understood. Except that each message appears to be
random until we establish a code to read it. This code takes the form
of an abstraction, that is, we choose to ignore certain things as
irrelevant and we thus partially select the content of the message by
a free choice.
-- Gödel, Escher, Bach: an Eternal Golden Braid
Someone else's definitions, my emphasis:
Abstraction is an emphasis on the idea, qualities and
properties rather than the particulars (a suppression of
detail).
Generalization is a broadening of application to
encompass a larger domain of objects of the same or
different type.
Definition golf
Abstraction is ignoring differences
Generalization is expecting differences
Abstraction: Bats, whales, mice, humans... mammals!
Generalization: It lays EGGS? Hang on a second...
Abstraction
— Suppressing detail sounds like a quotient set
— Partitioning elements into equivalence classes
— all members in a class are "the same"
— we position and dim the lights as we choose
Abstraction, concretely
— The set of natural numbers N
— An equivalence relation P = "congruent modulo 1"
— Equivalence classes: { 1, 3, ... }, { 2, 4, ... }
Abstraction
— I have objects B, C, and D
— We notice B <: A, C <: A, D <: A
— A abstracts B, C, and D
Generalization
— I have a property R: B => Bool
— We notice property S: A => Bool can classify B, C, D
— S generalizes R
— Note contravariance!
Do these actually differ?
— The difference (in this conception) is the arrow
— This duality pervades not only math but life itself
— It is extension vs. intension
Extension <-> Intention
abstract generalize
unification anti-unification
data codata
being doing
Set[A] Indicator[A]
objects attributes
The Marriage of
Extent and Intent
What is this?
What am I describing?
- It has wings. "A dragonfly?"
- It isn't an insect. "A bat?"
- It lays eggs. "A pterosaur?"
- It isn't a dinosaur. "A platypus in a bird costume?"
- It flies. "...in a hot air balloon?"
- It has feathers. "A realistic avian drone?"
Imperfection
— We usually work with "objects" already in mind
— Naturally we will select properties they share
— So the flaws tend to be in the "negative space"
— How much "slack" is there in our abstraction?
Bagel
abstraction
Mop abstraction
Muffin
abstraction
Towel
abstraction
Abstraction abstractly
— Ideally, extent and intent would converge
— An object set induces a common attribute set
— An attribute set induces a common object set
— Where they correspond, we find stability
— This is the idea behind formal concept analysis
Darwin's 'survival of the fittest' is
really a special case of a more
general law of survival of the
stable.
It may be a class of entities that
come into existence at a
sufficiently high rate to deserve a
collective name.
-- R. Dawkins, "The Selfish Gene"
Formal Concept Analysis (FCA)
FCA finds practical application in fields including...
— data and text mining
— machine learning
— knowledge management
— the semantic web
— software development
— chemistry & biology
FCA (cont)
— Imagine facts as a matrix of booleans
— Each row is an object
— Each column is an a!ribute
— Each cell is true if object has attribute
This is an incidence matrix
This is its concept la!ice
Formal Concepts
— A formal context is K = (G, M, I) where
— G, a set of objects (Gegenstand = object)
— M, a set of attributes (Merkmal = characteristic)
— I, a binary relation GxM (Inzidenzrelation = incidence)
— From the formal context we derive the concept la!ice
Formal Concepts (cont)
— For any set A ⊆ G and any set B ⊆ M
— The attribute set common to objects in A is A'
— The objects which have all attributes in B is B'
— If A=B' and A'=B, then (A,B) is a formal concept.
Formal Concepts (cont)
— The concept lattice orders these formal concepts
— The ordering is set inclusion
— (A, B) is a subconcept of (A', B') if A ⊆ A' (and B' ⊆ B)
— Extent is covariant and intent is contravariant
— A subconcept has fewer objects and more attributes
Formal Concepts (cont)
— I⇡ : P(G) => P(M) (attributes of all objects)
— I⇣ : P(M) => P(G) (objects with all attributes)
— Compose both ways to create closure operators:
— I⇡⇣: P(G) => P(G) and I⇣⇡: P(M) => P(M)
— Now for any set of objects A...
— (I⇡I⇣(A), I⇡(A)) is a formal concept
— And vice versa.
Formal Concepts (cont)
— Given formal concept (A,B)
— The objects in A are the concept's extent.
— The attributes in B are the concept's intent.
— An order isomorphism between subsets of G and M
BONUS: the EXTENDED ladder
of functional programming
Profunctor intuition
Jean Bénabou, who invented the term and originally
used profunctor, now prefers distributor, which is
supposed to carry the intuition that a distributor
generalizes a functor in a similar way to how a
distribution generalizes a function.
-- n-lab ("wikipedia on brutal mode" - @griotspeak)
Welcome to the SECRET RUNG
"AXE-WIELDING FIRE MONSTER"
Profunctor Nuclei
NOTHING MORE TO LEARN

Más contenido relacionado

La actualidad más candente

computer notes - Data Structures - 34
computer notes - Data Structures - 34computer notes - Data Structures - 34
computer notes - Data Structures - 34
ecomputernotes
 
Lesson20 Tangent Planes Slides+Notes
Lesson20   Tangent Planes Slides+NotesLesson20   Tangent Planes Slides+Notes
Lesson20 Tangent Planes Slides+Notes
Matthew Leingang
 
Lesson 19: Partial Derivatives
Lesson 19: Partial DerivativesLesson 19: Partial Derivatives
Lesson 19: Partial Derivatives
Matthew Leingang
 
Lesson 13: Derivatives of Logarithmic and Exponential Functions
Lesson 13: Derivatives of Logarithmic and Exponential FunctionsLesson 13: Derivatives of Logarithmic and Exponential Functions
Lesson 13: Derivatives of Logarithmic and Exponential Functions
Matthew Leingang
 
Working Out Percentages Using Equivalent Fractions
Working Out Percentages Using Equivalent FractionsWorking Out Percentages Using Equivalent Fractions
Working Out Percentages Using Equivalent Fractions
Chris James
 
4.4 review on derivatives
4.4 review on derivatives4.4 review on derivatives
4.4 review on derivatives
math265
 
computer notes - Data Structures - 32
computer notes - Data Structures - 32computer notes - Data Structures - 32
computer notes - Data Structures - 32
ecomputernotes
 
Examples of different polynomial graphs
Examples of different polynomial graphsExamples of different polynomial graphs
Examples of different polynomial graphs
Jessica Garcia
 
Evaluating and Graphing Polynomial Functions
Evaluating and Graphing Polynomial FunctionsEvaluating and Graphing Polynomial Functions
Evaluating and Graphing Polynomial Functions
swartzje
 

La actualidad más candente (19)

computer notes - Data Structures - 34
computer notes - Data Structures - 34computer notes - Data Structures - 34
computer notes - Data Structures - 34
 
Lesson20 Tangent Planes Slides+Notes
Lesson20   Tangent Planes Slides+NotesLesson20   Tangent Planes Slides+Notes
Lesson20 Tangent Planes Slides+Notes
 
Tangent plane
Tangent planeTangent plane
Tangent plane
 
Lesson 19: Partial Derivatives
Lesson 19: Partial DerivativesLesson 19: Partial Derivatives
Lesson 19: Partial Derivatives
 
Lesson 8: Basic Differentation Rules (slides)
Lesson 8: Basic Differentation Rules (slides)Lesson 8: Basic Differentation Rules (slides)
Lesson 8: Basic Differentation Rules (slides)
 
Scala Demystifying the Funky Stuff
Scala Demystifying the Funky StuffScala Demystifying the Funky Stuff
Scala Demystifying the Funky Stuff
 
types, types, types
types, types, typestypes, types, types
types, types, types
 
Lesson 13: Derivatives of Logarithmic and Exponential Functions
Lesson 13: Derivatives of Logarithmic and Exponential FunctionsLesson 13: Derivatives of Logarithmic and Exponential Functions
Lesson 13: Derivatives of Logarithmic and Exponential Functions
 
Working Out Percentages Using Equivalent Fractions
Working Out Percentages Using Equivalent FractionsWorking Out Percentages Using Equivalent Fractions
Working Out Percentages Using Equivalent Fractions
 
4.4 review on derivatives
4.4 review on derivatives4.4 review on derivatives
4.4 review on derivatives
 
Lesson 12: Linear Approximation
Lesson 12: Linear ApproximationLesson 12: Linear Approximation
Lesson 12: Linear Approximation
 
On the Design of a Galculator
On the Design of a GalculatorOn the Design of a Galculator
On the Design of a Galculator
 
14 graphs of factorable rational functions x
14 graphs of factorable rational functions x14 graphs of factorable rational functions x
14 graphs of factorable rational functions x
 
Computer notes - Binary Search
Computer notes - Binary SearchComputer notes - Binary Search
Computer notes - Binary Search
 
computer notes - Data Structures - 32
computer notes - Data Structures - 32computer notes - Data Structures - 32
computer notes - Data Structures - 32
 
Examples of different polynomial graphs
Examples of different polynomial graphsExamples of different polynomial graphs
Examples of different polynomial graphs
 
27 power series x
27 power series x27 power series x
27 power series x
 
Evaluating and Graphing Polynomial Functions
Evaluating and Graphing Polynomial FunctionsEvaluating and Graphing Polynomial Functions
Evaluating and Graphing Polynomial Functions
 
Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)
 

Similar a Keynote, Lambdaconf 2017 - The Axes of Generalization

0.5.derivatives
0.5.derivatives0.5.derivatives
0.5.derivatives
m2699
 
3.1 derivative of a function
3.1 derivative of a function3.1 derivative of a function
3.1 derivative of a function
btmathematics
 
High Wizardry in the Land of Scala
High Wizardry in the Land of ScalaHigh Wizardry in the Land of Scala
High Wizardry in the Land of Scala
djspiewak
 

Similar a Keynote, Lambdaconf 2017 - The Axes of Generalization (20)

Graph of rational function
Graph of rational functionGraph of rational function
Graph of rational function
 
Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721
 
Fp in scala part 2
Fp in scala part 2Fp in scala part 2
Fp in scala part 2
 
23 improper integrals send-x
23 improper integrals send-x23 improper integrals send-x
23 improper integrals send-x
 
23 improper integrals send-x
23 improper integrals send-x23 improper integrals send-x
23 improper integrals send-x
 
The integral
The integralThe integral
The integral
 
0.5.derivatives
0.5.derivatives0.5.derivatives
0.5.derivatives
 
3.1 derivative of a function
3.1 derivative of a function3.1 derivative of a function
3.1 derivative of a function
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
 
antidifferentiation.ppt
antidifferentiation.pptantidifferentiation.ppt
antidifferentiation.ppt
 
Calculus- Basics
Calculus- BasicsCalculus- Basics
Calculus- Basics
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and ScalaFolding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
 
Integration material
Integration material Integration material
Integration material
 
Integration
IntegrationIntegration
Integration
 
Scala jargon cheatsheet
Scala jargon cheatsheetScala jargon cheatsheet
Scala jargon cheatsheet
 
Defining Functions on Equivalence Classes
Defining Functions on Equivalence ClassesDefining Functions on Equivalence Classes
Defining Functions on Equivalence Classes
 
Limit - Mohd Noor
Limit - Mohd NoorLimit - Mohd Noor
Limit - Mohd Noor
 
High Wizardry in the Land of Scala
High Wizardry in the Land of ScalaHigh Wizardry in the Land of Scala
High Wizardry in the Land of Scala
 
04-Sets-Relations-A.pdf
04-Sets-Relations-A.pdf04-Sets-Relations-A.pdf
04-Sets-Relations-A.pdf
 
Maths AIP.pdf
Maths AIP.pdfMaths AIP.pdf
Maths AIP.pdf
 

Más de Paul Phillips (8)

Suffuse: a typed filesystem
Suffuse: a typed filesystemSuffuse: a typed filesystem
Suffuse: a typed filesystem
 
Brief tour of psp-std
Brief tour of psp-stdBrief tour of psp-std
Brief tour of psp-std
 
Keynote, Lambdaconf 2016 - Equality is Hard
Keynote, Lambdaconf 2016 - Equality is HardKeynote, Lambdaconf 2016 - Equality is Hard
Keynote, Lambdaconf 2016 - Equality is Hard
 
Naming Things and Finding Cothings
Naming Things and Finding CothingsNaming Things and Finding Cothings
Naming Things and Finding Cothings
 
Keynote, LambdaConf 2015 - Ipecac for the Ouroboros
Keynote, LambdaConf 2015 - Ipecac for the OuroborosKeynote, LambdaConf 2015 - Ipecac for the Ouroboros
Keynote, LambdaConf 2015 - Ipecac for the Ouroboros
 
Keynote, LambdaConf 2014 - The Silent Productivity Killer
Keynote, LambdaConf 2014 - The Silent Productivity KillerKeynote, LambdaConf 2014 - The Silent Productivity Killer
Keynote, LambdaConf 2014 - The Silent Productivity Killer
 
A Scala Corrections Library
A Scala Corrections LibraryA Scala Corrections Library
A Scala Corrections Library
 
Keynote, PNW Scala 2013
Keynote, PNW Scala 2013Keynote, PNW Scala 2013
Keynote, PNW Scala 2013
 

Último

Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Último (20)

MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 

Keynote, Lambdaconf 2017 - The Axes of Generalization

  • 1. The Axes of Abstraction The Axes of Generalization "Give me six hours to generalize and I will spend the first four sharpening the axis." Paul Phillips Lambdaconf 2017 Boulder, CO
  • 2. Situation — Trend: axioms, logic, inference, laws — Math abstractions (e.g. monoids) succeeding — Domain abstractions remain mostly ad hoc — "More art than science" — That's a euphemism for "not science"
  • 3. Thesis There is science we can apply. We can infer more. We can derive more. We can mine what is for what must be. We can resist adhocicity.
  • 4. Axes noun: axis, plural: axes "an imaginary line that divides something into equal or roughly equal halves" x^2 = -1? NOW what? -- Heron of Alexandria Some imagination, Carl. -- Gauss's kindergarten teacher
  • 5. Hold my beer. — W.R. Hamilton (paraphrased)
  • 6. The axis of axis exoticity I initially thought I'd talk about axes like: - Parametricity # giver of free theorems - Arity # size polymorphism - Orderity # kind polymorphism - Opacity # "boxity" says @xeno-by - Inductivity # data vs. codata
  • 7. Algebraic axes Or algebraic properties: - Associativity # category theory - Commutativity # CRDTs - Distributivity # belief propagation - Idempotency # lattices - Invertibility # isomorphisms - Selectivity # idempotent-er
  • 8. Yet more exoticity Other candidates: - Longevity # Lifetimes - Evitability # evaluation strategy - Classity # "first class" is like "power" - Quotidity # macro depth polymorphism
  • 9. Forget it! Instead, I discovered something new (to me.) I think it deserves a wider audience. But first...
  • 11. Generalization def f(x: 5): 10 = x + x // it's 10!
  • 12. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5
  • 13. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer
  • 14. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers
  • 15. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers def f[A: Ring](x: A): A = x + x // Don't assume * is commutative
  • 16. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers def f[A: Ring](x: A): A = x + x // Don't assume * is commutative def f[A: Rng](x: A): A = x + x // Don't assume * has identity
  • 17. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers def f[A: Ring](x: A): A = x + x // Don't assume * is commutative def f[A: Rng](x: A): A = x + x // Don't assume * has identity def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists
  • 18. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers def f[A: Ring](x: A): A = x + x // Don't assume * is commutative def f[A: Rng](x: A): A = x + x // Don't assume * has identity def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists def f[A: Group](x: A): A = x + x // Don't assume + is commutative
  • 19. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers def f[A: Ring](x: A): A = x + x // Don't assume * is commutative def f[A: Rng](x: A): A = x + x // Don't assume * has identity def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists def f[A: Group](x: A): A = x + x // Don't assume + is commutative def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse
  • 20. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers def f[A: Ring](x: A): A = x + x // Don't assume * is commutative def f[A: Rng](x: A): A = x + x // Don't assume * has identity def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists def f[A: Group](x: A): A = x + x // Don't assume + is commutative def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse def f[A: Semigroup](x: A): A = x + x // Don't assume + has identity
  • 21. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers def f[A: Ring](x: A): A = x + x // Don't assume * is commutative def f[A: Rng](x: A): A = x + x // Don't assume * has identity def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists def f[A: Group](x: A): A = x + x // Don't assume + is commutative def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse def f[A: Semigroup](x: A): A = x + x // Don't assume + has identity def f[A: Magma](x: A): A = x + x // Don't assume + is associative
  • 22. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers def f[A: Ring](x: A): A = x + x // Don't assume * is commutative def f[A: Rng](x: A): A = x + x // Don't assume * has identity def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists def f[A: Group](x: A): A = x + x // Don't assume + is commutative def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse def f[A: Semigroup](x: A): A = x + x // Don't assume + has identity def f[A: Magma](x: A): A = x + x // Don't assume + is associative def f[A](x: A): A = x // Assume nothing
  • 23. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers def f[A: Ring](x: A): A = x + x // Don't assume * is commutative def f[A: Rng](x: A): A = x + x // Don't assume * has identity def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists def f[A: Group](x: A): A = x + x // Don't assume + is commutative def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse def f[A: Semigroup](x: A): A = x + x // Don't assume + has identity def f[A: Magma](x: A): A = x + x // Don't assume + is associative def f[A](x: A): A = x // Assume nothing
  • 24. Generalization def f(x: 5): 10 = x + x // it's 10! def f(x: Int): Int = x + x // Don't assume 5 def f[A <: Number](x: A): A = x + x // Don't assume integer def f[A: CommutativeRing](x: A): A = x + x // Don't assume numbers def f[A: Ring](x: A): A = x + x // Don't assume * is commutative def f[A: Rng](x: A): A = x + x // Don't assume * has identity def f[A: CommutativeGroup](x: A): A = x + x // Don't assume * exists def f[A: Group](x: A): A = x + x // Don't assume + is commutative def f[A: Monoid](x: A): A = x + x // Don't assume + has an inverse def f[A: Semigroup](x: A): A = x + x // Don't assume + has identity def f[A: Magma](x: A): A = x + x // Don't assume + is associative def f[A](x: A): A = x // Assume nothing
  • 26. Abstraction SAGREDO: This is a marvelous idea! It suggests that when we try to understand nature, we should look at the phenomena as if they were messages to be understood. Except that each message appears to be random until we establish a code to read it. This code takes the form of an abstraction, that is, we choose to ignore certain things as irrelevant and we thus partially select the content of the message by a free choice. -- Gödel, Escher, Bach: an Eternal Golden Braid
  • 27. Someone else's definitions, my emphasis: Abstraction is an emphasis on the idea, qualities and properties rather than the particulars (a suppression of detail). Generalization is a broadening of application to encompass a larger domain of objects of the same or different type.
  • 28. Definition golf Abstraction is ignoring differences Generalization is expecting differences Abstraction: Bats, whales, mice, humans... mammals! Generalization: It lays EGGS? Hang on a second...
  • 29. Abstraction — Suppressing detail sounds like a quotient set — Partitioning elements into equivalence classes — all members in a class are "the same" — we position and dim the lights as we choose
  • 30. Abstraction, concretely — The set of natural numbers N — An equivalence relation P = "congruent modulo 1" — Equivalence classes: { 1, 3, ... }, { 2, 4, ... }
  • 31. Abstraction — I have objects B, C, and D — We notice B <: A, C <: A, D <: A — A abstracts B, C, and D
  • 32. Generalization — I have a property R: B => Bool — We notice property S: A => Bool can classify B, C, D — S generalizes R — Note contravariance!
  • 33. Do these actually differ? — The difference (in this conception) is the arrow — This duality pervades not only math but life itself — It is extension vs. intension
  • 34. Extension <-> Intention abstract generalize unification anti-unification data codata being doing Set[A] Indicator[A] objects attributes
  • 35.
  • 36.
  • 39.
  • 40. What am I describing? - It has wings. "A dragonfly?" - It isn't an insect. "A bat?" - It lays eggs. "A pterosaur?" - It isn't a dinosaur. "A platypus in a bird costume?" - It flies. "...in a hot air balloon?" - It has feathers. "A realistic avian drone?"
  • 41. Imperfection — We usually work with "objects" already in mind — Naturally we will select properties they share — So the flaws tend to be in the "negative space" — How much "slack" is there in our abstraction?
  • 46. Abstraction abstractly — Ideally, extent and intent would converge — An object set induces a common attribute set — An attribute set induces a common object set — Where they correspond, we find stability — This is the idea behind formal concept analysis
  • 47. Darwin's 'survival of the fittest' is really a special case of a more general law of survival of the stable. It may be a class of entities that come into existence at a sufficiently high rate to deserve a collective name. -- R. Dawkins, "The Selfish Gene"
  • 48. Formal Concept Analysis (FCA) FCA finds practical application in fields including... — data and text mining — machine learning — knowledge management — the semantic web — software development — chemistry & biology
  • 49. FCA (cont) — Imagine facts as a matrix of booleans — Each row is an object — Each column is an a!ribute — Each cell is true if object has attribute
  • 50. This is an incidence matrix
  • 51. This is its concept la!ice
  • 52.
  • 53. Formal Concepts — A formal context is K = (G, M, I) where — G, a set of objects (Gegenstand = object) — M, a set of attributes (Merkmal = characteristic) — I, a binary relation GxM (Inzidenzrelation = incidence) — From the formal context we derive the concept la!ice
  • 54. Formal Concepts (cont) — For any set A ⊆ G and any set B ⊆ M — The attribute set common to objects in A is A' — The objects which have all attributes in B is B' — If A=B' and A'=B, then (A,B) is a formal concept.
  • 55. Formal Concepts (cont) — The concept lattice orders these formal concepts — The ordering is set inclusion — (A, B) is a subconcept of (A', B') if A ⊆ A' (and B' ⊆ B) — Extent is covariant and intent is contravariant — A subconcept has fewer objects and more attributes
  • 56. Formal Concepts (cont) — I⇡ : P(G) => P(M) (attributes of all objects) — I⇣ : P(M) => P(G) (objects with all attributes) — Compose both ways to create closure operators: — I⇡⇣: P(G) => P(G) and I⇣⇡: P(M) => P(M) — Now for any set of objects A... — (I⇡I⇣(A), I⇡(A)) is a formal concept — And vice versa.
  • 57. Formal Concepts (cont) — Given formal concept (A,B) — The objects in A are the concept's extent. — The attributes in B are the concept's intent. — An order isomorphism between subsets of G and M
  • 58.
  • 59. BONUS: the EXTENDED ladder of functional programming
  • 60. Profunctor intuition Jean Bénabou, who invented the term and originally used profunctor, now prefers distributor, which is supposed to carry the intuition that a distributor generalizes a functor in a similar way to how a distribution generalizes a function. -- n-lab ("wikipedia on brutal mode" - @griotspeak)
  • 61.
  • 62.
  • 63.
  • 64.
  • 65. Welcome to the SECRET RUNG "AXE-WIELDING FIRE MONSTER" Profunctor Nuclei NOTHING MORE TO LEARN