Você está na página 1de 76

Universidade Federal do Rio Grande do Norte

Centro de Ciências Exatas e da Terra


Departamento de Informática e Matemática Aplicada
Bacharelado em Ciência da Computação

Automatic extraction of Hilbert Calculi


associated to fragments of classical logic

Joel Felipe Ferreira Gomes

Natal-RN
December 2019
Joel Felipe Ferreira Gomes

Automatic extraction of Hilbert Calculi associated to


fragments of classical logic

Undergraduate thesis submitted to the De-


partamento de Informática e Matemática
Aplicada of the Centro de Ciências Exatas e
da Terra of the Universidade Federal do Rio
Grande do Norte as a partial requirement for
obtaining the bachelor’s degree in Computer
Science.

Advisor
Prof. João Marcos

Universidade Federal do Rio Grande do Norte – UFRN


Departamento de Informática e Matemática Aplicada – DIMAp

Natal-RN
December 2019
Universidade Federal do Rio Grande do Norte - UFRN
Sistema de Bibliotecas - SISBI
Catalogação de Publicação na Fonte. UFRN - Biblioteca Setorial Prof. Ronaldo Xavier de Arruda - CCET

Gomes, Joel Felipe Ferreira.


Automatic extraction of Hilbert calculi associated to
fragments of classical logic / Joel Felipe Ferreira Gomes. -
2019.
74f.: il.

Monografia (Bacharelado em Ciência da Computação) -


Universidade Federal do Rio Grande do Norte, Centro de Ciências
Exatas e da Terra, Departamento de Informática e Matemática
Aplicada. Natal, 2019.
Orientador: João Marcos.

1. Computação - Monografia. 2. Reticulado de Post -


Monografia. 3. Fragmentos da lógica clássica - Monografia. 4.
Axiomatização - Monografia. 5. Cálculo de Hilbert - Monografia.
I. Marcos, João. II. Título.

RN/UF/CCET CDU 004

Elaborado por Joseneide Ferreira Dantas - CRB-15/324


Undergraduate thesis under the title Automatic extraction of Hilbert Calculi associated to
fragments of classical logic presented by Joel Felipe Ferreira Gomes and accepted by the
Departamento de Informática e Matemática Aplicada of the Centro de Ciências Exatas
e da Terra of the Universidade Federal do Rio Grande do Norte, being approved by all
members of the examining board specified below:

PhD João Marcos


Advisor
Departamento de Informática e Matemática Aplicada
Universidade Federal do Rio Grande do Norte

PhD Umberto Rivieccio


Departamento de Informática e Matemática Aplicada
Universidade Federal do Rio Grande do Norte

PhD Carlos Olarte


Escola de Ciências e Tecnologia
Universidade Federal do Rio Grande do Norte

Natal-RN, December 2019.


To my family and friends that supported and inspired me
throughout this amazing journey.
Acknowledgements

It would be impossible to conceive this work without the support provided by the
professors who have spent my academic life inside this university, both from IMD and
DIMAp. Thus, special thanks to João Marcos, Umberto Rivieccio, Gibeon Aquino, Ath-
anasios “Thanos” Tsouanas, André Britto and Antônio “Tonhão” Igor.

Thanks to my family for all the love and support, and for with standing all the
difficulties encountered – Edilene Pereira Ferreira Gomes, Hareton Ribeiro Gomes, Daniel
Henrique Ferreira Gomes and Rafael de Jesus Ferreira Gomes. In addition, thanks to Enid
Nazareth Pereira Ferreira for the long distance support, and a special thanks to Raissa
Pereira for being present in all keys moments, helping me to keep my sanity.

Thanks to Paulo Lopes, Hugo Oliveira, Cinthia Katiane, Thales Gomes, Fagner Dias,
Allan Gonçalves and Gustavo Bezerra for all the discussions, conversations, memes and
for friendship throughout my journey on the Computer Science course.

Last but not least, thanks to Vitor Greati for help me make this work, and for all
the conversations, discussions, sleepless nights, and shared future plans, still fuzzy but
hopefully promising.
“And when at last the work is done
Don’t sit down it’s time to dig another one”

Roger Waters
Extração automática de cálculos de Hilbert associados
aos fragmentos da lógica clássica

Autor: Joel Felipe Ferreira Gomes


Orientador(a): Prof. João Marcos

Resumo

A lógica clássica pode ser definida como a lógica induzida pelo clone completo sobre
{0, 1}. A menos de um isomorfismo, qualquer outra lógica 2-valorada pode então ser
vista como uma sublógica / fragmento da lógica clássica. Ainda há muito pouco con-
hecimento sobre a combinação mínima de tais fragmentos (cf. (MARCELINO; CALEIRO;
MARCOS, 2018)), que em princípio pode ser obtida simplesmente unindo-se os cálculos
de Hilbert correspondentes. Em 1941, Emil Post estudou o reticulado de todos os clones
2-valorados, ordenados sobre inclusão (cf. (POST, 1941)). Este reticulado - infinitamente
contável, mas constituído de membros gerados finitamente - constituiu desde então uma
fonte inestimável de informações e insights sobre as relações entre as sub-lógicas da lógica
clássica. Em (RAUTENBERG, 1981), Wolfgang Rautenberg explorou a classificação de
Post para demonstrar que toda lógica 2-valorada é fortemente axiomatizável; vale a pena
notar que esta demonstração induz um procedimento eficaz para produzir um cálculo de
Hilbert para qualquer fragmento da lógica clássica. Este trabalho propõe implementar um
sistema Web que é capaz de receber como entrada um conjunto de operações 2-valoradas
e retornar ao usuário o cálculo de Hilbert associado. A implementação do procedimento
para produzir o cálculo de Hilbert associado à entrada informada será feita utilizando a
linguagem de programação Haskell e distribuído como uma API RESTful. Além disso,
será feito um Website, a ser usado livremente pela comunidade, que receberá as entradas
do usuário, consumirá a API, e informará o resultado do procedimento citado, baseado
nas entradas que o usuário forneceu.

Palavras-chave: Reticulado de Post, Fragmentos da lógica clássica, Axiomatização, Cál-


culo de Hilbert
Automatic extraction of Hilbert Calculi associated to
fragments of classical logic

Author: Joel Felipe Ferreira Gomes


Advisor: Prof. João Marcos

Abstract

The classical logic can be defined as the logic induced by the complete clone over {0, 1}.
Up to isomorphism, any other 2-valued logic may then be seen as a sublogic / fragment of
classical logic. There is still very little common knowledge about the minimal combination
of such fragments (cf. (MARCELINO; CALEIRO; MARCOS, 2018)), which in principle may be
obtained by simply merging the corresponding Hilbert calculi. In 1941, Emil Post studied
the lattice of all the 2-valued clones, ordered under inclusion (cf. ( POST, 1941)). This lat-
tice —countably infinite yet constituted of finitely generated members— has constituted
ever since an invaluable source of information and insights about the relationships among
the sublogics of classical logic. In (RAUTENBERG, 1981), Wolfgang Rautenberg explored
Post’s classification in proving that every 2-valued logic is strongly finitely axiomatizable;
it is worth noting that this proof carries along an effective procedure for producing a
Hilbert calculus to any fragment of classical logic. This work proposes to implement a
Web system that is able to receive as input a set of 2-valued operations and return to the
user the Hilbert Calculus associated. The implementation of the procedure to produce
the Hilbert Calculus associated with the reported input will be done using the Haskell
programming language and distributed as a RESTful API. In addition, a Website will be
made, to be used freely by the community, which will receive the user inputs, consume
the API, and inform the result of the cited procedure, based on the inputs that the user
provided.

Keywords: Post’s lattice, Fragments of classical logic, Axiomatization, Hilbert Calculus


Lista de figuras

1 Post’s Lattice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 18

2 PLLP Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 22

3 Rautenberg Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 24

4 Fragment Axiomatization Website . . . . . . . . . . . . . . . . . . . . . p. 59

5 Clone Comparison Website . . . . . . . . . . . . . . . . . . . . . . . . . p. 59

6 Rules Independence Website . . . . . . . . . . . . . . . . . . . . . . . . p. 60

7 Soundness Check Website . . . . . . . . . . . . . . . . . . . . . . . . . p. 61


Lista de tabelas

1 Truth Table of ¬ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 25

2 Truth Table of 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 25

3 Truth Table of 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 26

4 Truth Table of ∨ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 28

5 Truth Table of ∧ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 30

6 Truth Table of ↔3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 34

7 Truth Table of d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 37

8 Truth Table of ka . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 40

9 Truth Table of ki . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 41

10 Truth Table of ak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 42

11 Truth Table of ad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 43
List of abbreviations and initials

PLLP – Post’s Lattice Localization Problem – page 21

TEP – Term Equivalence Problem – page 21

CMP – Clone Membership Problem – page 22

REST – REpresentational State Transfer – page 57

URI – Uniform Resource Identifier – page 57

API – Application Programming Interface – page 57


List of Algorithms

1 CMP Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 23
Contents

1 Introduction p. 15

2 Theoretical Framework p. 17

2.1 Clones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 17

2.2 Post’s Lattice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 18

2.3 Classical Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 19

2.4 Hilbert Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 19

3 Algorithm for extraction of a Hilbert calculus p. 21

3.1 Post’s Lattice Localization Problem . . . . . . . . . . . . . . . . . . . . p. 21

3.2 Rautenberg Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 23

3.2.1 Trivial cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 24

3.2.1.1 R1 = Clo{0,1} (∅) . . . . . . . . . . . . . . . . . . . . . p. 25

3.2.1.2 R4 = Clo{0,1} ({¬}) . . . . . . . . . . . . . . . . . . . . p. 25

3.2.1.3 R6 = Clo{0,1} ({1}) . . . . . . . . . . . . . . . . . . . . p. 25

3.2.1.4 R8 = Clo{0,1} ({0}) . . . . . . . . . . . . . . . . . . . . p. 26

3.2.1.5 R11 = Clo{0,1} ({0, 1}) . . . . . . . . . . . . . . . . . . p. 26

3.2.1.6 R13 = Clo{0,1} ({¬, 0}) . . . . . . . . . . . . . . . . . . p. 26

3.2.2 Main cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 27

3.2.2.1 S2 = Clo{0,1} ({∨}) . . . . . . . . . . . . . . . . . . . . p. 27

3.2.2.2 S4 = Clo{0,1} ({∨, 1}) . . . . . . . . . . . . . . . . . . . p. 28

3.2.2.3 S5 = Clo{0,1} ({∨, 0}) . . . . . . . . . . . . . . . . . . . p. 28


3.2.2.4 S6 = Clo{0,1} ({∨, 0, 1}) . . . . . . . . . . . . . . . . . . p. 28

3.2.2.5 P2 = Clo{0,1} ({∧}) . . . . . . . . . . . . . . . . . . . . p. 29

3.2.2.6 P4 = Clo{0,1} ({∧, 0}) . . . . . . . . . . . . . . . . . . . p. 30

3.2.2.7 P5 = Clo{0,1} ({∧, 1}) . . . . . . . . . . . . . . . . . . . p. 30

3.2.2.8 P6 = Clo{0,1} ({∧, 0, 1}) . . . . . . . . . . . . . . . . . p. 30

3.2.2.9 A4 = Clo{0,1} ({∨, ∧}) . . . . . . . . . . . . . . . . . . . p. 31

3.2.2.10 A3 = Clo{0,1} ({∨, ∧, 0}) . . . . . . . . . . . . . . . . . p. 32

3.2.2.11 A2 = Clo{0,1} ({∨, ∧, 1}) . . . . . . . . . . . . . . . . . p. 32

3.2.2.12 A1 = Clo{0,1} ({∨, ∧, 0, 1}) . . . . . . . . . . . . . . . . p. 32

3.2.2.13 L4 = Clo{0,1} ({↔3 }) . . . . . . . . . . . . . . . . . . . p. 34

3.2.2.14 L2 = Clo{0,1} ({↔3 , 1}) . . . . . . . . . . . . . . . . . . p. 34

3.2.2.15 L3 = Clo{0,1} ({↔3 , 0}) . . . . . . . . . . . . . . . . . . p. 35

3.2.2.16 L1 = Clo{0,1} ({↔3 , 0, 1}) . . . . . . . . . . . . . . . . p. 35

3.2.2.17 L5 = Clo{0,1} ({↔3 , ¬}) . . . . . . . . . . . . . . . . . . p. 35

3.2.2.18 D2 = Clo{0,1} ({d}) . . . . . . . . . . . . . . . . . . . . p. 37

3.2.2.19 D3 = Clo{0,1} ({d, ¬}) . . . . . . . . . . . . . . . . . . p. 37

3.2.2.20 D1 = Clo{0,1} ({d, ↔3 }) . . . . . . . . . . . . . . . . . . p. 38

3.2.2.21 F6∞ = Clo{0,1} ({ka}) . . . . . . . . . . . . . . . . . . . p. 39

3.2.2.22 F7∞ = Clo{0,1} ({ka, 0}) . . . . . . . . . . . . . . . . . . p. 40

3.2.2.23 F5∞ = Clo{0,1} ({ki}) . . . . . . . . . . . . . . . . . . . p. 41

3.2.2.24 F8∞ = Clo{0,1} ({ki, 0}) . . . . . . . . . . . . . . . . . . p. 41

3.2.2.25 F2∞ = Clo{0,1} ({ak}) . . . . . . . . . . . . . . . . . . . p. 42

