skip to main content
10.1145/308386.308462acmconferencesArticle/Chapter ViewAbstractPublication PagespodsConference Proceedingsconference-collections
Article
Free Access

What should a database know?

Authors Info & Claims
Published:01 March 1988Publication History

ABSTRACT

The by now conventional perspective on databases, especially deductive databases, is that they are sets of first order sentences. As such, they can be said to be claims about the truths of some external world, the database is a symbolic representation of that world.

While agreeing with this account of what a database is, I disagree with how, both in theory and practice, a database is used, specifically how it is queried and how its integrity is enforced.

Virtually all approaches to database query evaluation treat queries as first order formulas, usually with free variables whose bindings resulting from the evaluation phase define the answers to the query. The sole exception to this is the work of Levesque (1981, 1984), who argues that queries should be formulas in an epistemic modal logic. Queries, in other words, should be permitted to address aspects of the external world as represented in the database, as well as aspects of the database itself i e aspects of what the database knows. To take a simple example, suppose DB = p y q

Query p (i e is p true in the external world?)

Answer unknown

Query Kp (i e. do you know whether p is true in the external world?)

Answer no

Levesque's modal logic (called KFOPCE) distinguishes between known and unknown individuals in the database and thus accounts for “regular” database values as well as null values. For example, if KB is

{Teach (John, Math100), (∃ x) Teach (x, CS100), Teach (Mary, Psych100) y Teach (Sue, Psych100)},

then

Query (∃ x)K Teach (John, x) i e is there a known course which John teaches?

Answer yes-Math100

Query (∃ x)K Teach (x, CS100) i e is there a known teacher for CS100?

Answer No

Query (∃ x) Teach (x, Psych100) i e does anyone teach Psych 100?

Answer: Yes - Mary or Sue

Query (∃ x)K Teach (x, Psych100) i e is there a known teacher of Psych100?

Answer No

Levesque (1981, 1984) provides a semantics for his language KFOPCE FOPCE, is the first order language KFOPCE without the modal K Levesque proposes that a database is best viewed as a set of FOPCE sentences, and that it be queried by sentences of KFOPCE. He further provides a (noneffective) way of answering database queries.

Recently I have considered the concept of a static integrity constraint in the context of Levesque's KFOPCE (Reiter 1988). The conventional view of integrity constraints is that, like the database itself, they too are first order formulas (e g Lloyd & Topor (1985), Nicolas & Yazdanian (1978), Reiter (1984)). There are two definitions in the literature of a deductive database KB satisfying an integrity constraint IC.

Definition 1 Consistency (e.g. Kowalski (1978), Sadri and Kowalski (1987)) KB satisfies IC if f KB + IC is satisfiable

Definition 2 Entailment (e g Lloyd and Topor (1985), Reiter (1984)) KB satisfies IC if f KB @@@@ IC

Alas, neither definition seems correct. Consider a constraint requiring that employees have social security numbers (Vx) emp (x) ⊃ (∃ y) ss# (x y) (1)

1 Suppose KB = {emp (Mary)} Then KB + IC is satisfiable. But intuitively, we want the constraint to require KB to contain a ss# entry for Mary, so we want IC to be violated. Thus Definition 1 does not capture our intuitions.

2 Suppose KB = { } Intuitively, this should satisfy IC, but KB @@@@ IC. So Definition 2 is inappropriate.

An alternative definition comes to mind when one sees that constraints like (1) intuitively are interpreted as statements not about the world but about the contents of the database, or about what it knows. Thus, using the modal K for “knows”, (1) should be rendered by (Vx K emp (x) ⊃ (∃ y) K ss# (x y)

Other Examples

1 To prevent a database from simultaneously assigning the properties male and female to the same individual, use the constraint (Vx) ⌍ K (male (x) ∧female (x))

2 To force a database to assign one of the properties male and female to each individual, use the constraint (Vx) K person (x) ⊃K male (x) ∨ K female (x)

3 To require that known instances of the relation mother(,) have first argument a female person and a second argument a person, use the constraint (Vx, y) K mother (x,y) ⊃ K (person (x) ∧female (x) ∧person (y))

4 To require that every known employee have a social security number, without necessarily knowing what that number is (so that a null value is permitted), use (Vx) K emp (x)K (∃ y) ss# (x y)

My account of integrity constraints therefore, is that rather than being first order sentences, they are sentences of Levesque's KFOPCE. Constraints are not statements about the world, but about the contents of the database. The natural definition of when a database KB satisfies a constraint IC is the following KB satisfies IC iff the answer to IC when viewed as a query to KB is “yes”.

In effect, therefore, my proposal is to understand integrity constraints as formally indistinguishable from KFOPCE queries, with the proviso that for any database state the answer to these queries must be “yes”.

My talk will elaborate on the above notion of deductive databases. Specifically, it will provide Levesque's semantics for the K operator, discuss query evaluation under the closed world assumption, characterize integrity checking for a natural class of integrity constraints and databases, and conclude with some open research topics.

References

  1. Kowalskl (1978) Logic for data descnptton, m H Gallan'e and J Marlker (eds), Logtc and Data Bases, Plenum Press, New York, pp 77-103Google ScholarGoogle Scholar
  2. Levesque, H J (1981) A formal treatment of incomplete knowledge bases, Ph D thes~s, Dept of Computer Science, Umvers~ty of Toronto, also avatlable as Techmcal Report No 3, Falrchtld Laboratory for Axttfieml Intelhgenee Rcseareh, Patio Alto, Cahforma Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Levesque, H J (1984) Foundauons of a functtonal approach to knowledge representataon, Araficzal lntelhgence 23, pp 155-212 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Lloyd, J W, and Topor, R W. (1985) A basts for deducuve database systems, J Logic Progranmung 2 93-109 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Nicolas, J.}VI and Yazdanlan, K (1978). Integrity checking m deAuctwe data bases, m- I-L Gallmre and J Mmker (eds ), Logtc and Data Bases, Plenum Press, New York, pp 325-344Google ScholarGoogle Scholar
  6. Rmter, R (1984) Towards a logtcal reconstn~t~on of relauonal database theory, m M~L Brod~, J Mylopoulos and j W Schnndt (eds), On Conceptual Modelhng Perspectzves from Arnfictal lntelhgence, Databases and Programrmng Languages, Sprmger, New York, pp 191-233.Google ScholarGoogle Scholar
  7. Relter, R. (1988) On mtegnty constraints, Proc Theorencal Aspects of Reasomng about Knowledge, Asdomar, CA, March 7-9Google ScholarGoogle Scholar
  8. Sadn, F and Kowalska, R (1987) An apphcatton of general purpose theorem-proving to database integrity, m J Mmker (ed.), Foundanons of Deducnve Databases and Logzc Progranmung, Morgan Kaufmann Pubhshers, Palo AltoGoogle ScholarGoogle Scholar

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Conferences
    PODS '88: Proceedings of the seventh ACM SIGACT-SIGMOD-SIGART symposium on Principles of database systems
    March 1988
    352 pages
    ISBN:0897912632
    DOI:10.1145/308386

    Copyright © 1988 ACM

    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 1 March 1988

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • Article

    Acceptance Rates

    Overall Acceptance Rate642of2,707submissions,24%

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader