SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
On the Design of a Galculator
Paulo Silva
Departamento de Informática
Universidade do Minho
Braga, Portugal

November 16, 2009
Guimarães
Outline
Introduction
Motivation
Objectives
Ingredients
Indirect equality
Galois connections
Relation and fork algebras
Point-free transform
Galois and Galculator
Concluding remarks
Contributions
Future work
Outline
Introduction
Motivation
Objectives
Ingredients
Indirect equality
Galois connections
Relation and fork algebras
Point-free transform
Galois and Galculator
Concluding remarks
Contributions
Future work
Software correctness
Current approaches
Software correctness is an ambitious challenge
Sometimes proofs are hindered by the theory
Tool support seems to be important

Alternatives
Sometimes algebraic approaches are possible
Algebras “abstract” the underlying logic
Proofs become more syntactic

Galois connections can play an important role
Software correctness
Current approaches
Software correctness is an ambitious challenge
Sometimes proofs are hindered by the theory
Tool support seems to be important

Alternatives
Sometimes algebraic approaches are possible
Algebras “abstract” the underlying logic
Proofs become more syntactic

Galois connections can play an important role
Whole division implementation

Haskell code
x ‘div ‘ y | x < y = 0
| x y = (x − y ) ‘div ‘ y + 1
for non-negative x and positive y .
This is the code. Where is the specification?
Whole division implementation

Haskell code
x ‘div ‘ y | x < y = 0
| x y = (x − y ) ‘div ‘ y + 1
for non-negative x and positive y .
This is the code. Where is the specification?
Whole division specification
Implicit definition
c =x ÷y ⇔ ∃r : 0

r <y : x =c×y +r

Explicit definition
x ÷y =

z :: z × y

x

Galois connection
z ×y

x ⇔ z

x ÷y

(y > 0)
Whole division specification
Implicit definition
c =x ÷y ⇔ ∃r : 0

r <y : x =c×y +r

Explicit definition
x ÷y =

z :: z × y

x

Galois connection
z ×y

x ⇔ z

x ÷y

(y > 0)
Whole division specification
Implicit definition
c =x ÷y ⇔ ∃r : 0

r <y : x =c×y +r

Explicit definition
x ÷y =

z :: z × y

x

Galois connection
z ×y

x ⇔ z

x ÷y

(y > 0)
Specification vs. Implementation

We can verify if the implementation meets the
specification.
We can calculate the implementation from the
specification.
Whole division
From specification to implementation

We want to calculate the implementation
x ÷ y = (x − y ) ÷ y + 1

if x

x ÷y =0

if x < y

from specification
z ×y

x ⇔ z

x ÷y

(y > 0)

Some useful Galois connections
a−b =c ⇔ a=c+b
a−b

c ⇔ a

c+b

y
Proof when x
z

y
x÷y

⇔

{ z×y

x ⇔ z

x÷y assuming x

0, y > 0 }

x

z×y
⇔

{ cancellation, thanks to a − b
z × y −y

⇔

c⇔a

c+b }

x−y

{ distributivity }
(z − 1)×y

⇔

{ z×y
z−1

⇔

x ⇔ z

x÷y assuming x

(x − y )÷y
{ a−b

z

x −y

c⇔a

(x − y ) ÷ y +1

c+b }

y}
Proof when x
z

y
x÷y

⇔

{ z×y

x ⇔ z

x÷y assuming x

0, y > 0 }

x

z×y
⇔

{ cancellation, thanks to a − b
z × y −y

⇔

c⇔a

c+b }

x−y

{ distributivity }
(z − 1)×y

⇔

{ z×y
z−1

⇔

x ⇔ z

x÷y assuming x

(x − y )÷y
{ a−b

z

x −y

c⇔a

(x − y ) ÷ y +1

c+b }

y}
Proof when x
z

y
x÷y

⇔

{ z×y

x ⇔ z

x÷y assuming x

0, y > 0 }

x

z×y
⇔

{ cancellation, thanks to a − b
z × y −y

⇔

c⇔a

c+b }

x−y

{ distributivity }
(z − 1)×y

⇔

{ z×y
z−1

⇔

x ⇔ z

x÷y assuming x

(x − y )÷y
{ a−b

z

x −y

c⇔a

(x − y ) ÷ y +1

c+b }

y}
Proof when x
z