3.2.2.26 F3∞ = Clo{0,1} ({ak, 1}) . . . . . . . . . . . . . . . . . . p. 43

3.2.2.27 F1∞ = Clo{0,1} ({ad}) . . . . . . . . . . . . . . . . . . . p. 43

3.2.2.28 F4∞ = Clo{0,1} ({ad, 1}) . . . . . . . . . . . . . . . . . p. 45

3.2.2.29 C4 = Clo{0,1} ({ki, ∨}) . . . . . . . . . . . . . . . . . . p. 46


3.2.2.30 C3 = Clo{0,1} ({ki, ∨, 0}) . . . . . . . . . . . . . . . . . p. 46

3.2.2.31 C2 = Clo{0,1} ({ki, ∨, 1}) . . . . . . . . . . . . . . . . . p. 46

3.2.2.32 C1 = Clo{0,1} ({ki, ∨, 0, 1}) . . . . . . . . . . . . . . . . p. 47

3.2.3 Recursive cases . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 48

3.2.3.1 Monotonic expansions of S2 . . . . . . . . . . . . . . . p. 48

3.2.3.2 Expansions of F1∞ or F4∞ . . . . . . . . . . . . . . . . p. 49

3.2.3.3 Expansions of F5∞ or F8∞ . . . . . . . . . . . . . . . . p. 50

3.2.3.4 Expansions of F6∞ or F7∞ . . . . . . . . . . . . . . . . p. 51

4 A computational implementation of extraction of a Hilbert calculus p. 53

4.1 Computational Representation . . . . . . . . . . . . . . . . . . . . . . . p. 53

4.2 API RESTful . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 57

4.3 Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 59

5 Concluding Remarks p. 62

References p. 63

Appendix A -- TEP Algorithm in Haskell p. 64

Appendix B -- Truth tables in Haskell p. 65

Appendix C -- Interpretations in Haskell p. 67

Appendix D -- Matrices in Haskell p. 68

Appendix E -- Axiomatizations in Haskell p. 70


15

1 Introduction

The present undergraduate thesis is part of a proposed implementation of the extrac-


tion of the Hilbert calculi associated with clones that semantically represent the various
fragments of classical logic.

The general axiomatization procedure was proposed in a remarkable article by Wolfgang


Rautenberg (RAUTENBERG, 1981), which is long and complex and contains several small
errors to be located and corrected by careful reading.

An important feature of Rautenberg’s proofs is that there is an underlying procedure


for obtaining the Hilbert calculus for any fragment of Classical Logic, by knowing the set
of basic operations of the associated clone. The implementation of this procedure is of
special interest to the scholars interested in these fragments and, more importantly, in
their combinations, since Hilbert calculus are favorable environments for fibring logic.

The implementation of this procedure was never done. Now that we know that Hilbert
Calculi provide the most appropriate and simple environment for defining combinations
of logics to support the study of complex systems derived by that combinations, the
implementation of such an axiomatization procedure proves to be very important.

To understand the purpose of this work and its implications, some definitions are
fundamental, like the concepts of clones, the logic induced by a clone, Post’s lattice, and
Hilbert calculi, which will be formally presented in the Chapter 2.

In order for the algorithm to be implemented, we first have to, given a set F of
operations on {0, 1}, find the clone in Post’s lattice to which this set belongs. This problem
is referred to as Post’s Lattice Localization Problem (PLLP), the proposed solution is
presented in Section 3.1.

After finding out which clone in the Post’s Lattice the user-supplied set of operations
refers to, we use the Rautenberg algorithm (RAUTENBERG, 1981) to return the corres-
ponding Hilbert calculus. The algorithm is presented in Section 3.2.
16

In addition, it was necessary to implement the concepts and the algorithm presented
computationally. The implementation was done using the Haskell programming language,
and it will be explained in the Section 4.1.

The algorithm of the procedure to produce the Hilbert Calculus associated with the
informed set of 2-valued operations was distributed as a API RESTful, which can be ac-
cessed on http://logicapi.lolita.dimap.ufrn.br/, and described in details in Section
4.2.

In addition, a Website was made, to be used freely by the community, which will
receive the user inputs, consume the API, and inform the result of the cited procedure,
based on the inputs that the user provided, which can be accessed on http://logicapps.
lolita.dimap.ufrn.br/, and described in details in Section 4.3.
17

2 Theoretical Framework

The purpose of this work is to exhibit an algorithm for the extraction the Hilbert
calculi associated to fragments of classical logic. Some topics treated here require a theor-
etical background and are thus explored in this section: Clones, Post’s Lattice, Classical
logic and its fragments, Hilbert calculus.

2.1 Clones

Let A be a non-empty set. An operation on A is a function f : Ak → A, for some


k ∈ ω. It is said that k is the arity of f , or equivalently, that f is a k-ary function. A
k-ary function f is monotonic when for any x, y ∈ Ak , if x ≥ y then f (x) ≥ f (y).

A clone C on a set A is a set closed by projections and composition. Formally, C is a


set of operations on A such that:

1. C contains all the projections πin , for all n ∈ ω and 1 ≤ i ≤ n ;

2. If f is a k-ary operation in C and g1 , . . . , gk are m-ary operations in C, then, for all


x ∈ Am , (f ◦(g1 , . . . , gk ))(x) = f (g1 (x), . . . , gk (x)) is in C (generalized composition).

Given a set F of operations on A, we call CloA (F) the clone generated by F . If


n (F) is the set of all operations
F is a set of operations on a set A and n ∈ ω, then CloA
of arity n on CloA (F ). A set F of operations on A is functionally complete if the
CloA (F ) contains all n-ary functions, for n ≥ 1. As an example, we have the set of boolean
operations {∧, ¬} (Table 5 and Table 1, respectively). Given F � ⊇ F, if CloA (F � ) ⊇
CloA (F ) then CloA (F � ) is called an expansion of CloA (F). A monotonic expansion
is when F � contains only monotonic functions.
18

2.2 Post’s Lattice

The set of all clones on a set A, ordered by the inclusion relation, defines a lattice.
When |A| > 2, the cardinality of this set is equal to that of the continuum. However, for
|A| = 2, Emil Post (POST, 1941) showed that the number of clones on {0, 1} is denumerable
and, even more, that each such clone is generated by a finite set of operations on A. In
this case, the corresponding lattice is called Post’s Lattice (Figure 1).

Figure 1: Post’s Lattice


19

2.3 Classical Logic

It is possible to establish a relationship between clones over {0, 1} and fragments of


classical logic using the bivaluations induced by these clones and the consequence relations
induced by those bivaluations. This requires the concept of languages. So consider a set
of function symbols Σ = {f1 , . . . , fn }, and let P = {x1 , x2 , . . .} be a set of variables.
We call LΣ (P ) the language generated by P on Σ, where LΣ (P ) is the carrier of
the absolutely free Σ-algebra generated over a given set of setential variables P . The
elements of LΣ (P ) are called formulas. A substitution is a mapping σ : P → LΣ (P ),
unique extendable into an endomorphism ·σ : LΣ (P ) → LΣ (P ). Given Γ ⊆ LΣ (P ), we
denote by Γ σ the set {γ σ : γ ∈ Γ}. If F = {fi | 1 ≤ i ≤ n} is a set of operations
on {0, 1}, such that fi is an interpretation for fi , where an interpretation consists of
assigning truth values to the variables and defining how truth values are combined by
the connectives, this is usually given through truth tables, then a valuation under F
is a total function v : LΣ (P ) → {0, 1} such that, for each fi ∈ Σ, if fi has arity k:
v(fi (φ1 , . . . , φk )) = fi (v(φ1 ), . . . , v(φk )), that is, valuations are homomorphisms from the
language to the two-element boolean algebra.

A matrix M over a signature Σ is a structure �V, D, #M � where V is a set (of truth-


values), D ⊆ V is the set of designated values and, for each connective #, #M gives
its interpretation. The set F induces a consequence relation �F such that, for {A} ∪
Γ ⊆ LΣ (P ): Γ �F A if, and only if v(Γ) ⊆ {1} implies v(A) = 1, for all valuations v
under F. The Classical Logic, defined from the universal-algebraic perspective, up to
an isomorphism, is �Σ, �F � induced by a functionally complete set F. As examples we
have: �∧,∨,¬ ; �∧,¬ ; �↓ , where ↓ is the joint denial. A fragment of Classical Logic is
any logic �Σ, �F � � such that Clo{0,1} (F � ) ⊆ Clo{0,1} (F), where F is functionally complete.
As examples we have: �∧,¬ ; �∨ ; ��,⊥ .

2.4 Hilbert Calculus

From the results obtained by Emil Post (POST, 1941), mentioned above, we have
that all fragments of Classical Logic are organized into a lattice ordered by inclusion,
which gives a basis to several studies on the characteristics and interrelationships of these
fragments. One such study was carried out by Wolfgang Rautenberg (RAUTENBERG,
1981), who showed that every fragment of Classical Logic is strongly finitely axiomatizable.
In order to understand this result, some definitions concerning Hilbert calculi are needed.
20

A Hilbert calculus H on a signature Σ is a pair H = �Σ, R�, where R ⊆ 2LΣ × LΣ


is a set of so-called inference rules. For a rule �Γ, ϕ� ∈ R, Γ is called the rule’s set of
premises, whereas ϕ is called the rule’s conclusion. A schematic rule is an infinite set of
rules, such that, for a rule �Γ, ϕ�, the schematic rule has all the rules �Γ σ , ϕ σ � for every
substitution σ : P → LΣ (P ).

A subset Y of a set of inference rules is said to be independent if some well-formed


formula in Y cannot be proved by the inference rules of the set of these non-Y inference
rules (MENDELSON, 2015). To say that a set of inference rules R is soundness with
respect to truth-tables it will suffice to show that, for every �Γ, ϕ� ∈ R, if every row of
the truth-table that makes all γ ∈ Γ true, also makes ϕ true.

The logic induced by a Hilbert calculus H = �Σ, R�, LH = �Σ, �H � is such that, for
each Γ ⊆ LΣ (P ), Γ �H is the least set that contains Γ and is closed under all apliciations
of instaces of the instance rules in R, that is, if �Δ, ϕ� ∈ R and σ : P → LΣ (P ) is such
that Δσ ⊆ Γ �H then ϕ σ ∈ Γ �H . Strongly axiomatizing a logic L = �Σ, �L � means
finding a Hilbert calculus H such that �L = �H .

The result by Rautenberg means that, for each fragment L of Classical Logic, there is
a Hilbert calculus H such that �L = �H and the set of schematic rules of H is finite. An
example is the clone-induced logic generated by the singleton {∨}, which is axiomatized
by the following schematic rules: �{P }, P ∨ Q�, �{P ∨ P }, P �, �{P ∨ Q}, Q ∨ P �, �{P ∨
(Q ∨ R)}, (P ∨ Q) ∨ R�, where P, Q, R ∈ L∨ . In order to make rules easier to view, they
will be shown as follows:

P P ∨P P ∨Q P ∨ (Q ∨ R)
P ∨Q P Q∨P (P ∨ Q) ∨ R
21

3 Algorithm for extraction of a


Hilbert calculus

The first step of the extraction of Hilbert calculus from a set of boolean functions is,
given the set F of functions on {0, 1}, find to which clone in Post’s Lattice the Clo {0,1} (F )
corresponds. This problem is the Post’s Lattice Localization Problem (PLLP). After find-
ing it, we use the Rautenberg algorithm to return the corresponding Hilbert calculus.

3.1 Post’s Lattice Localization Problem

The Post’s Lattice Localization Problem (PLLP) may be thus described: given a finite
set F of operations on the set {0, 1}, to find, in the Post’s lattice P = �B ∗ , ⊆�, the B ∈ B ∗
such that Clo{0,1} (F ) = B. The proposed solution is based on the fact that the lattice has
finite and infinite sections, thus consisting of the following steps:

1. Check if Clo{0,1} (F ) = B for some B ∈ B ∗ of the finite sections, that is, for some
green clone B on Figure 2, in any order. If so, return such B.

2. Otherwise, check, in the infinite sections, from top to bottom, if B ⊆ Clo {0,1} (F )
for some B ∈ B ∗ , that is, the red clones on Figure 2. If so, return B.

Note that the main condition involved in both steps listed above refers to whether
one clone is contained in another, given the knowledge of its basic sets of operations. A
stronger condition, clone equality, gives rise to the problem known in the literature as
the Term Equivalence Problem (TEP) (BERGMAN; JUEDES, 2001). By the definition of
clone generated by a set of operations, we have that, for finite sets of operations F 1 and
F2 on {0, 1}, if F1 ⊆ Clo{0,1} (F2 ), then Clo{0,1} (F1 ) ⊆ Clo{0,1} (F2 ). Thereby, the TEP
translates into the following question: given the finite sets F1 e F2 of operations on {0, 1},
is it the case that F2 ⊆ Clo{0,1} (F1 ) and F1 ⊆ Clo{0,1} (F2 )?
22

Figure 2: PLLP Algorithm

To answer that, the conditions involved may be further simplified by reducing TEP to
the Clone Membership Problem (CMP): given a finite set F of operations on {0, 1} and
a operation g : {0, 1}k → {0, 1}, k ∈ ω + , verify if g ∈ Clo{0,1} (F). The solution to CMP
{0,1}
uses two theoretical results. The first says that Clon (F) is the smallest set of operations
on {0, 1} such that contains the n-ary projections and is closed by compositions on the
set F, which characterizes a finite specification since F is finite. The second result is an
{0,1}
application of the Kleene fixed-point theorem, and ensures that Clo n (F), because it
is characterized by a finite specification, can be generated in finite time, starting with
the set of n-ary projections and applying the compositions with the functions on F. The
algorithm presented in Algorithm 1 is based directly on this idea to solve the CMP.
23

