SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à On the Design of a Galculator

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

Similaire à 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
 

Plus de 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
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Dernier (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

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