y
x÷y

⇔

{ z×y

x ⇔ z

x÷y assuming x

0, y > 0 }

x

z×y
⇔

{ cancellation, thanks to a − b
z × y −y

⇔

c⇔a

c+b }

x−y

{ distributivity }
(z − 1)×y

⇔

{ z×y
z−1

⇔

x ⇔ z

x÷y assuming x

(x − y )÷y
{ a−b

z

x −y

c⇔a

(x − y ) ÷ y +1

c+b }

y}
Proof when x
z

y
x÷y

⇔

{ z×y

x ⇔ z

x÷y assuming x

0, y > 0 }

x

z×y
⇔

{ cancellation, thanks to a − b
z × y −y

⇔

c⇔a

c+b }

x−y

{ distributivity }
(z − 1)×y

⇔

{ z×y
z−1

⇔

x ⇔ z

x÷y assuming x

(x − y )÷y
{ a−b

z

x −y

c⇔a

(x − y ) ÷ y +1

c+b }

y}
Proof when x
z

y
x÷y

⇔

{ z×y

x ⇔ z

x÷y assuming x

0, y > 0 }

x

z×y
⇔

{ cancellation, thanks to a − b
z × y −y

⇔

c⇔a

c+b }

x−y

{ distributivity }
(z − 1)×y

⇔

{ z×y
z−1

⇔

x ⇔ z

x÷y assuming x

(x − y )÷y
{ a−b

z

x −y

c⇔a

(x − y ) ÷ y +1

c+b }

y}
Proof when x < y

z
⇔

x÷y
{ z×y

z×y
⇔

x ⇔ z

x÷y }

x
{ transitivity, since x < y }

z ×y
⇔

x ∧ z ×y <y

{ since y = 0 }
z ×y

⇔

{ z
z

0

x ∧ z

0

0 entails z × y

x, since 0

x }
Proof when x < y

z
⇔

x÷y
{ z×y

z×y
⇔

x ⇔ z

x÷y }

x
{ transitivity, since x < y }

z ×y
⇔

x ∧ z ×y <y

{ since y = 0 }
z ×y

⇔

{ z
z

0

x ∧ z

0

0 entails z × y

x, since 0

x }
Proof when x < y

z
⇔

x÷y
{ z×y

z×y
⇔

x ⇔ z

x÷y }

x
{ transitivity, since x < y }

z ×y
⇔

x ∧ z ×y <y

{ since y = 0 }
z ×y

⇔

{ z
z

0

x ∧ z

0

0 entails z × y

x, since 0

x }
Proof when x < y

z
⇔

x÷y
{ z×y

z×y
⇔

x ⇔ z

x÷y }

x
{ transitivity, since x < y }

z ×y
⇔

x ∧ z ×y <y

{ since y = 0 }
z ×y

⇔

{ z
z

0

x ∧ z

0

0 entails z × y

x, since 0

x }
Proof when x < y

z
⇔

x÷y
{ z×y

z×y
⇔

x ⇔ z

x÷y }

x
{ transitivity, since x < y }

z ×y
⇔

x ∧ z ×y <y

{ since y = 0 }
z ×y

⇔

{ z
z

0

x ∧ z

0

0 entails z × y

x, since 0

x }
Objectives

Exploit equational reasoning
Use Galois connections in equational proofs
Integrate Galois connections, fork algebras and indirect
equality

Galois language
Language for mathematical reasoning
Equivalent to first-order logic
Strongly typed
Front-end for the Galculator
Objectives

Galculator = Galois connections + calculator
Proof assistant based on Galois connections, their algebra
and associated tactics
Exploit the state-of-the-art Haskell technology in the
development of a proof assistant prototype
Outline
Introduction
Motivation
Objectives
Ingredients
Indirect equality
Galois connections
Relation and fork algebras
Point-free transform
Galois and Galculator
Concluding remarks
Contributions
Future work
Indirect equality

Definition (Indirect inequality)
a

b

⇔

∀ x :: x

a⇒x

b

a

b

⇔

∀ x :: b

x ⇒a

x

Definition (Indirect equality)
a=b

⇔

∀ x :: x

a⇔x

b

a=b

⇔