Algorithm 1 CMP Algorithm


Require: A set F of operations on {0, 1}, and a k-ary operation g : {0, 1}k → {0, 1}.
Ensure: Answer if g ∈ Clo{0,1} (F)
C 0 ⇐ {πik |1 ≤ i ≤ k}
i⇐0
repeat
if g ∈ C i then
return true
end if
i⇐i+1
C i ⇐ C i−1
for f ∈ F do
for g ∈ {�g1 , . . . , garity(f ) �|gj ∈ C i−1 } do
C i ⇐ C i ∪ {f ◦ g}
end for
end for
until C i ⊆ C i−1
return false

As shown, the resolution of the CMP implies the resolution of the PLLP according to
the presented method and, therefore, it was implemented in Appendix A.

3.2 Rautenberg Algorithm

The algorithm is presented recursively, in which the base cases are the green (trivial
cases) and yellow (main cases) painted cases in Figure 3, and the recursive part consists
in the blue cases. Vitor Greati, in (GREATI, 2019), prove that, for each Hilbert calculus
H presented in the Section 3.2.1 and 3.2.2, �L = �H , for the corresponding clone L.
Rautenberg (RAUTENBERG, 1981) prove that, for each Hilbert calculus H presented in
the Section 3.2.3, �L = �H , for the corresponding clone L.
24

Figure 3: Rautenberg Algorithm

3.2.1 Trivial cases

Listed below are the Hilbert calculi associated with the cases considered trivial by
Rautenberg, because the corresponding clones are characterized by low arity connectives
and little interaction, so the Hilbert calculi that axiomatize these clones have few rules.
These cases are those related to the clones Ri of Post’s Lattice.
25

3.2.1.1 R1 = Clo{0,1} (∅)

Since this clone is generated by ∅, then it has only projections, so, given that com-
position of projections are projections, and all the projections are in the clone, so it has
no axiomatic rules.

3.2.1.2 R4 = Clo{0,1} ({¬})

This clone is generated by only one unary connective ¬, commonly known as logical
negation. This connective is characterized by the following truth table:

A ¬A
0 1
1 0

Table 1: Truth Table of ¬

The following are the inference rules that axiomatize this clone. They are presented
in (MARCELINO; CALEIRO; MARCOS, 2018).

P ¬(¬P ) P ¬P (R4 )
(R41 ) (R42 ) 3
¬(¬P ) P Q

3.2.1.3 R6 = Clo{0,1} ({1})

This clone is generated by only one nullary connective 1, commonly known as logical
truth. This connective is characterized by the following truth table:

1
1

Table 2: Truth Table of 1

The following is the inference rule that axiomatize this clone. It is presented in
(RAUTENBERG, 1981).

(R61 )
1
26

3.2.1.4 R8 = Clo{0,1} ({0})

This clone is generated by only one nullary connective 0, commonly known as logical
falsity. This connective is characterized by the following truth table:

0
0

Table 3: Truth Table of 0

The following is the inference rule that axiomatize this clone. It is presented in
(RAUTENBERG, 1981).
0 (R8 )
1
P

3.2.1.5 R11 = Clo{0,1} ({0, 1})

This clone is generated by two nullary connective: 0 and 1. These connectives are
characterized by the truth tables in Table 3 and Table 2, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.1.3 and 3.2.1.4.
0 (R8 ) (R61 )
1
P 1

3.2.1.6 R13 = Clo{0,1} ({¬, 0})

This clone is generated by the connectives: ¬ and 0. These connectives are character-
ized by the truth tables in Table 1 and Table 3, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.1.2 plus an interaction rule between the connectives.

P ¬(¬P ) P ¬P (R4 )
(R41 ) (R42 ) 3 (R131 )
¬(¬P ) P Q ¬0

So far, we have the axiomatizations of the following clones:


27

3.2.2 Main cases

Listed below are the Hilbert calculi associated with the cases considered the main ones
by Rautenberg, because the clones that expand the clones of these cases, use, according
to Rautenberg, the Hilbert calculi of these clones to generate their own Hilbert calculi.
These cases are those related to the clones Si , Pi , Aj , Cj , Lk , Dl and Fn∞ of Post’s Lattice.

3.2.2.1 S2 = Clo{0,1} ({∨})

This clone is generated by only one binary connective ∨, commonly known as logical
disjunction. This connective is characterized by the following truth table:
28

A B A∨B
0 0 0
0 1 0
1 0 0
1 1 1

Table 4: Truth Table of ∨

The following are the inferences rule that axiomatize this clone. They are presented
in (RAUTENBERG, 1981).

P (S2 ) P ∨ P (S2 ) P ∨Q P ∨ (Q ∨ R)
1 2 (S23 ) (S24 )
P ∨Q P Q∨P (P ∨ Q) ∨ R

3.2.2.2 S4 = Clo{0,1} ({∨, 1})

This clone is generated by the connectives ∨ and 1. These connectives are character-
ized by the truth tables in Table 4 and Table 2, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.1 and 3.2.1.3.

P (S2 ) P ∨ P (S2 ) P ∨Q P ∨ (Q ∨ R)
1 2 (S23 ) (S24 ) (R61 )
P ∨Q P Q∨P (P ∨ Q) ∨ R 1

3.2.2.3 S5 = Clo{0,1} ({∨, 0})

This clone is generated by the connectives ∨ and 0. These connectives are character-
ized by the truth tables in Table 4 and Table 3, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.1 plus an interaction rule between the connectives,
presented in (RAUTENBERG, 1981).

P (S2 ) P ∨ P (S2 ) P ∨Q P ∨ (Q ∨ R) P ∨ 0 (S5 )


1 2 (S23 ) (S24 ) 1
P ∨Q P Q∨P (P ∨ Q) ∨ R P

3.2.2.4 S6 = Clo{0,1} ({∨, 0, 1})

This clone is generated by the connectives ∨, 0 and 1. These connectives are charac-
terized by the truth tables in Table 4, Table 3 and Table 2 respectively.
29

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.3 and 3.2.1.3.

P (S2 ) P ∨ P (S2 ) P ∨ Q (S2 ) P ∨ (Q ∨ R) (S2 ) P ∨ 0 (S5 ) (R61 )


1 2 3 4 1
P ∨Q P Q∨P (P ∨ Q) ∨ R P 1

So far, we have the axiomatizations of the following clones:

3.2.2.5 P2 = Clo{0,1} ({∧})

This clone is generated by only one binary connective ∧, commonly known as logical
conjunction. This connective is characterized by the following truth table:
30

A B A∧B
0 0 0
0 1 1
1 0 1
1 1 1

Table 5: Truth Table of ∧

The following are the inferences rule that axiomatize this clone. They are presented
in (RAUTENBERG, 1981).

P Q P ∧Q P ∧Q
(P21 ) (P22 ) (P23 )
P ∧Q P Q

3.2.2.6 P4 = Clo{0,1} ({∧, 0})

This clone is generated by the connectives ∧ and 0. These connectives are character-
ized by the truth tables in Table 5 and Table 3, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.5 and 3.2.1.4.
P Q P ∧Q P ∧Q 0 (R8 )
(P21 ) (P22 ) (P23 ) 1
P ∧Q P Q P

3.2.2.7 P5 = Clo{0,1} ({∧, 1})

This clone is generated by the connectives ∧ and 1. These connectives are character-
ized by the truth tables in Table 5 and Table 2, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.5 and 3.2.1.3.
P Q P ∧Q P ∧Q
(P21 ) (P22 ) (P23 ) (R61 )
P ∧Q P Q 1

3.2.2.8 P6 = Clo{0,1} ({∧, 0, 1})

This clone is generated by the connectives ∧, 0 and 1. These connectives are charac-
terized by the truth tables in Table 5, Table 3 and Table 2, respectively.
31

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.6 and 3.2.1.3.
P Q P ∧Q P ∧Q 0 (R8 )
(P21 ) (P22 ) (P23 ) 1 (R61 )
P ∧Q P Q P 1

So far, we have the axiomatizations of the following clones:

3.2.2.9 A4 = Clo{0,1} ({∨, ∧})

This clone is generated by the connectives ∨ and ∧. These connectives are character-
ized by the truth tables in Table 4 and Table 5, respectively.
32

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.1 and some interaction rules between the connectives,
presented in (RAUTENBERG, 1981).

P (S2 ) P ∨ P (S2 ) Q∨P (P ∨ Q) ∨ R


1 2 (S23 ) (S24 )
P ∨Q P P ∨Q P ∨ (Q ∨ R)
S ∨ A S ∨ B (A4 ) S ∨ (A ∧ B) S ∨ (A ∧ B)
0 (A41 ) (A41 )
S ∨ (A ∧ B) S∨A S∨B

3.2.2.10 A3 = Clo{0,1} ({∨, ∧, 0})

This clone is generated by the connectives ∨, ∧ and 0. These connectives are charac-
terized by the truth tables in Table 4, Table 5 and Table 3, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.9 and an interaction rule between the connectives,
presented in (RAUTENBERG, 1981).

P (S2 ) P ∨ P (S2 ) Q∨P (P ∨ Q) ∨ R


1 2 (S23 ) (S24 )
P ∨Q P P ∨Q P ∨ (Q ∨ R)
S ∨ A S ∨ B (A4 ) S ∨ (A ∧ B) S ∨ (A ∧ B) P (A3 )
1 (A42 ) (A43 ) 1
S ∨ (A ∧ B) S∨A S∨B P ∨0

3.2.2.11 A2 = Clo{0,1} ({∨, ∧, 1})

This clone is generated by the connectives ∨, ∧ and 1. These connectives are charac-
terized by the truth tables in Table 4, Table 5 and Table 2, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.9 and Section 3.2.1.3.

P (S2 ) P ∨ P (S2 ) Q∨P (P ∨ Q) ∨ R


1 2 (S23 ) (S24 )
P ∨Q P P ∨Q P ∨ (Q ∨ R)
S ∨ A S ∨ B (A4 ) S ∨ (A ∧ B) S ∨ (A ∧ B)
1 (A42 ) (A43 ) (R61 )
S ∨ (A ∧ B) S∨A S∨B 1

3.2.2.12 A1 = Clo{0,1} ({∨, ∧, 0, 1})

This clone is generated by the connectives ∨, ∧, 0 and 1. These connectives are char-
acterized by the truth tables in Table 4, Table 5, Table 3 and Table 2, respectively.
33

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.10 and Section 3.2.1.3.

P (S2 ) P ∨ P (S2 ) Q∨P (P ∨ Q) ∨ R


1 2 (S23 ) (S24 )
P ∨Q P P ∨Q P ∨ (Q ∨ R)
S ∨ A S ∨ B (A4 ) S ∨ (A ∧ B) S ∨ (A ∧ B) P (A3 )
1 (A42 ) (A43 ) 1 (R61 )
S ∨ (A ∧ B) S∨A S∨B P ∨0 1

So far, we have the axiomatizations of the following clones:


34

3.2.2.13 L4 = Clo{0,1} ({↔3 })

This clone is generated by only one ternary connective ↔3 , which is defined as ↔3


(x, y, z) = x ↔ (y ↔ z), in which ↔ is commonly known as logical biconditional. This
connective is characterized by the following truth table:

A B C ↔3 (A, B, C)
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1

Table 6: Truth Table of ↔3

The following are the inferences rule that axiomatize this clone. They are presented
in (RAUTENBERG, 1981).

P Q R ↔3 (P, Q, R) ↔3 (P, Q, R)
(L41 ) (L42 ) (L43 )
↔3 (P, Q, R) ↔3 (Q, P, R) ↔3 (P, R, Q)
P ↔3 (P, Q, Q) ↔3 (P, Q, ↔3 (R, S, T ))
(L44 ) (L45 ) (L46 )
↔3 (P, Q, Q) P ↔3 (↔3 (P, Q, R), S, T )

3.2.2.14 L2 = Clo{0,1} ({↔3 , 1})

This clone is generated by the connectives ↔3 and 1. These connectives are charac-
terized by the truth tables in Table 6 and Table 2, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.13 and 3.2.1.3.
P Q R ↔3 (P, Q, R) ↔3 (P, Q, R)
(L41 ) (L42 ) (L43 ) (R61 )
↔3 (P, Q, R) ↔3 (Q, P, R) ↔3 (P, R, Q) 1
P ↔3 (P, Q, Q) ↔3 (P, Q, ↔3 (R, S, T ))
(L44 ) (L45 ) (L46 )
↔3 (P, Q, Q) P ↔3 (↔3 (P, Q, R), S, T )
35

3.2.2.15 L3 = Clo{0,1} ({↔3 , 0})

This clone is generated by the connectives ↔3 and 0. These connectives are charac-
terized by the truth tables in Table 6 and Table 3, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.13 and 3.2.1.4.
P Q R ↔3 (P, Q, R) ↔3 (P, Q, R) 0 (R8 )
(L41 ) (L42 ) (L43 ) 1
↔3 (P, Q, R) ↔3 (Q, P, R) ↔3 (P, R, Q) P
P ↔3 (P, Q, Q) ↔3 (P, Q, ↔3 (R, S, T ))
(L44 ) (L45 ) (L46 )
↔3 (P, Q, Q) P ↔3 (↔3 (P, Q, R), S, T )

