SlideShare une entreprise Scribd logo
1  sur  161
Télécharger pour lire hors ligne
Illogical Engineers
“Those who cannot remember the past are
condemned to repeat it.”
Software engineers
“Software Engineering”
7th-11th Oct 1968
50
years ago
50years ago
“A software system can best be designed if
the testing is interlaced with the designing
instead of being used after the design.”
“The good systems that are presently working
were written by small groups. More than
twenty programmers working on a project is
usually disastrous.”
"I bought my boss two
copies of The
Mythical Man Month
so that he could read
it twice as fast."
“The reason that small groups have succeeded (...) is
that there is a need for a certain structure of
communication, and a structure of decision making in
the development of software. This succeeds with small
groups, because it can all be done intuitively by one
person serving as most of the network. For large groups
to succeed, we (...) have to face organizational
structure for communications and decisions.”
How to design successful software?
1. Flowchart until you think you understand the problem.
1. Flowchart until you think you understand the problem.
2. Write code until you realize that you don’t.
1. Flowchart until you think you understand the problem.
2. Write code until you realize that you don’t.
3. Go back and re-do the flowchart.
1. Flowchart until you think you understand the problem.
2. Write code until you realize that you don’t.
3. Go back and re-do the flowchart.
4. Write some more code and iterate to what you feel is the
correct solution.
How to design successful software?
“Design and implementation proceeded in a
number of stages. Each stage was typified by
a period of intellectual activity followed by a
period of program reconstruction”
“Each stage produced a usable product and
the period between the end of one stage and
the start of the next provided the operational
experience upon which the next design was
based.”
“In general the products of successive stages
approached the final design requirement;
each stage included more facilities than the
last.”
“Selig’s picture requires a feedback loop, for
monitoring of the system. One must collect
data on system performance, for use in future
improvements.”
Speaking about waterfall...
“I believe in this concept, but the implementation described above is
risky and invites failure. The testing phase which occurs at the end of
the development cycle is the first event for which timing, storage,
input/output transfers, etc., are experienced as distinguished from
analyzed. (...) then invariably a major redesign is required. A simple (...)
redo of some isolated code will not fix these kinds of difficulties. The
required design changes are likely to be so disruptive that the software
requirements upon which the design is based and which provides the
rationale for everything are violated. Either the requirements must be
modified, or a substantial change in the design is required. In effect the
development process has returned to the origin and one can expect up
to a lO0% overrun in schedule and/or costs.”
“Royce's 1970 paper is generally considered
to be the paper which defined the stagewise
"waterfall" model of the software process. But
it is surprising to see that (...) he already
incorporates prototyping as an essential step
compatible with the waterfall model.”
“The earlier Benington and Hosier papers had
good approximations to the waterfall model,
and that Royce's paper”
"Pitfalls and Safeguards in Real-Time Digital
Systems with Emphasis on Programming"
W.A. Hosier, 1961
"Production of Large Computer Programs”
H.D. Benington, June 1956.
http://gildingandcompany.co.uk/pegasus-computer-from-1956-the-passage-of-time/
“As soon as specifications a system program
are definitive, contractors should begin to
consider how they will verify the program's
meeting of the specifications.“
“"A requirements spec was generated. It has a
number of untestable requirements, with
phrases like 'appropriate response' all too
common. The design review took weeks, yet
still retained the untestable requirements."
“Software Process Management: Lessons
Learned From History”
Barry W. Boehm, 1987
“There are 2 hard problems in computer
science:
“There are 2 hard problems in computer
science: cache invalidation
“There are 2 hard problems in computer
science: cache invalidation and naming things
“There are 2 hard problems in computer
science: cache invalidation, naming things,
and off-by-1 errors.
“There are 2 hard problems in computer
science: cache invalidation, naming things,
and off-by-1 errors.
Microservices
Microservices
What is a microservice?
Microservices
What is a difference between Microservices and SOA?
“When we've talked about microservices a common
question is whether this is just Service Oriented
Architecture (SOA) that we saw a decade ago. (...) The
problem, however, is that SOA means too many different
things, (...) the fact that SOA means such different things
means it's valuable to have a term that more crisply defines
this architectural style.” -- Martin Fowler
“Alexander Pasik, a former analyst at Gartner, coined
the term SOA. (...) Pasik was driven to create term SOA
because “client/server” had lost its classical meaning.”
from “SOA in Practice: The Art of Distributed System Design” by Nicolai M. Josuttis
“The common notion that Gartner Group
invented SOA is simply absurd. (...) the
underlying approach to distributed computing
was invented at least 15 years earlier.”
Are the problems being
addressed and solved?
Software Engineer?
Software Craftsman
What does it mean to be a software engineer?
“The phrase ‘software engineering’ was
deliberately chosen as being provocative, in
implying the need for software manufacture
to be based on the types of theoretical
foundations and practical disciplines, that are
traditional in the established branches of
engineering.”
“The phrase ‘software engineering’ was
deliberately chosen as being provocative, in
implying the need for software manufacture
to be based on the types of theoretical
foundations and practical disciplines, that are
traditional in the established branches of
engineering.”
Towards engineering!
Towards engineering!
● Type System matters
Towards engineering!
● Type System matters
● Functional Programming is our lord and saviour
Towards engineering!
● Type System matters
● Functional Programming is our lord and saviour
○ statically typed
○ dependently typed
○ total
Towards engineering!
● Type System matters
● Functional Programming is our lord and saviour
○ statically typed
○ dependently typed
○ total
● Recognising Computer Science roots in math is essential to
write correct software
if (a = 10) {
...
} else {
// will never be executed, variable a is changed!
}
The “beauty” of C++
Compiles!
And that’s a
bad thing
val a: Int = 10
if(a == “10”) “ten” else “sth else”
val a: Int = 10
“sth else”
val a: Int = 10
if(a == “10”) “ten” else “sth else”
trait Eq[A] {
def ===(a1: A)(a2: A): Boolean
}
val a: Int = 10
if(a == “10”) “ten” else “sth else”
trait Eq[A] {
def ===(a1: A)(a2: A): Boolean
}
val a: Int = 10
if(a === “10”) “ten” else “sth else”
trait Eq[A] {
def ===(a1: A)(a2: A): Boolean
}
val a: Int = 10
if(a === “10”) “ten” else “sth else”
Doesn’t
compile
trait Eq[A] {
def ===(a1: A)(a2: A): Boolean
}
val a: Int = 10
if(a === “10”) “ten” else “sth else”
Doesn’t
compile
and that’s a goodthing!
Let's play a
game
/** Concatenate two maps. Keys from both maps must be
* included. If keys collide, add values together. */
def concat(
map1: Map[String, Int],
map2: Map[String, Int]
): Map[String, Int] = ???
00:59
00:58
00:57
00:56
/** Concatenate two maps. Keys from both maps must be
* included. If keys collide, add values together. */
def concat(
map1: Map[String, Int],
map2: Map[String, Int]
): Map[String, Int] = ???
/** Concatenate two maps. Keys from both maps must be
* included. If keys collide, add values together. */
def concat(
map1: Map[String, Option[(Int, Option[FinancialReport])],
map2: Map[String, Option[(Int, Option[FinancialReport])]
): Map[String, Option[(Int, Option[FinancialReport])] = ???
00:27
00:26
00:25
00:25
trait Semigroup[A] {
def |+|(a1: A, a2: A): A
}
trait Semigroup[A] {
def |+|(a1: A, a2: A): A
}
trait Semigroup {
def pairS[A, B]: Semigroup[(A, B)] = ???
}
trait Semigroup[A] {
def |+|(a1: A, a2: A): A
}
trait Semigroup {
def pairS[A:Semigroup, B:Semigroup]: Semigroup[(A, B)] = ...
}
trait Semigroup[A] {
def |+|(a1: A, a2: A): A
}
trait Semigroup {
def pairS[A:Semigroup, B:Semigroup]: Semigroup[(A, B)] = ...
def optionS[A:Semigroup]: Semigroup[Option[A]] = ...
}
trait Semigroup[A] {
def |+|(a1: A, a2: A): A
}
trait Semigroup {
def pairS[A:Semigroup, B:Semigroup]: Semigroup[(A, B)] = ...
def optionS[A:Semigroup]: Semigroup[Option[A]] = ...
def mapS[A, B:Semigroup]: Semigroup[Map[A,B]] = ...
}
/** Concatenate two maps. Keys from both maps must be
* included. If keys collide, add values together. */
def concat(
m1: Map[String, Option[(Int, Option[FinancialReport])],
m2: Map[String, Option[(Int, Option[FinancialReport])]
): Map[String, Option[(Int, Option[FinancialReport])] = ???
/** Concatenate two maps. Keys from both maps must be
* included. If keys collide, add values together. */
def concat(
m1: Map[String, Option[(Int, Option[FinancialReport])],
m2: Map[String, Option[(Int, Option[FinancialReport])]
): Map[String, Option[(Int, Option[FinancialReport])] = m1 |+| m2
If it compiles, it works!
Can I prove correctness of
my program?
Can code be generated
from types?
Can I prove that my
program will terminate?
Curry–Howard
correspondence
Propositions as types, proofs as programs.
The Curry–Howard correspondence is the
observation that two families of seemingly
unrelated formalisms—namely, the proof
systems on one hand, and the models of
computation on the other—are in fact the
same kind of mathematical objects.
Curry–Howard correspondence
Proposition ≡ Type
Proof ≡ Program
Propositional Logic
∧ AND
∨ OR
→ IMPLIES
¬ NOT
Predicate Logic
∧ AND
∨ OR
→ IMPLIES
¬ NOT
∀ FOR ALL
∃ EXISTS
Constructive Logic (Intuitionistic Logic)
In mathematics, a constructive
proof is a method of proof that
demonstrates the existence of
a mathematical object by
creating or providing a method
for creating the object.
Constructive Logic (Intuitionistic Logic)
Constructive Logic (Intuitionistic Logic)
Constructive Logic (Intuitionistic Logic)
Constructive Logic (Intuitionistic Logic)
Constructive Logic (Intuitionistic Logic)
Constructive Logic (Intuitionistic Logic)
Constructive Logic (Intuitionistic Logic)
P ∨ ¬P
P → ¬¬P
Constructive Logic (Intuitionistic Logic)
P ∨ ¬P
P → ¬¬P
Curry–Howard correspondence
Proposition ≡ Type
Proof ≡ Program
Prove that:
P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R)
Prove that:
P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R)
X ∧ Y (X, Y)
Prove that:
P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R)
X ∧ Y (X, Y)
X ∨ Y X + Y
Prove that:
P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R)
X ∧ Y (X, Y)
X ∨ Y Either[X, Y]
Prove that:
P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R)
X ∧ Y (X, Y)
X ∨ Y Either[X, Y]
X → Y X => Y
Prove that:
P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R)
def proof[P, Q, R]: (P, Either[Q, R]) => Either[(P, Q), (P, R)] = ???
Prove that:
P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R)
def proof[P, Q, R]: (P, Either[Q, R]) => Either[(P, Q), (P, R)] = ???
Prove that:
P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R)
def proof[P, Q, R]: (P, Either[Q, R]) => Either[(P, Q), (P, R)] = ???
Prove that:
P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R)
def proof[P, Q, R]: (P, Either[Q, R]) => Either[(P, Q), (P, R)] =
(input: (P, Either[Q, R])) => input match {
case (p, Left(q)) => Left((p, q))
case (p, Right(r)) => Right((p, r))
}
Prove that:
P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R)
def proof[P, Q, R]: (P, Either[Q, R]) => Either[(P, Q), (P, R)] =
(input: (P, Either[Q, R])) => input match {
case (p, Left(q)) => Left((p, q))
case (p, Right(r)) => Right((p, r))
}
So why can’t we prove?
P ∨ ¬P
So why can’t we prove?
P ∨ ¬P
¬P P => “False”
So why can’t we prove?
P ∨ ¬P
¬P P => Nothing
So why can’t we prove?
P ∨ ¬P
¬P P => Nothing
def proof[P]: Either[P, P => Nothing] = ???
What’s the point of all this?
Computer Science is my
rooted in Math
“We must know! We will know!”
While the roots of formalised logic go back to
Aristotle, the end of the 19th and early 20th
centuries saw the development of modern logic and
formalised mathematics.
“We must know! We will know!”
Question: could you derive all
mathematical truth using axioms and
inference rules of formal logic, in principle
opening up the process to automatisation?
“We must know! We will know!”
In 1929, Mojżesz Presburger showed that the theory
of natural numbers with addition is decidable and
gave an algorithm that could determine if a given
sentence in the language was true or false.
“We must know! We will know!”
“Bertrand Russell and Alfred Whitehead set out to
do something amazing.”
“Starting with just basic axioms of set theory, tried
to build complete edifice of mathematics as one
system, published as Principia Mathematica.”
Kurt Gödel
“On Formally Undecidable Propositions of
Principia Mathematica and Related
Systems” (1931)
Incompleteness theorem
Kurt Gödel proved that for any system which
is at least as powerful to represent simple
arithmetic: either your system is incomplete
(i.e. cannot prove its own axioms) or it is
inconsistent (i.e. can derive a contradiction)
Kurt Gödel proved that for any system which
is at least as powerful to represent simple
arithmetic: either your system is incomplete
(i.e. cannot prove its own axioms) or it is
inconsistent (i.e. can derive a contradiction)
def identity[A](a: A): A = a
def willProveAnything[A]: A = ???
def willProveAnything[A]: A = null
def willProveAnything[A]: A = throw RuntimeException(“ha!”)
def willProveAnything[A]: A = willProveAnything
Kurt Gödel proved that for any system which
is at least as powerful to represent simple
arithmetic: either your system is incomplete
(i.e. cannot prove its own axioms) or it is
inconsistent (i.e. can derive a contradiction)
Kurt Gödel proved that for any system which
is at least as powerful to represent simple
arithmetic: either your system is incomplete
(i.e. cannot prove its own axioms) or it is
inconsistent (i.e. can derive a contradiction)
Automated Theorem Prover
It follows that an automated theorem prover will fail to
terminate while searching for a proof precisely when the
statement being investigated is undecidable in the theory being
used. Despite this theoretical limit, in practice, theorem provers
can solve many hard problems, even in models that are not fully
described by any first order theory.
Chymyst/curryhoward
https://github.com/Chymyst/curryhoward
Before we finish...
The End
Pawel Szulc
Pyrofex
@rabbitonweb
http://rabbitonweb.com
paul.szulc@gmail.com

