Belnap-Dunn logic and query answering in inconsistent databases with null values

This paper concerns an expansion of first-order Belnap-Dunn logic, named $\mathrm{BD}^{\supset,\mathsf{F}}$, and an application of this logic in the area of relational database theory. The notion of a relational database, the notion of a query applicable to a relational database, and several notions of an answer to a query with respect to a relational database are considered from the perspective of this logic, taking into account that a database may be an inconsistent database or a database with null values. The chosen perspective enables among other things the definition of a notion of a consistent answer to a query with respect to a possibly inconsistent database without resort to database repairs. For each of the notions of an answer considered, being an answer to a query with respect to a database of the kind considered is decidable.


Introduction
In the area of relational database theory, it is quite common since the 1980s to take the view that a database is a set of formulas of first-order classical logic, a query is a formula of first-order classical logic, and query answering amounts to proving that a formula is a logical consequence of a set of formulas in first-order classical logic (see e.g.[27,12]).The use of first-order classical logic makes it difficult to take into account the possibility that a database is an inconsistent database and the possibility that a database is a database with null values.
In the logical view of relational databases, an inconsistent relational database is an inconsistent set of formulas in the sense that there is at least one conjunction of two formula of which one is the negation of the other that is a logical consequence of the set of formulas.Because in classical logic every formula is a logical consequence of each such a conjunction, it becomes difficult to take the possibility that a database is inconsistent properly into account.A logic in which not every formula is a logical consequence of each conjunction of two formula of which one is the negation of the other is called a paraconsistent logic.
The view on null values in relational databases taken in this paper can be described as follows: (a) in relational databases with null values, a single dummy value, called the null value, is used for values that are indeterminate, (b) a value that is indeterminate is a value that is either unknown or nonexistent, and (c) independent of whether it is unknown or nonexistent, no meaningful answer can be given to the question whether the null value and whatever value, including the null value itself, are the same.Several variations on this view on null values in relational databases have been studied (see e.g.[11,30,15]).However, those variations are less basic and most of them give rise to similar problems in a logical view of relational databases with null values.
In the logical view of relational databases, a relational database with null values is an incomplete set of formulas in the sense that there is at least one disjunction of two formula of which one is the negation of the other that is not a logical consequence of the set of formulas.Because in classical logic each such a disjunction is a logical consequence of every set of formulas, it becomes difficult to take the possibility that null values occur in a database properly into account.A logic in which not each disjunction of two formula of which one is the negation of the other is a logical consequence of every set of formulas is called a paracomplete logic.
In [22], the notion of a relational database, the notion of a query applicable to a relational database, and several notions of an answer to a query with respect to a relational database are considered from the perspective of LPQ ⊃,F , an expansion of the first-order version of Priest's logic of paradox known as LPQ [26].The possibility that a database is an inconsistent database is taken into account, but the possibility that a database is a database with null values is not taken into account.The reason for this is that LPQ ⊃,F is paraconsistent, but not paracomplete.There are many other paraconsistent logics.The choice of LPQ ⊃,F stems from the fact that its connectives and quantifiers are all familiar from classical logic and its logical consequence relation is very closely connected to the one of classical logic.
In [23], BD ⊃,F , an expansion of first-order Belnap-Dunn logic [1] with classical connectives, is introduced and studied with the emphasis on (a) the connection between the logical consequence relations of BD ⊃,F and the version of classical logic with the same connectives and quantifiers and (b) the definability in BD ⊃,F of interesting non-classical connectives added to Belnap-Dunn logic in its expansions that have been studied earlier.BD ⊃,F is both paraconsistent and paracomplete.Like for LPQ ⊃,F , it holds for BD ⊃,F that its connectives and quantifiers are all familiar from classical logic and its logical consequence relation is very closely connected to the one of classical logic.
An appendix of [23] goes briefly into an minor variation of BD ⊃,F that covers terms with an indeterminate value.This variation, called BD ⊃,F ⊥ , is also paraconsistent and paracomplete.Moreover, its treatment of equations corresponds to the above-mentioned thought that no meaningful answer can be given to the question whether the null value and whatever value, including the null value itself, are the same value.All this means that both the possibility that a database is an inconsistent database and the possibility that a database is a database with null values can be properly taken into account when the notions considered in [22] are considered from the perspective of BD ⊃,F ⊥ .This is taken up in the current paper.In order to make this paper selfcontained, the language and logical consequence relation of BD ⊃,F as well as a sequent calculus proof system for BD ⊃,F are presented.BD ⊃,F ⊥ is introduced as a minor variation of BD ⊃,F .The notion of a relational database, the notion of a query applicable to a relational database, and several notions of an answer to a query with respect to a relational database are defined in the setting of BD ⊃,F ⊥ , taking into account that a database may be an inconsistent database and/or a database with null values.Like in [22], the definitions concerned are based on those given in [27].Two notions of a consistent answer to a query with respect to a possibly inconsistent relational database are introduced.Like in [22], one of them is reminiscent of the notion of a consistent answer from [6] and the other is reminiscent of the notion of a consistent answer from [2].
The structure of this paper is as follows.In Sections 2, 3, and 4, the language of BD ⊃,F , the logical consequence relation of BD ⊃,F , and a sequent calculus proof system for BD ⊃,F are presented.In Section 5, BD ⊃,F ⊥ is introduced as a minor variation of BD ⊃,F .In Sections 6 and 7, relational databases and query answering with respect to a database that may be an inconsistent database and/or a database with null values are considered from the perspective of BD ⊃,F .In Section 8, some variations of the view on null values in relational databases taken in this paper are briefly discussed.In Section 9, some concluding remarks are made.Parts of the sections in which BD ⊃,F is introduced overlap with parts of [23].

