File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/80/c80-1032_metho.xml
Size: 24,164 bytes
Last Modified: 2025-10-06 14:11:17
<?xml version="1.0" standalone="yes"?> <Paper uid="C80-1032"> <Title>DATABASE SYSTEM BASED ON INTENSIONAL LOGIC</Title> <Section position="1" start_page="0" end_page="0" type="metho"> <SectionTitle> DATABASE SYSTEM BASED ON INTENSIONAL LOGIC </SectionTitle> <Paragraph position="0"/> </Section> <Section position="2" start_page="0" end_page="0" type="metho"> <SectionTitle> DEPARTMENT OF COMPUTER SCIENCE TOKYO INSTITUTE OF TECHNOLOGY 2-12-1, OOKAYAMA, MEGURO-KU TOKYO 152, JAPAN </SectionTitle> <Paragraph position="0"> Model theoretic semantics of database systems is studied. As Rechard Montague has done in his work, 5 we translate statements of DDL and DML into intensional logic and the latter is interpreted with reference to a suitable model. Major advantages of its approach include (i) it leads itself to the design of database systems which can handle historical data, (ii) it provides with a formal description of database semantics.</Paragraph> </Section> <Section position="3" start_page="0" end_page="0" type="metho"> <SectionTitle> 1. INTRODUCTION </SectionTitle> <Paragraph position="0"> There have been developed several knowledge-base systems which utilize mathematical logic, however they can Great facts or rules at the current world only. ~~ In the medical fields or the area of artificial intelligence there are many applications in which the database systems with historical data handling capability are required. For example, in a query to a medical database tHas a sterum treatment been applied to John?' historical data is essential.</Paragraph> <Paragraph position="1"> One of the reasons why existing database systems provide poor support for such historical information is probably because very few theoretical study has been done yet.</Paragraph> <Paragraph position="2"> Intensional logic (IL) which Rechard Montague developed to describe semantics of natural language formally seems to be useful to the theory of such database. The first application of modal logic to the logic of database was done by Lipski, though he treated incompleteness of database only.</Paragraph> <Paragraph position="3"> In the Montague's approach, concepts of intension and extension are used. 5'6 The same concepts can be applied in the theory of database. Correspondence between IL and semantics of database is shown in Fig.l.</Paragraph> <Paragraph position="4"> The extension of a constant predicate P in IL which corresponds to a relation in database corresponds to the contents in the current database state.</Paragraph> <Paragraph position="5"> The main purpose of this paper is to describe in a implementation-independent way aspects of those database semantics, which are characterized by interpretation of update operations and queries . And we show the feasibility of using intensional logic for description of the semantics.</Paragraph> <Paragraph position="6"> The treatment of update of database is closely related to that of assignment in programming language with data type specification facility.</Paragraph> <Paragraph position="7"> Firstly we use Montaguets intensional logic and later we will introduce two-sorted type theory to treat queries which refer state indirectly.</Paragraph> <Paragraph position="8"> In section 2, we define a data model treated in this article. This data model is considered as hierachical relational model. In section 3, syntax of intensional logic is defined and its semantics is stated in section 4. In section 5, 6, syntax of query statements and their Montague semantics are given. In section 7, 8, data manipulation statements are introduced and their semantics is also defined. In section 9, semantics of two kinds of null value is stated as meaning postulates. In section i0, we introduce two-sorted type theory and give semantics of statements referring states. Section II is a concluding section.</Paragraph> </Section> <Section position="4" start_page="0" end_page="220" type="metho"> <SectionTitle> 2. DATA MODEL </SectionTitle> <Paragraph position="0"> In this section we define a data model which corresponds to relational model exploiting hierarchical structure of relations, that is, each component of relation may be also a relation or set of relations recursively. In the Relational Model which Codd 7 introduced, 3rd-normal form or 4th-normal form is exploited to avoid the update anomalies, though we regard it as an implementational matter. Hierachical structure of relation is quite natural for representing information in the real world.</Paragraph> <Paragraph position="1"> As a part of a data definition language (DDL), schema declaration is formally defined as follows. This DDL describes hierachical schema of database, name of each relation and attribute names or selector names of a relation. When we consider schema of relation, we do not concern the name of relation.</Paragraph> <Paragraph position="2"> Let S O be the set of all elementary data types e.g. integer, real or string of characters and so on, and F be the set of selector names.</Paragraph> <Paragraph position="3"> Schemas of database are constructed from S O recursively as strings on C t = S O u {\[,\],',:} F.</Paragraph> <Paragraph position="4"> Def. The set S of schemes is the smallest set S 2 satisfying (i),(2).</Paragraph> <Paragraph position="5"> (i) SimS0US 2, (2) t I ..... tneS I, s I ..... SnEF (si~s j for imj) => \[sl:t I .... ,Sn:tn\]ES2 (l~n).</Paragraph> <Paragraph position="6"> Schema declaration in our DDL is of the form Relation name = t * where t E S.</Paragraph> <Paragraph position="7"> Now we can define the hierarchical relational database (HRDB) as follows.</Paragraph> <Paragraph position="8"> Def. The set HD of HRDB is defined as HD= U D t . t~S For t E S, D t is the set of database whose schema is t defined recursively with the following rules (I), (2).</Paragraph> <Paragraph position="9"> (i) tES 0 => Dt=E~, where E~ is the set of data -- 5 L havlng elementary type t, (2) tES and t=\[Sl:t I ..... Sn:t n\] => Dt=2Dt~ xDt~ x...xDL' L n , where Dt~DtiU{NULL1,NIJLL2}.</Paragraph> <Paragraph position="10"> An exampIe of a database is shown as follows.</Paragraph> <Paragraph position="11"> Example i Now, we consider an employee relation comprising of tuples which have hierarchical structure. Each such tuple consists of employee number, name, education relation, age, a set of skills and children relation.</Paragraph> <Paragraph position="12"> Corresponding schema declaration is as follows.</Paragraph> <Paragraph position="13"> EMPi=\[$E:int, NAME:string, EDUCATION:\[SCHOOL:string, DEG:string, YR:int\], SKILL:\[SNAME:string\], KIDS:\[KNAME:string, AGE:int, SEX:string\], SAL:int\] Fig.2 is an instance of database with this schema at some state or world.</Paragraph> </Section> <Section position="5" start_page="220" end_page="220" type="metho"> <SectionTitle> EMPI EDUCATION SKILL SE NAME SCHOOL DEG YR SNAME i CARY J 2 JONES 3 SMITH </SectionTitle> <Paragraph position="0"> The value 'NULL1' means nothing, however in some state there may be some values. The value 'NULL2' means absolutely no value exists in any state. The order of selector in each tuple is insignificant and order of raw is also insignificant. This hierarchical schema can be visualized by tree graph. Fig.2 is a two-dimensional representation of hierarchical data which reflects the images of data instances.</Paragraph> <Paragraph position="2"/> </Section> <Section position="6" start_page="220" end_page="220" type="metho"> <SectionTitle> EDUCATION SKILL </SectionTitle> <Paragraph position="0"> Fig.3 A tree graph of hierarchical data Note that the data declaration in our DDL and this graph show the data structure only while the graph provides a convenient means to visualize the instances.</Paragraph> <Paragraph position="1"> !</Paragraph> </Section> <Section position="7" start_page="220" end_page="220" type="metho"> <SectionTitle> KIDS KNAME AGEJ SEX ~ 3. SYNTAX OF INTENSIONAL LOGIC </SectionTitle> <Paragraph position="0"> Intensional logic used in the Montaguets approach is based on the theory of types. In this section we describe the extended version of IL according to Gallin. 8 The set of all possible types is recursively defined as follows * Def. Let e, t, s be any three objects. The set of types of IL is the smallest set T satisfying (1)~(3).</Paragraph> <Paragraph position="1"> (I) e, t C/ T, (2) a, b ~ T => <a, b> E T, (3) a E T => <s, a> E T.</Paragraph> <Paragraph position="2"> Objects of type e correspond to entities. Type of IL corresponds schema of our DDL or DML. Our schema supports n-ary relations, and it is considered as n-ary function whose range is truth values. For any function of two (or more) arguments there exists an equivalent one which takes one argument at a time, 9 i.e. (DixD2 x ...</Paragraph> <Paragraph position="4"> the types in IL correspond to schemas of our DDL. Dtype which is a subset of type T in IL is now introduced as follows.</Paragraph> <Paragraph position="5"> Def. Dtype is the smallest set of T A satisfying (1)~(4).</Paragraph> <Paragraph position="6"> (i) e E T B, (2) a E T A => <s, a> ~ T B, (3) a E T B => <a, t> e T A, (4) be T B, a e T A => <b, a> ~ T A. Constants of type <s,a> (a E Dtype) correspond to relations with schema corresponding to type a. Such translation will be defined formally in section 6. Intuitively speaking, constants of type <s,<e,t>> corresponds to relations with schema \[s: int\], \[s: real\] or Is: string\], i.e. single flat domain relation. Constants of type <s,<<s,a>,t>> correspond to relations with schema \[s: \[...\]\] i.e. hierarchical relations of single domain whose value is not flat but a relation with schema corresponding to type a. By rule (4), we can define the type of IL corresponding to n-ary relation schemas. Example 2 The type of constant in IL corresponds to relation in Example 1 is which <s,<e,<e,<<s,<e,<e,<e,t>>>>,<<s,<e,t>> ,<<s,<e,<e,<e,t>>>>,<e,t>>>>>>>.</Paragraph> <Paragraph position="7"> We take CON a (VAR a) to be the set of constants (variables) of type a. Now, we define the set Tm a of terms of IL of type a as follows. Def.</Paragraph> <Paragraph position="8"> (i) CON a c Tm a, (2) VAR a c Tma, (3) A, B E Tm e => A+B, A-B, A,B, A/B ~ Tm e, (4) A e Tm<a,b >, B PS Tm a => A\[B\] ~ Tm b, (5) A C/ Tm b, x E VAR a => ~.x(A) ~ Tm<a,b >, (6) A, B E Tm a => (A-B) E Tm t, (7) A E Tm a => hA E Tm<s,a >, (8) A e Tm<s,a > => VA ETm a' (9) A, B E Tm a, P E Tm t => (P + A, B) e Tm a, (i0) A C/ Tm a, c E CON<s,b >, B e Tm b => {B/Vc}A PS Tm a, (Ii) A e Tm t => PA e Tm t, FA e Tm t. The additional construct (i0) is introduced by Janssen. I0 Following Henkin, II we define sentential connectives, quantifiers and modal operators as follows.</Paragraph> <Paragraph position="9"> Def.</Paragraph> <Paragraph position="10"> (I) T = \[kxtxt-~.xtxt\].</Paragraph> <Paragraph position="11"> (2) F = \[~,xtxt-AxtT\], (3) ~ = Xxt\[F'xt\], (4) A = AxtkYt\[If<t,t>\[fx.y\].~f<t,t>\[fT\]\] , (5) / = kxtkYt\[\[xAy\]'x\], (6) V = ~xtAYt\[,-.x+y\], (7) YxaA = \[AxaA'AxaT\], (8) ~XaA = ~Y=xa~A, (9) \[Aa~B a\] = \[AAa'ABa\], (I0) \[\]A = \[A~T\].</Paragraph> <Paragraph position="12"> (ii) OA = ~\[\]~A.</Paragraph> <Paragraph position="13"> We write \[AAB\] instead of \[\[hA\]B\] where A and B are formulas, similarly for the other binary connectives.</Paragraph> </Section> <Section position="8" start_page="220" end_page="222" type="metho"> <SectionTitle> 4. SEMANTICS OF IL </SectionTitle> <Paragraph position="0"> The terms of intensional logic are interpreted in an intensional model. Such a model is a system M = (Ma, <, m)aPST, where M a is a frame based on non-empty sets D and I, and < is a linear ordering on S. To simplify following arguments, we make no distinction among 'int', 'real' and 'string', and they are represented by D.</Paragraph> <Paragraph position="1"> Def. Frame is defined as the indexed family (Ma)aE T of sets, where (i) Me=D u {NULL1, NULL2}, (2) Mt=2={0,1}, (3) M<a,b>=MbMa={FIF:Ma->Mb}, (4) M<s,a>=MaI={FIF:I->Ma } U {NULL1, NULL2}. Function m must be such that if c is a a constant of type a, then m(Ca)eM<s,a >. Tile assignment g is a function from variable to value such that if x e VAR a then g(x a) e M a. If x a is a variable of type a, and x e M a then g(x/X) denotes the value assignment exactly like g except that it assigns the value X to the variable x.</Paragraph> <Paragraph position="2"> Now we define the interpretation of a term A a in a model M with respect to the state s and the assignment g. It is denoted by VM,s,g(Aa) and defined inductively as follows. (We dropped the subscript 'Mr.) Def.</Paragraph> <Paragraph position="3"> (i) Vs,g(Xa)=g(Xa), XaEVARa, (2) Vs,g(Ca)=m(Ca)(S), CaeCON a, (3) Vs,g(Ae+Be)=Vs,g(Ae)+Vs,g(Be) and similar for the other arithmetical operations, (4) Vs,g(A<a,b >\[ Ba\])=Vs, g(A<a,b>)\[Vs,g(Ba)\], (5) Vs,g(XXaAb)=the function f with domain M a, such that whenever XeM a then f(x)=Vs,g,(Ab), where g'=g(x/X). By using meta-operator \[, we express the above as \[ X\[Vs,g,(Ab)\] , (6) Vs,g(Aa-Ba)=l if Vs,g(Aa)=Vs,g(Ba), and 0 otherwise, (7) Vs,g(AAa)=\[ j\[Vj,g(Aa)\] , (8) Vs,g(VA<s,a>)=Vs,~~(A<s,a>)(s), (9) Vs,g((Pt+A a, Ba))=Vs,g(Aa) if Vs,g(Pt)=l, and Vs,g(B a) otherwise, (10) Vs,g({Bb/VC<s,b>}Aa)=Vt,g(Aa ), where t=<c+V s,g(B b) >s, (II) Vs,g(PAt)=I if there is some s' in S such that s'<s and Vs,,g(A)=1, 0 otherwise, (12) Vs,g(FAt)=l if there is some s' in S such that s<s' and Vs, g(A)=l, 0 otherwise. In the rule (10) t denotes the state in which all constants have values exactly like in s except that the value of Vc is the value of the expression B b in the state s.</Paragraph> <Paragraph position="4"> We must clarify the notion of state in our model to define the meaning of database. State is understood to present the internal situation of a database. A state is altered by update operations. A new state s I preceeds an old state s 2, i.e. (s2<sl). Clearly a state sEl determines the value of all relations. The effect of update operation is that it modifies the value of single relation, and in order to model this update operation, it should be assumed that the resulting state always exists and is unique.</Paragraph> <Paragraph position="5"> So we restrict our model for IL which satisfies the following postulates.</Paragraph> <Paragraph position="6"> I) Update postulate For every t I ~ I, every c C/ CON<s,a > (a E Dtype) and every i e M a, there exists a unlque</Paragraph> <Paragraph position="8"> for all constants c' m c.</Paragraph> <Paragraph position="9"> 2) Uniqueness postulate For every t i, t 2 e I (t I ~ t$), there exists c ~ CON<s,a > (a e Dtype) such t~at</Paragraph> <Paragraph position="11"> that is, the result of update operation should be distinct from all of the other states.</Paragraph> <Paragraph position="12"> Therefore, we can identify a state with contents of database. The database is translated into constant in IL. So the set I of states is defined by</Paragraph> <Paragraph position="14"/> </Section> <Section position="9" start_page="222" end_page="222" type="metho"> <SectionTitle> 5. QUERY STATEMENTS </SectionTitle> <Paragraph position="0"> Now we introduce a syntax of queries in our data manipulation language (DML). The set Q of queries is defined as QiuQ2 recursively.</Paragraph> <Paragraph position="1"> Def.</Paragraph> <Paragraph position="2"> (i) O, I c Qi' (2) d E descriptor => d E QI' (3) ql' q2 ~ Qi => -ql' (ql+q2)' (qldegq2)' (ql/q2), always ql' past q1' future q2 ~ QI' (4) f ~ Q2' q ~ Q1 => q when f, q whenever f c QI' (5) T, F ~ Q2' (6) ql' q2 E Q1 => ql=q2 e Q2' (7) fl' f2 E Q2 =>'If1' (flVf2)' (flAf2)' (fl=>f2), always f, past f, future f, f2 when fl' f2 whenever fl E Q2&quot; Qi is the set of queries for which an answer is a set of objects. For a query in Q2 an answer is yes or no.</Paragraph> <Paragraph position="3"> Every descriptor is of the form <R, s I, s 2, A>, where R is a relation name, s\], s 2 are sequences of selectors, and A is the ~ubset of D t which is accessed by s 2.</Paragraph> <Paragraph position="4"> <R, s I, a 2, A> is used to denote the set of ~ element of tuples in the relation R whose s 2 ement is in A. In the above rule (3) all descriptors in (ql+q2), (qloq2) or (q1/q2) must have the same selector sequence s I as their second component.</Paragraph> <Paragraph position="5"> We assume certain auxiliary language for describing A which is a subset of the domain D t. Example 3 Let us consider a query, tWas every employee who has a child named Jack educated at school B or C?' on the database given in the previous example. We have a expression <EMP, NAME, KIDS.KNAME, {Jack}> o -<EMP, NAME, EDUCATION.SCHOOL, {B, C}>=0. Let us consider another example as follows. 'Get all names of employees who always earn more than I0000 or less than 500. I The corresponding expression is always(<EMP, NAME, SAL, {xlx>10000}> + <EMP, NAME, SAL, {xTx<500}>).</Paragraph> </Section> <Section position="10" start_page="222" end_page="223" type="metho"> <SectionTitle> 6. SEMANTICS OF QUERIES </SectionTitle> <Paragraph position="0"> We have already defined a model theoretic meaning of IL. Thus the remaining part of Montague semantics is defining a translation which gives for each syntactic structure of the language some meaningful expression of IL. For a part of statement E, its translation into IL is denoted E t. Relation name R is translated into a constant R' of IL whose type is determined by its schema declared at DDL. More precisely this type is determined with next rules. If there is a statement VRname: t' in a data definition part, then type of the constant Rname' is G(t), where G is a function</Paragraph> <Paragraph position="2"> (2) tE S O => F(t) = e.</Paragraph> <Paragraph position="3"> Each descriptor <R, s I, s 2, A> is translated according to the schema of R and sequences of selectors s I and 82. Let s o denote the common maximal prefix of s I, s 2 and Is0i'~=n, Is I \[=n+k, Is 21=n+q, i.e. s I, s 2 are represented as Sl=S01.s02...S0n.Sll.Sl2...Slk, s2=s01.s02 ... S0n. S21.s22...S2q.</Paragraph> <Paragraph position="4"> t For string s, Isl denotes length of s.</Paragraph> <Paragraph position="5"> , where the sequence 3ii...3i m 2~oes~ not contain ~iSll or ~'is2 I. The number m and positions of \[i \], \[i \] in the sequence of Sll s21 \[il\]...\[i m\] are determined self evidently by the DDL statement about R. If n=0 then the first component \[R(So1...S0n)\]'\[R'\]\[i\] of the above conjunctive form is replaced by R'-i. If k=0 or q=0 then an appropriate but obvious modification is also needed. It is possible to construct this IL expression systematically according to a micro syntax of a descriptor, however it is somewhat tedious so we do not concern it. When a is a type of sub-schema corresponding to the selector s9\], A' is a predicate of type <a, t> in which Aqi) has the value i when an object corresponding to i is an element of A.</Paragraph> <Paragraph position="6"> Each i s is a bounded variable whose type is the one determined by G and sub-schema corresponding to a selector s used in a relation R.</Paragraph> <Paragraph position="7"> Translation of R(Sl...Sn) is defined as follows.</Paragraph> <Paragraph position="9"> , where, each bounded variable il,..0,i_ has the same type determined by G and su~-schema corresponding each selector which appears in the same level of relation R as the selector s n appears. Moreover the sequence 3ii,..., 3i n does not contain ~i_.</Paragraph> <Paragraph position="10"> According to the syntax of Q, translation into IL expression is defined as follows.</Paragraph> <Paragraph position="11"> Def.</Paragraph> <Paragraph position="12"> (1) \[O\]'=A~xEF\]\[x\], (2) \[l\]'=^~x\[T\]\[x\], (3) \[-q\]'=AXx(~(V\[q\]'\[x\])), (4) \[ql+q2\]'=Axx(vEql\]'\[x\]vV\[q2\]'\[x\]), (5) \[qloq2\]'=A~x(V\[ql\]'\[x\]AV\[q2\]'\[x\]), (6) \[q1*q2\]'=A~x(~V\[ql\]'\[x\]vV\[q2\]'\[x\]), (7) \[always q\]'=A~x(~V\[q\]'\[x\]), (8) \[past q\]'=A%x(eV\[q\]'\[x\]), (9) \[future q\]'=A~x(FV\[q\]'\[x\]), (I0) \[q when f\]', \[q whenever f\]': these will be defined in section I0, (11) \[T\]'=AT, \[F\]'=AF, (12) \[ql=q2\]'=A(V\[ql\]'mV\[q2\]'), (13) \[~f\],=A(V\[f\],), (14) \[flVf2\]'=A(V\[fl\]'vV\[f2\]'), (15) \[flAf2\]'=A(V\[fl\]'AV\[f2\]'), (16) \[fl=>f2\]'=^(~V\[fl\]'VV\[f2\]'), (17) \[always f\],=~v\[f\],, (18) \[past f\],=pV\[f\], (19) \[future f\]'=FV\[f\] ', (20) \[f2 when fl \]', \[f2 whenever fl\]': these will also be defined in section i0. In case of \[0\]'. \[I\]', type of x is determined by the context of its usage in a query.</Paragraph> </Section> <Section position="11" start_page="223" end_page="223" type="metho"> <SectionTitle> 7. DATA MANIPULATION STATEMENTS </SectionTitle> <Paragraph position="0"> Insertion, deletion and update of tuples in database are now considered. We concern the case where we can manipulate either one tuple at a time or a set of tuples with a single command.</Paragraph> <Paragraph position="1"> Syntax of update statements is defined as follows. Update statements are built up from certain descriptor and operation. More exactly, the set M of data manipulation statements is defined with the following four cases: I~ (se t oriented update) d: descriptor, <f,d> ~ M , where f means arbitrary operation on the object in the answer of d, (2) (individual insertion) (2-i) <R, t> E M , where, R is a relation name and t is a tuple which is intended to be inserted into R, (2-2) d: descriptor, <d, t> PS M, (3) (individual deletion) (3-1) ~<R, t> e M, (3-2) d:descriptor, ~<d, t> PS M, (4) (set oriented deletion) ~<R, S, A> ~ M , where, R is a relation name, s 2 is a sequence of selectors and A is the subset of D t which is accessed by s 2.</Paragraph> <Paragraph position="2"> A set oriented update statement (i) changes all elements in a relation R that are elements of answer for query q by values which is a result of operation f on them. An individual insertion (2-1) means insertion of a tuple t into a relation R as usual, and an individual insertion (2-2) means insertion of a tuple t into the all relations which are elements of answer for query d. We can define the meaning of individual deletions (3-1), (3-2) in the same manner as in the case of insertion by changing the word 'insert w by 'delete v. Set oriented deletion statement (4) deletes all tuples whose values accessed by B 2 are in A from relation R.</Paragraph> </Section> <Section position="12" start_page="223" end_page="223" type="metho"> <SectionTitle> 8. SEMANTICS OF DATA MANIPULATION </SectionTitle> <Paragraph position="0"> In the Montague semantics, a data manipulation statement is translated into forward predicate transformer, which is a function from a state predicate to a state predicate whose type is <s, t>, and which has the format of an intension of an assertion. So the predicate transformer has a type <<s, t>, <s, t>> and has the format kP(~), where P~VAR<o +> and ~ is a term of type <s, t>. For set orlented update statement, we define the translation into IL as follows. In this definition symbol ,+t is used to designate the are needed as in the case of query statements. For insertion operation <d,t> and deletion operations ~<d,t>; ~<R,S,A>, we can define their corresponding IL expressions in the same manner as shown in the case of set oriented update.</Paragraph> <Paragraph position="1"> By using an intensional version of Floyd's semantics of assignment 12 \[A:=B\]'=IP^~z\[{z/VA'}VpAVA'-{z/VA'\]B'\], and semantics of composition</Paragraph> </Section> class="xml-element"></Paper>