∀ x :: a

x ⇔b

x
Galois connections

Definition (Galois connection)
Given two preordered sets (A, A ) and (B, B ) and two
functions B o f A and A o g B , the pair (f , g) is a Galois
connection if and only if, for all a ∈ A and b ∈ B:
f a

B

b

⇔

a

A

gb

Graphical notation
A



Al

f
g

,
B

B

or (A,

A)

o

(f ,g)

(B,

B)
Galois connections
f a

B

⊤A

b

⇔

g

a

A

gb

⊤B

f

A

B
f⊤A

g B

g

f
B
A
Algebra
Identity connection.
(A,

A)

o

(id,id)

(A,

A)

Composition.
if (A, ) o

(f ,g)

(h,k )
(B, ) and (B, ) o
(C, ) then
(h◦f ,g ◦k )

(A, ) o

(C, )

Converse.
if (A, ) o

(f ,g)

(B, ) then (B, ) o

(g,f )

(A, )

Relator. For every relator F,
if (A, ) o

(f ,g)

(B, ) then (FA, F

(F f ,F g)

)o

(FB, F

)
Relation and fork algebras
Relation algebras
Extension of Boolean algebras
Single inference rule: substitution of equals by equals
Amenable for syntactic manipulation
Equivalent to a three-variable fragment of first-order logic

Fork algebras
Extend relation algebras with a pairing operator
Equivalent in expressive and deductive power to first-order
logic

Equational reasoning
Relation and fork algebras
Relation algebras
Extension of Boolean algebras
Single inference rule: substitution of equals by equals
Amenable for syntactic manipulation
Equivalent to a three-variable fragment of first-order logic

Fork algebras
Extend relation algebras with a pairing operator
Equivalent in expressive and deductive power to first-order
logic

Equational reasoning
Point-free definitions
Definition (Galois connection)
f◦ ◦

B

=

A

◦

g

Definition (Indirect equality)
f =g
f =g

⇔
⇔

◦

f

◦

◦

f =
=g

◦

◦

g
◦
Outline
Introduction
Motivation
Objectives
Ingredients
Indirect equality
Galois connections
Relation and fork algebras
Point-free transform
Galois and Galculator
Concluding remarks
Contributions
Future work
Galois language

Module
Definition

GC
Definition

Axiom

Type

Theorem

Strategy

Proof Step
Fork
Formula
Rewriting
Combinator
Term

Derivation

Order

Function

Galois
connection
Galculator prototype
Combine

GC
Derive

Laws

Relation
algebra
Derive

Properties
Derive

Rules

TRS

Strategies

Combine

Theory
domain
Derive
Outline
Introduction
Motivation
Objectives
Ingredients
Indirect equality
Galois connections
Relation and fork algebras
Point-free transform
Galois and Galculator
Concluding remarks
Contributions
Future work
Contributions
Study about Galois connections
Survey of the most important theoretical results
Comprehensive study of different approaches to combine
Galois connections
Relation with category theory
Survey of applications

Innovative approach
Fork algebras used together with Galois connections
Use of indirect equality
Amenable for either pencil-and-paper or computer assisted
proofs
Contributions
Galois language
Follows from the theoretical concepts
Strongly typed
Galois connections introduce some semantic support while
reasoning in a syntactic level

Galculator prototype
Proof assistant prototype based on Galois connections
First proof engine to calculate directly with point-free
Galois connections
Application of advanced and innovative implementation
techniques

Weitere ähnliche Inhalte

Was ist angesagt?

2.2 limits ii
2.2 limits ii2.2 limits ii
2.2 limits ii
math265
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
asimnawaz54
 
2.9 graphs of factorable polynomials
2.9 graphs of factorable polynomials2.9 graphs of factorable polynomials
2.9 graphs of factorable polynomials
math260
 
2.8 translations of graphs
2.8 translations of graphs2.8 translations of graphs
2.8 translations of graphs
math260
 
1.6 slopes and the difference quotient
1.6 slopes and the difference quotient1.6 slopes and the difference quotient
1.6 slopes and the difference quotient
math265
 
Lesson 4 - Calculating Limits (Slides+Notes)
Lesson 4 - Calculating Limits (Slides+Notes)Lesson 4 - Calculating Limits (Slides+Notes)
Lesson 4 - Calculating Limits (Slides+Notes)
Matthew Leingang
 