Contenu connexe

Similaire à Illogical engineers

A Software Problem (and a maybe-solution)
A Software Problem (and a maybe-solution)A Software Problem (and a maybe-solution)
A Software Problem (and a maybe-solution)YangJerng Hwa
 
Agile architecture upload
Agile architecture uploadAgile architecture upload
Agile architecture uploadThe Real Dyl
 
ASAS 2014 - Simon Brown
ASAS 2014 - Simon BrownASAS 2014 - Simon Brown
ASAS 2014 - Simon BrownAvisi B.V.
 
MiniOS: an instructional platform for teaching operating systems labs
MiniOS: an instructional platform for teaching operating systems labsMiniOS: an instructional platform for teaching operating systems labs
MiniOS: an instructional platform for teaching operating systems labsRafael Roman Otero
 
Thoughts On Architecting V4 2
Thoughts On Architecting V4 2Thoughts On Architecting V4 2
Thoughts On Architecting V4 2bmercer
 
MODEL-DRIVEN ENGINEERING (MDE) in Practice
MODEL-DRIVEN ENGINEERING (MDE) in PracticeMODEL-DRIVEN ENGINEERING (MDE) in Practice
MODEL-DRIVEN ENGINEERING (MDE) in PracticeHussein Alshkhir
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Ganesh Samarthyam
 
