
Data Shariug Analysis for a Database Programming Language via Abstract Interpretation Giuseppe Amato Fosca Giannotti Gianni Mainetto * CNUCE, Institute of CNR, Via S.M;rria 36, 156126 Pisa, Italy Abstract subclass of DBPLs in which the data model of persis- tent values is completely integrated into a program- This paper presents an experiment in nsing n fnrmnl tech- ming language. In fact, the guiding principle of Per- niqne for static prngrnm nnnlyais, hnsodan abstract intarpre sistent Programming Languages is the orthogonal per- t.ntion, in the context of persistent progrnmming Inngnngw. sistence: it establishes that persistence is a property The nim of thn annlysis is to dntoct npportnnities for snfe of arbitrary values and all values have the same rights parallelism fnr trnnsnetinn nperatinn sehadnling. Tmnsnctinn to persistence [S]. Specifically, if a Persistent Program- apcratinns cnn he snfely intarlanved when there is no nverlnp- ping among their rends& nnd writ-b. A non-atnndnrd ming Language is designed on the basis of formal se- interpreter perfnrmcl the nnnlysis. This interpreter, given mantics, formal methods for designing, transforming the text of n trnns.actinn nnd n reprascntntinn nf the dntn and optimizing database programs can be exploited. stored in the dntnh.m, oufnmnfica//y derivea in n finite time Indeed, it is a challenging research direction to investi- n11 npprnxirnntinn of the randset and writ-t nf the nnnlysed gate whether, which and how such formal methods can lrnnsnclinn. lnfnrmntian ahtnined from the non-atnndnrd in- be successfully put to work in the database context. terpret,ntinn is provided to the schodnler hefnra haginning the cxrcntion of trnnsactinn operations. In this way, we ohtnin A In the programming language area, a consolidated schrdnler thnt renlism n cnnservntive two-phase lacking pro- class of formal techniques for static program aualy- tocol fnr persistent programming Inngnaga trnnsactinncl. We sis is known as abstract interpretation (AI) [l&3]. It npply the nnalysis to n Iangnage thnt is n signiticnnt snhset is aimed at gathering information on the dynamic se- of Gnlilan. The gnnl of the nnnlyh i.s tn &.teet the nccems mantics of a program or specification to be used by xnlely to shnrc\nhlennd mnclitinhle persistent dntn. compilers, partial evaluators and debuggers, or merely as documentation [9]. For example, logic programming has successfully used AI for detecting properties such 1 Introduction as groundness and goal independence to provide effi- cient specialised parallel execution of logic programs ‘I’hc evolution of Data Base Programming Languages [lo]. Functional programming uses AI to detect strict- (DRPLs), which provide a unifying formalism for data ness and reference independence for efficient graph re- tlcfinition and manipulation, opens up opportunities duction and optimised garbage collection [l]. For exchanging ideas, problems and technical solutions We propose using AI for a novel application, i.e. to bctwecn tbr two areas of databases and programming develop a conservative two-phase locking (2PL) pro- languages. Persistent Programming Languages are the tocol in a persistent system. An aggressive scheduler, that real&s for example a strict 2PL protocol, analyses ‘email:(fosca,~msys}Ocnuce.cnr.it phone:+39-50-593339 iax:+39-50-904052 transaction operations one at a time, and immediately Prrmi,km to copt~ wilhonl fed all or pall of this malcrial D granted decides whether to execute, delay or reject the opera- pmnidrd that ihe rnpirs are not made or dirfribwfcd for direct cam- tion [7]. It has no knowledge of the future operations mrrvial adsnntngr. thr VLDll copyright notice and the lit/r: of the of a transaction. For example, it can decide to exe- pnhlirnlion and il.4 dafr appear, and nnlicr ir ghcn that copying is cute a write operation that will subsequently risk the hy /wrmiasion af thr Iferg I,arJt Data narr: /?ndommcni. To copy nlhrrwiar. or lo republish, reqsimr e fw and/or rpwial permisrinn transaction being aborted because of a deadlock. A /mm the Endnwmrnf. conservafive scheduler should know a prioti the shared Proecwclirlg~ cd the 19th VCDB Cadiircnec data which concurrently executing transactions are go- DuMin, Irclnutl, 1993 ing to access, so that it can prevent deadlock and abort- 405 ing due to transaction conflicts. Almost all database tures whose cardinatity cannot be determined at com- systems traditionally have an aggressive and a conser- pile time: sequences and classes. vative version of schedulers, because there is a perfor- The rest of the paper is organized as follows: Section mance tradeoff between the two types of schedulers and 2 presents the language, the architecture of the sys- each version performs especially welt for certain types tem and the concurrency control protocol; Sections 3 of applications. and 4 introduce thr format framework of non-standard The scheduler can know in advance the set of dat,a access counting srmauticn and its abstract vl*rsion; in that a traIlsaction is going to acccs.9,called rrnff.url crud Srrtion 5 two cxafnptrs art* illustrat~*d; finally !+ctiou (i mrileuel, if thcr trirIlsfwt.iOll programmer prottccIarc:s it. contains ILII HHnc~ssint~ntof the phlpot8cd tc.c.hniqut* ruitl In Persistent Programming Languages, inferring rrad- directions for future ctrvelopr~~e~~k~ set and writeset of a transaction is difficult because persistent data have a complex structure and both persistent and temporary functions may be involved 2 The PPL system in a transaction execution. Thus we propose a tool, based on Abstract Interpretation, that automatically In this section we wilt sketch the language, the architec- performs a static analysis of the program that defines ture and the concurrency control protocol we are using a transaction, inferring an approximation of its readset for our experiment. Restrictions and simplifications to and writeset. the Galileo system have been assumed in order to point We anatyse transactions written in PPL, a language out the crucial issues of the proposed analysis. which is a significant subset of Galileo [3]. PPL is a The language, which we will refer to as PPL (Per- higher order functional language, strongly and stati- sistent Programming Language), is a subset of Galileo cally typed, with single inheritance, which allows an tailored for keeping the most important database con- object-oriented programming style. PPL transactions structs provided by the original languagc~. Marc spccif- can access the most important datastructures provided icatty, PPL deals with classes and objects. It is a higher by Galileo: basic type values, references, records, se- order functional language strongly and statically typed quences, functions, objects, and classes. which allows side effects to values of a limited IIIIIII- The goat of the analysis is to detect the accesses to ber of types: rcfcrences, ctasscn and objrcts. A CIHSS sh.arable and modifiable data structures such as refcr- is a modifiable sequence of objects and an obj& is an ences, classes and objects. In fact, the concurrent exe- instance of a record type with a unique ubject idcnii- cution of transactions can only create inconsistency in fier. Classes can be organised in a taxonomic hierarchy the case of updates. Our idea has been inspired by Hu- through single inheritance. Objects ran have it9 rorw dak’s proposal [15] that uses reference counting analysis ponents both functions which mime methods of ctassi- to reduce the run-time memory management overhead cal object oriented formalisms, and other objects (in- in a first order functional language. Similar problems of stances of other classes). run-time memory management for a higher-order func- Since the analysis for access counting takes place af- tional programming language have also been investi- ter the type checking of the transaction program, the gated in [l 11. language deals with welt-typed expressions. Like in The first step of our experiment consists in defining Galileo, a transaction in 1’1’1, is represrutrd by a lay- a non-standard semantics which extends the standard level expression and starts with the beginning of ttrr one by determining the number of accesses to modi- expression evaluation. An expression can be a COII- fiable data. Informally, every time the real execution stant, an identifier, a user defined function application accesses a reference or a class or an object, a corre- or the application of a language primitive. The syntax sponding access counter is incremented in either read of an expression of PPL is defined as follows’ : or write mode according to the executed operation. The second step consists in defining an abstraction of the non-standard semantics that guarantees the ter- mination of the analysis. The termination relies on the fact that the abstract execution operates on finite ab- stract domains of values. The main choice is to use a finite set of “typed” locations as an abstract domain c,p E con (conatsnts and primitives) where abstract values of the corresponding type are I, lb E Ide, Lab (identifiers and field names) cl, f, e, r, o, 1 E Ezp (expressions) stored. A special treatment has been proposed for ab- stract dynamic data structures, i.e. the data struc- 406 l’riluitivrs arc defined for each b&c and constructed the shared persistent environment. Inside a transac- type, and allow specific operations on values of that tion, local values can be declared for the sake of compu- type, for instance fwsignment on references, field se- tation (construct use-in). Figure 1 shows the architcc- leclion on records and so on. The other primitives are ture underlying PPL. It adopts the client-server model the language constructs for flow control and declara- that is typical of Object Oriented Databases and Per- tions such as if - then - else, sequencing, use, etc.. sistent Programming Languages architectures [12,13]. The following are some primitives which play a sig- The server handles the shared persistent store, i.e.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages11 Page
-
File Size-