Review 1 -_limits-_continuity_(pcalc+_to_ap_calc)
Review 1 -_limits-_continuity_(pcalc+_to_ap_calc)Review 1 -_limits-_continuity_(pcalc+_to_ap_calc)
Review 1 -_limits-_continuity_(pcalc+_to_ap_calc)
Ron Eick
 
29 conservative fields potential functions
29 conservative fields potential functions29 conservative fields potential functions
29 conservative fields potential functions
math267
 

Was ist angesagt? (18)

2.2 limits ii
2.2 limits ii2.2 limits ii
2.2 limits ii
 
Andrei rusu-2013-amaa-workshop
Andrei rusu-2013-amaa-workshopAndrei rusu-2013-amaa-workshop
Andrei rusu-2013-amaa-workshop
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
 
2.9 graphs of factorable polynomials
2.9 graphs of factorable polynomials2.9 graphs of factorable polynomials
2.9 graphs of factorable polynomials
 
2.8 translations of graphs
2.8 translations of graphs2.8 translations of graphs
2.8 translations of graphs
 
Predicates and Quantifiers
Predicates and Quantifiers Predicates and Quantifiers
Predicates and Quantifiers
 
1.6 slopes and the difference quotient
1.6 slopes and the difference quotient1.6 slopes and the difference quotient
1.6 slopes and the difference quotient
 
Defining Functions on Equivalence Classes
Defining Functions on Equivalence ClassesDefining Functions on Equivalence Classes
Defining Functions on Equivalence Classes
 
On the Jensen-Shannon symmetrization of distances relying on abstract means
On the Jensen-Shannon symmetrization of distances relying on abstract meansOn the Jensen-Shannon symmetrization of distances relying on abstract means
On the Jensen-Shannon symmetrization of distances relying on abstract means
 
Continuity and Uniform Continuity
Continuity and Uniform ContinuityContinuity and Uniform Continuity
Continuity and Uniform Continuity
 
16 slopes and difference quotient x
16 slopes and difference quotient x16 slopes and difference quotient x
16 slopes and difference quotient x
 
Lesson 4 - Calculating Limits (Slides+Notes)
Lesson 4 - Calculating Limits (Slides+Notes)Lesson 4 - Calculating Limits (Slides+Notes)
Lesson 4 - Calculating Limits (Slides+Notes)
 
Review 1 -_limits-_continuity_(pcalc+_to_ap_calc)
Review 1 -_limits-_continuity_(pcalc+_to_ap_calc)Review 1 -_limits-_continuity_(pcalc+_to_ap_calc)
Review 1 -_limits-_continuity_(pcalc+_to_ap_calc)
 
12 derivatives and integrals of inverse trigonometric functions x
12 derivatives and integrals of inverse trigonometric functions x12 derivatives and integrals of inverse trigonometric functions x
12 derivatives and integrals of inverse trigonometric functions x
 
IVR - Chapter 1 - Introduction
IVR - Chapter 1 - IntroductionIVR - Chapter 1 - Introduction
IVR - Chapter 1 - Introduction
 
11 the inverse trigonometric functions x
11 the inverse trigonometric functions x11 the inverse trigonometric functions x
11 the inverse trigonometric functions x
 
29 conservative fields potential functions
29 conservative fields potential functions29 conservative fields potential functions
29 conservative fields potential functions
 

Andere mochten auch

ECQ_RegistrationForm
ECQ_RegistrationFormECQ_RegistrationForm
ECQ_RegistrationForm
Matthew Minor
 
Research Symposium Presentation NwaukaO Final
Research Symposium Presentation NwaukaO FinalResearch Symposium Presentation NwaukaO Final
Research Symposium Presentation NwaukaO Final
Oliver Nwauka
 
Assam the very idea of india is under threat
Assam the very idea of india is under threatAssam the very idea of india is under threat
Assam the very idea of india is under threat
Atiqur Rahman Barbhuiya
 
Ficha animais
Ficha animaisFicha animais
Ficha animais
brunoma
 

Andere mochten auch (17)

ECQ_RegistrationForm
ECQ_RegistrationFormECQ_RegistrationForm
ECQ_RegistrationForm
 
