SlideShare a Scribd company logo
1 of 40
Download to read offline
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

More Related Content

What's hot

2.2 limits ii
2.2 limits ii2.2 limits ii
2.2 limits iimath265
 
Andrei rusu-2013-amaa-workshop
Andrei rusu-2013-amaa-workshopAndrei rusu-2013-amaa-workshop
Andrei rusu-2013-amaa-workshopAndries Rusu
 
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 inferenceasimnawaz54
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiersblaircomp2003
 
2.9 graphs of factorable polynomials
2.9 graphs of factorable polynomials2.9 graphs of factorable polynomials
2.9 graphs of factorable polynomialsmath260
 
2.8 translations of graphs
2.8 translations of graphs2.8 translations of graphs
2.8 translations of graphsmath260
 
Predicates and Quantifiers
Predicates and Quantifiers Predicates and Quantifiers
Predicates and Quantifiers Istiak Ahmed
 
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 quotientmath265
 
Defining Functions on Equivalence Classes
Defining Functions on Equivalence ClassesDefining Functions on Equivalence Classes
Defining Functions on Equivalence ClassesLawrence Paulson
 
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 meansFrank Nielsen
 
Continuity and Uniform Continuity
Continuity and Uniform ContinuityContinuity and Uniform Continuity
Continuity and Uniform ContinuityDEVTYPE
 
16 slopes and difference quotient x
16 slopes and difference quotient x16 slopes and difference quotient x
16 slopes and difference quotient xmath260
 
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
 
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 xmath266
 
IVR - Chapter 1 - Introduction
IVR - Chapter 1 - IntroductionIVR - Chapter 1 - Introduction
IVR - Chapter 1 - IntroductionCharles Deledalle
 
11 the inverse trigonometric functions x
11 the inverse trigonometric functions x11 the inverse trigonometric functions x
11 the inverse trigonometric functions xmath266
 
29 conservative fields potential functions
29 conservative fields potential functions29 conservative fields potential functions
29 conservative fields potential functionsmath267
 

What's hot (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
 

Viewers also liked

ECQ_RegistrationForm
ECQ_RegistrationFormECQ_RegistrationForm
ECQ_RegistrationFormMatthew Minor
 
Research Symposium Presentation NwaukaO Final
Research Symposium Presentation NwaukaO FinalResearch Symposium Presentation NwaukaO Final
Research Symposium Presentation NwaukaO FinalOliver Nwauka
 
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 FluenteLari Aveiro
 
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?reybango
 
Dollymount External Expert
Dollymount External ExpertDollymount External Expert
Dollymount External ExpertNaoise
 
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 threatAtiqur Rahman Barbhuiya
 
φυλλο εργασιας εξισωσεις δευτερου βαθμου
φυλλο εργασιας    εξισωσεις δευτερου βαθμουφυλλο εργασιας    εξισωσεις δευτερου βαθμου
φυλλο εργασιας εξισωσεις δευτερου βαθμουKozalakis
 
Ficha animais
Ficha animaisFicha animais
Ficha animaisbrunoma
 

Viewers also liked (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
 

Similar to On the Design of a Galculator

Similar to 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
11848 ch0411848 ch04
11848 ch04
 
11848 ch04(1)
11848 ch04(1)11848 ch04(1)
11848 ch04(1)
 
11848 ch04(1) (1)
11848 ch04(1) (1)11848 ch04(1) (1)
11848 ch04(1) (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
 

More from Paulo Silva

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 ImplementationsPaulo Silva
 
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 AlgebrasPaulo Silva
 
On the Design of a Galculator
On the Design of a GalculatorOn the Design of a Galculator
On the Design of a GalculatorPaulo Silva
 
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 AssistantPaulo Silva
 
Dependent Types for Cryptography Implementations
Dependent Types for Cryptography ImplementationsDependent Types for Cryptography Implementations
Dependent Types for Cryptography ImplementationsPaulo Silva
 
Machine Assisted Verification Tools for Cryptography
Machine Assisted Verification Tools for CryptographyMachine Assisted Verification Tools for Cryptography
Machine Assisted Verification Tools for CryptographyPaulo Silva
 

More from 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
 

Recently uploaded

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 

Recently uploaded (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 

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