Cloud computing - an architect's perspective
Cloud computing - an architect's perspectiveCloud computing - an architect's perspective
Cloud computing - an architect's perspectiveHARMAN Services
 
Software Systems Requirements Engineering
Software Systems Requirements EngineeringSoftware Systems Requirements Engineering
Software Systems Requirements EngineeringKristen Wilson
 
Is There a Return on Investment from Model-Based Systems Engineering?
Is There a Return on Investment from Model-Based Systems Engineering?Is There a Return on Investment from Model-Based Systems Engineering?
Is There a Return on Investment from Model-Based Systems Engineering?Elizabeth Steiner
 
Cs 1023 lec 4 (week 1)
Cs 1023 lec 4 (week 1)Cs 1023 lec 4 (week 1)
Cs 1023 lec 4 (week 1)stanbridge
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkGanesh Samarthyam
 
A3 - AR Code Planetarium CST.pdf
A3 - AR Code Planetarium CST.pdfA3 - AR Code Planetarium CST.pdf
A3 - AR Code Planetarium CST.pdfJames Anderson
 
The Big Picture - Integrating Buzzwords
The Big Picture - Integrating BuzzwordsThe Big Picture - Integrating Buzzwords
The Big Picture - Integrating BuzzwordsAlessandro Giorgetti
 
