C.3 Datalog 13 Datalog rules can also use negation.The following rules define a view relation c that contains the names of all customers who have a deposit,but have no loan, at the bank: c(N):-depositor(N,A),not is borrower(N) is _borrower(N):-borrower(N,L) Prolog and most Datalog implementations recognize attributes of a relation by position and omit attribute names.Thus,Datalog rules are compact,compared to SQL queries.However,when relations have a large number of attributes,or the order or number of attributes of relations may change,the positional notation can be cumbersome and error prone.It is not hard to create a variant of Datalog syntax using named attributes,rather than positional attributes.In such a system, the Datalog rule defining v1 can be written as v1(accountnumber A,balance B):- account(account number A,branchname"Perryridge",balance B), B>700 Translation between the two forms can be done without significant effort,given the relation schema. C.3.2 Syntax of Datalog Rules Now that we have informally explained rules and queries,we can formally define their syntax;we discuss their meaning in Section C.3.3.We use the same conven- tions as in the relational algebra for denoting relation names,attribute names,and constants (such as numbers or quoted strings).We use uppercase(capital)letters and words starting with uppercase letters to denote variable names,and lower- case letters and words starting with lowercase letters to denote relation names and attribute names.Examples of constants are 4,which is a number,and"John," which is a string;X and Name are variables.A positive literal has the form p(,t2,,tn) where p is the name of a relation with n attributes,and h,h,...,n are either constants or variables.A negative literal has the form not p(h,2,....) where relation p has n attributes.Here is an example of a literal: account(A,“Perryridge'”,B) Literals involving arithmetic operations are treated specially.For example, the literal B>700,although not in the syntax just described,can be conceptuallyC.3 Datalog 13 Datalog rules can also use negation. The following rules define a view relation c that contains the names of all customers who have a deposit, but have no loan, at the bank: c(N) :– depositor(N,A), not is borrower(N) is borrower(N) :– borrower(N, L) Prolog and most Datalog implementations recognize attributes of a relation by position and omit attribute names. Thus, Datalog rules are compact, compared to SQL queries. However, when relations have a large number of attributes, or the order or number of attributes of relations may change, the positional notation can be cumbersome and error prone. It is not hard to create a variant of Datalog syntax using named attributes, rather than positional attributes. In such a system, the Datalog rule defining v1 can be written as v1(account number A, balance B) :– account(account number A, branch name “Perryridge”, balance B), B > 700 Translation between the two forms can be done without significant effort, given the relation schema. C.3.2 Syntax of Datalog Rules Now that we have informally explained rules and queries, we can formally define their syntax; we discuss their meaning in Section C.3.3. We use the same conventions as in the relational algebra for denoting relation names, attribute names, and constants (such as numbers or quoted strings). We use uppercase (capital) letters and words starting with uppercase letters to denote variable names, and lowercase letters and words starting with lowercase letters to denote relation names and attribute names. Examples of constants are 4, which is a number, and “John,” which is a string; X and Name are variables. A positive literal has the form p(t1, t2,..., tn) where p is the name of a relation with n attributes, and t1, t2, ..., tn are either constants or variables. A negative literal has the form not p(t1, t2,..., tn) where relation p has n attributes. Here is an example of a literal: account(A, “Perryridge”, B) Literals involving arithmetic operations are treated specially. For example, the literal B > 700, although not in the syntax just described, can be conceptually