3.2.2.16 L1 = Clo{0,1} ({↔3 , 0, 1})

This clone is generated by the connectives ↔3 , 0 and 1. These connectives are char-
acterized by the truth tables in Table 6, Table 3 and Table 2, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.15 and 3.2.1.3.
P Q R ↔3 (P, Q, R) ↔3 (P, Q, R) 0 (R8 )
(L41 ) (L42 ) (L43 ) 1
↔3 (P, Q, R) ↔3 (Q, P, R) ↔3 (P, R, Q) P
P ↔3 (P, Q, Q) ↔3 (P, Q, ↔3 (R, S, T ))
(L44 ) (L45 ) (L46 ) (R61 )
↔3 (P, Q, Q) P ↔3 (↔3 (P, Q, R), S, T ) 1

3.2.2.17 L5 = Clo{0,1} ({↔3 , ¬})

This clone is generated by the connectives ↔3 and ¬. These connectives are charac-
terized by the truth tables in Table 6 and Table 1, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.13 and 3.2.1.2, adding some interaction rules between
the connectives, presented in (RAUTENBERG, 1981).
36

P Q R ↔3 (P, Q, R) ↔3 (P, Q, R)
(L41 ) (L42 ) (L43 )
↔3 (P, Q, R) ↔3 (Q, P, R) ↔3 (P, R, Q)
P ↔3 (P, Q, Q) ↔3 (P, Q, ↔3 (R, S, T ))
(L44 ) (L45 ) (L46 )
↔3 (P, Q, Q) P ↔3 (↔3 (P, Q, R), S, T )
P ¬(¬P ) P ¬(P )
(R41 ) (R42 ) (R43 )
¬(¬P ) P Q
↔3 (¬(P ), Q, R) ¬(↔3 (P, Q, R))
(L51 ) (L52 )
¬(↔3 (P, Q, R)) ↔3 (¬(P ), Q, R)

So far, we have the axiomatizations of the following clones:


37

3.2.2.18 D2 = Clo{0,1} ({d})

This clone is generated by only one ternary connective d, which is defined as


d(x, y, z) = (x ∧ y) ∨ ((x ∧ z) ∨ (y ∧ z)). This connective is characterized by the follow-
ing truth table:

A B C d(A, B, C)
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

Table 7: Truth Table of d

The following are the inferences rule that axiomatize this clone. They are presented
in (RAUTENBERG, 1981).

P Q d(Q, P, P ) P
(D21 ) (D22 ) (D23 )
d(P, Q, R) P d(Q, P, P )
d(S, T, d(P, Q, R)) d(A, B, d(P, Q, d(R, S, T )))
(D24 ) (D25 )
d(T, S, d(Q, P, R)) d(A, B, d(d(P, Q, R), d(P, Q, S), T ))
d(S, T, d(P, Q, R)) d(A, B, d(d(P, Q, R), d(P, Q, S), T ))
(D26 ) (D27 )
d(T, S, d(P, R, Q)) d(A, B, d(P, Q, d(R, S, T )))

3.2.2.19 D3 = Clo{0,1} ({d, ¬})

This clone is generated by the connectives d and ¬. These connectives are character-
ized by the truth tables in Table 7 and Table 1, respectively.

The following are the inference rules that axiomatize this clone. They are the union of
rules showed in the Section 3.2.2.18 and some interaction rules between the connectives,
presented in (RAUTENBERG, 1981).

P Q d(Q, P, P ) P
(D21 ) (D22 ) (D23 )
d(P, Q, R) P d(Q, P, P )
38
d(S, T, d(P, Q, R)) d(A, B, d(P, Q, d(R, S, T )))
(D24 ) (D25 )
d(T, S, d(Q, P, R)) d(A, B, d(d(P, Q, R), d(P, Q, S), T ))
d(S, T, d(P, Q, R)) d(A, B, d(d(P, Q, R), d(P, Q, S), T ))
(D26 ) (D27 )
d(T, S, d(P, R, Q)) d(A, B, d(P, Q, d(R, S, T )))
d(R, S, d(Q, P, ¬(P ))) d(R, S, Q)
(D31 ) (D32 )
d(R, S, Q) d(R, S, d(Q, P, ¬(P )))

3.2.2.20 D1 = Clo{0,1} ({d, ↔3 })

This clone is generated by the connectives d and ↔3 . These connectives are charac-
terized by the truth tables in Table 7 and Table 6, respectively.

The inference rules that axiomatize this clone are the union of rules showed in the Sec-
tion 3.2.2.18 and 3.2.2.13, adding the following interaction rules between the connectives,
presented by me and Vitor Greati in (GREATI, 2019).

d(A, B, ↔3 (C, D, E))


(D11 )
↔3 (d(A, B, C), d(A, B, D), d(A, B, E))
↔3 (d(A, B, C), d(A, B, D), d(A, B, E))
(D12 )
d(A, B, ↔3 (C, D, E))
↔3 (A, B, d(C, D, E))
(D13 )
d(↔3 (A, B, C), ↔3 (A, B, D), ↔3 (A, B, E))
d(↔3 (A, B, C), ↔3 (A, B, D), ↔3 (A, B, E))
(D14 )
↔3 (A, B, d(C, D, E))
↔3 (F, G, d(A, B, ↔3 (C, D, E)))
(D15 )
↔3 (F, G, ↔3 (d(A, B, C), d(A, B, D), d(A, B, E)))
↔3 (F, G, ↔3 (d(A, B, C), d(A, B, D), d(A, B, E)))
(D16 )
↔3 (F, G, d(A, B, ↔3 (C, D, E)))
d(F, G, ↔3 (A, B, d(C, D, E)))
(D17 )
d(F, G, d(↔3 (A, B, C), ↔3 (A, B, D), ↔3 (A, B, E)))
d(F, G, d(↔3 (A, B, C), ↔3 (A, B, D), ↔3 (A, B, E)))
(D18 )
d(F, G, ↔3 (A, B, d(C, D, E)))

So far, we have the axiomatizations of the following clones:


39

3.2.2.21 F6∞ = Clo{0,1} ({ka})

This clone is generated by only one ternary connective ka, which is defined as
ka(x, y, z) = x ∧ (y ∨ z). This connective is characterized by the following truth table:
40

A B C ka(A, B, C)
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

Table 8: Truth Table of ka

The following are the inferences rule that axiomatize this clone. They are presented
in (RAUTENBERG, 1981).

A P (F6 ) ka(A, P, ka(A, Q, R)) ka(A, P, Q)


1 (F62 ) (F63 )
ka(A, P, Q) ka(A, ka(A, P, Q), R)) ka(A, Q, P )
ka(A, P, P ) ka(B, R, ka(A, P, Q)) ka(B, R, ka(A, P, Q))
(F64 ) (F65 ) (F66 )
P ka(B, R, A)) ka(B, R, ka(B, P, Q)))
ka(B, R, A) ka(B, R, ka(B, P, Q))
(F67 )
ka(B, R, ka(A, P, Q))

3.2.2.22 F7∞ = Clo{0,1} ({ka, 0})

This clone is generated by the connectives ka and 0. These connectives are character-
ized by the truth tables in Table 8 and Table 3, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.21 and an interaction rule between the connectives,
presented in (RAUTENBERG, 1981).

A P (F6 ) ka(A, P, ka(A, Q, R)) ka(A, P, Q)


1 (F62 ) (F63 )
ka(A, P, Q) ka(A, ka(A, P, Q), R)) ka(A, Q, P )
ka(A, P, P ) ka(B, R, ka(A, P, Q)) ka(B, R, ka(A, P, Q))
(F64 ) (F65 ) (F66 )
P ka(B, R, A)) ka(B, R, ka(B, P, Q)))
ka(B, R, A) ka(B, R, ka(B, P, Q)) ka(A, P, 0)
(F67 ) (F71 )
ka(B, R, ka(A, P, Q)) ka(A, P, Q)
41

3.2.2.23 F5∞ = Clo{0,1} ({ki})

This clone is generated by only one ternary connective ki, which is defined as
ki(x, y, z) = x ∧ (y → z), in which → is commonly known as logical conditional. This
connective is characterized by the following truth table:

A B C ki(A, B, C)
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1

Table 9: Truth Table of ki

The following are the inferences rule that axiomatize this clone. They are presented
in (RAUTENBERG, 1981).

P ki(A, P, Q) ki(A, ki(P, P, Q), R) A