Week 4 Assignment - Software Development PlanScenario-Your team has be.docx
Week 4 Assignment - Software Development PlanScenario-Your team has be.docxWeek 4 Assignment - Software Development PlanScenario-Your team has be.docx
Week 4 Assignment - Software Development PlanScenario-Your team has be.docxestefana2345678
 
Creating An Incremental Architecture For Your System
Creating An Incremental Architecture For Your SystemCreating An Incremental Architecture For Your System
Creating An Incremental Architecture For Your SystemGiovanni Asproni
 
Architectural Thinking - What Is Architecture?
Architectural Thinking - What Is Architecture?Architectural Thinking - What Is Architecture?
Architectural Thinking - What Is Architecture?ingo
 

Similaire à Illogical engineers (20)

Let's talk about... Microservices
Let's talk about... MicroservicesLet's talk about... Microservices
Let's talk about... Microservices
 
A Software Problem (and a maybe-solution)
A Software Problem (and a maybe-solution)A Software Problem (and a maybe-solution)
A Software Problem (and a maybe-solution)
 
Agile architecture upload
Agile architecture uploadAgile architecture upload
Agile architecture upload
 
ASAS 2014 - Simon Brown
ASAS 2014 - Simon BrownASAS 2014 - Simon Brown
ASAS 2014 - Simon Brown
 
MiniOS: an instructional platform for teaching operating systems labs
MiniOS: an instructional platform for teaching operating systems labsMiniOS: an instructional platform for teaching operating systems labs
MiniOS: an instructional platform for teaching operating systems labs
 
Thoughts On Architecting V4 2
Thoughts On Architecting V4 2Thoughts On Architecting V4 2
Thoughts On Architecting V4 2
 
MODEL-DRIVEN ENGINEERING (MDE) in Practice
MODEL-DRIVEN ENGINEERING (MDE) in PracticeMODEL-DRIVEN ENGINEERING (MDE) in Practice
MODEL-DRIVEN ENGINEERING (MDE) in Practice
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...
 
Developing Digital Twins
Developing Digital TwinsDeveloping Digital Twins
Developing Digital Twins
 
Cloud computing - an architect's perspective
Cloud computing - an architect's perspectiveCloud computing - an architect's perspective
Cloud computing - an architect's perspective
 
Software Systems Requirements Engineering
Software Systems Requirements EngineeringSoftware Systems Requirements Engineering
Software Systems Requirements Engineering
 
Is There a Return on Investment from Model-Based Systems Engineering?
Is There a Return on Investment from Model-Based Systems Engineering?Is There a Return on Investment from Model-Based Systems Engineering?
Is There a Return on Investment from Model-Based Systems Engineering?
 
Cs 1023 lec 4 (week 1)
Cs 1023 lec 4 (week 1)Cs 1023 lec 4 (week 1)
Cs 1023 lec 4 (week 1)
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
 
A3 - AR Code Planetarium CST.pdf
A3 - AR Code Planetarium CST.pdfA3 - AR Code Planetarium CST.pdf
A3 - AR Code Planetarium CST.pdf
 