The Language of BD ⊃,F
In this section the language of the logic BD ⊃,F is described.First the notions of a signature and an alphabet are introduced and then the terms and formulas of BD ⊃,F are defined for a fixed but arbitrary signature.Moreover, some relevant notational conventions are presented and some remarks about free variables and substitution are made.In coming sections, the logical consequence relation of BD ⊃,F and a proof system for BD ⊃,F are presented for a fixed but arbitrary signature.
Signatures and alphabets It is assumed that the following has been given: (a) a countably infinite set Var of variables, (b) for each n ∈ N, a countably infinite set Func n of function symbols of arity n, and, (c) for each n ∈ N, a countably infinite set Pred n of predicate symbols of arity n.It is also assumed that all these sets are mutually disjoint and disjoint from the set {=, ¬, ∧, ∨, ⊃, ∀, ∃}.
The symbols from {Func n | n ∈ N} ∪ {Pred n | n ∈ N} are known as non-logical symbols.Function symbols of arity 0 are also known as constant symbols and predicate symbols of arity 0 are also known as proposition symbols.
A signature Σ is a subset of {Func n | n ∈ N} ∪ {Pred n | n ∈ N}.We write Func n (Σ ) and Pred n (Σ ), where Σ is a signature and n ∈ N, for the sets Σ ∩ Func n and Σ ∩ Pred n , respectively.
The language of BD ⊃,F will be defined for a fixed but arbitrary signature Σ .This language will be called the language of BD ⊃,F over Σ or shortly the language of BD ⊃,F (Σ ).The corresponding logical consequence relation will be called the logical consequence relation of BD ⊃,F (Σ ) and a corresponding proof system will be called a proof system for BD ⊃,F (Σ ).
The alphabet of the language of BD ⊃,F (Σ ) consists of the following symbols: the variables from Var ; -the non-logical symbols from Σ ; -the logical symbols of BD ⊃,F , to wit: • the equality symbol = ; • the falsity connective F ; • the negation connective ¬ ; • the conjunction connective ∧ ; • the disjunction connective ∨ ; • the implication connective ⊃ ; • the universal quantifier ∀ ; • the existential quantifier ∃ .

Terms and formulas
The language of BD ⊃,F (Σ ) consists of terms and formulas.They are constructed from the symbols in the alphabet of the language of BD ⊃,F (Σ ) according to the formation rules given below.
The set of all terms of BD ⊃,F (Σ ), written Term(Σ ), is inductively defined by the following formation rules: The set of all closed terms of BD ⊃,F (Σ ) is the subset of Term(Σ ) that can be formed by applying formation rules 2 and 3 only.
The set of all formulas of BD ⊃,F (Σ ), written Form(Σ ), is inductively defined by the following formation rules: The set Atom(Σ ) of all atomic formulas of BD ⊃,F (Σ ) is the subset of Form(Σ ) can be formed by applying formation rules 1-3 only.The set Lit (Σ ) of all literals of BD ⊃,F (Σ ) is the subset of Form(Σ ) can be formed by applying formation rules 1-3 and 5 only.
We write e 1 ≡ e 2 , where e 1 and e 2 are terms from Term(Σ ) or formulas from Form(Σ ), to indicate that e 1 is syntactically equal to e 2 .
In the coming sections, we will write CL ⊃,F for the version of classical logic that has the same language as BD ⊃,F .

Notational conventions
The following will sometimes be used without mentioning (with or without decoration): x as a meta-variable ranging over all variables from Var , t as a meta-variable ranging over all terms from Term(Σ ), A as a meta-variable ranging over all formulas from Form(Σ ), and Γ as a meta-variable ranging over all sets of formulas from Form(Σ ).
The string representation of terms and formulas suggested by the formation rules given above can lead to syntactic ambiguities.Parentheses are used to avoid such ambiguities.The need to use parentheses is reduced by ranking the precedence of the logical connectives ¬, ∧, ∨, ⊃.The enumeration presents this order from the highest precedence to the lowest precedence.Moreover, the scope of the quantifiers extends as far as possible to the right and ∀x Free variables and substitution Free variables of a term or formula and substitution for variables in a term or formula are defined in the usual way.
Let x be a variable from Var , t be a term from Term(Σ ), and e be a term from Term(Σ ) or a formula from Form(Σ ).Then we write [x := t]e for the result of substituting the term t for the free occurrences of the variable x in e, avoiding (by means of renaming of bound variables) free variables becoming bound in t.
3 Truth and Logical Consequence in BD ⊃,F (Σ ) In this section, the truth value of formulas of BD ⊃,F (Σ ) and the logical consequence relation on sets of formulas of BD ⊃,F (Σ ) will be defined.This will be done using the logical matrix of BD ⊃,F (Σ ).
First, the logical matrix of BD ⊃,F (Σ ) is defined.Next, the truth value of formulas of BD ⊃,F (Σ ) and the logical consequence relation on sets of formulas of BD ⊃,F (Σ ) are defined.The truth value of formulas is defined with respect to (a) a structure consisting of a set of values and an interpretation of each non-logical symbol and the equality symbol and (b) an assignment of values from that set of values to the variables.Structures and assignments are introduced before the definition in question.
Matrix The interpretation of the logical symbols of BD ⊃,F (Σ ), with the exception of the equality symbol, is given by means of a logical matrix.
In the definition of this matrix, t (true), f (false), b (both true and false), and n (neither true nor false) are taken as truth values.Moreover, use is made of the partial order ≤ on the set {t, f, b, n} in which f is the least element, t is the greatest element, and b and n are incomparable.We write inf V and sup V , where V ⊆ {t, f, b, n}, for the greatest lower bound and least upper bound, respectively, of V with respect to ≤.
The matrix of BD ⊃,F (Σ ) is the triple V, D, O , where: -O consists of the following constant and functions: where a, a 1 , and a 2 range over all truth values from V and V ranges over all non-empty subsets of V.
V is the set of truth values of BD ⊃,F (Σ ), D is the set of designated truth values of BD ⊃,F (Σ ), and F, ¬, ∧, ∨, ⊃, ∀, and ∃ are the truth functions that are the interpretations of the logical symbols F, ¬, ∧, ∨, ⊃, ∀, and ∃, respectively.The idea behind the designated truth values is that a formula is valid if its truth value with respect to all structures and assignments in those structures (both defined below) is a designated truth value.The set of non-designated truth values of BD ⊃,F (Σ ), written D, is the set V\D.
Structures The interpretation of the non-logical symbols of BD ⊃,F (Σ ) and the equality symbol is given by means of structures.
A structure A of BD ⊃,F (Σ ) is a pair U A , I A , where: -U A is a set, called the domain of A, such that U A = ∅ and U A ∩ V = ∅; -I A consists of: • an element c A ∈ U A for every c ∈ Func 0 (Σ ); Instead of w A we write w when it is clear from the context that the interpretation of symbol w in structure A is meant.
Assignments The interpretation of the variables of BD ⊃,F (Σ ) is given by means of assignments.
Let A be a structure of BD ⊃,F (Σ ).Then an assignment in A is a function α : Var → U A .For every assignment α in A, variable x ∈ Var , and element Valuations and models Let A be a structure of BD ⊃,F (Σ ), and let α be an assignment in A. Then the valuation of Term(Σ ) in structure A under assignment α is the function tval A α : Term(Σ ) → U A that maps each term t to the element of U A that is the value of t in A under assignment α.Similarly, the valuation of Form(Σ ) in structure A under assignment α is the function fval A α : Form(Σ ) → V that maps each formula A to the element of V that is the truth value of A in A under assignment α.We write