(F51 ) (F52 ) (F53 )
Q ki(A, P, ki(A, Q, R)) ki(A, P, ki(A, Q, P )))
ki(A, P, ki(A, Q, R)) ki(B, R, ki(A, P, Q)) ki(B, R, ki(A, P, Q))
(F54 ) (F55 ) (F56 )
ki(A, ki(P, P, Q), R) ki(B, R, A) ki(B, R, ki(B, P, Q))
ki(B, R, A) ki(B, R, ki(B, P, Q)) ki(B, T, A)
(F57 ) (F58 )
ki(B, R, ki(A, P, Q)) ki(B, T, ki(A, ki(A, ki(A, P, Q), P ), P )
ki(B, T, A)
(F59 )
ki(B, T, ki(A, ki(A, P, ki(A, Q, R)), ki(A, P, R)))

3.2.2.24 F8∞ = Clo{0,1} ({ki, 0})

This clone is generated by the connectives ki and 0. These connectives are character-
ized by the truth tables in Table 9 and Table 3, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.23 and an interaction rule between the connectives,
42

presented in (RAUTENBERG, 1981).

P ki(A, P, Q) ki(A, ki(P, P, Q), R) A


(F51 ) (F52 ) (F53 )
Q ki(A, P, ki(A, Q, R)) ki(A, P, ki(A, Q, P )))
ki(A, P, ki(A, Q, R)) ki(B, R, ki(A, P, Q)) ki(B, R, ki(A, P, Q))
(F54 ) (F55 ) (F56 )
ki(A, ki(P, P, Q), R) ki(B, R, A) ki(B, R, ki(B, P, Q))
ki(B, R, A) ki(B, R, ki(B, P, Q)) ki(B, T, A)
(F57 ) (F58 )
ki(B, R, ki(A, P, Q)) ki(B, T, ki(A, ki(A, ki(A, P, Q), P ), P )
ki(B, T, A) ki(A, P, 0)
(F59 ) (F81 )
ki(B, T, ki(A, ki(A, P, ki(A, Q, R)), ki(A, P, R))) ki(A, P, Q)

3.2.2.25 F2∞ = Clo{0,1} ({ak})

This clone is generated by only one ternary connective ak, which is defined as
ak(x, y, z) = x ∨ (y ∧ z). This connective is characterized by the following truth table:

A B C ak(A, B, C)
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1

Table 10: Truth Table of ak

The following are the inferences rule that axiomatize this clone. They are presented
in (RAUTENBERG, 1981).

ak(P, P, P ) ak(ak(R, P, Q), S, S) ak(Q, P, P )


(F21 ) (F22 ) (F23 )
P ak(ak(R, P, P ), S, S) ak(P, Q, Q)
P ak(ak(R, P, Q), S, S) ak(ak(R, Q, Q), P, P )
(F24 ) (F25 ) (F26 )
ak(Q, P, P ) ak(ak(R, Q, Q), S, S) ak(R, ak(Q, P, P ), ak(Q, P, P ))
ak(ak(R, P, P ), S, S) ak(ak(R, Q, Q), S, S)
(F27 )
ak(ak(R, P, Q), S, S)
43

3.2.2.26 F3∞ = Clo{0,1} ({ak, 1})

This clone is generated by the connectives ak and 1. These connectives are charac-
terized by the truth tables in Table 10 and Table 2, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.25 and 3.2.1.3.
ak(P, P, P ) ak(ak(R, P, Q), S, S) ak(Q, P, P )
(F21 ) (F22 ) (F23 )
P ak(ak(R, P, P ), S, S) ak(P, Q, Q)
P ak(ak(R, P, Q), S, S) ak(ak(R, Q, Q), P, P )
(F24 ) (F25 ) (F26 )
ak(Q, P, P ) ak(ak(R, Q, Q), S, S) ak(R, ak(Q, P, P ), ak(Q, P, P ))
ak(ak(R, P, P ), S, S) ak(ak(R, Q, Q), S, S)
(F27 ) (R61 )
ak(ak(R, P, Q), S, S) 1

3.2.2.27 F1∞ = Clo{0,1} ({ad})

This clone is generated by only one ternary connective ad, which is defined as
ad(x, y, z) = x ∨ (y ∧ ¬z). This connective is characterized by the following truth table:

A B C ad(A, B, C)
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1

Table 11: Truth Table of ad

The following are the inferences rule that axiomatize this clone. They are presented
44

in (RAUTENBERG, 1981).

Q ad(Q, A, P ) ad(S, Q, S)
(F11 ) (F12 ) (F13 )
ad(Q, A, P ) ad(A, Q, A) ad(S, ad(Q, A, P ), S)
ad(P, P, P ) P ad(Q, A, P ) ad(P, B, R) ad(Q, A, P )
(F14 ) (F15 ) (F16 )
P Q ad(Q, B, R)
ad(P, Q, P ) A ad(S, ad(Q, A, P ), S)
(F17 ) (F18 ) (F19 )
ad(Q, P, Q) ad(ad(P, A, Q), A, P ) ad(S, ad(A, Q, A), S)
ad(S, A, S) ad(P, ad(Q, R, Q), P )
(F110 ) (F111 )
ad(S, ad(ad(P, A, Q), A, P ), S) ad(ad(P, Q, P ), R, ad(P, Q, P ))
ad(S, P, S), ad(S, ad(Q, A, P ), S)
(F112 )
ad(S, Q, S)
ad(A, B, T )
(F113 )
ad(ad(P, A, ad(P, A, ad(Q, A, P ))), B, T )
ad(A, B, T )
(F114 )
ad(ad(ad(R, A, P ), A, ad(ad(R, A, Q), A, P )), B, T )
ad(ad(Q, R, Q), A, P )
(F115 )
ad(ad(Q, A, P ), ad(R, A, P ), ad(Q, A, P ))
ad(ad(Q, A, P ), ad(R, A, P ), ad(Q, A, P ))
(F116 )
ad(ad(Q, R, Q), A, P )
ad(ad(R, B, Q), A, P )
(F117 )
ad(ad(R, A, P ), ad(R, B, Q), ad(R, A, P ))
ad(ad(R, A, P ), ad(R, B, Q), ad(R, A, P ))
(F118 )
ad(ad(R, B, Q), A, P )
ad(S, ad(P, B, R), S), ad(S, ad(Q, A, P ), S)
(F119 )
ad(S, ad(Q, B, R), S)
ad(S, ad(A, B, T ), S)
(F120 )
ad(S, ad(ad(P, A, ad(P, A, ad(Q, A, P ))), B, T ), S)
ad(S, ad(ad(Q, R, Q), A, P ), S)
(F121 )
ad(S, ad(ad(Q, A, P ), ad(R, A, P ), ad(Q, A, P )), S)
ad(S, ad(ad(Q, A, P ), ad(R, A, P ), ad(Q, A, P )), S)
(F122 )
ad(S, ad(ad(Q, R, Q), A, P ), S)
ad(S, ad(ad(R, B, Q), A, P ), S)
(F123 )
ad(S, ad(ad(R, A, P ), ad(R, P, Q), ad(R, A, Q)), S)
ad(S, ad(ad(R, A, P ), ad(R, P, Q), ad(R, A, Q)), S)
(F124 )
ad(S, ad(ad(R, B, Q), A, P ), S)
ad(S, ad(A, B, T ), S)
(F125 )
ad(S, ad(ad(ad(ad(R, A, P ), A, ad(Q, A, P )), A, ad(ad(R, A, Q), A, P )), B, T ), S)
45

3.2.2.28 F4∞ = Clo{0,1} ({ad, 1})

This clone is generated by the connectives ad and 1. These connectives are charac-
terized by the truth tables in Table 11 and Table 2, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.27 and 3.2.1.3.

So far, we have the axiomatizations of the following clones:


46

3.2.2.29 C4 = Clo{0,1} ({ki, ∨})

This clone is generated by the connectives ki and ∨. These connectives are character-
ized by the truth tables in Table 5 and Table 9, respectively.

The following are the inference rules that axiomatize this clone. They are the union
of rules showed in the Section 3.2.2.23 and an interaction rule between the connectives,
presented in (RAUTENBERG, 1981).

P ki(A, P, Q) ki(A, ki(P, P, Q), R) A


(F51 ) (F52 ) (F53 )
Q ki(A, P, ki(A, Q, R)) ki(A, P, ki(A, Q, P )))
ki(A, P, ki(A, Q, R)) ki(B, R, ki(A, P, Q)) ki(B, R, ki(A, P, Q))
(F54 ) (F55 ) (F56 )
ki(A, ki(P, P, Q), R) ki(B, R, A) ki(B, R, ki(B, P, Q))
ki(B, R, A) ki(B, R, ki(B, P, Q)) ki(B, T, A)
(F57 ) (F58 )
ki(B, R, ki(A, P, Q)) ki(B, T, ki(A, ki(A, ki(A, P, Q), P ), P )
ki(B, T, A)
(F59 )
ki(B, T, ki(A, ki(A, P, ki(A, Q, R)), ki(A, P, R)))
ki(T, S, (A ∨ B))
(C40 )
ki(T, S, ki((A ∨ B), ki((A ∨ B), A, R), ki((A ∨ B), ki((A ∨ B), B, R), R)))
ki(T, S, A) ki(T, S, B)
(C41 ) (C42 )
ki(T, S, (A ∨ B)) ki(T, S, (A ∨ B))

3.2.2.30 C3 = Clo{0,1} ({ki, ∨, 0})

This clone is generated by the connectives ki, ∨ and 0. These connectives are charac-
terized by the truth tables in Table 9, Table 4 and Table 3, respectively.

The Hilbert calculus that axiomatizes this clone contains all the showed in the Section
3.2.2.29, and the following rule:

ki(T, S, 0)
(C30 )
ki(T, S, R)

3.2.2.31 C2 = Clo{0,1} ({ki, ∨, 1})

This clone is generated by the connectives ki, ∨ and 1. These connectives are charac-
terized by the truth tables in Table 9, Table 4 and Table 2, respectively.

The inference rules that axiomatize this clone are the union of rules showed in the
Section 3.2.2.29 and 3.2.1.3.
47

3.2.2.32 C1 = Clo{0,1} ({ki, ∨, 0, 1})

This clone is generated by the connectives ki, ∨, 0 and 1. These connectives are char-
acterized by the truth tables in Table 9, Table 4, Table 3 and Table 2, respectively.

The inference rules that axiomatize this clone are the union of rules showed in the
Section 3.2.2.30 and 3.2.1.3.

So far, we have the axiomatizations of the following clones:


48

3.2.3 Recursive cases

For the other cases, we divide them into four possibilities: (1) the clone is a monotonic
expansion of the S2 , (2) the clone is a expansion of F1∞ or F4∞ , (3) the clone is a expansion
of F5∞ or F8∞ , (4) the clone is a expansion of F6∞ or F7∞

Besides that, we will need the definition of the clones Fim (1 ≤ i ≤ 8)(m ≥ 2). A clone
Fim is the expansion of Fi∞ with the connective dm witch may be described by:
m

dm (x0 , . . . , xm ) = (x0 ∧ · · · ∧ xi−1 ∧ xi+1 ∧ · · · ∧ xm ) (3.1)
i=0

m−1
� m

dm (x0 , . . . , xm ) = (xi ∨ xj ) (3.2)
i=0 j=i+1

This connective is commonly known as threshold function. As an example of threshold


function, we have the connective d3 = ((A∧B∧C)∨(A∧B∧D)∨(A∧C∧D)∨(B∧C∧D)) =
(A ∨ B) ∧ (A ∨ C) ∧ (A ∨ D) ∧ (B ∨ C) ∧ (B ∨ D) ∧ (C ∨ D), and an example of expansion
of F2∞ we have the clone F23 = Clo{0,1} (ak, d3 ).

3.2.3.1 Monotonic expansions of S2

For this case, we will suppose that B = Clo{0,1} (F) for some F, such that F = {∨, #},
for some n-ary monotonic connective #. Given that, every monotonic connective can be
� �
written as #(x1 , . . . , xn ) = C∈C i∈C xi , where C is the set of clauses of #, Rautenberg
(RAUTENBERG, 1981) shows that the Hilbert calculus that axiomatizes this clone contains
the rules of Section 3.2.2.1 and, for m = |C|, and for all 1 ≤ k ≤ m the following rules:
� �
S ∨ ( i∈C1 xi ) . . . S ∨ ( i∈Cm xi ) S ∨ #(x1 , . . . , xn )
(B0 ) � (Bk )
S ∨ #(x1 , . . . , xn ) S ∨ ( i∈Ck xi )

As an example, we have the clone A4 = Clo{0,1} ({∨, ∧}). Given that A ∧ B can be
written as ∧(A, B), such that, C = {{A}, {B}}, therefore the inference rules are the
following:

P (S2 ) P ∨ P (S2 ) Q∨P (P ∨ Q) ∨ R


1 2 (S23 ) (S24 )
P ∨Q P P ∨Q P ∨ (Q ∨ R)
S ∨ A S ∨ B (A4 ) S ∨ (∧(A, B)) S ∨ (∧(A, B))
0 (A41 ) (A41 )
S ∨ (∧(A, B)) S∨A S∨B

Another example, is the clone F2∞ = Clo{0,1} ({ak}). Given that ak(A, B, B) = A ∨ B,
49

and C = {{A, B}, {A, C}}, therefore ak(A, B, C) = ∧(∨(A, B), ∨(A, C)). So, replacing
the ∨ in rules of Section 3.2.2.1 for ak(A, B, B) and adding the rules listed above with
the corresponding C, the rules are exactly the ones listed in Section 3.2.2.25.

Knowing that ak is monotonic and, for all m ≥ 2, dm is a monotonic connective, then


the clones F2m and F3m are axiomatizable using the Hilbert calculus presented above, with
the appropriate C.

3.2.3.2 Expansions of F1∞ or F4∞

First of all, we deal with the normal forms of a m-ary connective dm .

Lemma 3.1 (Normal Form Lemma) Given a m-ary connective dm :

�m
1. dm (x1 , . . . , xm ) = i=0 αi , where αi = (x0 ∧ · · · ∧ xi−1 ∧ xi+1 ∧ · · · ∧ xm ) replacing
all occurrences of A ∧ B for ka(A, B, B). Based on equation 3.1.
�m−1 �m
2. dm (x1 , . . . , xm ) = i=0 j=i+1 ad(xi , xj , xi ). Given that A ∨ B = ad(A, B, A).
Based on equation 3.2.
�m
3. dm (x1 , . . . , xm ) = i=0 γi , where γi = (x0 ∧ · · · ∧ xi−1 ∧ xi+1 ∧ · · · ∧ xm ) replacing all
occurrences of A ∧ B for ki(A, A, B). Based on equation 3.1.

For the clones F1m , we will suppose that B = Clo{0,1} (F) for some F, such that

F = {ad, dm }. By the Normal Form Lemma dm (x1 , . . . , xm ) = C∈C adi∈C xi , where C is
the set of clauses of dm , then Rautenberg (RAUTENBERG, 1981) shows that the Hilbert
calculus that axiomatizes this clone contains all the rules of Section 3.2.2.27 and, for
n = |C|, for all 1 ≤ k ≤ n, where Pk = adi∈Ck xi and Q = dm (x1 , . . . , xm ), the following
rules:
ad(T, S, P1 ) ad(T, S, Q)
(B0 ) (Bk )
ad(T, S, ad(P1 , P2 , ad(P1 , P3 , · · · ad(P1 , Pn , Q) · · · ))) ad(T, S, Pk )

For the clones F4m , we will suppose that B = Clo{0,1} (F) for some F, such that
F = {ad, 1, dm }. The Hilbert calculus that axiomatizes these clones contains all the rules
listed above, and the rule of Section 3.2.1.3.

As an example of expansion of F1∞ , consider the clone F12 = Clo{0,1} ({ad, d2 }), whose
set of clauses of d2 is C = {{A, B}, {A, C}, {B, C}}, therefore

d2 (A, B, C) = ∧(∨(A, B), ∨(A, C), ∨(B, C)) = ∧(ad(A, B, A), ad(A, C, A), ad(B, C, B))
50

So, the inference rules, in this case, are: all the rules of Section 3.2.2.27, plus the following
rules:
ad(T, S, ad(A, B, A))
(F120 )
ad(T, S, ad(ad(A, B, A), ad(A, C, A), ad(ad(A, B, A), ad(B, C, B), d2 (A, B, C))))
ad(T, S, d2 (A, B, C)) ad(T, S, d2 (A, B, C)) ad(T, S, d2 (A, B, C))
(F121 ) (F122 ) (F123 )
ad(T, S, ad(A, B, A)) ad(T, S, ad(A, C, A)) ad(T, S, ad(B, C, B))

3.2.3.3 Expansions of F5∞ or F8∞

For the clones F5m , we will suppose that B = Clo{0,1} (F) for some F, such that

F = {ki, dm }. By the Normal Form Lemma dm (x1 , . . . , xm ) = C∈C kii∈C xi , where C is
the set of clauses of dm , Rautenberg (RAUTENBERG, 1981) shows that the Hilbert calculus
that axiomatizes this clone contains all the rules of Section 3.2.2.23 and, for n = |C|, for
all 1 ≤ k ≤ n, where Pk = kii∈Ck xi and Q = dm (x1 , . . . , xm ), the following rules:

ki(T, S, Q)
(B0 )
ki(T, S, ki(Q, ki(Q, P1 , R), ki(Q, ki(Q, P2 , R), · · · ki(Q, ki(Q, Pn , R), R) · · · )))
ki(T, S, Pk )
(Bk )
ki(T, S, Q)

For the clones F8m , we will suppose that B = Clo{0,1} (F) for some F, such that
F = {ad, 0, dm }. The Hilbert calculus that axiomatizes this clone contains all the rules
listed above, and the following rule:

ki(T, S, 0)
(B0 )
ki(T, S, R)

As an example of expansion of F5∞ , consider the clone F52 = Clo{0,1} ({ki, d2 }), such
that, the set of clauses of d2 is C = {{A, B}, {A, C}, {B, C}}, therefore

d2 (A, B, C) = ∨(∧(A, B), ∧(A, C), ∧(B, C)) = ∨(ki(A, A, B), ki(A, A, C), ki(B, B, C))

Given that, P1 = ki(A, A, B), P2 = ki(A, A, C), P3 = ki(B, B, C) and Q = d2 (A, B, C),
the inference rules are all the rules of Section 3.2.2.23, plus the following rules:

ki(T, S, Q)
(F520 )
ki(T, S, ki(Q, ki(Q, P1 , R), ki(Q, ki(Q, P2 , R), ki(Q, ki(Q, P3 , R), R))))
ki(T, S, ki(A, A, B)) ki(T, S, ki(A, A, C)) ki(T, S, ki(B, B, C))
(F521 ) (F522 ) (F523 )
ki(T, S, d2 (A, B, C)) ki(T, S, d2 (A, B, C)) ki(T, S, d2 (A, B, C))
51

3.2.3.4 Expansions of F6∞ or F7∞

For the clones F6m , we will suppose that B = Clo{0,1} (F) for some F, such that

F = {ka, dm }. By the Normal Form Lemma dm (x1 , . . . , xm ) = C∈C kai∈C xi , where C is
the set of clauses of dm , Rautenberg (RAUTENBERG, 1981) shows that the Hilbert calculus
that axiomatizes this clone contains all the rules of Section 3.2.2.23 and, for n = |C|, for
all 1 ≤ k ≤ n, where Pk = kai∈Ck xi and Q = dm (x1 , . . . , xm ), the following rules:

ka(T, S, Q) ka(T, S, Pk )
(B0 ) (Bk )
ka(T, S, ka(Q, P1 , ka(Q, P2 , · · · ka(Q, Pn−1 , Pn ) · · · ))) ka(T, S, Q)

For the clones F7m , we will suppose that B = Clo{0,1} (F) for some F, such that
F = {ka, 0, dm }. The Hilbert calculus that axiomatizes this clone contains all the rules
listed above, and the following extra rule:

ka(T, S, 0)
(B0 )
ka(T, S, R)

As an example of expansion of F6∞ , we have the clone F62 = Clo{0,1} ({ka, d2 }), such
that, the set of clauses of d2 is C = {{A, B}, {A, C}, {B, C}}, therefore

d2 (A, B, C) = ∨(∧(A, B), ∧(A, C), ∧(B, C)) = ∨(ka(A, B, B), ka(A, C, C), ka(B, C, C))

Given that, P1 = ka(A, B, B), P2 = ka(A, C, C), P3 = ka(B, C, C) and Q = d2 (A, B, C),
the inference rules are all the rules of Section 3.2.2.23, plus the following rules:

ka(T, S, Q)
(B0 )
ka(T, S, ka(Q, P1 , ka(Q, P2 , ka(Q, Pn−1 , Pn ))))
ka(T, S, ka(A, B, B)) ka(T, S, ka(A, C, C)) ka(T, S, ka(B, C, C))
(F521 ) (F522 ) (F523 )
ka(T, S, d2 (A, B, C)) ka(T, S, d2 (A, B, C)) ka(T, S, d2 (A, B, C))

This completes the axiomatization of all fragments of classical logic.


52
53

4 A computational implementation
of extraction of a Hilbert calculus

The algorithm of the procedure to produce the Hilbert Calculus associated with the
informed set of 2-valued operations was implemented using the Haskell programming
language and was distributed as a API RESTful, in addition a website was made, to be
freely used by the community, which will receive the user inputs, consume the API, and
inform the result of the cited procedure, based on the inputs that the user provided.

4.1 Computational Representation

The concepts presented in Chapter 2 implemented using Haskell and the first one is
that of a schematic formula, which could be just a variable A, B, or could be a compound
formula such as A ∧ B, A → B, where ∧ and → are function symbols.

data Formula =
Var String |
Op Symbol [Formula]

The following are examples of schematic formulas, where the connective ∧ and ∨
are represented by the symbols ∗ and +, respectively. The list of all symbols and their
associated connectives are in Appendix C.

-- The schematic formula P


read "P" :: Formula
-- The schematic formula P ∨ Q
read "+(P, +(Q, R))" :: Formula
-- The schematic formula (R ∨ P ) ∧ (R ∨ Q)
read "*(+(R, P), +(R, Q))" :: Formula
54

Another concept is that of a signature, which is a set of function symbols. These


symbols are grouped according to their arity.

type Signature = Map Nat (S.Set Connective)

The following are examples of signatures:

-- The signature Σ = {¬}


read "[(1, ["-"])]" :: Signature
-- The signature Σ = {¬, →, ∨}
read "[(1, ["-"]), (2, ["==>", "+"])]" :: Signature

For each connective we have an interpretation, as explained in Section 2.3, and, for
each interpretation, we have an associated truth table. So, the interpretation in Haskell
is a set of mappings from a function symbol to a truth table.

type TruthTable a = M.Map [a] a


type Interpretation a = M.Map Symbol (TruthTable a)

Below is an example of the usual interpretation of the connective ∧, that can be


checked in Table 5. The list of all truth tables used in this work are in Appendix B, and
the list of all function symbols and their associated interpretations are in Appendix C.

-- Truth Table for ∧


andTruthTable = mkTruthTable [([0, 0], 0),
([0, 1], 1),
([1, 0], 1),
([1, 1], 1)] :: (TruthTable Int)
-- Interpretation for {∧}
andInterpretation = [("*", andTruthTable)]

A matrix M over a signature Σ is a structure �V, D, #M � where V is a set (of truth-


values), D ⊆ V is the set of designated values and, for each connective #, #M gives its
55

interpretation.

-- Set of truth-values V
type V a = S.Set a
-- Set of designated values D
type D a = S.Set a
-- Matrix values
type Values a = (V a, D a)
-- Matrix by definition �V, D, ·M �
data Matrix a = Matrix {
values :: Values a,
interpretation :: Interpretation a
}

The example below describes the matrix for the clone Clo{0,1} ({∧}), described in
Section 3.2.2.5. The list of the matrices for all clones are in Appendix D.

-- Matrix values for classical logic


valuesMatrix = ([0, 1], [1])
-- Matrix for Clo{0,1} ({∧})
matrix = Matrix {values=valuesMatrix, interpretation=andInterpretation}

Inference rules, as explained in Section 2.4, are described as a set of rules, where each
rule �Γ, ϕ� ∈ R, Γ is the rule’s set of premises, whereas ϕ is the rule’s conclusion.

-- Rule �Γ, ϕ�
data Rule = Rule {
premises :: S.Set Formula, -- Γ
conclusion :: Formula -- ϕ
}
-- Inference Rules R
type InferenceRules = S.Set Rule

The example below describes the inference rules of the Hilbert calculus that axiomat-
izes the clone Clo{0,1} ({∧}), described in Section 3.2.2.5.
56

-- P2 Axiomatization - Clo{0,1} ({∧})


p2_1 = read "{P, Q} | *(P, Q)" :: Rule
p2_2 = read "{*(P, Q)} | P" :: Rule
p2_3 = read "{*(P, Q)} | Q" :: Rule
p2Axiomatization = [p2_1, p2_2, p2_3]

A Hilbert calculus H, as explained in Section 2.4, is a structure �Σ, R�, where Σ is a


signature and R is a set of schematic inference rules.

data HilbertCalculus = HilbertCalculus {


sigma :: Signature,
rules :: InferenceRules
}

An example is the Hilbert calculus that axiomatizes the clone Clo {0,1} ({∧}), described
by p2Axiomatization.

-- Hilbert calculus for Clo{0,1} ({∧})


p2logic = HilbertCalculus {sigma = [{2, "*"}], rules = p2Axiomatization}

The list of all Hilbert calculi that axiomatize each fragment of classical logic, showed
in section 3.2, are in Appendix E.

Using all these definitions, we can now implement the proposed algorithm for CMP
in Haskell, showed in the Algorithm 1, which is in the Appendix A. Consequently, we
have the algorithm for TEP, applying the CMP algorithm twice, swapping the inputs, as
explained in section 3.1. Therefore, the algorithm is:

-- Given a base set as initial state A and B another base set


-- of functions over {0,1}, determine they are term equivalent
isTermEquivalent (MonadThrow m) => Matrix Int -> Matrix Int -> m Bool
isTermEquivalent baseA baseB = pure (&&) <*> ltr <*> rtl
where
ltr = isInClone baseA baseB
rtl = isInClone baseB baseA
57

Given that, the PLLP algorithm, showed in the Figure 2, is the following:

pllp :: Matrix Int -> Matrix Int


pllp baseA = case find (isTermEquivalent baseA) greenMatrices of
Just baseB -> baseB
Nothing -> pllpRecursive 1 baseA

pllpRecursive :: Int -> Matrix Int -> Matrix Int


pllpRecursive depth base
| isInClone base $ f4ExpansionMatrix !! depth = f4ExpansionMatrix !! depth
| isInClone base $ f8ExpansionMatrix !! depth = f8ExpansionMatrix !! depth
| isInClone base $ f3ExpansionMatrix !! depth = f3ExpansionMatrix !! depth
| isInClone base $ f7ExpansionMatrix !! depth = f7ExpansionMatrix !! depth
| isInClone base $ f1ExpansionMatrix !! depth = f1ExpansionMatrix !! depth
| isInClone base $ f5ExpansionMatrix !! depth = f5ExpansionMatrix !! depth
| isInClone base $ f2ExpansionMatrix !! depth = f2ExpansionMatrix !! depth
| isInClone base $ f6ExpansionMatrix !! depth = f6ExpansionMatrix !! depth
| otherwise = pllpRecursive (depth+1) base

The Rauntenberg algorithm is similar, changing the TEP checking for a signature
equality checking, and changing the CMP checking for a signature expansion checking,
so, for each input, the output is some of the axiomatizations presented in Appendix E.

4.2 API RESTful

Fielding (FIELDING, 2000) introduced and defined the style of REST (Representational
State Transfer) architecture, whose central abstraction is called resource. A resource is
anything that has a URI (Uniform Resource Identifier), which is an identifier that satisfies
the formatting requirements. The model deals with an abstraction of the web architecture,
that is, it consists of rules that, when followed, allow the creation of a project with well
defined interfaces.

When we create web services using the REST architecture style, we are creating a
RESTful application. RESTful web services expose resources through URIs and use HTTP
methods to create, return, change, and delete their resources.

An API (Application Programming Interface) is a set of routines and standards es-


58

tablished by an application, so that other applications can use the functionality of this
application without having to know details of the software implementation. Therefore,
APIs allow interoperability between applications, in other words, communication between
applications and between users.

An API was built to facilitate communication between the site and the Haskell al-
gorithm so that the Rautenberg Algorithm was computed separately from the site in a
separate module. In addition, auxiliary routes have been created to support the other
apps of the site.

The routes created were:

• /logic/{connectives} : The main service, which is responsible for returning the Hil-
bert calculus associated with the informed set of 2-valued operations in connectives.
Ex.: /logic/[{"symbol":"+","k":2}]

• /connectives : Service responsible for returning connectives available on the system.


Ex.: /connectives

• /independence/{values}/{designated }/{super }/{sub}/{from}/{to}:


Service responsible for check if the consequence relation sub is independent from
the consequence relation super, in which, we know that sub ⊆ super, according
to the informed sets of values and designated. If it is possible to tell if it is not
independent, then the service returns all cases that are not independent, and the
cases are sent from from until the case to, otherwise, the service returns nothing.
Ex.: /independence/[0,1,2]/[1]/["{a}|+(a,b)"]/["{a}|+(a,b)"]/0/10

• /soundness/{connectives}/{rules} : Service responsible for checking the soundness


of the list of rules in rules according to the interpretation of the connectives reported
in connectives. Ex.: /soundness/[{"symbol":"+","k":2}]/["{a}|+(a,b)"]

• /clomem/{clone1 }/{clone2 }/{typ} : Service responsible for check if, given the clones
on {0, 1} clone1 and clone2, if the value of typ is “one” then check if the connectives
in clone2 are in clone1, if the value of typ is “two” then check if the connectives
in clone1 are in clone2, finally, if the value of typ is “three” then check if the con-
nectives in clone2 are the same of clone1. Ex.: /clomem/[{"symbol":"*","k":
2}]/[{"symbol":"+","k":2}]/"one"
59

4.3 Website

A Website was created in order to make the following tools available to the community.

• Fragment Axiomatization – The main tool, which returns the Hilbert Calculus as-
sociated with the reported connectives. (The main algorithm of this work)

Figure 4: Fragment Axiomatization Website

• Clone Comparison – Given the A and B connective sets, the tool checks to see if
Clo{0,1} (A) ⊆ Clo{0,1} (B), Clo{0,1} (A) ⊇ Clo{0,1} (B) or both. (CMP algorithm)

Figure 5: Clone Comparison Website


60

• Rules Independence – Tool that checks if a subset of rules is independent of the


informed rule set.

Figure 6: Rules Independence Website


61

• Soundness Check – Tool that checks the soundness of the list of informed rules
according to the interpretation of the informed connectives.

Figure 7: Soundness Check Website


62

5 Concluding Remarks

In order to be able to automatically extract Hilbert Calculi for classical logic frag-
ments, we implemented the PLLP, TEP and CMP algorithms, in Section 4.1, to find
which clone in the Post lattice the user is requesting the calculus.

Moreover, was computationally implemented, using Haskell, the extraction of Hil-


bert Calculus associated with all the classical logic fragments, so if the user accesses
the website of Figure 4, and informs the connectives, the user will receive as output the
corresponding Hilbert calculus. The code is available at http://github.com/joelffg/
HilbertCalculusExtraction

Finally, the API containing the above algorithm, as well as other features, is available
at http://logicapi.lolita.dimap.ufrn.br/ and the website is available at http://
logicapps.lolita.dimap.ufrn.br/. Examples of use of the site can be found in the
Figures 4, 5, 6 and 7.

Implementing the Rautenberg’s algorithm, and making it available to the community


in a free and accessible way, can greatly facilitate field studies, along with the other tools
available, reducing the learning gap and maturity for understanding articles that address
it.
63

References

BERGMAN, C.; JUEDES, D. Computational complexity of term-equivalence.


International Journal of Algebra and Computation, v. 09, 01 2001.

FIELDING, R. Architectural Styles and the Design of Network-based Software


Architectures. Tese (Doutorado), 01 2000.

GREATI, V. Hilbert calculi for the main fragments of classical logic. Undergraduate
Monograph in Computer Science, Universidade Federal do Rio Grande do Norte, 2019.
Available at https://monografias.ufrn.br/jspui/. 2019.

MARCELINO, S.; CALEIRO, C.; MARCOS, J. Combining fragments of classical logic:


When are interaction principles needed? Soft Computing, October 2018. ISSN 1432-7643.

MENDELSON, E. Introduction to Mathematical Logic, Sixth Edition. 6th ed.


ed. [S.l.]: CRC Press, 2015. (Discrete Mathematics and Its Applications). ISBN
9781482237726,1482237725,978-1-4822-3778-8,1482237784.

POST, E. L. The Two-Valued Iterative Systems of Mathematical Logic. [S.l.]: London:


Oxford University Press, 1941.

RAUTENBERG, W. 2-element matrices. Studia Logica, v. 40, n. 4, p. 315–353, Dec


1981. ISSN 1572-8730. Disponível em: <https://doi.org/10.1007/BF00401653>.
64

APPENDIX A -- TEP Algorithm in Haskell

-- | Given a base set as initial state A and B another base set of functions over {0,1}, determine
-- if B is in the clone generated by A.
isInClone :: (MonadThrow m) => Matrix Int -> Matrix Int -> m Bool
isInClone baseA baseB =
do
aritiesB <- return $ interpretationArities (interpretation baseB)
projections <- mapM ((flip generateProjections) (fst (values baseA))) (S.toList aritiesB)
let startState = Clone (S.fromList $ concat projections) in
evalState (isInClone_ baseB baseA) startState

-- | Given a base set as initial state A and B another base set of functions over {0,1}, determine
-- if B is in the clone generated by A.
isInClone_ :: (MonadThrow m) => Matrix Int -> Matrix Int -> State (CloneGenerationState Int) (m Bool)
isInClone_ baseB baseA =
do
fs <- get
let aritiesB = S.toList $ interpretationArities (interpretation baseB)
opsBaseA = M.elems (interpretation baseA)
opsBaseB = S.fromList $ M.elems (interpretation baseB)
-- | truth tables per arity
ttsByArity k = filter ((k==) . truthTableArity) (S.toList $ functions fs)
-- | all superpositions arity k with head tt
allsuperpose tt k = mapM (superpose tt) (replicateM (truthTableArity tt) (ttsByArity k))
-- | all superposition of arity k using heads in baseA
superposeInBase k = mapM (flip allsuperpose k) opsBaseA in
do
case mapM superposeInBase aritiesB of
Left e -> undefined
Right deltaToConcat ->
let delta = S.fromList (concat (concat deltaToConcat))
union = S.union delta (functions fs) in
if opsBaseB `S.isSubsetOf` union then
return $ return True
else if union `S.isSubsetOf` functions fs then
return $ return False
else
return $ evalState (isInClone_ baseB baseA) (Clone union)
65

APPENDIX B -- Truth tables in Haskell

zeroTruthTable = mkTruthTable [([], 0)] :: Either SomeException (TruthTable Int)

oneTruthTable = mkTruthTable [([], 1)] :: Either SomeException (TruthTable Int)

negationTruthTable = mkTruthTable [([0], 1),


([1], 0)] :: Either SomeException (TruthTable Int)

impliesTruthTable = mkTruthTable [([0, 0], 1),


([0, 1], 1),
([1, 0], 0),
([1, 1], 1)] :: Either SomeException (TruthTable Int)

andTruthTable = mkTruthTable [([0, 0], 0),


([0, 1], 0),
([1, 0], 0),
([1, 1], 1)] :: Either SomeException (TruthTable Int)

orTruthTable = mkTruthTable [([0, 0], 0),


([0, 1], 1),
([1, 0], 1),
([1, 1], 1)] :: Either SomeException (TruthTable Int)

kaTruthTable = mkTruthTable [([0, 0, 0], 0),


([0, 0, 1], 0),
([0, 1, 0], 0),
([0, 1, 1], 0),
([1, 0, 0], 0),
([1, 0, 1], 1),
([1, 1, 0], 1),
([1, 1, 1], 1)] :: Either SomeException (TruthTable Int)

kiTruthTable = mkTruthTable [([0, 0, 0], 0),


([0, 0, 1], 0),
([0, 1, 0], 0),
([0, 1, 1], 0),
([1, 0, 0], 1),
([1, 0, 1], 1),
([1, 1, 0], 0),
([1, 1, 1], 1)] :: Either SomeException (TruthTable Int)
66

adTruthTable = mkTruthTable [([0, 0, 0], 0),


([0, 0, 1], 0),
([0, 1, 0], 1),
([0, 1, 1], 0),
([1, 0, 0], 1),
([1, 0, 1], 1),
([1, 1, 0], 1),
([1, 1, 1], 1)] :: Either SomeException (TruthTable Int)

akTruthTable = mkTruthTable [([0, 0, 0], 0),


([0, 0, 1], 0),
([0, 1, 0], 0),
([0, 1, 1], 1),
([1, 0, 0], 1),
([1, 0, 1], 1),
([1, 1, 0], 1),
([1, 1, 1], 1)] :: Either SomeException (TruthTable Int)

xorTruthTable = mkTruthTable [([0, 0, 0], 0),


([0, 0, 1], 1),
([0, 1, 0], 1),
([0, 1, 1], 0),
([1, 0, 0], 1),
([1, 0, 1], 0),
([1, 1, 0], 0),
([1, 1, 1], 1)] :: Either SomeException (TruthTable Int)

dTruthTable = mkTruthTable [([0, 0, 0], 0),


([0, 0, 1], 0),
([0, 1, 0], 0),
([0, 1, 1], 1),
([1, 0, 0], 0),
([1, 0, 1], 1),
([1, 1, 0], 1),
([1, 1, 1], 1)] :: Either SomeException (TruthTable Int)
67

APPENDIX C -- Interpretations in Haskell

zero = ("$", fromRight M.empty zeroTruthTable)


one = (".", fromRight M.empty oneTruthTable)
implies = ("==>", fromRight M.empty impliesTruthTable)
negation = ("-", fromRight M.empty negationTruthTable)
and_ = ("*", fromRight M.empty andTruthTable)
or_ = ("+", fromRight M.empty orTruthTable)
ka = ("+*", fromRight M.empty kaTruthTable)
ki = (">*", fromRight M.empty kiTruthTable)
ad = ("+-", fromRight M.empty adTruthTable)
ak = ("*+", fromRight M.empty adTruthTable)
xor = ("++", fromRight M.empty xorTruthTable)
d = (">", fromRight M.empty dTruthTable)

dM :: Int -> (String, TruthTable Int)


dM 2 = d
dM m = (">" ++ name, fromRight M.empty ttdm)
where
(name, tt) = dM $ m-1
values = S.fromList [0, 1]
ttdm = mkTruthTable $ zip (generateTruthTableArgs (m + 1) values)
((replicate (2^m - 1) 0) ++ [1] ++ (M.elems tt))

connectives = [zero, one, implies, negation, and_, or_, ka, ki, ad, ak, xor, d]

getDefaultConnectives :: [(String, TruthTable Int)]


getDefaultConnectives = connectives
68

APPENDIX D -- Matrices in Haskell

valuesMatrix = (S.fromList [0, 1], S.fromList [1]) :: Values Int


r11Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation r11Signature [one, zero]}
r13Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation r13Signature [negation, zero]}
r4Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation r4Signature [negation]}
r6Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation r6Signature [one]}
r8Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation r8Signature [zero]}
s2Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation s2Signature [or_]}
s4Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation s4Signature [or_, one]}
s5Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation s5Signature [or_, zero]}
s6Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation s6Signature [or_, one, zero]}
p2Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation p2Signature [and_]}
p4Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation p4Signature [and_, zero]}
p5Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation p5Signature [and_, one]}
p6Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation p6Signature [and_, one, zero]}
l1Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation l1Signature [xor, zero, one]}
l2Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation l2Signature [xor, one]}
l3Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation l3Signature [xor, zero]}
l4Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation l4Signature [xor]}
l5Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation l5Signature [xor, negation]}
f1Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f1Signature [ad]}
f2Matrix = Matrix {values = valuesMatrix,
69

interpretation = fromRight M.empty $ mkInterpretation f2Signature [ak]}