The Big Picture - Integrating Buzzwords
The Big Picture - Integrating BuzzwordsThe Big Picture - Integrating Buzzwords
The Big Picture - Integrating Buzzwords
 
Week 4 Assignment - Software Development PlanScenario-Your team has be.docx
Week 4 Assignment - Software Development PlanScenario-Your team has be.docxWeek 4 Assignment - Software Development PlanScenario-Your team has be.docx
Week 4 Assignment - Software Development PlanScenario-Your team has be.docx
 
Creating An Incremental Architecture For Your System
Creating An Incremental Architecture For Your SystemCreating An Incremental Architecture For Your System
Creating An Incremental Architecture For Your System
 
Architectural Thinking - What Is Architecture?
Architectural Thinking - What Is Architecture?Architectural Thinking - What Is Architecture?
Architectural Thinking - What Is Architecture?
 

Plus de Pawel Szulc

Getting acquainted with Lens
Getting acquainted with LensGetting acquainted with Lens
Getting acquainted with LensPawel Szulc
 
Maintainable Software Architecture in Haskell (with Polysemy)
Maintainable Software Architecture in Haskell (with Polysemy)Maintainable Software Architecture in Haskell (with Polysemy)
Maintainable Software Architecture in Haskell (with Polysemy)Pawel Szulc
 
Painless Haskell
Painless HaskellPainless Haskell
Painless HaskellPawel Szulc
 
Trip with monads
Trip with monadsTrip with monads
Trip with monadsPawel Szulc
 
Trip with monads
Trip with monadsTrip with monads
Trip with monadsPawel Szulc
 
RChain - Understanding Distributed Calculi
RChain - Understanding Distributed CalculiRChain - Understanding Distributed Calculi
RChain - Understanding Distributed CalculiPawel Szulc
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineersPawel Szulc
 
Understanding distributed calculi in Haskell
Understanding distributed calculi in HaskellUnderstanding distributed calculi in Haskell
Understanding distributed calculi in HaskellPawel Szulc
 
Make your programs Free
Make your programs FreeMake your programs Free
Make your programs FreePawel Szulc
 
Going bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data typesGoing bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data typesPawel Szulc
 
“Going bananas with recursion schemes for fixed point data types”
“Going bananas with recursion schemes for fixed point data types”“Going bananas with recursion schemes for fixed point data types”
“Going bananas with recursion schemes for fixed point data types”Pawel Szulc
 
Writing your own RDD for fun and profit
Writing your own RDD for fun and profitWriting your own RDD for fun and profit
Writing your own RDD for fun and profitPawel Szulc
 
The cats toolbox a quick tour of some basic typeclasses
The cats toolbox  a quick tour of some basic typeclassesThe cats toolbox  a quick tour of some basic typeclasses
The cats toolbox a quick tour of some basic typeclassesPawel Szulc
 
Introduction to type classes
Introduction to type classesIntroduction to type classes
Introduction to type classesPawel Szulc
 
Functional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heavenFunctional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heavenPawel Szulc
 
Apache spark workshop
Apache spark workshopApache spark workshop
Apache spark workshopPawel Szulc
 
Introduction to type classes in 30 min
Introduction to type classes in 30 minIntroduction to type classes in 30 min
Introduction to type classes in 30 minPawel Szulc
 
Real world gobbledygook
Real world gobbledygookReal world gobbledygook
Real world gobbledygookPawel Szulc
 
Apache spark when things go wrong
Apache spark   when things go wrongApache spark   when things go wrong
Apache spark when things go wrongPawel Szulc
 

Plus de Pawel Szulc (20)

Getting acquainted with Lens
Getting acquainted with LensGetting acquainted with Lens
Getting acquainted with Lens
 
Impossibility
ImpossibilityImpossibility
Impossibility
 
Maintainable Software Architecture in Haskell (with Polysemy)
Maintainable Software Architecture in Haskell (with Polysemy)Maintainable Software Architecture in Haskell (with Polysemy)
Maintainable Software Architecture in Haskell (with Polysemy)
 
Painless Haskell
Painless HaskellPainless Haskell
Painless Haskell
 
Trip with monads
Trip with monadsTrip with monads
Trip with monads
 
Trip with monads
Trip with monadsTrip with monads
Trip with monads
 
RChain - Understanding Distributed Calculi
RChain - Understanding Distributed CalculiRChain - Understanding Distributed Calculi
RChain - Understanding Distributed Calculi
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineers
 
Understanding distributed calculi in Haskell
Understanding distributed calculi in HaskellUnderstanding distributed calculi in Haskell
Understanding distributed calculi in Haskell
 
Make your programs Free
Make your programs FreeMake your programs Free
Make your programs Free
 
Going bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data typesGoing bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data types
 
“Going bananas with recursion schemes for fixed point data types”
“Going bananas with recursion schemes for fixed point data types”“Going bananas with recursion schemes for fixed point data types”
“Going bananas with recursion schemes for fixed point data types”
 
Writing your own RDD for fun and profit
Writing your own RDD for fun and profitWriting your own RDD for fun and profit
Writing your own RDD for fun and profit
 