Research Symposium Presentation NwaukaO Final
Research Symposium Presentation NwaukaO FinalResearch Symposium Presentation NwaukaO Final
Research Symposium Presentation NwaukaO Final
 
Juego Divertido!!
Juego Divertido!!Juego Divertido!!
Juego Divertido!!
 
Prostodoncia
ProstodonciaProstodoncia
Prostodoncia
 
Montaje de-dientes
Montaje de-dientesMontaje de-dientes
Montaje de-dientes
 
Cuadro comparativo unidad dos
Cuadro comparativo unidad dosCuadro comparativo unidad dos
Cuadro comparativo unidad dos
 
Montaje de-dientes
Montaje de-dientesMontaje de-dientes
Montaje de-dientes
 
Seminário Aquisição de Leitura Fluente
Seminário Aquisição de Leitura FluenteSeminário Aquisição de Leitura Fluente
Seminário Aquisição de Leitura Fluente
 
Woah, You Can Test IE & Microsoft Edge on a Mac?
Woah, You Can Test IE & Microsoft Edge on a Mac?Woah, You Can Test IE & Microsoft Edge on a Mac?
Woah, You Can Test IE & Microsoft Edge on a Mac?
 
Dollymount External Expert
Dollymount External ExpertDollymount External Expert
Dollymount External Expert
 
Dilemmas of muslims
Dilemmas of muslimsDilemmas of muslims
Dilemmas of muslims
 
Assam the very idea of india is under threat
Assam the very idea of india is under threatAssam the very idea of india is under threat
Assam the very idea of india is under threat
 
φυλλο εργασιας εξισωσεις δευτερου βαθμου
φυλλο εργασιας    εξισωσεις δευτερου βαθμουφυλλο εργασιας    εξισωσεις δευτερου βαθμου
φυλλο εργασιας εξισωσεις δευτερου βαθμου
 
Ficha animais
Ficha animaisFicha animais
Ficha animais
 
NC CAE Brochure 2014
NC CAE Brochure 2014NC CAE Brochure 2014
NC CAE Brochure 2014
 
Presentacion marketingdigital3
Presentacion marketingdigital3Presentacion marketingdigital3
Presentacion marketingdigital3
 
Linea de tiempo
Linea de tiempoLinea de tiempo
Linea de tiempo
 

Ähnlich wie On the Design of a Galculator

Project in Calcu
Project in CalcuProject in Calcu
Project in Calcu
patrickpaz
 

Ähnlich wie On the Design of a Galculator (20)

Truth, deduction, computation lecture f
Truth, deduction, computation   lecture fTruth, deduction, computation   lecture f
Truth, deduction, computation lecture f
 
Introduction of predicate logics
Introduction of predicate  logicsIntroduction of predicate  logics
Introduction of predicate logics
 
Math Assignment Help
Math Assignment HelpMath Assignment Help
Math Assignment Help
 
5.5 Zeros of Polynomial Functions
5.5 Zeros of Polynomial Functions5.5 Zeros of Polynomial Functions
5.5 Zeros of Polynomial Functions
 
Top school in india
Top school in indiaTop school in india
Top school in india
 
Project in Calcu
Project in CalcuProject in Calcu
Project in Calcu
 
Limits and derivatives
Limits and derivativesLimits and derivatives
Limits and derivatives
 
dma_ppt.pdf
dma_ppt.pdfdma_ppt.pdf
dma_ppt.pdf
 
Probability cheatsheet
Probability cheatsheetProbability cheatsheet
Probability cheatsheet
 
11848 ch04(1) (1)
11848 ch04(1) (1)11848 ch04(1) (1)
11848 ch04(1) (1)
 
11848 ch04
11848 ch0411848 ch04
11848 ch04
 
11848 ch04(1)
11848 ch04(1)11848 ch04(1)
11848 ch04(1)
 
Function
Function Function
Function
 
Limits, continuity, and derivatives
Limits, continuity, and derivativesLimits, continuity, and derivatives
Limits, continuity, and derivatives
 
Lecture co3 math21-1
Lecture co3 math21-1Lecture co3 math21-1
Lecture co3 math21-1
 
3.5 Transformation of Functions
3.5 Transformation of Functions3.5 Transformation of Functions
3.5 Transformation of Functions
 