f3Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f3Signature [ak, one]}
f4Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f4Signature [ad, one]}
f5Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f5Signature [ki]}
f6Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f6Signature [ka]}
f7Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f7Signature [ka, zero]}
f8Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f8Signature [ki, zero]}
d2Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation d2Signature [d]}
d3Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation d3Signature [d, negation]}
d1Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation d1Signature [d, xor]}
a4Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation a4Signature [and_, or_]}
a3Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation a3Signature [and_, or_, zero]}
a2Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation a2Signature [and_, or_, one]}
a1Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation a1Signature [and_, or_, zero, one]}
c4Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation c4Signature [ki, or_]}
c3Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation c3Signature [ki, or_, zero]}
c2Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation c2Signature [ki, or_, one]}
c1Matrix = Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation c1Signature [ki, or_, zero, one]}
f1ExpasionMatrix = map (\x -> Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f1Signature [ad, dm x]}) [1..]
f2ExpasionMatrix = map (\x -> Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f2Signature [ak, dm x]}) [1..]
f3ExpasionMatrix = map (\x -> Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f3Signature [ak, one, dm x]}) [1..]
f4ExpasionMatrix = map (\x -> Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f4Signature [ad, one, dm x]}) [1..]
f5ExpasionMatrix = map (\x -> Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f5Signature [ki, dm x]}) [1..]
f6ExpasionMatrix = map (\x -> Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f6Signature [ka, dm x]}) [1..]
f7ExpasionMatrix = map (\x -> Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f7Signature [ka, zero, dm x]}) [1..]
f8ExpasionMatrix = map (\x -> Matrix {values = valuesMatrix,
interpretation = fromRight M.empty $ mkInterpretation f8Signature [ki, zero, dm x]}) [1..]
70