A α and [ [A] ]
A α for tval A α (t) and fval A α (A), respectively.These valuation functions are inductively defined in Table 1.In this table , x is a meta-variable ranging over all variables from Var , c is a meta-variable ranging over all function symbols from Func 0 (Σ ), f is a meta-variable ranging over all function symbols from Func n+1 (Σ ), p is a meta-variable ranging over all predicate symbols from Pred 0 (Σ ), P is a meta-variable ranging over all predicate symbols from Pred n+1 (Σ ), t 1 , . . ., t n+1 are meta-variables ranging over all terms from Term(Σ ), and A, A 1 , and A 2 are meta-variables ranging over all formulas from Form(Σ ).
The following theorem is a decidability result concerning valuations of formulas in structures with a finite domain.
Proposition 1.Let A be a structure of BD ⊃,F (Σ ) such that U A is finite, and let α be an assignment in A. Then, it is decidable whether, for a formula Table 1.Valuations of terms and formulas of BD ⊃,F (Σ ) Proof.This is easy to prove by induction on the structure of A.

⊓ ⊔
Below, the notion of a model of a set of formulas of BD ⊃,F (Σ ) is defined in terms of valuations.
Let Γ be a set of formulas from Form(Σ ), and let A be a structure of BD ⊃,F (Σ ).Then A is a model of Γ iff for all assignments α in A, for all Logical consequence Given the valuations of terms and formulas of BD ⊃,F (Σ ), it is easy to make precise when in BD ⊃,F (Σ ) a set of formulas is a logical consequence of another set of formulas.
Let Γ and ∆ be sets of formulas from Form(Σ ).Then ∆ is a logical consequence of Γ , written Γ ∆, iff for all structures A of BD ⊃,F (Σ ), for all assign- The two properties concerning the logical consequence relation of BD ⊃,F (Σ ) mentioned below are proved in [23].
The logical consequence relation of BD ⊃,F (Σ ) is such that for all Γ , ∆ ⊆ Form(Σ ) and A 1 , A 2 ∈ Form(Σ ) and moreover there exists a logic L with the same language as BD ⊃,F (Σ ) and a logical consequence relation ′ such that: This means that BD ⊃,F (Σ ) is ¬-coherent with classical logic in the sense of [3].There exist A, A ′ ∈ Form(Σ ) such that A, ¬A A ′ .Because BD ⊃,F (Σ ) is also ¬-coherent with classical logic, this means that BD ⊃,F (Σ ) is paraconsistent in the sense of [3].
There exist a Γ ⊆ Form(Σ ) and is also ¬-coherent with classical logic, this means that BD ⊃,F (Σ ) is paracomplete in the sense of [3].
Abbreviations In what follows, the following abbreviations will be used: ⋆A stands for ∆(A ∨ ¬A) (determinacy).
It follows from the definitions concerned that: This means that the abbreviations ∆A, •A, and ⋆A correspond to formulas of studied expansions of Belnap-Dunn logic whose connectives include ∆, • or ⋆.The connective ∆ is for example found in the expansion of Belnap-Dunn logic known as BD∆ [28].The connectives • and ⋆ have for example been studied in the setting of Belnap-Dunn logic in [9].The connective • is also found in the expansion of the first-order version of Priest's logic of paradox [26] known as LP • [25].The connective ⋆ is the counterpart of • in the setting of Kleene's strong three-valued logic [16,Section 64].
Moreover, notice that: In this section, a sequent calculus proof system for BD ⊃,F (Σ ) is presented.This means that the inference rules have sequents as premises and conclusions.First, the notion of a sequent is introduced.Then, the inference rules of the proof system of BD ⊃,F (Σ ) are presented.After that, the notion of a derivation of a sequent from a set of sequents and the notion of a proof of a sequent are introduced.Extensions of the proof system of BD ⊃,F (Σ ) which can serve as proof system for closely related logic are also described.
Sequents In the sequent calculus proof system for BD ⊃,F (Σ ), a sequent is an expression of the form Γ ⇒ ∆, where Γ and ∆ are finite sets of formulas from Form(Σ ).We write Γ , Γ ′ for Γ ∪ Γ ′ and A, where A is a formula from Form(Σ ), for {A} on both sides of a sequent.Moreover, we write ⇒ ∆ instead of ∅ ⇒ ∆.
A sequent Γ ⇒ ∆ states that the logical consequence relation that is defined in Section 3 holds between Γ and ∆.If a sequent Γ ⇒ ∆ can be proved by means of the rules of inference given below, then that logical consequence relation holds between Γ and ∆.