The cats toolbox a quick tour of some basic typeclasses
The cats toolbox  a quick tour of some basic typeclassesThe cats toolbox  a quick tour of some basic typeclasses
The cats toolbox a quick tour of some basic typeclasses
 
Introduction to type classes
Introduction to type classesIntroduction to type classes
Introduction to type classes
 
Functional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heavenFunctional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heaven
 
Apache spark workshop
Apache spark workshopApache spark workshop
Apache spark workshop
 
Introduction to type classes in 30 min
Introduction to type classes in 30 minIntroduction to type classes in 30 min
Introduction to type classes in 30 min
 
Real world gobbledygook
Real world gobbledygookReal world gobbledygook
Real world gobbledygook
 
Apache spark when things go wrong
Apache spark   when things go wrongApache spark   when things go wrong
Apache spark when things go wrong
 

Dernier

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Dernier (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

Illogical engineers

  • 1. Illogical Engineers “Those who cannot remember the past are condemned to repeat it.”
  • 4.
  • 5.
  • 6.
  • 7.
  • 10. “A software system can best be designed if the testing is interlaced with the designing instead of being used after the design.”
  • 11. “The good systems that are presently working were written by small groups. More than twenty programmers working on a project is usually disastrous.”
  • 12. "I bought my boss two copies of The Mythical Man Month so that he could read it twice as fast."
  • 13. “The reason that small groups have succeeded (...) is that there is a need for a certain structure of communication, and a structure of decision making in the development of software. This succeeds with small groups, because it can all be done intuitively by one person serving as most of the network. For large groups to succeed, we (...) have to face organizational structure for communications and decisions.”
  • 14. How to design successful software?
  • 15. 1. Flowchart until you think you understand the problem.
  • 16. 1. Flowchart until you think you understand the problem. 2. Write code until you realize that you don’t.
  • 17. 1. Flowchart until you think you understand the problem. 2. Write code until you realize that you don’t. 3. Go back and re-do the flowchart.
  • 18. 1. Flowchart until you think you understand the problem. 2. Write code until you realize that you don’t. 3. Go back and re-do the flowchart. 4. Write some more code and iterate to what you feel is the correct solution.
  • 19. How to design successful software?
  • 20. “Design and implementation proceeded in a number of stages. Each stage was typified by a period of intellectual activity followed by a period of program reconstruction”
  • 21. “Each stage produced a usable product and the period between the end of one stage and the start of the next provided the operational experience upon which the next design was based.”
  • 22. “In general the products of successive stages approached the final design requirement; each stage included more facilities than the last.”
  • 23.
  • 24. “Selig’s picture requires a feedback loop, for monitoring of the system. One must collect data on system performance, for use in future improvements.”
  • 26.
  • 27.
  • 28. “I believe in this concept, but the implementation described above is risky and invites failure. The testing phase which occurs at the end of the development cycle is the first event for which timing, storage, input/output transfers, etc., are experienced as distinguished from analyzed. (...) then invariably a major redesign is required. A simple (...) redo of some isolated code will not fix these kinds of difficulties. The required design changes are likely to be so disruptive that the software requirements upon which the design is based and which provides the rationale for everything are violated. Either the requirements must be modified, or a substantial change in the design is required. In effect the development process has returned to the origin and one can expect up to a lO0% overrun in schedule and/or costs.”
  • 29. “Royce's 1970 paper is generally considered to be the paper which defined the stagewise "waterfall" model of the software process. But it is surprising to see that (...) he already incorporates prototyping as an essential step compatible with the waterfall model.”
  • 30. “The earlier Benington and Hosier papers had good approximations to the waterfall model, and that Royce's paper”
  • 31. "Pitfalls and Safeguards in Real-Time Digital Systems with Emphasis on Programming" W.A. Hosier, 1961
  • 32. "Production of Large Computer Programs” H.D. Benington, June 1956.
  • 34. “As soon as specifications a system program are definitive, contractors should begin to consider how they will verify the program's meeting of the specifications.“
  • 35. “"A requirements spec was generated. It has a number of untestable requirements, with phrases like 'appropriate response' all too common. The design review took weeks, yet still retained the untestable requirements."
  • 36. “Software Process Management: Lessons Learned From History” Barry W. Boehm, 1987
  • 37. “There are 2 hard problems in computer science:
  • 38. “There are 2 hard problems in computer science: cache invalidation
  • 39. “There are 2 hard problems in computer science: cache invalidation and naming things
  • 40. “There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.
  • 41. “There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.
  • 43. Microservices What is a microservice?
  • 44. Microservices What is a difference between Microservices and SOA?
  • 45. “When we've talked about microservices a common question is whether this is just Service Oriented Architecture (SOA) that we saw a decade ago. (...) The problem, however, is that SOA means too many different things, (...) the fact that SOA means such different things means it's valuable to have a term that more crisply defines this architectural style.” -- Martin Fowler
  • 46. “Alexander Pasik, a former analyst at Gartner, coined the term SOA. (...) Pasik was driven to create term SOA because “client/server” had lost its classical meaning.” from “SOA in Practice: The Art of Distributed System Design” by Nicolai M. Josuttis
  • 47.
  • 48. “The common notion that Gartner Group invented SOA is simply absurd. (...) the underlying approach to distributed computing was invented at least 15 years earlier.”
  • 49. Are the problems being addressed and solved?
  • 52.
  • 53. What does it mean to be a software engineer?
  • 54. “The phrase ‘software engineering’ was deliberately chosen as being provocative, in implying the need for software manufacture to be based on the types of theoretical foundations and practical disciplines, that are traditional in the established branches of engineering.”
  • 55. “The phrase ‘software engineering’ was deliberately chosen as being provocative, in implying the need for software manufacture to be based on the types of theoretical foundations and practical disciplines, that are traditional in the established branches of engineering.”
  • 58. Towards engineering! ● Type System matters ● Functional Programming is our lord and saviour
  • 59. Towards engineering! ● Type System matters ● Functional Programming is our lord and saviour ○ statically typed ○ dependently typed ○ total
  • 60. Towards engineering! ● Type System matters ● Functional Programming is our lord and saviour ○ statically typed ○ dependently typed ○ total ● Recognising Computer Science roots in math is essential to write correct software
  • 61.
  • 62. if (a = 10) { ... } else { // will never be executed, variable a is changed! } The “beauty” of C++ Compiles! And that’s a bad thing
  • 63. val a: Int = 10 if(a == “10”) “ten” else “sth else”
  • 64. val a: Int = 10 “sth else”
  • 65. val a: Int = 10 if(a == “10”) “ten” else “sth else”
  • 66. trait Eq[A] { def ===(a1: A)(a2: A): Boolean } val a: Int = 10 if(a == “10”) “ten” else “sth else”
  • 67. trait Eq[A] { def ===(a1: A)(a2: A): Boolean } val a: Int = 10 if(a === “10”) “ten” else “sth else”
  • 68. trait Eq[A] { def ===(a1: A)(a2: A): Boolean } val a: Int = 10 if(a === “10”) “ten” else “sth else” Doesn’t compile
  • 69. trait Eq[A] { def ===(a1: A)(a2: A): Boolean } val a: Int = 10 if(a === “10”) “ten” else “sth else” Doesn’t compile and that’s a goodthing!
  • 71.
  • 72. /** Concatenate two maps. Keys from both maps must be * included. If keys collide, add values together. */ def concat( map1: Map[String, Int], map2: Map[String, Int] ): Map[String, Int] = ???
  • 73. 00:59
  • 74. 00:58
  • 75. 00:57
  • 76. 00:56
  • 77.
  • 78. /** Concatenate two maps. Keys from both maps must be * included. If keys collide, add values together. */ def concat( map1: Map[String, Int], map2: Map[String, Int] ): Map[String, Int] = ???
  • 79. /** Concatenate two maps. Keys from both maps must be * included. If keys collide, add values together. */ def concat( map1: Map[String, Option[(Int, Option[FinancialReport])], map2: Map[String, Option[(Int, Option[FinancialReport])] ): Map[String, Option[(Int, Option[FinancialReport])] = ???
  • 80. 00:27
  • 81. 00:26
  • 82. 00:25
  • 83. 00:25
  • 84. trait Semigroup[A] { def |+|(a1: A, a2: A): A }
  • 85. trait Semigroup[A] { def |+|(a1: A, a2: A): A } trait Semigroup { def pairS[A, B]: Semigroup[(A, B)] = ??? }
  • 86. trait Semigroup[A] { def |+|(a1: A, a2: A): A } trait Semigroup { def pairS[A:Semigroup, B:Semigroup]: Semigroup[(A, B)] = ... }
  • 87. trait Semigroup[A] { def |+|(a1: A, a2: A): A } trait Semigroup { def pairS[A:Semigroup, B:Semigroup]: Semigroup[(A, B)] = ... def optionS[A:Semigroup]: Semigroup[Option[A]] = ... }
  • 88. trait Semigroup[A] { def |+|(a1: A, a2: A): A } trait Semigroup { def pairS[A:Semigroup, B:Semigroup]: Semigroup[(A, B)] = ... def optionS[A:Semigroup]: Semigroup[Option[A]] = ... def mapS[A, B:Semigroup]: Semigroup[Map[A,B]] = ... }
  • 89. /** Concatenate two maps. Keys from both maps must be * included. If keys collide, add values together. */ def concat( m1: Map[String, Option[(Int, Option[FinancialReport])], m2: Map[String, Option[(Int, Option[FinancialReport])] ): Map[String, Option[(Int, Option[FinancialReport])] = ???
  • 90. /** Concatenate two maps. Keys from both maps must be * included. If keys collide, add values together. */ def concat( m1: Map[String, Option[(Int, Option[FinancialReport])], m2: Map[String, Option[(Int, Option[FinancialReport])] ): Map[String, Option[(Int, Option[FinancialReport])] = m1 |+| m2
  • 91. If it compiles, it works!
  • 92. Can I prove correctness of my program?
  • 93. Can code be generated from types?
  • 94. Can I prove that my program will terminate?
  • 96. The Curry–Howard correspondence is the observation that two families of seemingly unrelated formalisms—namely, the proof systems on one hand, and the models of computation on the other—are in fact the same kind of mathematical objects.
  • 98. Propositional Logic ∧ AND ∨ OR → IMPLIES ¬ NOT
  • 99. Predicate Logic ∧ AND ∨ OR → IMPLIES ¬ NOT ∀ FOR ALL ∃ EXISTS
  • 100. Constructive Logic (Intuitionistic Logic) In mathematics, a constructive proof is a method of proof that demonstrates the existence of a mathematical object by creating or providing a method for creating the object.
  • 107. Constructive Logic (Intuitionistic Logic) P ∨ ¬P P → ¬¬P
  • 108. Constructive Logic (Intuitionistic Logic) P ∨ ¬P P → ¬¬P
  • 110. Prove that: P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R)
  • 111. Prove that: P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R) X ∧ Y (X, Y)
  • 112. Prove that: P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R) X ∧ Y (X, Y) X ∨ Y X + Y
  • 113. Prove that: P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R) X ∧ Y (X, Y) X ∨ Y Either[X, Y]
  • 114. Prove that: P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R) X ∧ Y (X, Y) X ∨ Y Either[X, Y] X → Y X => Y
  • 115. Prove that: P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R) def proof[P, Q, R]: (P, Either[Q, R]) => Either[(P, Q), (P, R)] = ???
  • 116. Prove that: P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R) def proof[P, Q, R]: (P, Either[Q, R]) => Either[(P, Q), (P, R)] = ???
  • 117. Prove that: P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R) def proof[P, Q, R]: (P, Either[Q, R]) => Either[(P, Q), (P, R)] = ???
  • 118. Prove that: P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R) def proof[P, Q, R]: (P, Either[Q, R]) => Either[(P, Q), (P, R)] = (input: (P, Either[Q, R])) => input match { case (p, Left(q)) => Left((p, q)) case (p, Right(r)) => Right((p, r)) }
  • 119. Prove that: P ∧ (Q ∨ R) → (P ∧ Q) ∨ (P ∧ R) def proof[P, Q, R]: (P, Either[Q, R]) => Either[(P, Q), (P, R)] = (input: (P, Either[Q, R])) => input match { case (p, Left(q)) => Left((p, q)) case (p, Right(r)) => Right((p, r)) }
  • 120. So why can’t we prove? P ∨ ¬P
  • 121. So why can’t we prove? P ∨ ¬P ¬P P => “False”
  • 122. So why can’t we prove? P ∨ ¬P ¬P P => Nothing
  • 123. So why can’t we prove? P ∨ ¬P ¬P P => Nothing def proof[P]: Either[P, P => Nothing] = ???
  • 124. What’s the point of all this?
  • 125. Computer Science is my rooted in Math
  • 126. “We must know! We will know!” While the roots of formalised logic go back to Aristotle, the end of the 19th and early 20th centuries saw the development of modern logic and formalised mathematics.
  • 127. “We must know! We will know!” Question: could you derive all mathematical truth using axioms and inference rules of formal logic, in principle opening up the process to automatisation?
  • 128. “We must know! We will know!” In 1929, Mojżesz Presburger showed that the theory of natural numbers with addition is decidable and gave an algorithm that could determine if a given sentence in the language was true or false.
  • 129. “We must know! We will know!” “Bertrand Russell and Alfred Whitehead set out to do something amazing.” “Starting with just basic axioms of set theory, tried to build complete edifice of mathematics as one system, published as Principia Mathematica.”
  • 130.
  • 131.
  • 132. Kurt Gödel “On Formally Undecidable Propositions of Principia Mathematica and Related Systems” (1931) Incompleteness theorem
  • 133.
  • 134. Kurt Gödel proved that for any system which is at least as powerful to represent simple arithmetic: either your system is incomplete (i.e. cannot prove its own axioms) or it is inconsistent (i.e. can derive a contradiction)
  • 135. Kurt Gödel proved that for any system which is at least as powerful to represent simple arithmetic: either your system is incomplete (i.e. cannot prove its own axioms) or it is inconsistent (i.e. can derive a contradiction)
  • 139. def willProveAnything[A]: A = throw RuntimeException(“ha!”)
  • 140. def willProveAnything[A]: A = willProveAnything
  • 141. Kurt Gödel proved that for any system which is at least as powerful to represent simple arithmetic: either your system is incomplete (i.e. cannot prove its own axioms) or it is inconsistent (i.e. can derive a contradiction)
  • 142. Kurt Gödel proved that for any system which is at least as powerful to represent simple arithmetic: either your system is incomplete (i.e. cannot prove its own axioms) or it is inconsistent (i.e. can derive a contradiction)
  • 143. Automated Theorem Prover It follows that an automated theorem prover will fail to terminate while searching for a proof precisely when the statement being investigated is undecidable in the theory being used. Despite this theoretical limit, in practice, theorem provers can solve many hard problems, even in models that are not fully described by any first order theory.
  • 145.
  • 146.
  • 147.
  • 148.
  • 149.
  • 150.
  • 151.
  • 152.
  • 153.
  • 154.
  • 155.
  • 156.
  • 158.
  • 159.
  • 160.