APPENDIX E -- Axiomatizations in Haskell

-- R4 Axiomatization - 2(\lnot)
r4_1 = read "{P} | -(-(P))" :: Rule
r4_2 = read "{-(-(P))} | P" :: Rule
r4_3 = read "{P, -(P)} | Q" :: Rule
r4Axiomatization = [r4_1, r4_2, r4_3]
r4Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList r4Axiomatization)

-- R6 Axiomatization - 2(1)
r6_1 = read "{} | .()" :: Rule
r6Axiomatization = [r6_1]
r6Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList r6Axiomatization)

-- R8 Axiomatization - 2(0)
r8_1 = read "{$()} | P" :: Rule
r8Axiomatization = [r8_1]
r8Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList r8Axiomatization)

-- R11 Axiomatization - 2(0, 1)


r11_1 = read "{} | .()" :: Rule
r11Axiomatization = r8Axiomatization ++ [r11_1]
r11Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList r11Axiomatization)

-- R13 Axiomatization - 2(\lnot, 0)


r13_1 = read "{} | -($())" :: Rule
r13Axiomatization = r4Axiomatization ++ [r13_1]
r13Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList r13Axiomatization)

-- S2 Axiomatization - 2(v)
s2_1 = read "{P} | +(P, Q)" :: Rule
s2_2 = read "{+(P, P)} | P" :: Rule
s2_3 = read "{+(P, Q)} | +(Q, P)" :: Rule
s2_4 = read "{+(P, +(Q, R))} | +(+(P, Q), R)" :: Rule
s2Axiomatization = [s2_1, s2_2, s2_3, s2_4]
s2Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList s2Axiomatization)

-- S4 Axiomatization - 2(v, 1)
s4_0 = read "{} | .()" :: Rule
s4Axiomatization = s4_0 : s2Axiomatization
s4Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList s4Axiomatization)
71

-- S5 Axiomatization - 2(v, 0)
s5_0 = read "{+(P, $())} | P" :: Rule
s5Axiomatization = s5_0 : s2Axiomatization
s5Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList s5Axiomatization)

-- S6 Axiomatization - 2(v, 0, 1)
s6_0 = read "{} | .()" :: Rule
s6Axiomatization = s6_0 : s5Axiomatization
s6Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList s6Axiomatization)

-- P2 Axiomatization - 2(^)
p2_1 = read "{P, Q} | *(P, Q)" :: Rule
p2_2 = read "{*(P, Q)} | P" :: Rule
p2_3 = read "{*(P, Q)} | Q" :: Rule
p2Axiomatization = [p2_1, p2_2, p2_3]
p2Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList p2Axiomatization)

-- P4 Axiomatization - 2(^, 0)
p4_0 = read "{$()} | P" :: Rule
p4Axiomatization = p4_0 : p2Axiomatization
p4Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList p4Axiomatization)

-- P5 Axiomatization - 2(^, 1)
p5_0 = read "{} | .()" :: Rule
p5Axiomatization = p5_0 : p2Axiomatization
p5Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList p5Axiomatization)