Rules of inference
The sequent calculus proof system for BD ⊃,F (Σ ) consists of the inference rules given in Table 2.In this table, x and y are meta-variables ranging over all variables from Var , t, t 1 , and t 2 are meta-variables ranging over all terms from Term(Σ ), A, A 1 , and A 2 are meta-variables ranging over all formulas from Form(Σ ), and Γ and ∆ are meta-variables ranging over all finite sets of formulas from Form(Σ ).A formula A from Form(Σ ) is a literal iff A ∈ Lit (Σ ).

Derivations and proofs
In the sequent calculus proof system for BD ⊃,F (Σ ), a derivation of a sequent Γ ⇒ ∆ from a finite set of sequents H is a finite sequence s 1 , . . ., s n of sequents such that s n equals Γ ⇒ ∆ and, for each i ∈ {1, . . ., n}, one of the following conditions holds: s i ∈ H; -s i is the conclusion of an instance of some inference rule from the proof system of BD ⊃,F (Σ ) whose premises are among s 1 , . . ., s i−1 .
A proof of a sequent Γ ⇒ ∆ is a derivation of Γ ⇒ ∆ from the empty set of sequents.A sequent Γ ⇒ ∆ is said to be provable if there exists a proof of Γ ⇒ ∆.
The sequent calculus proof system of BD ⊃,F (Σ ) is sound and complete with respect to the logical consequence relation defined in Section 3.
A is a literal.† restriction: y is not free in Γ , y is not free in ∆, y is not free in A unless x ≡ y.
Proof.See Appendix A of [23].
⊓ ⊔ Extensions of the proof system The languages of CL ⊃,F and BD ⊃,F are the same.A sound and complete sequent calculus proof system of CL ⊃,F can be obtained by adding the following two inference rules to the sequent calculus proof system of BD ⊃,F : If we add only the inference rule ¬-R to the sequent calculus proof system of BD ⊃,F , then we obtain a sound and complete proof system of the paraconsistent (but not paracomplete) logic LPQ ⊃,F presented in [22].If we add only the inference rule ¬-L to the sequent calculus proof system of BD ⊃,F , then we obtain a sound and complete proof system of the obvious first-order version of the paracomplete (but not paraconsistent) propositional logic K3 ⊃,F presented in [21].

Covering Terms with an Indeterminate Value
This section goes into a minor variation of BD ⊃,F (Σ ), called BD ⊃,F ⊥ (Σ ), that can deal with terms with an indeterminate value.Semantically, this is handled by restricting the domain of structures to sets that contain a special dummy value ⊥ and assigning this value to terms with an indeterminate value.Thus, ⊥ is treated as a genuine value.It differs from other values only by conditions imposed on the equality relation of structures (see below).The conditions concerned fit in with the intuition that a term with an indeterminate value has an unknown value or does not have a value.
The language of BD ⊃,F (Σ ) and the language of BD ⊃,F ⊥ (Σ ) are the same.The logical consequence relation of BD ⊃,F ⊥ (Σ ) is defined as for BD ⊃,F (Σ ), but in terms of structures of BD ⊃,F ⊥ (Σ ).These structures differ slightly from the structures of BD ⊃,F (Σ ).
• an element c A ∈ U A for every c ∈ Func 0 (Σ ); • a function f A : • an element p A ∈ V for every p ∈ Pred 0 (Σ ); By the first condition imposed on = A in the definition of a structure In other words, the truth value of the formula t = t is a designated truth value iff the value of the term t is determinate.
By the condition imposed on = A in the definition of a structure In other words, the truth value of an equation t 1 = t 2 is neither true nor false (n) iff the value of t 1 or t 2 or both is indeterminate.Similar conditions are not imposed on the interpretations of the function and predicate symbols from Σ .However, because of the first condition imposed on = A , the relevant conditions can be expressed in BD ⊃,F ⊥ (Σ ).
Logical consequence Let Γ and ∆ be sets of formulas from Form(Σ ).Then ∆ is a logical consequence of Γ , written By the conditions on = A in the definition of a structure A of BD ⊃,F ⊥ (Σ ), we have that, for all t 1 , t 2 ∈ Term(Σ ): Proof system A sequent calculus proof system of BD ⊃,F ⊥ (Σ ) is obtained by replacing the inference rule =-Refl by the following two inference rules in the sequent calculus proof system of BD ⊃,F (Σ ): The resulting proof system is sound and complete.It is easy to see that the resulting proof system is sound.As explained in [23], the completeness proof requires a minor adaptation of the completeness proof for the proof system of BD ⊃,F (Σ ) given in that paper.
Abbreviations In what follows, the following abbreviations will be used: It follows from these definitions that: Notes BD ⊃,F ⊥ (Σ ) looks like a free logic [18,24] that is paraconsistent and paracomplete.However, ⊥ is included in the range of variables in BD ⊃,F ⊥ (Σ ), whereas ⊥ would be excluded from the range of variables in a free logic.This difference reflects that ⊥ is treated as a genuine value in BD ⊃,F ⊥ (Σ ) and ⊥ is not treated as a genuine value in free logics.
BD ⊃,F ⊥ (Σ ) has been devised to deal with logical theories (i.e.sets of formulas) of the kind that arise for example when possibly inconsistent relational databases with possibly null values are viewed as logical theories.
6 Relational Databases Viewed through BD ⊃,F ⊥ In this section, relational databases are considered from the perspective of BD ⊃,F ⊥ , taking into account that a database may be an inconsistent database (cf.[6,2]) and/or a database with null values (cf.[30,31,15]).The proof theoretic point of view is taken, i.e. a relational database is viewed as a logical theory.In the definition of the notion of a relational database, use is made of the notions of a relational language and a relational theory.The latter two notions are defined first.The definitions given in this section are to a great extent based on those given in [27].However, types are ignored for the sake of simplicity (cf.[12,29]).The view on null values in relational databases taken here is informally described in Section 1.