Probability Cheatsheet.pdf
Probability Cheatsheet.pdfProbability Cheatsheet.pdf
Probability Cheatsheet.pdf
 
Lesson 1: Functions
Lesson 1: FunctionsLesson 1: Functions
Lesson 1: Functions
 
Presentation of Polynomial
Presentation of PolynomialPresentation of Polynomial
Presentation of Polynomial
 
The Chase in Database Theory
The Chase in Database TheoryThe Chase in Database Theory
The Chase in Database Theory
 

Mehr von Paulo Silva (6)

Compiling CAO: From Cryptographic Specifications to C Implementations
Compiling CAO: From Cryptographic Specifications to C ImplementationsCompiling CAO: From Cryptographic Specifications to C Implementations
Compiling CAO: From Cryptographic Specifications to C Implementations
 
Galois: A Language for Proofs Using Galois Connections and Fork Algebras
Galois: A Language for Proofs Using Galois Connections and Fork AlgebrasGalois: A Language for Proofs Using Galois Connections and Fork Algebras
Galois: A Language for Proofs Using Galois Connections and Fork Algebras
 
On the Design of a Galculator
On the Design of a GalculatorOn the Design of a Galculator
On the Design of a Galculator
 
Galculator: Functional Prototype of a Galois-connection Based Proof Assistant
Galculator: Functional Prototype of a Galois-connection Based Proof AssistantGalculator: Functional Prototype of a Galois-connection Based Proof Assistant
Galculator: Functional Prototype of a Galois-connection Based Proof Assistant
 
Dependent Types for Cryptography Implementations
Dependent Types for Cryptography ImplementationsDependent Types for Cryptography Implementations
Dependent Types for Cryptography Implementations
 
Machine Assisted Verification Tools for Cryptography
Machine Assisted Verification Tools for CryptographyMachine Assisted Verification Tools for Cryptography
Machine Assisted Verification Tools for Cryptography
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