-- P6 Axiomatization - 2(^, 0, 1)
p6_0 = read "{} | .()" :: Rule
p6Axiomatization = p6_0 : p4Axiomatization
p6Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList p6Axiomatization)

-- A4 Axiomatization - 2(v, ^)
a4_5 = read "{+(R, P), +(R, Q)} | +(R, *(P, Q))" :: Rule
a4_6 = read "{+(R, *(P, Q))} | +(R, P)" :: Rule
a4_7 = read "{+(R, *(P, Q))} | +(R, Q)" :: Rule
a4Axiomatization = s2Axiomatization ++ [a4_5, a4_6, a4_7]
a4Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList a4Axiomatization)

-- A2 Axiomatization - 2(v, ^, 1)
a2_0 = read "{} | .()" :: Rule
a2Axiomatization = a2_0 : a4Axiomatization
a2Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList a2Axiomatization)

-- A3 Axiomatization - 2(v, ^, 0)
a3Axiomatization = p2Axiomatization ++ s5Axiomatization
a3Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList a3Axiomatization)

-- A1 Axiomatization - 2(v, ^, 0, 1)
a1_0 = read "{} | .()" :: Rule
a1Axiomatization = a1_0 : a3Axiomatization
a1Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList a1Axiomatization)
72

-- F_6^\inf Axiomatization - 2(ka)


f6_1 = read "{A, P} | +*(A, P, Q)" :: Rule
f6_2 = read "{+*(A, P, P)} | P" :: Rule
f6_3 = read "{+*(A, P, Q)} | +*(A, Q, P)" :: Rule
f6_4 = read "{+*(A, P, +*(A, Q, R))} | +*(A, +*(A, P, Q), R)" :: Rule
f6_5 = read "{+*(B, R, A), +*(B, R, +*(B, P, Q))} | +*(B, R, +*(A, P, Q))" :: Rule
f6_6 = read "{+*(B, R, +*(A, P, Q))} | +*(B, R, A)" :: Rule
f6_7 = read "{+*(B, R, +*(A, P, Q))} | +*(B, R, +*(B, P, Q))" :: Rule

f6Axiomatization = [f6_1, f6_2, f6_3, f6_4, f6_5, f6_6, f6_7]


f6Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList f6Axiomatization)

-- F_5^\inf Axiomatization - 2(ki)


f5_1 = read "{P, >*(A, P, Q)} | Q" :: Rule
f5_2 = read "{A} | >*(A, P, >*(A, Q, P))" :: Rule
f5_3 = read "{>*(B, T, A)} | >*(B, T, >*(A, >*(A, P, >*(A, Q, R)), >*(A, P, R)))" :: Rule
f5_4 = read "{>*(B, T, A)} | >*(B, T, >*(A, >*(A, >*(A, P, Q), P), P))" :: Rule
f5_5 = read "{>*(A, P, >*(A, Q, R))} | >*(A, >*(P, P, Q), R)" :: Rule
f5_6 = read "{>*(A, >*(P, P, Q), R)} | >*(A, P, >*(A, Q, R))" :: Rule
f5_7 = read "{>*(B, R, A), >*(B, R, >*(B, P, Q))} | >*(B, R, >*(A, P, Q))" :: Rule
f5_8 = read "{>*(B, R, >*(A, P, Q))} | >*(B, R, A)" :: Rule
f5_9 = read "{>*(B, R, >*(A, P, Q))} | >*(B, R, >*(B, P, Q))" :: Rule

f5Axiomatization = [f5_1, f5_2, f5_3, f5_4, f5_5, f5_6, f5_7, f5_8, f5_9]
f5Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList f5Axiomatization)

-- F_7^\inf Axiomatization - 2(ka,0)


f7_0 = read "{+*(A, P, $())} | +*(A, P, Q)" :: Rule

f7Axiomatization = f6Axiomatization ++ [f7_0]


f7Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList f7Axiomatization)

-- F_8^\inf Axiomatization - 2(ki,0)


f8_0 = read "{>*(A, P, $())} | >*(A, P, Q)" :: Rule

f8Axiomatization = f5Axiomatization ++ [f8_0]


f8Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList f8Axiomatization)

-- F_1^\inf Axiomatization - 2(ad)


f1_1 = read "{P, +-(Q, A, P)} | Q" :: Rule
f1_2 = read "{A} | +-(+-(P, A, Q), A, P)" :: Rule
f1_3 = read "{+-(A, B, T)} | +-(+-(+-(R, A, P), A, +-(+-(R, A, Q), A, P)), B , T)" :: Rule
f1_4 = read "{+-(A, B, T)} | +-(+-(P, A, +-(P, A, +-(Q, A, P))), B, T)" :: Rule
f1_5 = read "{+-(Q, A, P)} | +-(A, Q, A)" :: Rule
f1_6 = read "{Q} | +-(Q, A, P)" :: Rule
f1_7 = read "{+-(+-(Q, R, Q), A, P)} | +-(+-(Q, A, P), +-(R, A, P), +-(Q, A, P))" :: Rule
f1_8 = read "{+-(+-(Q, A, P), +-(R, A, P), +-(Q, A, P))} | +-(+-(Q, R, Q), A, P)" :: Rule
f1_9 = read "{+-(P, B, R), +-(Q, A, P)} | +-(Q, B, R)" :: Rule
f1_10 = read "{+-(+-(R, B, Q), A, P)} | +-(+-(R, A, P), +-(R, B, Q), +-(R, A, P))" :: Rule
f1_11 = read "{+-(+-(R, A, P), +-(R, B, Q), +-(R, A, P))} | +-(+-(R, B, Q), A, P)" :: Rule
f1_12 = read "{+-(P, P, P)} | P" :: Rule
f1_13 = read "{+-(P, Q, P)} | +-(Q, P, Q)" :: Rule
f1_14 = read "{+-(P, +-(Q, R, Q), P)} | +-(+-(P, Q, P), R, +-(P, Q, P))" :: Rule
73

f1_15 = read "{+-(S, P, S), +-(S, +-(Q, A, P), S)} | +-(S, Q, S)" :: Rule
f1_16 = read "{+-(S, A, S)} | +-(S, +-(+-(P, A, Q), A, P), S)" :: Rule
f1_17 = read "{+-(S, +-(A, B, T), S)} | +-(S, +-(+-(+-(+-(R, A, P), A, +-(Q, A, P)), A,
+-(+-(R, A, Q), A, P)), B, T), S)" :: Rule
f1_18 = read "{+-(S, +-(A, B, T), S)} | +-(S, +-(+-(P, A, +-(P, A, +-(Q, A, P))), B, T), S)"::Rule
f1_19 = read "{+-(S, +-(Q, A, P), S)} | +-(S, +-(A, Q, A), S)" :: Rule
f1_20 = read "{+-(S, Q, S)} | +-(S, +-(Q, A, P), S)" :: Rule
f1_21 = read "{+-(S, +-(+-(Q, R, Q), A, P), S)} | +-(S, +-(+-(Q, A, P), +-(R, A, P), +-(Q, A, P)), S)"
:: Rule
f1_22 = read "{+-(S, +-(+-(Q, A, P), +-(R, A, P), +-(Q, A, P)), S)} | +-(S, +-(+-(Q, R, Q), A, P), S)"
:: Rule
f1_23 = read "{+-(S, +-(P, B, R), S), +-(S, +-(Q, A, P), S)} | +-(S, +-(Q, B, R), S)" :: Rule
f1_24 = read "{+-(S, +-(+-(R, B, Q), A, P), S)} | +-(S, +-(+-(R, A, P), +-(R, P, Q), +-(R, A, Q)), S)"
:: Rule
f1_25 = read "{+-(S, +-(+-(R, A, P), +-(R, P, Q), +-(R, A, Q)), S)} | +-(S, +-(+-(R, B, Q), A, P), S)"
:: Rule

f1Axiomatization = [f1_1, f1_2, f1_3, f1_4, f1_5, f1_6, f1_7, f1_8, f1_9, f1_10, f1_11, f1_12, f1_13,
f1_14, f1_15, f1_16, f1_17, f1_18, f1_19, f1_20, f1_21, f1_22, f1_23, f1_24, f1_25]
f1Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList f1Axiomatization)

-- F_4^\inf Axiomatization - 2(ad, 1)


f4_1 = read "{} | .()" :: Rule

f4Axiomatization = f1Axiomatization ++ [f4_1]


f4Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList f4Axiomatization)

-- F_2^\inf Axiomatization - 2(ak)


f2_1 = read "{P} | *+(Q, P, P)" :: Rule
f2_2 = read "{*+(P, P, P)} | P" :: Rule
f2_3 = read "{*+(Q, P, P)} | *+(P, Q, Q)" :: Rule
f2_4 = read "{*+(*+(R, Q, Q), P, P)} | *+(R, *+(Q, P, P), *+(Q, P, P))" :: Rule
f2_5 = read "{*+(*+(R, P, P), S, S), *+(*+(R, Q, Q), S, S)} | *+(*+(R, P, Q), S, S)" :: Rule
f2_6 = read "{*+(*+(R, P, Q), S, S)} | *+(*+(R, P, P), S, S)" :: Rule
f2_7 = read "{*+(*+(R, P, Q), S, S)} | *+(*+(R, Q, Q), S, S)" :: Rule

f2Axiomatization = [f2_1, f2_2, f2_3, f2_4, f2_5, f2_6, f2_7]


f2Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList f2Axiomatization)

-- F_3^\inf Axiomatization - 2(ak, 1)


f3_8 = read "{} | .()" :: Rule

f3Axiomatization = f2Axiomatization ++ [f3_8]


f3Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList f3Axiomatization)

-- L_4 Axiomatization - 2(+_3)


l4_1 = read "{P, Q, R} | ++(P, Q, R)" :: Rule
l4_2 = read "{++(P, Q, R)} | ++(Q, P, R)" :: Rule
l4_3 = read "{++(P, Q, R)} | ++(P, R, Q)" :: Rule
l4_4 = read "{P} | ++(P, Q, Q)" :: Rule
l4_5 = read "{++(P, Q, Q)} | P" :: Rule
l4_6 = read "{++(P, Q, ++(R, S, T))} | ++(++(P, Q, R), S, T)" :: Rule
74

l4Axiomatization = [l4_1, l4_2, l4_3, l4_4, l4_5, l4_6]


l4Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList l4Axiomatization)

-- L_2 Axiomatization - 2(+_3, 1)


l2_7 = read "{} | .()" :: Rule

l2Axiomatization = l4Axiomatization ++ [l2_7]


l2Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList l2Axiomatization)

-- L_3 Axiomatization - 2(+_3, 0)


l3_7 = read "{$()} | P" :: Rule

l3Axiomatization = l4Axiomatization ++ [l3_7]


l3Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList l3Axiomatization)

-- L_5 Axiomatization - 2(+_3, \lnot)


l5_7 = read "{P, -(P)} | Q" :: Rule
l5_8 = read "{P} | -(-(P))" :: Rule
l5_9 = read "{-(-(P))} | P" :: Rule
l5_10 = read "{-(++(P, Q, R))} | ++(-(P), Q, R)" :: Rule
l5_11 = read "{++(-(P), Q, R)} | -(++(P, Q, R))" :: Rule

l5Axiomatization = l4Axiomatization ++ [l5_7, l5_8, l5_9, l5_10, l5_11]


l5Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList l5Axiomatization)

-- L_1 Axiomatization - 2(+_3, 0, 1)


l1Axiomatization = l4Axiomatization ++ [l2_7, l3_7]
l1Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList l1Axiomatization)

-- D_2 Axiomatization - 2(d)


d2_1 = read "{P, Q} | >(P, Q, R)" :: Rule
d2_2 = read "{>(Q, P, P)} | P" :: Rule
d2_3 = read "{P} | >(Q, P, P)" :: Rule
d2_4 = read "{>(S, T, >(P, Q, R))} | >(T, S, >(Q, P, R))" :: Rule
d2_5 = read "{>(S, T, >(P, Q, R))} | >(T, S, >(P, R, Q))" :: Rule
d2_6 = read "{>(A, B, >(P, Q, >(R, S, T)))} | >(A, B, >(>(P, Q, R), >(P, Q, S), T))" :: Rule
d2_7 = read "{>(A, B, >(>(P, Q, R), >(P, Q, S), T))} | >(A, B, >(P, Q, >(R, S, T)))" :: Rule

d2Axiomatization = [d2_1, d2_2, d2_3, d2_4, d2_5, d2_6, d2_7]


d2Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList d2Axiomatization)

-- D_3 Axiomatization - 2(d, \lnot)


d3_8 = read "{>(R, S, >(Q, P, -(P)))} | >(R, S, Q)" :: Rule
d3_9 = read "{>(R, S, Q)} | >(R, S, >(Q, P, -(P)))" :: Rule

d3Axiomatization = d2Axiomatization ++ [d3_8, d3_9]


d3Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList d3Axiomatization)

-- D_1 Axiomatization - 2(d, +_3)


d1_0 = read "{>(P, Q, ++(R, S, T))} | ++(>(P, Q, R), >(P, Q, S), >(P, Q, T))" :: Rule
d1_1 = read "{++(P, Q, >(R, S, T))} | >(++(P, Q, R), ++(P, Q, S), ++(P, Q, T))" :: Rule
d1Axiomatization = d2Axiomatization ++ l4Axiomatization ++ [d1_0, d1_1]
d1Signature = fromRight M.empty $ sigmaFromConseqRelation (S.fromList d1Axiomatization)

Você também pode gostar