Relational languages
The pair (Σ , Form(Σ )), where Σ is a signature, is called the language of BD ⊃,F ⊥ (Σ ).If Σ satisfies particular conditions, then the language of BD ⊃,F ⊥ (Σ ) is considered a relational language.Let Σ be a signature.Then the language R = (Σ , Form(Σ )) of BD ⊃,F ⊥ (Σ ) is a relational language iff it satisfies the following conditions: -Func 0 (Σ ) is finite, nil ∈ Func 0 (Σ ), and Func 0 (Σ ) \ {nil} is non-empty; Relational theories Below, we will introduce the notion of a relational theory.In the definition of a relational theory, use is made of a number of auxiliary notions.These auxiliary notions are defined first.
Let R = (Σ , Form(Σ )) be a relational language.Then the nil-indeterminacy axiom for R is the formula ¬(nil↓) and the equality semi-normality axiom for R is the formula . Let R = (Σ , Form(Σ )) be a relational language and let c 1 , . . ., c n be all members of Func 0 (Σ ).Then the domain closure axiom for R is the formula and the unique name axiom set for R is the set of formulas Let R = (Σ , Form(Σ )) be a relational language and let P ∈ Pred n+1 (Σ ) (n ∈ N).Then the P -determinacy axiom for R is the formula ∀x 1 , . . ., x n+1 • ⋆P (x 1 , . . ., x n+1 ) .
Let R = (Σ , Form(Σ )) be a relational language, let Λ ⊆ Form(Σ ) be a finite set of atomic facts for R, and let P ∈ Pred n+1 (Σ ) (n ∈ N).Suppose that there exist formulas in Λ in which P occurs and let P (c 1 1 , . . ., c 1 n+1 ), . . ., P (c m 1 , . . ., c m n+1 ) be all formulas from Λ in which P occurs.Then the P -completion axiom for Λ is the formula . Suppose that there does not exist a formula in Λ in which P occurs.Then the P -completion axiom for Λ is the formula The domain closure, unique name, and P -completion axioms are adopted from [27].The nil-indeterminacy, equality semi-normality, and P -determinacy axioms are new.The nil-indeterminacy axiom states that the value of nil is indeterminate.The equality semi-normality axiom states that equations are interpreted classically except that their truth value is neither true nor false if terms with an indeterminate value are involved.The P -determinacy axiom states that P never yields the truth value neither true nor false.
Let R = (Σ , Form(Σ )) be a relational language.Then the relational structure axioms for R, written RSA(R), is the set of all formulas A ∈ Form(Σ ) for which one of the following holds: -A is the nil-indeterminacy axiom for R; -A is the equality semi-normality axiom for R; -A is the domain closure axiom for R; -A is an element of the unique name axiom set for R; -A is the P -determinacy axiom for R for some P ∈ {Pred n+1 (Σ ) | n ∈ N}.
Let R = (Σ , Form(Σ )) be a relational language, and let Λ ⊆ Form(Σ ) be a finite set of atomic facts for R. Then the relational theory for R with basis Λ, written RT (R, Λ), is the set of all formulas A ∈ Form(Σ ) for which one of the following holds: for some finite set Λ ⊆ Form(Σ ) of atomic facts for R. The elements of this unique Λ are called the atomic facts of Θ .
The following theorem is a decidability result concerning provability of sequents Γ ⇒ A where Γ includes the relational structure axioms for some relational language.
Theorem 2. Let R = (Σ , Form(Σ )) be a relational language, and let Γ be a finite subset of Form(Σ ) such that RSA(R) ⊆ Γ .Then it is decidable whether, for a formula A ∈ Form(Σ ), Γ ⇒ A is provable.
Proof.Since it is known from Theorem 1 that Γ ⇒ A is provable iff Γ A, it is shown instead that it is decidable whether, for a formula A ∈ Form(Σ ), Γ A.
Because RSA(R) ⊆ Γ , it is sufficient to consider only structures that are models of RSA(R).The domains of these structures have the same finite cardinality.Because in addition there are finitely many predicate symbols in Σ , there exist moreover only finitely many of these structures.
Clearly, it is sufficient to consider only the restrictions of assignments to the set of all variables occurring in Γ ∪ {A}.Because the set of all variable occurring in Γ ∪ {A} is finite and the domain of the structures to be considered is finite, there exist only finitely many such restrictions and those restrictions are finite.
It follows easily from the above-mentioned finiteness properties and Proposition 1 that it is decidable whether, for a formula A ∈ Form(Σ ), Γ A.