On the Design of a Galculator

  • 1. On the Design of a Galculator Paulo Silva Departamento de Informática Universidade do Minho Braga, Portugal November 16, 2009 Guimarães
  • 2. Outline Introduction Motivation Objectives Ingredients Indirect equality Galois connections Relation and fork algebras Point-free transform Galois and Galculator Concluding remarks Contributions Future work
  • 3. Outline Introduction Motivation Objectives Ingredients Indirect equality Galois connections Relation and fork algebras Point-free transform Galois and Galculator Concluding remarks Contributions Future work
  • 4. Software correctness Current approaches Software correctness is an ambitious challenge Sometimes proofs are hindered by the theory Tool support seems to be important Alternatives Sometimes algebraic approaches are possible Algebras “abstract” the underlying logic Proofs become more syntactic Galois connections can play an important role
  • 5. Software correctness Current approaches Software correctness is an ambitious challenge Sometimes proofs are hindered by the theory Tool support seems to be important Alternatives Sometimes algebraic approaches are possible Algebras “abstract” the underlying logic Proofs become more syntactic Galois connections can play an important role
  • 6. Whole division implementation Haskell code x ‘div ‘ y | x < y = 0 | x y = (x − y ) ‘div ‘ y + 1 for non-negative x and positive y . This is the code. Where is the specification?
  • 7. Whole division implementation Haskell code x ‘div ‘ y | x < y = 0 | x y = (x − y ) ‘div ‘ y + 1 for non-negative x and positive y . This is the code. Where is the specification?
  • 8. Whole division specification Implicit definition c =x ÷y ⇔ ∃r : 0 r <y : x =c×y +r Explicit definition x ÷y = z :: z × y x Galois connection z ×y x ⇔ z x ÷y (y > 0)
  • 9. Whole division specification Implicit definition c =x ÷y ⇔ ∃r : 0 r <y : x =c×y +r Explicit definition x ÷y = z :: z × y x Galois connection z ×y x ⇔ z x ÷y (y > 0)
  • 10. Whole division specification Implicit definition c =x ÷y ⇔ ∃r : 0 r <y : x =c×y +r Explicit definition x ÷y = z :: z × y x Galois connection z ×y x ⇔ z x ÷y (y > 0)
  • 11. Specification vs. Implementation We can verify if the implementation meets the specification. We can calculate the implementation from the specification.
  • 12. Whole division From specification to implementation We want to calculate the implementation x ÷ y = (x − y ) ÷ y + 1 if x x ÷y =0 if x < y from specification z ×y x ⇔ z x ÷y (y > 0) Some useful Galois connections a−b =c ⇔ a=c+b a−b c ⇔ a c+b y
  • 13. Proof when x z y x÷y ⇔ { z×y x ⇔ z x÷y assuming x 0, y > 0 } x z×y ⇔ { cancellation, thanks to a − b z × y −y ⇔ c⇔a c+b } x−y { distributivity } (z − 1)×y ⇔ { z×y z−1 ⇔ x ⇔ z x÷y assuming x (x − y )÷y { a−b z x −y c⇔a (x − y ) ÷ y +1 c+b } y}
  • 14. Proof when x z y x÷y ⇔ { z×y x ⇔ z x÷y assuming x 0, y > 0 } x z×y ⇔ { cancellation, thanks to a − b z × y −y ⇔ c⇔a c+b } x−y { distributivity } (z − 1)×y ⇔ { z×y z−1 ⇔ x ⇔ z x÷y assuming x (x − y )÷y { a−b z x −y c⇔a (x − y ) ÷ y +1 c+b } y}
  • 15. Proof when x z y x÷y ⇔ { z×y x ⇔ z x÷y assuming x 0, y > 0 } x z×y ⇔ { cancellation, thanks to a − b z × y −y ⇔ c⇔a c+b } x−y { distributivity } (z − 1)×y ⇔ { z×y z−1 ⇔ x ⇔ z x÷y assuming x (x − y )÷y { a−b z x −y c⇔a (x − y ) ÷ y +1 c+b } y}
  • 16. Proof when x z y x÷y ⇔ { z×y x ⇔ z x÷y assuming x 0, y > 0 } x z×y ⇔ { cancellation, thanks to a − b z × y −y ⇔ c⇔a c+b } x−y { distributivity } (z − 1)×y ⇔ { z×y z−1 ⇔ x ⇔ z x÷y assuming x (x − y )÷y { a−b z x −y c⇔a (x − y ) ÷ y +1 c+b } y}
  • 17. Proof when x z y x÷y ⇔ { z×y x ⇔ z x÷y assuming x 0, y > 0 } x z×y ⇔ { cancellation, thanks to a − b z × y −y ⇔ c⇔a c+b } x−y { distributivity } (z − 1)×y ⇔ { z×y z−1 ⇔ x ⇔ z x÷y assuming x (x − y )÷y { a−b z x −y c⇔a (x − y ) ÷ y +1 c+b } y}
  • 18. Proof when x z y x÷y ⇔ { z×y x ⇔ z x÷y assuming x 0, y > 0 } x z×y ⇔ { cancellation, thanks to a − b z × y −y ⇔ c⇔a c+b } x−y { distributivity } (z − 1)×y ⇔ { z×y z−1 ⇔ x ⇔ z x÷y assuming x (x − y )÷y { a−b z x −y c⇔a (x − y ) ÷ y +1 c+b } y}
  • 19. Proof when x < y z ⇔ x÷y { z×y z×y ⇔ x ⇔ z x÷y } x { transitivity, since x < y } z ×y ⇔ x ∧ z ×y <y { since y = 0 } z ×y ⇔ { z z 0 x ∧ z 0 0 entails z × y x, since 0 x }
  • 20. Proof when x < y z ⇔ x÷y { z×y z×y ⇔ x ⇔ z x÷y } x { transitivity, since x < y } z ×y ⇔ x ∧ z ×y <y { since y = 0 } z ×y ⇔ { z z 0 x ∧ z 0 0 entails z × y x, since 0 x }
  • 21. Proof when x < y z ⇔ x÷y { z×y z×y ⇔ x ⇔ z x÷y } x { transitivity, since x < y } z ×y ⇔ x ∧ z ×y <y { since y = 0 } z ×y ⇔ { z z 0 x ∧ z 0 0 entails z × y x, since 0 x }
  • 22. Proof when x < y z ⇔ x÷y { z×y z×y ⇔ x ⇔ z x÷y } x { transitivity, since x < y } z ×y ⇔ x ∧ z ×y <y { since y = 0 } z ×y ⇔ { z z 0 x ∧ z 0 0 entails z × y x, since 0 x }
  • 23. Proof when x < y z ⇔ x÷y { z×y z×y ⇔ x ⇔ z x÷y } x { transitivity, since x < y } z ×y ⇔ x ∧ z ×y <y { since y = 0 } z ×y ⇔ { z z 0 x ∧ z 0 0 entails z × y x, since 0 x }
  • 24. Objectives Exploit equational reasoning Use Galois connections in equational proofs Integrate Galois connections, fork algebras and indirect equality Galois language Language for mathematical reasoning Equivalent to first-order logic Strongly typed Front-end for the Galculator
  • 25. Objectives Galculator = Galois connections + calculator Proof assistant based on Galois connections, their algebra and associated tactics Exploit the state-of-the-art Haskell technology in the development of a proof assistant prototype
  • 26. Outline Introduction Motivation Objectives Ingredients Indirect equality Galois connections Relation and fork algebras Point-free transform Galois and Galculator Concluding remarks Contributions Future work
  • 27. Indirect equality Definition (Indirect inequality) a b ⇔ ∀ x :: x a⇒x b a b ⇔ ∀ x :: b x ⇒a x Definition (Indirect equality) a=b ⇔ ∀ x :: x a⇔x b a=b ⇔ ∀ x :: a x ⇔b x
  • 28. Galois connections Definition (Galois connection) Given two preordered sets (A, A ) and (B, B ) and two functions B o f A and A o g B , the pair (f , g) is a Galois connection if and only if, for all a ∈ A and b ∈ B: f a B b ⇔ a A gb Graphical notation A Al f g ,
  • 31. Algebra Identity connection. (A, A) o (id,id) (A, A) Composition. if (A, ) o (f ,g) (h,k ) (B, ) and (B, ) o (C, ) then (h◦f ,g ◦k ) (A, ) o (C, ) Converse. if (A, ) o (f ,g) (B, ) then (B, ) o (g,f ) (A, ) Relator. For every relator F, if (A, ) o (f ,g) (B, ) then (FA, F (F f ,F g) )o (FB, F )
  • 32. Relation and fork algebras Relation algebras Extension of Boolean algebras Single inference rule: substitution of equals by equals Amenable for syntactic manipulation Equivalent to a three-variable fragment of first-order logic Fork algebras Extend relation algebras with a pairing operator Equivalent in expressive and deductive power to first-order logic Equational reasoning
  • 33. Relation and fork algebras Relation algebras Extension of Boolean algebras Single inference rule: substitution of equals by equals Amenable for syntactic manipulation Equivalent to a three-variable fragment of first-order logic Fork algebras Extend relation algebras with a pairing operator Equivalent in expressive and deductive power to first-order logic Equational reasoning
  • 34. Point-free definitions Definition (Galois connection) f◦ ◦ B = A ◦ g Definition (Indirect equality) f =g f =g ⇔ ⇔ ◦ f ◦ ◦ f = =g ◦ ◦ g ◦
  • 35. Outline Introduction Motivation Objectives Ingredients Indirect equality Galois connections Relation and fork algebras Point-free transform Galois and Galculator Concluding remarks Contributions Future work
  • 38. Outline Introduction Motivation Objectives Ingredients Indirect equality Galois connections Relation and fork algebras Point-free transform Galois and Galculator Concluding remarks Contributions Future work
  • 39. Contributions Study about Galois connections Survey of the most important theoretical results Comprehensive study of different approaches to combine Galois connections Relation with category theory Survey of applications Innovative approach Fork algebras used together with Galois connections Use of indirect equality Amenable for either pencil-and-paper or computer assisted proofs
  • 40. Contributions Galois language Follows from the theoretical concepts Strongly typed Galois connections introduce some semantic support while reasoning in a syntactic level Galculator prototype Proof assistant prototype based on Galois connections First proof engine to calculate directly with point-free Galois connections Application of advanced and innovative implementation techniques
  • 41. Future work Integration with host theorem provers (e.g., Coq) Mechanization of point-free transform Automated proofs Free-theorems Extension of the type system Evaluation of the language Application to abstract interpretation