⊓ ⊔
Relational databases Having defined the notions of an relational language and a relational theory, we are ready to define the notion of a relational database in the setting of BD ⊃,F ⊥ .A relational database DB is a triple (R, Θ , Ξ ), where: -R = (Σ , Form(Σ )) is a relational language; -Θ is a relational theory for R; -Ξ is a finite subset of Form(Σ ).
Θ is called the relational theory of DB and Ξ is called the set of integrity constraints of DB.
The set Ξ of integrity constraints of a relational database DB = (R, Θ , Ξ ) can be seen as a set of assumptions about the relational theory of the relational database Θ .If the relational theory agrees with these assumptions, then the relational database is called consistent.
Let R = (Σ , Form(Σ )) be a relational language, and let DB = (R, Θ , Ξ ) be a relational database.Then DB is consistent iff, for each A ∈ Form(Σ ) such that A is an atomic fact for R or A is of the form ¬A ′ where A ′ is an atomic fact for R: Notice that, if DB is not consistent, Θ , Ξ ⇒ A ′ is provable with the sequent calculus proof system of CL ⊃,F (Σ ) for all A ′ ∈ Form(Σ ).However, the sequent calculus proof system of BD ⊃,F ⊥ (Σ ) rules out such an explosion.

Models of relational theories
The models of relational theories for a relational language R = (Σ , Form(Σ )) are structures of BD ⊃,F ⊥ (Σ ) of a special kind.Let R = (Σ , Form(Σ )) be a relational language.Then a relational structure for R is a structure A of BD ⊃,F ⊥ (Σ ) such that: for all n ∈ N, for all P ∈ Pred n+1 (Σ ), for all d 1 , . . ., d n+1 ∈ U A : The following corollary of the definitions of relational structure axioms for R and relational structure for R justifies the term "relational structure axioms".
Corollary 1.Let R = (Σ , Form(Σ )) be a relational language, and let A be a structure of BD ⊃,F ⊥ (Σ ).Then A is a relational structure for R iff, for all assignments α in A, for all A ∈ RSA(R), ) be a relational language, and let Θ be a relational theory for R. Then all models of Θ are relational structures for R because RSA(R) ⊆ Θ .Θ does not have a unique model up to isomorphism.Θ 's predicate completion axioms fail to enforce a unique model up to isomorphism.However, identification of t and b in the models of Θ yields uniqueness up to isomorphism.
Let R = (Σ , Form(Σ )) be a relational language, and let A be a relational structure for R. Then we write ∇A for the relational structure A ′ for R such that: Theorem 3. Let R = (Σ , Form(Σ )) be a relational language, let Θ be a relational theory for R, and let A and A ′ be models of Θ .Then ∇A and ∇A ′ are isomorphic relational structures.
Proof.The proof goes in almost the same way as the proof of part 1 of Theorem 3.1 from [27].The only point of attention is that it may be the case that, for some P ∈ Pred n+1 (Σ ) and c ⊓ ⊔ Theorem 4. Let R = (Σ , Form(Σ )) be a relational language, and let A be a relational structure for R. Then there exists a relational theory Θ for R such that A is a model of Θ .
Proof.The proof goes in the same way as the proof of part 2 of Theorem 3.1 from [27].⊓ ⊔ 7 Query Answering Viewed through BD ⊃,F ⊥ In this section, queries applicable to a relational database and their answers are considered from the perspective of BD ⊃,F ⊥ .As a matter of fact, the queries introduced below are closely related to the relational-calculus-oriented queries originally introduced by [10].Three kinds of answers to queries are introduced.Two of them take the integrity constraint of the database into account.They differ in their approach to deal with inconsistencies.A discussion of these approaches can be found in [22,Section 8].
Queries As to be expected in the current setting, a query applicable to a relational database involves a formula of BD ⊃,F ⊥ .Let R = (Σ , Form(Σ )) be a relational language.Then a query for R is an expression of the form (x 1 , . . ., x n ) • A, where: x 1 , . . ., x n ∈ Var ; -A ∈ Form(Σ ) and all variables that are free in A are among x 1 , . . ., x n .
Let DB = (R, Θ , Ξ ) be a relational database.Then a query is applicable to DB iff it is a query for R.
Answers Answering a query with respect to a consistent relational database amounts to looking for closed instances of the formula concerned that are logical consequences of a relational theory.The main issue concerning query answering is how to deal with inconsistent relational databases.
Let R = (Σ , Form(Σ )) be a relational language, let DB = (R, Θ , Ξ ) be a relational database, and let (x 1 , . . ., x n ) • A be a query that is applicable to DB .Then an answer to (x 1 , . . ., The above definition of an answer to a query with respect to a database does not take into account the integrity constraints of the database concerned.

Consistent answers
The definition of a consistent answer given below is based on the following: the formula that corresponds to an answer is a logical consequence of some set of atomic facts and negations of atomic facts that are logical consequences of the relational theory of the database; -in the case of a consistent answer there must be such a set that does not contain an atomic fact or negation of an atomic fact that causes the database to be inconsistent.
Let R = (Σ , Form(Σ )) be a relational language.Then a semi-atomic fact for R is an A ∈ Form(Σ ) such that A is an atomic fact for R or A is of the form ¬A ′ where A ′ is an atomic fact for R.
Let R = (Σ , Form(Σ )) be a relational language, let DB = (R, Θ , Ξ ) be a relational database, and let (x 1 , . . ., x n ) • A be a query that is applicable to DB.Then a consistent answer to (x 1 , . . ., x n ) • A with respect to DB is a (c 1 , . . ., c n ) ∈ Func 0 (Σ ) n for which there exists a set Φ of semi-atomic facts for R such that: The above definition of a consistent answer to a query with respect to a database is reminiscent of the definition of a consistent answer to a query with respect to a database given in [6].It simply accepts that a database is inconsistent and excludes the source or sources of the inconsistency from being used in consistent query answering.

Strongly consistent answers
The definition of a strongly consistent answer given below is not so tolerant of inconsistency and makes use of consistent repairs of the database.The idea is that an answer is strongly consistent if it is an answer with respect to every minimally repaired version of the original database.
Let R = (Σ , Form(Σ )) be a relational language, and let Λ ⊆ Form(Σ ) be a finite set of atomic facts for R.Then, following [2], the binary relation ≤ Λ on the set of all finite sets of atomic facts for R is defined by: Intuitively, Λ ′ ≤ Λ Λ ′′ indicates that the extent to which Λ ′ differs from Λ is less than the extent to which Λ ′′ differs from Λ.
Let R = (Σ , Form(Σ )) be a relational language, let Λ ⊆ Form(Σ ) be a finite set of atomic facts for R, and let Ξ is a finite subset of Form(Σ ).Then Λ is consistent with Ξ iff for all semi-atomic facts A for R, RT (R, Λ) ⇒ A is provable only if RT (R, Λ), Ξ ⇒ •A is provable.We write Con(Ξ ) for the set of all finite sets of atomic facts for R that are consistent with Ξ .
Let R = (Σ , Form(Σ )) be a relational language, let Λ ⊆ Form(Σ ) be a finite set of atomic facts for R, let DB = (R, RT (R, Λ), Ξ ) be a relational database, and let (x 1 , . . ., x n ) • A be a query that is applicable to DB .Then a strongly consistent answer to (x 1 , . . ., x n ) The above definition of a strongly consistent answer to a query with respect to a database is essentially the same as the definition of a consistent answer to a query with respect to a database given in [2].It represents, presumably, the first view on what the repairs of an inconsistent database are.Other views on what the repairs of an inconsistent database are have been taken in e.g.[20,14,8,7,4].
Null values in answers If (c 1 , . . ., c n ) is an answer, consistent answer or strongly consistent answer to a query with respect to a database with null values, then each of c 1 , . . ., c n may be syntactically equal to nil.Such answers are called answers with null values.In most work on query answering with respect to a database with null values, answers with null values are not considered.Notable exceptions are [15,19], where the view taken on null values in relational databases is different from the view taken in this paper.

Decidability
The following theorem is a decidability result concerning being an answer to a query with respect to a database.Theorem 5. Let R = (Σ , Form(Σ )) be a relational language, let DB = (R, Θ , Ξ ) be a relational database, and let (x 1 , . . ., x n ) • A be a query applicable to DB.Then it is decidable whether, for (c 1 , . . ., c n ) ∈ Func 0 (Σ ) n : -(c 1 , . . ., c n ) is an answer to (x 1 , . . ., x n ) • A with respect to DB ; -(c 1 , . . ., c n ) is a consistent answer to (x 1 , . . ., x n ) • A with respect to DB; -(c 1 , . . ., c n ) is a strongly consistent answer to (x 1 , . . ., x n ) • A with respect to DB .
Proof.Each of these decidability results follows immediately from Theorem 2 and the definition of the kind of answer concerned.

⊓ ⊔
As a corollary of Theorem 5, we have that the set of answers to a query, the set of consistent answers to a query, and the set of strongly consistent answers to a query are computable.
Example The example given below is kept extremely simple so that readers that are not initiated in the sequent calculus proof system of BD ⊃,F ⊥ can understand the remarks made about the provability of sequents.
Consider the relational database whose relational language, say R, has constant symbols a, b, c, d, and nil and ternary predicate symbol P , whose relational theory is the relational theory of which P (a, b, nil), P (a, nil, c), P (a, nil, d), and P (b, c, d) are the atomic facts, and whose single integrity constraint is ∀x, y, z, y ′ , z ′ • (P (x, y, z) ∧ P (x, y ′ , z ′ )) → y = y ′ .Moreover, consider the query x • ∃y, z, z ′ • P (x, y, z) ∧ P (x, y, z ′ ) ∧ z = z ′ .Clearly, the set of answers is {a}.The sets of semi-atomic formulas that are logical consequences of the relational theory and do not cause the database to be inconsistent include only one of P (a, b, nil), P (a, nil, c), and P (a, nil, d).This means that, for each such set, say Φ, there is no constant symbol k ∈ {a, b, c, d, nil} such that Φ, RSA(R) ⇒ [y := k](∃x, z, z ′ • P (x, y, z) ∧ P (x, y, z ′ ) ∧ z = z ′ ) is provable.Hence, the set of consistent answers is ∅.
The repairs of {P (a, b, nil), P (a, nil, c), P (a, nil, d), P (b, c, d)} include only one of P (a, b, nil), P (a, nil, c), and P (a, nil, d).This means that, for each repair, say Λ, there is no constant symbol k ∈ {a, b, c, d, nil} such that RT (R, Λ) ⇒ [y := k](∃x, z, z ′ • P (x, y, z) ∧ P (x, y, z ′ ) ∧ z = z ′ ) is provable.Hence, the set of strongly consistent answers is also ∅.Now, consider the relational database that differs from the one described above only in that in the integrity constraint y = y ′ is replaced by y == y ′ .It is easy to see that in this case the set of answers and the set of strongly consistent answers to the query described above remain the same, but the set of consistent answers becomes {a}.
Several examples in which null values play no role can be found in [22].

The Views on Null Values in Databases
In this short section, some remarks are made on the different views that exist on null values in relational databases.

Our view
The view taken in this paper on null values in relational databases can be summarized as follows: in relational databases with null values, a single dummy value, called the null value, is used for values that are indeterminate; -a value that is indeterminate is a value that is either unknown or nonexistent; -independent of whether it is unknown or nonexistent, no meaningful answer can be given to the question whether the null value and whatever value, including the null value itself, are the same.
In the database literature, a null value for all values that are indeterminate, i.e. for all values that are either unknown or nonexistent, is usually called a no information null value.Moreover, the term inapplicable is often used instead of nonexistent.
Other views Firstly, the view taken in this paper means that there are no separate null values for values that are unknown and values that are nonexistent.Separate null values for values that are unknown and values that are nonexistent have for example been studied in [30,13].In those papers, query answering is based on a four-valued logic devised to deal with the two different null values.The logics concerned differ from each other and both differ a lot from BD ⊃,F ⊥ .Secondly, the view taken in this paper means that the values for which the null value is a dummy value is not restricted to values that are unknown.A single null value, for values that are unknown only, has for example been studied in [11,5,15].In [15] and later publications in which this kind of null value is considered, query answering with respect to a database with null values is usually approached in a way that is based on the idea that a database with null values represents a set of possible databases without null values.This approach is reminiscent of the database repair approach to query answering with respect to an inconsistent database from [2].
Thirdly, the view taken in this paper means that there are no multiple null values.Multiple null values, each for values that are unknown only, has for example been studied in [15,19].In those papers, the same approach to query answering is applied as in [15] to the case of a single null value.
A single null value for both values that are unknown and values that are nonexistent has also been studied before in [31,17].In [31], query answering is based on a three-valued logic that is closely related to BD ⊃,F ⊥ .In [17], an attempt is made to apply the approach to query answering from [15] to the case of a single null value for both values that are unknown and values that are nonexistent.
The fact that so many views on null values in relational databases have been studied indicates that time and again the views already studied turned out to be unsatisfactory from one angle or another.The view taken in this paper is primarily based on the consideration that it should be relatively simple from a logical perspective, taking into account that a database is anyhow no more than a representation of an approximation of a piece of reality.
The equality issue The view taken in this paper is essentially the same as the view taken in [31] and is based on similar considerations.There is one aspect of this view that is often considered undesirable in work on null values in relational databases, namely the point that no meaningful answer can be given to the question whether the null value equals itself.Made precise in the setting of this paper, it is the following that is often considered undesirable: The main reason that is given to consider this undesirable is that it may lead to counterintuitive answers to queries.However, this is only so in the case where it is (implicitly) assumed that the null value is a dummy value for values that are unknown only.In that case, the following is considered more appropriate: (see e.g.[19]).
It is worth mentioning that the adapted equality predicate can be expressed in the setting of this paper.Consider the abbreviation t 1 == t 2 introduced earlier.As mentioned before, it follows from the definition of this abbreviation that: Clearly, == corresponds to the adapted equality predicate.This means that, although the definitions in Sections 6 and 7 are based on the view that the null value is a dummy value for both values that are unknown and values that are nonexistent, BD ⊃,F ⊥ allows for treating the null value as a dummy value for values that are unknown only.

Concluding Remarks
In this paper, a coherent logical view on relational databases and query answering is presented that takes into account the possibility that a database is a database with null values and the possibility that a database is an inconsistent database.The presented view combines: the proof-theoretic logical view of Reiter [27] on what is a relational database, a query applicable to a relational database, and an answer to a query with respect to a consistent relational database without null values; -the view of Zaniolo [31] on null values in relational databases; -the view of Bry [6] as well as the view of Arenas et al [2] on what is a consistent answer to a query with respect to an inconsistent relational database.
The view is expressed in the setting of the paraconsistent and paracomplete logic BD ⊃,F ⊥ .In a logic that is not paracomplete, it would have been difficult to take properly into account the possibility that a database is a database with null values, and in a logic that is not paraconsistent, it would have been difficult to take properly into account the possibility that a database is an inconsistent database.
The main views on what is a consistent answer to a query with respect to an inconsistent relational database are the view of Bry [6] and the view of Arenas et al [2].The latter view is based on a notion of a minimal repair of an inconsistent database.Most other views on consistent query answering, for example the views presented in [20,14,8,7,4], are based on a notion of a minimal repair of an inconsistent database that differs from the one from [2] by different choices concerning, among other things, the kinds of changes (deletions, additions, alterations) that may be made to the original database to obtain a repair and what is taken as the extent to which two databases differ.
There are four main views on null values in relational databases, namely the view of Zaniolo [31], two views of Imieliński and Lipski [15], and the view of Vassilion [30].Other views are mostly variations on one of these views.The Codd-table view from [15], in which there are no multiple null values, can be expressed in the setting of BD ⊃,F ⊥ because the single null value can be treated as in that view by using == instead of =.In the V-table view from [15], there may be multiple null values (called marked nulls).A variation of BD ⊃,F ⊥ is needed to express this view.In the view from [30], there are separate null values for values that are unknown and values that are nonexistent.It is questionable whether BD ⊃,F ⊥ is suitable to express this view on null values in relational databases, in particular if the possibility that a databases is inconsistent has to be taken into account as well.
It is shown in this paper that, for each of the three kinds of answer introduced, being an answer to a query with respect to a relational database is decidable.However, it is to be expected that query answering for these kinds of answers is intractable without severe restrictions on the integrity constraints and/or the use of null values.A study of the computational complexity of query answering for these kinds of answers in the setting of BD ⊃,F ⊥ is an interesting option for future work.