A Temporal Logic Based Approach for Querying Lists, Trees, and DAGs in Databases

合集下载

一个无穷维动力系统的行波解

一个无穷维动力系统的行波解

NONLINEARITY doi:10.1088/0951-7715/24/10/012
Travelling wave solutions for an infection-age structured epidemic model with external supplies
Arnaud Ducrot and Pierre Magal
2 ∂t S(t, x) = dS ∂x S(t, x) +
− γ S(t, x),
for t > 0,
x ∈ R,
(1.1)
where the parameter > 0 represents the entering flux of susceptible individuals, while γ > 0 is the rate at which individuals die or leave the population. If we assume that the process of contamination occurs by mass action law, then the model we will consider in this work reads as
ቤተ መጻሕፍቲ ባይዱ
where the function β(a) denotes the infection age-specific contamination rate and the function µ(a) represents an additional mortality (or exit) rate due to the disease. Here the diffusion coefficients dS > 0 and dI > 0 describe the spatial motility of each class. Note that the diffusion coefficients may be different from susceptible to infected depending on the disease. Throughout this work, we will make the following assumption. Assumption 1.1. We assume that dS , dI , and γ are positive constants, and the maps a → β(a) and a → µ(a) are almost everywhere bounded, and, respectively, belong to L∞ (0, ∞) and L∞ loc ([0, ∞)). The corresponding spatially homogeneous system reads as

英语作文里的逻辑如何体现

英语作文里的逻辑如何体现

英语作文里的逻辑如何体现Logic is an essential component of writing an effective and persuasive essay. It is the backbone of a well-structured essay that presents a clear and concise argument. In this essay, I will discuss how logic is reflected in English writing and provide a high-quality imitation of the most downloaded essay online.Firstly, logic is reflected in the structure of an essay. A well-structured essay follows a logical sequenceof ideas that leads the reader from the introduction to the conclusion. The introduction should provide background information and set the tone for the essay. The body paragraphs should be organized in a logical order that supports the thesis statement. Each paragraph shouldcontain a topic sentence that introduces the main idea and evidence that supports it. The conclusion should summarize the main points and restate the thesis statement.Secondly, logic is reflected in the use of evidence. Apersuasive essay should provide evidence that supports the argument. The evidence should be relevant, reliable, and presented in a logical manner. The writer should use facts, statistics, and examples to support their argument. The evidence should be presented in a logical order that supports the thesis statement.Thirdly, logic is reflected in the use of language. The language used in an essay should be clear, concise, and precise. The writer should avoid using vague or ambiguous language that can confuse the reader. The writer should use words and phrases that are appropriate for the audience and the purpose of the essay. The writer should also use transitional words and phrases to connect ideas and create a logical flow.Now, let me provide a high-quality imitation of the most downloaded essay online, reflecting the use of logicin English writing.The topic of my essay is the importance of exercise for a healthy lifestyle. The essay will follow a logicalstructure that includes an introduction, body paragraphs, and a conclusion. The body paragraphs will provide evidence that supports the argument that exercise is essential for a healthy lifestyle.Introduction:Exercise is an essential component of a healthy lifestyle. It has numerous benefits that include weight loss, improved cardiovascular health, and increased energy levels. In this essay, I will discuss the importance of exercise for a healthy lifestyle.Body Paragraph 1:Exercise is an effective way to maintain a healthy weight. It burns calories and increases metabolism, which helps to reduce body fat. In addition, exercise can help to prevent obesity, which is a major risk factor for many chronic diseases.Body Paragraph 2:Exercise improves cardiovascular health. It strengthens the heart and improves blood flow, which reduces the risk of heart disease and stroke. Regular exercise can also lower blood pressure and cholesterol levels, which are other risk factors for cardiovascular disease.Body Paragraph 3:Exercise increases energy levels and improves mood. It releases endorphins, which are natural mood boosters. Regular exercise can also improve sleep quality, which is essential for overall health and wellbeing.Conclusion:In conclusion, exercise is essential for a healthy lifestyle. It has numerous benefits that include weight loss, improved cardiovascular health, and increased energy levels. By incorporating exercise into our daily routine, we can improve our overall health and wellbeing.。

Complexity of monodic guarded fragments over linear and real time

Complexity of monodic guarded fragments over linear and real time
Complexity of monodic guarded fragments over linear and real time
Ian Hodkinson 1
Department of Computing, Imperial College London, London SW7 2AZ, UK
1
Introduction
Propositional temporal logic is now well established, both in its theory and its utility for practical applications in computing. In contrast, predicate, or first-order, temporal logic has been less studied. Unpublished results of Lindstr¨ om and Scott in the 1960s showed that even weak fragments of first-order temporal logic are highly undecidable, and these and later similar results (see, e.g., [6,15]) may have suggested that other areas were more profitable to work on. Recently, however, some decidable fragments of first-order temporal logic have been found. The so-called monodic fragments, originating in [15], have now been quite extensively investigated. In these fragments, formulas beginning with a temporal operator are required to have at most one free variable. Also, the ‘first-order part’ of formulas must lie in some decidable fragment of first-order logic with very mild closure properties. Suitable fragments include the monadic fragment (with only unary relation symbols), the one- and two-variable fragments, and the guarded, loosely guarded, and packed fragments. [15] showed that the monodic fragments based on all these first-order fragments are decidable over a wide range of linear flows of time. (We use ‘flow of time’ synonymously with ‘strict partial order’.) A notable case left open in [15] is for real

线性时态逻辑LTL的一个公理系统及其可靠性证明

线性时态逻辑LTL的一个公理系统及其可靠性证明

LTL的一个公理系统及其可靠性证明题目:LTL的一个公理系统及其可靠性证明@binzhengLTL的一个公理系统及其可靠性证明题目(列出相应的参考文献):提高题1. 给出LTL的一个可靠的公理系统并证明其可靠性。

1) 以写出的独立的公理数目作为评分标准。

2) 不必证明写出公理的独立性。

答:一、根据课程讲义的语义规定:⏹Let σ be a sequence s0 s1 s2… in a Kripke Model M⏹Let σi be a suffix of σ: s i s i+1 s i+2… (σ0 =σ )⏹σi |= p, where p a proposition, if p is in L(s i).⏹σi |= Φ/\ψ if σi |= Φ and σi |= ψ.⏹σi |= Φ\/ψ if σi |= Φ or σi |= ψ.⏹σi|= ¬Φ if it is not the case that σi |= Φ.⏹σi |= OΦ if σi+1 |= Φ⏹σi |= <>Φ if for some j≥i, σj |= Φ.⏹σi |= []Φ if for each j≥i, σj |= Φ.⏹σi |= ΦU ψ if for some j≥i, σj|=ψ.and for each i≤k<j, σk |=Φ.⏹σi |= ΦR ψ if either for every j≥i, σj |= ψ or for some j≥i, σj|= Φ and,for every i≤k≤j, σk |= ψ.⏹Intuitively, ΦR ψ means ψ holds forever or holds until some pointswhere both Φ and ψ hold.二、以下是LTL的一个可靠的公理系统(共19个公理)及其证明记Φ,ψ,ρ为LTL语法定义中的公式公理1)O (Φ∨ψ) ≡(O Φ) ∨(O ψ)左边到右边:由语义定义,σi+1 |= (Φ∨ψ),即或者σi+1 |= Φ,或者σi+1 |=ψ,即(O Φ) ∨(O ψ)。

异构多智能体系统模型检查

异构多智能体系统模型检查
able to observe the whole information of the system and whether agents are able to record the history information agents’strategies are ,
divided into fo ur types.These strategy abilities are def ined in sem antic level of ATL,as w ell as other logics.H owever,under perfect inform ation and perfect recall setting.aI1 agents have the same strategy ability.Under imperfect information and/or imperfect recall
M odel-Checking for H eterOgeneOus M ulti—Agent System s
ZHANG Ye—Di. SONG Fu
(School ofInformation Science and Technology,Shanghai Tech University,Shanghai 201210,China)
中文 引用格 式 :张业 迪,宋 富.异 构 多智 能体 系统模 型检 查.软 件学报 ,2018,29(6):1582—1594.http://www.jOS.org.crgl000—9825/
5462.htm
英文 引用格 式:Zhang YD Song F.ห้องสมุดไป่ตู้odel—Checking for heterogeneous multi.agent systems.Ruan Jian Xue Bao/Journal of Software,201 8,29(6):1 582—1 594(in Chinese).http://www.jos。org.en/1 000—9825/5462.htm

Temporal and Modal Logic Programming Languages

Temporal and Modal Logic Programming Languages

In a modal logic, the meaning of a formula depends on an implicit context. The collection of contexts is said to be the set of possible worlds denoted by U . In Kripke semantics, a relation over U , called the accessibility relation, is associated with each modal operator. A world v is said to be accessible from a world u if hu; vi belongs to 2
Manolis Gergatsoulis
1 Introduction
The main idea behind logic programming is the use of (a subset of) logic as a programming language. In the well-known logic programming language Prolog, the knowledge and assumptions about a problem are formalized as a set of logical axioms in the form of Horn clauses Llo87]. A proof system, called SLD-resolution, is used to prove that a statement, called a goal clause, is a logical consequence of the program. In this way, SLD-resolution plays the role of an execution mechanism of the language.

1 Introduction A Modal Logic for Reasoning about Possibilistic Belief Fusion

A Modal Logic for Reasoning about Possibilistic Belief FusionChurn-Jung Liau Tuan-Fang FanInstitute of Information Science Institute of Information ManagementAcademia Sinica National Chiao-Tung UniversityTaipei115,Taiwan Hsinchu300,Taiwanliaucj@.tw tffan.iim92g@.tw1IntroductionIn this paper,we propose a modal logic for reasoning aboutpossibilistic belief fusion.This is a combination of multi-agent epistemic logic and possibilistic logic.We use gradedepistemic operators to represent agents’uncertain beliefs,andthe operators are interpreted in accordance with possibilisticsemantics.We employ ordered fusion based on a level skip-ping strategy to resolve the inconsistency caused by directfusion;that is,the level at which the inconsistency occurs isskipped.Here,we present the formal semantics and an ax-iomatic system for the logic.2SyntaxTo encode the degrees of reliability of n agents,we use or-dering relations over any subset of{1,...,n}.Let T O n de-note the set of all possible strict total orders over any non-empty subset of{1,...,n}.Then,we can associate a uniquesyntactic notation with each strict total order in T O n.LetX={i1,i2,...,i m}be a non-empty subset of{1,...,n}and>be a strict total order such that i j>i k iff j<k for all1≤,j,k≤m.Then,the syntactic notation for(X,>)is thestring i1>i2>···>i m.In this paper,the capital letter O is used to denote meta-variables ranging over such notations.Let O be the stringi1>i2>···>i m,then the set{i1,i2,...,i m}is calledthe domain of O,denoted byδ(O).In this case,O>i m+1denotes i1>i2>···>i m>i m+1if i m+1∈δ(O).Asthe syntactic notation is unique for each total order,we canalso identify the notation with the total order itself,and writeO∈T O n.Furthermore,the upper-case Greek letterΩisused to denote meta-variables ranging over nonempty subsetsof T O n.We now present the syntax of our logic for reasoning aboutpossibilistic belief fusion based on a level skipping strategy.The logic is called SFPL⊗,n ,where ∈[0,1]is the incon-sistency tolerance degree of the logic and⊗is a continuous T-norm1.LetΦ0be a set of propositional symbols.Then theset of well-formed formulas(wff)of SFPL⊗,n is defined asthe smallest set containingΦ0∪{⊥, },and is closed under Boolean operators and the following rule:1A T-norm is any binary operation on[0,1]that is commutative, associative,non-decreasing in each argument,and has1as unit.•ifϕis a wff,then[Ω]aϕand[Ω]+aϕare wffs for any nonemptyΩ⊆T O n,and any rational number a∈[0,1].IfΩ={O}is a singleton,we write[O]aϕ(resp.[O]+aϕ), instead of[{O}]aϕ(resp.[{O}]+aϕ).Intuitively,[O]aϕ(resp. [O]+aϕ)means that an agent merging distributed beliefs in ac-cordance with the ordering of O will believeϕwith a strength at least equal to(resp.more than)a.We can view each O as a virtual agent,and[Ω]corresponds to a distributed belief oper-ator[Fagin et al.,1996]of virtual agents inΩ.Note that our purpose is to ensure the consistency of ordered fusion based on any single order O.WhenΩcontains more than one or-der,[Ω]+ ⊥may hold.This does not matter,however,since a non-singletonΩplays only an auxiliary role in our logic.3SemanticsTo present the semantics,we briefly review possibility theory [Zadeh,1978].In this theory,each possibility distribution π:W→[0,1]can derive an associated possibility measure Π:2W→[0,1]and a necessity measure N:2W→[0,1], asΠ(X)=sup x∈Xπ(x)and N(X)=1−sup x∈Xπ(x).A possibility distributionπ:W→[0,1]is normalized if Π(W)=1.A normalized possibility distribution repre-sents a consistent belief state.Ifπis not normalized,i.e., sup x∈Wπ(x)<1,it represents a partially inconsistent belief state.1−sup x∈Wπ(x)is called the inconsistency degree of π,and is denoted byι(π).An SFPL⊗,n-structure is a tuple M=(W,(πi)1≤i≤n,V), where W is a set of possible worlds,eachπi maps each world w to a possibility distributionπi,w:W→[0,1]over W such thatι(πi,w)≤ ,and V maps elements inΦ0to subsets of W. We defineπO,w for each O∈T O n and w∈W inductively as follows:πO>i,w=πO,w ifι(πO,w⊗πi,w)> ,πO,w⊗πi,w otherwise. Furthermore,we also defineπΩ,w for eachΩ⊆T O n and w∈W,asπΩ,w=O∈ΩπO,w.Then,the satisfactionrelation|=for SFPL⊗,n-model is defined as•w|=p iff w∈V(p),for each p∈Φ0,•w|=⊥and w|= ,•w|=¬ϕiff w|=ϕ,•w|=ϕ∨ψiff w|=ϕor w|=ψ,•w|=[Ω]aϕiff NΩ,w(|ϕ|)≥a,•w|=[Ω]+aϕiff NΩ,w(|ϕ|)>a,where|ϕ|is the truth set ofϕin the model and NΩ,w is the necessity measure associated withπΩ,w.A set of wffsΣis satisfied in a world w,written as w|=Σ,if w|=ϕfor allϕ∈Σ.We writeΣ|=Mϕif,for each possible world w in M,w|=Σimplies w|=ϕ;andΣ|=SFPL⊗,n ϕifΣ|=Mϕfor each SFPL⊗,n-structure M.Σcan be omitted when it is an empty set,so a wffϕis valid inM,denoted by|=Mϕ,if∅|=Mϕ,and|=SFPL⊗,n ϕdenotes∅|=SFPL⊗,n ϕ.The subscript is usually omitted if it is clearfrom the context.•Axioms:1.P:all tautologies of the propositional calculus2.Bookkeeping:(a)[Ω]cϕ⊃[Ω]+d ϕif c>d(b)[Ω]+cϕ⊃[Ω]cϕ(c)[Ω]0ϕ(d)¬[Ω]+1ϕ3.V1:(a)([Ω]aϕ∧[Ω]a(ϕ⊃ψ))⊃[Ω]aψ(b)([Ω]+aϕ∧[Ω]+a(ϕ⊃ψ))⊃[Ω]+aψ4.V2:¬[i]+ ⊥5.V3:ifΩ1∩Ω2=∅,then(a)([Ω1]aϕ∧[Ω2]bϕ)⊃[Ω1∪Ω2]a⊕bϕ(b)([Ω1]+aϕ∧[Ω2]+b ϕ)⊃[Ω1∪Ω2]+a⊕bϕ6.O1:(a)¬[{O,i}]+ ⊥⊃([Ω∪{O>i}]aϕ≡[Ω∪{O,i}]aϕ)(b)¬[{O,i}]+ ⊥⊃([Ω∪{O>i}]+aϕ≡[Ω∪{O,i}]+aϕ)7.O2:(a)[{O,i}]+ ⊥⊃([Ω∪{O>i}]aϕ≡[Ω∪{O}]aϕ)(b)[{O,i}]+ ⊥⊃([Ω∪{O>i}]+aϕ≡[Ω∪{O}]+aϕ)•Rules of Inference:1.R1(Modus ponens,MP):ϕϕ⊃ψψ2.R2(Generalization,Gen):ϕ[Ω]1ϕFigure1:The axiomatic system for SFPL⊗,n 4Proof TheoryAn axiomatic system can be developed for SFPL⊗,nby gener-alizing the corresponding axioms of DBF s n[Liau,2005]and PL⊗n[Boldrin and Saffiotti,1999].The axiomatic system forSFPL⊗,nis presented in Figure1.The symbol⊕in axiom V3denotes the T-conorm corresponding to⊗,which is de-fined as a⊕b=1−(1−a)⊗(1−b).The axiom V2is the requirement that the inconsistency degree of each agent’s belief state is not more than ,which is the inconsistency tol-erance degree of the logic.The axioms O1and O2further enforce the same property for each virtual agent O.A wffϕis derivable from the system SFPL⊗,n,or sim-ply,ϕis a theorem of SFPL⊗,n,if there is afinite sequence ϕ1,...,ϕm such thatϕ=ϕm and everyϕi is an instance of an axiom schema;or it is obtained from earlierϕj’s by the application of an inference rule.It is written asSFPL⊗,nϕifϕis a theorem of SFPL⊗,n.LetΣ∪{ϕ}be a subset of wffs,thenϕis derivable fromΣin the system SFPL⊗,n,written asΣSFPL⊗,nϕ,if there is afinite subsetΣ ofΣsuch thatSFPL⊗,nΣ ⊃ϕ.We drop the subscript when no confu-sion occurs.We then have the soundness and completenesstheorem for SFPL⊗,n.Theorem1For any wffϕof SFPL⊗,n,|=ϕiff ϕ.5Concluding RemarksIn this paper,we present a modal logic for reasoning about ordered fusion of possibilistic beliefs based on a level skip-ping strategy.While direct fusion and ordered fusion in epis-temic logic[Fagin et al.,1996;Cholvy,1994;Liau,2005],as well as direct fusion in possibilistic logic[Boldrin and Saf-fiotti,1999]have been proposed previously in the literature, the results in this paperfill a gap in the previous works.The modal logic should be applicable to reasoning in multi-agent systems.In future work,it should be possible to consider op-erations other than T-norms for the fusion of possibility dis-tributions.References[Boldrin and Saffiotti,1999]L.Boldrin and A.Saffiotti.A modal logic for merging partial belief of multiple rea-soners.Journal of Logic and Computation,9(1):81–103, 1999.[Cholvy,1994]L.Cholvy.A logical approach to multi-souces reasoning.In M.Masuch and L.P´o los,editors, Knowledge Representation and Reasoning under Uncer-tainty,LNCS808,pages183–196.Springer-Verlag,1994. [Fagin et al.,1996]R.Fagin,J.Y.Halpern,Y.Moses,and M.Y.Vardi.Reasoning about Knowledge.MIT Press, 1996.[Liau,2005]C.J.Liau.A modal logic framework for multi-agent belief fusion.ACM Transactions on Computational Logic,6(1):124–174,2005.[Zadeh,1978]L.A.Zadeh.Fuzzy sets as a basis for a theory of possibility.Fuzzy Sets and Systems,1(1):3–28,1978.。

Specifying logic programs in controlled natural language

T ECHNICAL R EPORT 94.17, D EPARTMENT OF C OMPUTER S CIENCE, U NIVERSITY OF Z URICH, N OVEMBER 1994Specifying Logic Programs inControlled Natural LanguageNorbert E. Fuchs, Hubert F. Hofmann, Rolf SchwitterDepartment of Computer Science, University of ZurichAbstractWriting specifications for computer programs is not easy since one has to take into account the disparate conceptual worlds of the application domain and of software development. To bridge this conceptual gap we propose controlled natural language as a declarative and application-specific specification language. Controlled natural language i s a subset of natural language that can be accurately and effi ci ently processed by a computer, but is expressive enough to allow natural usage by non-specialists. Specifications in controlled natural language are automatically translated into Prolog clauses, hence become formal and executable. The translati on uses a defi ni te clause grammar enhanced by feature structures. Inter-text references of the speci fi cati on, e.g. anaphora, are resolved by di scourse representati on theory. The generated Prolog clauses are added to a knowledge base, and furthermore provide the input of a concept lexicon. We have implemented a prototypical specification system that successfully processes the greater part of the specification of a simple automated teller machine.Table of Contents1Declarati ve Speci fi cati ons (1)2Overvi ew of the Speci fi cati on System (2)3Controlled Natural Language (4)4Uni fi cati on-Based Grammar Formali sms (UBGs) (6)4.1 Definite-Clause Grammars (DCGs) (7)4.2 Feature Structures and Unification (8)4.3 Graph Unification Logic Programming (GULP) (10)4.4 DCG and GULP (10)5Discourse Representation Theory (DRT) (11)5.1 Overview of DRT (11)5.2 Si mple DRSs (12)5.3 Complex DRSs (14)5.4 Ways to investigate a DRS (16)5.5 Implementation (16)6Concept Lexicon (22)6.1 Introduction (22)6.2 The Lexicon in Time and Context (23)6.3 A Model for Lexical Semantics (25)6.4 TANDEM – The Conceptual Lexicaliser (26)6.5 On the Road: An Example Session with TANDEM (30)6.6 Related Work i n Conceptuali sati ons (33)7Conclusi on and Future Research (34)7.1 Increased Coverage of Controlled Natural Language (34)7.2 Complementary Specification Notations (34)7.3 Knowledge Assi mi lati on (34)7.4 Template-Based Text Generation (35)References (36)Appendix A: SimpleMat (Plain English Version ) (40)Appendi x B: Si mpleMat (Controlled Engli sh Versi on) (42)1Declarative SpecificationsProgram development means that i nformal and formal knowledge of an appli cati on domai n i s ulti mately formali sed as a program. To cope wi th the large conceptual gap between the world of the application specialist and the world of the software developer this formalisation process is usually divided into several intermediate steps associated wi th di fferent representati ons of the relevant knowledge. In the context of thi s report we are ma i nly i nterested i n two of these representat i ons: requ i rements and spec i f i cat i ons.By requi rements we understand a representati on of the problem to be solved by a program. Requ rements may come from d fferent sources and express d sparate vi ewpoi nts. They are often i mpli ci t, and may have to be eli ci ted i n a knowledge acqu i s i t i on process. Consequently requ i rements tend to be i nformal, vague,contradictory, incomplete, and ambiguous.From the requirements we derive specifications as a first statement of a solution to the problem at hand, of the servi ces that the i ntended program wi ll provi de to i ts users.Spec f cat ons as an agreement between the part es nvolved should be expl c t,concrete, consi stent, complete, and unambi guous. Furthermore, we demand that specifications be formal.The deri vati on of formal speci fi cati ons from i nformal requi rements i s di ffi cult, and known to be cruc i al for the subsequent software development process. The speci fi cati on process i tself cannot be formali sed, nei ther are there formal methods to vali date the speci fi cati ons wi th respect to the requi rements [Hoare 87]. Nevertheless,the process can be made easier by the choice of a specification language that allows us to express the concepts of the appli cati on domai n conci sely and di rectly, and to convi nce ourselves of the adequacy of the speci fi cati on wi thout undue di ffi culty.Furthermore, we wi sh to support the speci fi cati on process by computer tools. Whi ch specification languages fulfil these prerequisites?Si nce we want to develop logi c programs, speci fi cally Prolog programs, i t i s only natural that we consi der Prolog i tself as a fi rst candi date. Though Prolog has been recommended as a sui table speci fi cati on language [Kowalski 85, Sterli ng 94] and has often been used as such, application-specific specification languages seem to be a better choi ce si nce they allow us to express the concepts of the appli cati on domai n di rectly,and sti ll can be mapped to Prolog [Sterli ng 92]. By maki ng "true statements about the ntended domai n of di scourse" [Kramer & Mylopoulos 92] and "expressi ng basi c concepts directly, without encoding, taking the objects of the language [of the domain of di scourse] as abstract enti ti es" [Börger & Rosenzwei g 94], appli cati on-speci fi c speci fi cati on languages are – i n the ori gi nal sense of the word – declarati ve, and have all the practical advantages of declarative programming [Lloyd 94]. Specifically, they are understood by application specialists.In a previous phase of our project we have shown that graphical and textual views of logic programs can be considered as application-specific specification languages [Fuchs & Fromherz 94]. Each vi ew has an associ ated edi tor, and between a program and i ts vi ews there i s an automati c bi -di recti onal mappi ng. Both these features lead to the followi ng i mportant consequences.•Wi th the help of the vi ew edi tors we can compose programs i n appli cati on-specific concepts.•The bi -di recti onal mappi ng of a vi ew to a program i n a logi c language assi gns aformal semanti cs to the vi ew. Thus, though vi ews gi ve the i mpressi on of bei ng i nformal, they are i n fact formal and have the same semanti cs as thei r associ ated program.•The executabi li ty of the logi c program and the semanti cs-preservi ng mappi ng between a program and i ts vi ews enable us to si mulate the executi on of the program on the level of the vi ews. Thus vali dati on and prototypi ng i n concepts close to the application domain become possible.•Prov d ng semant cally equ valent representat ons, we can reduce the gap between the di fferent conceptual worlds of the appli cati on domai n speci ali st and the software developer.•The dual-faced i nformal/formal appearance of the vi ews provi des an effecti ve soluti on for the cri ti cal transi ti on from i nformal to formal representations.Altogether, the characteri sti cs of the vi ews i nduce us to call them speci fi cati ons of the program. Furthermore, si nce the vi ews are semanti cally equi valent to the (executable)program, they can even be considered as executable specifications.Natural language (NL) has a long tradi ti on as a speci fi cati on language though i t is well-known that the advantages of us ng NL, e.g. ts fam l ar ty, are normally outwei ghed by i ts di sadvantages, e.g. i ts vagueness and ambi gui ty. Nevertheless, NL be ng the standard means of commun cat on between the persons nvolved n software development, it is only tempting to use NL as specification language in a way that keeps most of its advantages and eliminates most of the disadvantages.In this report we describe an approach using controlled natural language as a view of a logi c program. Users – appli cati on speci ali sts and software developers – compose speci fi cati ons for logi c programs i n controlled natural language that i s automati cally translated nto Prolog. As po nted out above, th s translat on makes seem ngly nformal speci fi cati ons i n controlled natural language formal, and gi ves them the combined advantages of informality and formality.We have been develop ng a system for the spec f cat on of log c programs n controlled natural language. In our approach, we assume a stri ct di vi si on of work between a user and the system. Users are always in charge, they are the sole source of domai n knowledge, and take all desi gn deci si ons. The system does not i ni ti ally contain any domain knowledge besides the vocabulary of the application domain, and plays only the rule of a diligent clerk, e.g. checking specifications for consistency.Seen from the standpoi nt of a user our speci fi cati on system offers the followi ng functi onali ty. The user enters i nteracti vely speci fi cati on text i n controlled natural language (cf. section 3) which is parsed (cf. section 4), analysed for discourse references (cf. section 5), and translated into Prolog clauses (cf. section 5). The Prolog clauses are added to a knowledge base, moreover they provide the input for a concept lexicon (cf.section 6). The user can query the knowledge base. Answers are returned to the user in restricted natural language.2Overview of the Specification SystemIn this section we will briefly describe the components of the specification system, and i nd i cate the i r i mplementat i on status. The subsequent sect i ons conta i n deta i led descri pti ons of the i mplemented components and thei r underlyi ng mechani sms.The dialog component i s the si ngle i nterface for the di alog between the user and the speci fi cati on system. The user enters speci fi cati on text i n controlled natural language whi ch the di alog component forwards to the parser i n tokeni sed form. Parsi ng errors and ambiguities to be resolved by the user are reported back by the dialog component. The user can also query the knowledge base i n controlled natural language. Answers to queri es are formulated by the answer generator and forwarded to the di alog component. Finally, the user can use the dialog component to call tools like the editor of the linguistic lexicon. (Status: only text input is possible)The parser uses a predefi ned defi ni te clause grammar wi th feature structures and a predefi ned li ngui sti c lexi con to check sentences for syntacti cal correctness, and to generate syntax trees and sets of nested di scourse representati on structures. The li ngui sti c lexi con can be modi fi ed by an edi tor callable from the di alog component. Thi s edi tor wi ll be called automati cally when the parser fi nds an undefi ned word. (Status: parser functional; editor of linguistic lexicon still missing)The discourse handler analyses and resolves i nter-text references and updates the di scourse representati on structures generated by the parser. (Status: fully functi onal; linguistic coverage needs to be extended)The translator translates di scourse representati on structures i nto Prolog clauses. These Prolog clauses are ei ther passed to the conceptual lexi cali ser and the knowledge assi mi lator, or – i n case of queri es – to the i nference engi ne. (Status: translati on fully functional; linguistic coverage needs to be extended)The conceptual lexicaliser uses the generated Prolog clauses to bui ld a concept lexi con that contai ns the appli cati on domai n knowledge collected so far. Thi s knowledge i s used by the inference engine to answer queries of the user, and by the parser to resolve ambi gui ti es. An edi tor allows the user to i nspect and modi fy the contents of the concept lexicon. (Status: conceptual knowledge is added to the concept lexicon without taki ng i nto account the already accumulated knowledge; the knowledge i s currently not being used by the other components; editor is missing)The knowledge assimilator adds new knowledge to the knowledge base i n a way that avoids inconsistency and redundancy (cf. section 7.3). (Status: not yet implemented)The inference engine answers user queri es wi th the help of the knowledge i n the knowledge base and the concept lexi con. Si nce both the knowledge base and the queri es wi ll be expressed i n Prolog, the i ni ti al versi on of the i nference engi ne wi ll si mply apply Prolog's i nference strategy. (Status: not yet i mplemented, but i nferences are possi ble vi a the Prolog programmi ng envi ronment)The answer generator takes the answers of the i nference engi ne and reformulates them in restricted natural language. By accessing the linguistic lexicon, the conceptual lexi con and the knowledge base the answer generator uses the termi nology of the application domain (cf. section 7.4). (Status: not yet implemented)3Controlled Natural LanguageA software specification is a statement of the services a software system is expected to provide to its users, and should be written in a concise way that is understandable by potential users of the system, by management and by software suppliers [Sommerville 92]. Strangely enough, this goal is hard to achieve if specifications are expressed in full natural language. Natural language terminology tends to be ambiguous, imprecise and unclear. Also, there i s consi derable room for errors and mi sunderstandi ngs si nce people may have di fferent vi ews of the role of the software system. Furthermore,requi rements vary and new requi rements ari se so that the speci fi cati on i s subject to frequent change. All these factors can lead to i ncomplete and i ncons i stent specifications that are difficult to validate against the requirements.People have advocated the use of formal speci fi cati on languages to eli mi nate some of the problems assoc i ated w i th natural language. Because of the need of comprehensi bi li ty, we cannot replace documents wri tten i n natural language by formal speci fi cati ons i n all cases. Many cli ents would not understand such a formal document and would hardly accept it as a contract for the software system.Though it seems that we are stuck between the over-flexibility of natural language and the potenti al i ncomprehensi bi li ty of formal languages, there i s a way out. To i mprove the quali ty of speci fi cati ons wi thout loosi ng thei r readabi li ty, i t i s i mportant to establi sh a context where natural language i s used i n a controlled way. Controlled natural language enforces wri ti ng standards that li mi t the grammar and vocabulary,and leads to texts containing more predictable, less ambiguous language.Controlled natural language can also help to fi nd an agreement about the correct interpretation of a specification. When readers and writers are guided, for instance, to use the same word for the same concept i n a consi stent way then mi sunderstandi ngs can be reduced. Thi s i s of utmost i mportance because a software speci fi cati on wi ll be read, i nterpreted, cri ti ci sed, and rewri tten, agai n and agai n unti l a result i s produced that is satisfactory to all participants.Controlled languages are nei ther unnatural, nor new, as the followi ng examples from vari ous fi elds show. In aerospace i ndustry a notati on was developed that reli es on using natural language in a controlled way for the preparation of aircraft maintenance documentati on [AECMA 85]. Epstei n used syntacti cally restri cted natural language as data base query language [Epstei n 85]. Another well-known example for controlled language i s legi slati on. Thi s case i s especi ally relevant for our approach si nce i t was shown that the language of legislation has many similarities with the language of logic programmi ng, and that statutes can easi ly be translated i nto Prolog clauses [Kowalski 90, Kowalski 92]. Fi nally, LPA's Prolog-based flex tool ki t represents rules and frames for expert systems i n the Knowledge Speci fi cati on Language KSL – an Engli sh-li ke notation enhanced by mathematical and control expressions [Vasey 89].Thus we propose to restrict the use of natural language in specifications to a controlled subset wi th a well-defi ned syntax and semanti cs. On the one hand thi s subset should be expressive enough to allow natural usage by non-specialists, and on the other hand the language should be accurately and effi ci ently processable by a computer. Thi s means that we have to f i nd the r i ght trade-off between express i veness and processability [Pulman 94].In our approach controlled natural language spec i f i cat i ons are translated i nto semanti cally equi valent Prolog clauses. Thi s dual representati on of speci fi cati ons narrows the gap between full natural language and formal specification languages and gives us most of the benefits of both. The translation of the specification into a formal language can help to uncover omi ssi ons and i nconsi stenci es. Thi s poi nt i s i mportant because human language, even when i t i s used unambi guously, has the tendency to leave assumpti ons and conclusi ons i mpli ci t, whereas a computer language forces them to be explicit.Tak i ng i nto account express i veness, computer-processab i l i ty, and the eventual translati on i nto Prolog clauses, we suggest that the basi c model of controlled natural language should cover the followi ng constructi ons:•simple declarative sentences of the form subject – predicate – object •relative clauses, both subject and object modifying •comparati ve constructi ons li ke bigger than , smaller than and equal to •compound sentences li ke and-li sts, or-li sts, and-then-li sts •sentence patterns li ke if ... then •negati on li ke does not, is not and has notThi s language overlaps wi th the computer-processable natural language proposed by Pulman and his collaborators [Macias & Pulman 92, Pulman 94].Habitability – i.e. the ability to construct sentences in controlled natural language, and to avoi d constructi ons that fall outsi de the bounds of the language – seems to be achi evable, parti cularly when the system gi ves feedback to i ts users [Epstei n 85,Capi ndale & Crawford 89]. However, we are convi nced that employi ng controlled natural language for speci fi cati ons wi ll be only successful when users are trai ned and wi lli ng to stri ve for clear wri ti ng. Here we present some short gui deli nes – patterned after standard prescriptions for good style [e.g. Williams 85] – that can help to convey the model of controlled natural language to its users:•use active rather than passive tense•use grammatically correct and simple constructs•be precise and define the terms that you use•break up long sentences with several different facts•avoid ellipsis and idioms•avoid adverbs, subjunctive and modality•be relevant, not verbose•keep paragraphs short and modular•di sti ngui sh functi onal and non-functi onal requi rements, system goals and desi gni nformati onA speci fi cati on i n controlled natural language i s wri tten i n outli ne format, i.e. i t has a hi erarchi cal structure of paragraphs. Each paragraph consi sts of speci fi cati on textadorned wi th comments. Comments can be used to express non-functionalspeci fi cati ons, desi gn i nstructi ons etc. The speci fi cati on text wi ll be processed by the system – i.e. ulti mately translated i nto Prolog clauses – whi le comments remai n unchanged. Textual references, e.g. anaphora, are resolved i nsi de a paragraph, or i n superordinate paragraphs.The quali ty of the software speci fi cati on i s as i mportant as program quali ty. As wi th programs, the speci fi cati on should be desi gned so that changeabi li ty i s achi eved by minimising external references and making paragraphs as modular as possible. Also, modulari ty of paragraphs i s i mportant for understandi ng the speci fi cati on text and for reuse of parts of a speci fi cati ons i n other speci fi cati on contexts. Eventually, a reposi tory of predefi ned paragraphs wi ll be provi ded whi ch can be used li ke a card-i ndex.4Unification-Based Grammar Formalisms (UBGs)Uni fi cati on-based grammar formali sms have attracted consi derable attenti on as a common method i n computati onal li ngui sti c duri ng the last few years. Hi stori cally, these formali sms are the result of several i ndependently i ni ti ated strai ns of research that have converged on the i dea of uni fi cati on. On the one hand li ngui sts have developed the r theor es follow ng the un f cat on-based approach to grammar [Kaplan & Bresnan 82, Gazdar et al. 85, Pollard & Sag 94]. On the other hand the logic programming community created very general formalisms that were intended as tools for i mplementi ng grammars of di fferent style [Perei ra & Warren 80, Shi eber et al. 83, Dörre 91, Covington 94a].Grammar formali sms are metalanguages whose i ntended use i s to descri be a set of well-formed sentences i n an object language. The choi ce of thi s metalanguage for natural language processi ng i s cri ti cal and should fulfi l three i mportant cri teri a: linguistic felicity, expressiveness, and computational effectiveness [Shieber 86].Fi rst, li ngui sts need notati ons that allow them to encode thei r li ngui sti c descri pti ons concisely and flexibly, and to express the relevant generalisations over rules and lexical entri es. For that purpose, uni fi cati on-based grammars (UBGs) are advantageous si nce they descri be abstract relati ons between sentences and i nformati onal structures i n a purely declarati ve manner.Second, UBGs use context-free grammar rules i n whi ch nontermi nal symbols are augmented by sets of features. A careful addition of features increases the power of thegrammar and results i n a class of languages often descri bed as i ndexed grammars [Gazdar & Mellish 89].Thi rd, we want machi nes to be able to understand and employ the formali sm i n reali sti c amounts of ti me. In our approach computati onal effecti veness i s achi eved by translating feature structures into Prolog terms that unify in the desired way.4.1 Definite-Clause Grammars (DCGs)To parse a natural language sentence s to determ ne, whether the sentence s generated by a particular grammar and what kind of structure the grammar assigns to the sentence. Thus a parser has two inputs – a grammar and a sentence to be parsed –and one or more outputs representi ng the syntacti c and semanti c structures of the parsed sentence.Prolog provi des a speci al syntacti c notati on for grammars – the so-called Defi ni te-Clause Grammars format – that we use to implement the parser of our system.A definite-clause grammar (DCG) is not itself a theory of grammar but rather a special syntacti c notati on i n whi ch li ngui sti c theori es of grammars can be expressed. The Prolog DCG-notation allows context-free phrase-structure rules to be stated directly in Prolog. For instance, we can write productions quite naturally assentence --> noun_phrase, verb_phrase.noun_phrase --> determiner, noun.noun --> [customer].DCGs can be run virtually directly as Prolog clauses, so that the Prolog proof procedure gi ves us a backbone for a top-down, depth-fi rst, left-to-ri ght parsi ng mechani sm. For thi s purpose, Prolog i nterpreters equi pped wi th a DCG translator wi ll automati cally convert the DCG-rules i nto Prolog clauses by addi ng two extra arguments to every symbol:sentence(P1,P) :- noun_phrase(P1,P2), verb_phrase(P2,P).noun_phrase(P1,P) :- determiner(P1,P2), noun(P2,P).noun(P1,P) :- 'C'(P1,customer,P).We can state the first rule declaratively in English as: there is a sentence in the list P1-P, if there is a noun phrase in the list P1-P2 and a verb phrase in the list P2-P. For a sentence to be well formed, no words should remai n after the verb phrase has been processed, i.e. P should be the empty list ([]). The second rule has a reading similar to the fi rst one. Fi nally, the thi rd rule has been translated to a call of the speci al Prolog bui lt-i n pri mi ti ve '$C'. The rule can be read as: there is a noun in the list P1-P, if the noun in P1-P is customer.Normally, we are not satisfied with a grammar that simply recognises whether a given input string is a sentence of the language generated by the grammar. We also want to get the syntacti c structure, or a semanti c representati on, of the sentence. To thi s purpose we augment the DCG notation in two different ways:•we i ntroduce addi ti onal arguments for nontermi nal symbols•we add Prolog goals in braces on the right-hand side of DCG-rulesThrough the use of addi ti onal arguments DCGs allow us to descri be "quasi context-sensi ti ve" phenomena qui te easi ly. Otherwi se, representi ng occurrences of agreement or gap threadi ng would be cumbersome, or even di ffi cult. Prolog goals on the ri ght-hand side of DCG-rules allow us to perform computations during the syntactic analysis of an input sentence.A parser produces some structure of the i nput sentence that i t has recogni sed. That means, a natural language sentence i s not just a stri ng of words, but the words are grouped i nto consti tuents that have syntacti c and semanti c properti es i n common. A qui te natural way to represent syntacti c trees i s to supply every nontermi nal symbol wi th an addi ti onal argument that encodes the i nformati on for the perti nent subtree. Thus, these addi ti onal arguments can be seen as parti ally speci fi ed trees i n whi ch variables correspond to not yet specified subtrees. Enhanced by arguments for a syntax tree, our DCG-rules would look like:sentence(s(NP,VP)) --> noun_phrase(NP), verb_phrase(VP).noun_phrase(np(DET,N))--> determiner(DET), noun(N).noun(cn(CN))--> [CN], { common_noun(CN) }.common_noun(customer).Now i t i s easy to bui ld the syntax tree recursi vely duri ng parsi ng si nce Prolog's unification will compose subtrees step by step into the full syntax tree.As shown DCGs use term structures but thi s can lead to two grave drawbacks. Fi rst, DCGs i denti fy values by thei r posi ti on, so that a grammar wri ter must remember wh ch argument pos t on corresponds to wh ch funct on. Second, s nce ar ty s si gni fi cant i n term uni fi cati on, the grammar wri ter has to speci fy a value for each feature, at least by marking it as an anonymous variable.Wi thout changi ng the computati onal power of the exi sti ng DCG formali sm, we can overcome these drawbacks by adding a notation for feature structure unification.4.2Feature Structures and UnificationUsually, uni fi cati on-based grammar formali sms use a system based on features and values. A feature structure i s an i nformati on-beari ng object that descri bes a (possi bly li ngui sti c) object by speci fyi ng values for vari ous of i ts features. Such a feature structure is denoted by a feature-value matrix. For example, the matrixa:bc:dcontai ns the value b for the feature name a and the value d for the feature name c. A value can be ei ther an atomi c symbol or another feature structure. Thi s leads to a recursi ve defi ni ti on si nce one feature structure can be embedded i nsi de another one. Consi der the followi ng matri xa:b h:Y d:e f:gc:Note that the value of the feature name c is itself specified by a feature structure. We will refer to such a feature name in our linguistic context as being category valued. The variable Y stands for a feature structure that contains currently no information.。

自然语言时间语义信息处理

第三章时间信息表达与推理模型
行为描述是指对于概念的行为进行形式化的描述,概念网络目前采用的是脚本描述方法,这种方法简单方便,而且推理链可以清晰呈现,虽然描述的灵活性不够,效率需要进一步提高,但已经可以基本实现对于现代汉语中虚词行为规则的有效分析和描述。

基于此,对于自然语言中实词和虚词两大词类,都有了相应的语义处理方法,并可以实现对于句子的统一分析:分词之后,首先确定词汇对应的概念,然后通过概念复合规则对相关概念进行语义复合,接着进一步分析概念类脚本的执行和成员脚本的执行,达到对语义的初步分析处理。

概念网络不仅仅是一种知识表示方法,而且已经搭建起了概念网络平台。

概念平台将概念按照领域区分存放,加载了特定领域的概念库之后,便可以对相应的领域概念的属性、行为等特征进行编辑,添加概念之间的语义状态、语义约束等相关语义联系。

由于目前概念网络平台的概念语义知识有限,还无法达到自动分析获取语义的阶段,因此初期为了确保准确性,采用手工添加概念语义特征的方法。

在此实验平台之上,当构建了比较丰富的语义之后,可以进一步添加自动学习的方法,分析语料的语义关联,以自动获取概念语义定义。

概念平台中除了概念的定义和浏览模块,还增加了中文文本分词,文本理解接口,初步实现了对已定义概念的语义复合功能,参见图3—2。

3—2概念网络语义处理平台。

04章形式化说明技术

04章形式化说明技术形式化说明技术(Formal Specification Techniques)是一种系统性、精确地描述和定义软件系统执行行为、功能和性质的技术方法。

它通过使用数学语言和形式规约的方法,将软件系统的设计和实现过程从自然语言的模糊性和歧义性中解放出来,从而改善了软件开发和维护的效率和质量。

形式化说明技术的核心思想是将软件系统描述为一个数学模型,通过形式化的推理和证明,确保系统满足设计要求并具备所需的性质。

形式化说明技术不仅能够精确地描述系统的行为和功能,还可以检查系统的正确性、一致性、完备性、可靠性和安全性等方面的属性,提前发现和解决潜在的问题。

形式化说明技术的应用范围广泛,包括需求分析、系统设计、编码验证、软件测试、系统仿真和代码生成等方面。

下面将介绍几种常见的形式化说明技术。

1. 判定性有穷状态自动机(Deterministic Finite State Automaton,DFSA):DFSA 是一种常用的形式化说明技术,用于描述系统的状态和状态转移。

它可以形式化地描述系统的行为,通过状态转移图来表示系统的状态变化,从而帮助开发人员更好地理解和设计系统。

2. 时序逻辑(Temporal Logic):时序逻辑是一种扩展的命题逻辑,用于描述系统的时序性质。

通过形式化的规约、语义和推理,可以验证系统是否满足时序性质,如安全性、活性、不变性等。

时序逻辑广泛应用于软硬件系统的验证和验证。

3. Petri 网(Petri Nets):Petri 网是一种用于建模和分析并发系统的图形化形式化说明技术。

Petri 网通过描述系统的状态、变迁和资源,揭示系统的并发行为和资源竞争情况,从而帮助开发人员理解和设计并发系统。

4. Z 规范(Z Specification):Z 规范是一种基于集合论和一阶谓词逻辑的形式化说明技术,用于描述系统的状态、操作和约束等。

Z 规范通过形式化地定义系统的状态集合、操作集合和约束条件,帮助开发人员更好地理解和设计系统。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

A Temporal Logic Based Approach for QueryingLists,Trees,and D AG s in DatabasesPeter BeckerWilhelm-Schickard-Institut f¨u r Informatik,Universit¨a t T¨u bingenSand13,D-72076T¨u bingenE-Mail:AbstractAlthough lists,trees,and directed acyclic graphs(dags)are of fundamental interest in computer science,they have scarcely been noticed as data types byexisting database systems and database models.In this article I present query lan-guage concepts for(object-oriented)database systems offering such non-traditionaldata resp.object types.For the main task of such a query language,namely thespecification of predicates on instances of these types,a temporal logic approach isused.For this,an existing timely oriented approach for querying lists is extendedby incorporating concepts from the area of branching-time logics.This articlemainly presents the logic concepts of the query language and an implementationof these concepts in an object base systems for discrete structures.1IntroductionLists,trees,and graphs are some of the most important data structures in computer science.They are not only used as implementation concepts for the efficient realization of several data types,but especially serve for the modeling of hierarchically or complex assembled entities.Typical application areas for databases,where e.g.trees as data type are useful are computer linguistics and text databases,cf.[CACS94,GT87].In such applications, trees can serve as a modeling tool for describing whole entities,e.g.parse trees resulting from a syntactical analysis(cf.[AB94])or trees to represent the S GML structure of a document(cf.[CACS94]).Despite their importance as modeling tools,lists,trees,and graphs have scarcely been noticed as data types by existing database systems.Traditional database systems only offer sets resp.relations for the representation of entity collections and simple data types like integer or string for the representation of entity attributes.Non-traditional data types like lists,trees,and graphs have to be represented by these facilities in a laborious way.Overcoming the problem of representing complex entities was one major reason for the development of object-oriented database systems.But up to now,only simplecollection types like tuples,sets,lists,and bags have been incorporated into commonobject-oriented database systems(see e.g.[Cat94]).Moreover,the query facilities of such database systems are quite constrained with respect to these collection types.Especially query predicates that concern several items in single lists(e.g.“From agiven set of lists,select all lists,where the items are monotonically increasing”)are hardly supported.A user has to write a dedicated method in an associated databaseprogramming language to execute a query like the one given above.Such a proceeding may be quite elaborate.In this article,query language concepts for databases offering lists,trees,anddirected acyclic graphs(dags)as data resp.object type are presented.The query language approach that is presented here was inspired by the work of J.Richardson givenin[Ric92].In this article,a temporal logic approach for the specification of predicateson lists has been presented.This approach seems natural,because“temporal formulae (for discrete,linear time),which usually serve to describe time-ordered sequences ofstates,can equally well describe spatially-ordered sequences of objects”,cf.[Ric92].In this work I extend the approach given in[Ric92]to trees and dags.For this,con-cepts of the area of branching-time logics are incorporated into the former approach.Inparticular concepts of the so-called computational tree logic(C TL*resp.C TL)[CES86] are used.C TL*,which has mainly been used for the specification and verification ofconcurrent systems,extends the concepts of linear time logic,which is the basis of[Ric92],by introducing path quantifiers.Beside the logic concepts,the integration of these concepts in an object base systemfor discrete structures is shown in this article.For this,the object-oriented model and method base system M[Bec94]has been used as an implementation platform.The rest of the paper is structured as follows:In Section2a review of the mostimportant facts of[Ric92]is given.In Section3,I present the extension of this approach to trees by using concepts of C TL*.In Section4,I show the incorporationof the concepts given in the former sections into the object base system M.Section5examines the application of the temporal logic concepts to the problem of querying dags and Section6gives a summary and presents some open problems.2A Timely Approach for Querying ListsIn this section a review of the main concepts of[Ric92]is given.Mainly,the set oftemporal operators that will form the basis for querying lists are introduced.These operators are similar to the usual operators in propositional linear time logic(P LTL),cf.[Eme90].A list is seen as a sequence of objects,.A distinction is madebetween the value at point,denoted by and the-th item of a list,denoted by .To refer to the value at the current position of a list(the value at point“now”) the symbol is used.An atomic fomula is defined as a predicate that can directly be evaluated by lookingat an individual list element.Such a formula does not contain logical operators and returns a boolean result.is an example of an atomic formula.It is true,if the actual list value is less thanfive.The truth of a formula is defined as truth at a point of a list.The relation assigns for each List,for each,and for each list logic formula a truth value according to the following definition.Definition1(Syntax and Semantics of List Logic)is an atomic formula and evaluates to true forq(q)is the next(previous)operator.It has the meaning that a fomula is valid at the next position.E.g.the list logic formula means that the element after the actual element is negative.()is the until(since)operator.The formula()has the meaning that formula is valid at some point in the future(past),i.e. after(before)the actual point,and that from now(from there)until then(since now) the formula ist true.We write as a shorthand for.If we have,we say that the list is a model for the list logic formula.Observe that the operators and q are weak operators,i.e.(q)is always true,independent of,at the last(first)position of a list.Based on these definitions, we derive additional temporal operators in the following definition.Definition2(Additional Operators for List Logic)strong next(previous)q qeventually(past)true truealways(past)The operator q)is the strong counterpart to(q).(Up to now we have only considered predicates in that the state of each individual list value is compared with itself or with global constants.But for a query like,“Is the list monotonically increasing”,we need some facility to compare several list values with each other.For this,the binding operator has to be used(see Definition1).The binding operator introduces the variable whose scope is.denotes the formula derived from by replacing all free occurrences of in with. Example2The list is monotonically increasing:The list contains no duplicates:Observe the functionality of the binding operator in thefirst of the two examples above.The always operator()examines each list item.In these examinations the actual list value is bound to by the binding operator.This bound value is then compared with the value at the next position by using the next()operator.Beside the logical concepts presented above,[Ric92]gives other valuable contri-butions like an extension of an existing query algebra with the concepts shown above. Here,we do not review this further,but in Section4,which describes the incorporation of my approach into an object base sytem,similar query algebra concepts to that in [Ric92]are presented.3A Logic for Querying TreesNow,we consider unordered rooted trees of arbitrary degree.As usual, denotes the node set of the tree and the edge set of.The label function assigns to each node of a value of some arbitrary domain.Analogous to lists,denotes the value at a node of,and denotes the node itself.The approach presented in the last section is mainly an adaption of propositional linear time logic(P LTL).In linear time there is just one possible future,like in the case of lists,where each element has at most one successor.To generalize this approach to trees,I use concepts from the area of branching-time logics.With branching-time there may be several incompatible futures.This is analogous to trees,where each element may have several distinct successors.Here,I use an adaption of the computational tree logic(C TL*resp.C TL).C TL* has been proposed for thefirst time in[CES86]as an extension of C TL.It has the advantage on other branching-time logics that it fully incorporates P LTL.Moreover,it is more expressive than a lot of other branching-time logics proposed,see[Eme90]. Nevertheless,it facilitates easy and intelligible query formulation,as we will show in this and the following section.The main idea of C TL*is the introduction of path quantifiers.Let be a P LTL formula.Then the C TL*formula has the informal meaning that there exists a path begining in the actual node that satisfies.Such paths are simply viewed as lists.The dual operator has the meaning that is valid for all paths starting in the actual node.Because the logic that I am going to present here is closely related to C TL*,I denote it as C TL.As for lists,it is assumed that there exists a set of atomic formulas.In C TL,we have two different types of formulas,namely state formulas and path formulas.State formulas correspond to nodes,i.e.their truth value is determined with respect to a given node,while path formulas correspond to a path of a given tree.First, the syntax of C TL and the restricted language C TL are defined.Definition3(Syntax of C TL and C TL)State Formulas(S1)Each atomic formula is a state formula.(S2)If and are state formulas,so are:and.(S3)If is a path formula then,and are state formulas.Path Formulas(P1)Each state formula also is a path formula.(P2)If and are path formulas,so are:and.(P3)If and are path formulas,so are:,and q.The set of state formulas generated by the above rules forms the language C TL.The set of state formulas generated by(S1–3)and the following rule(P0)forms the language C TL:(P0)If and are state formulas,then,and q are path formulas.Observe,that the restricted logic C TL is obtained by disallowing boolean combina-tions and nestings of list logic operators.We will need C TL especially for dags,cf. Section5.Before the semantics of C TL is presented,another definition has to be given. Definition4Let be a node of a tree.A path of is called a maximal path for,if and only if is a leaf.Definition5(Semantics of C TL and C TL)State Formulas:The relation assigns for each tree,for each node,and for each state formula a truth value in the following way:(S1)evaluates to true for(S2)(S3)maximal pathmaximal pathsfor the pathfrom the root toPath Formulas:The relation assigns for each tree,for each maximal path,for each,and for each path formula a truth value: (P1)(P2)(P3)qAdditional logical operators for path formulas can be defined analogously to Defi-nition2,e.g.object base system for discrete structures(e.g.graphs and trees).One of its main features is the easy and efficient integration of data resp.object types for such discrete structures as well as of dedicated software packages for the solution of discrete problems.M is based on the object-oriented paradigm including concepts for the support of persistence and transactions,it uses a client server architecture.Operations concerning objects of the model resp.object base are defined by the means of a specialized model base language called MeBaL.They are issued from a client as requests to the server, which does all administration and manipulation of the object base.In the prototype implementation the methods resp.for verifying,whether a list logic resp.C TL formula is valid for a given list resp.tree,are offered via M. Let denote a C TL formula.Then the MeBaL statementverifies,whether the tree is a model for.As you can see,parameters are named in M.is the parameter name,while is the parameter value.To test whether a list has only positive elements(the list logic formulation is ),the following statement can be used:Formulas are represented by a so-called lambda expressions,which give the definition of a function,but are simple atomic data types like integer or real.They are syntactically represented by an opening,arbitrary MeBaL statements,and a closing parantheses.In the example above we have a nested lambda expression.The inner one()tests whether the actual list element is positive.The variable corresponds to the symbol of list logic.The outer expression()applies the operator to.In this process,the variable is bound to the list for which the method has been applied.Each operator of list logic has a corresponding M method.Here,the method is used to apply the operator.M offers some abbreviation concepts to facilitate easier query formulation.The character can be used instead of the identifier.Moreover,the M facility for the definition of operators has been used to represent each“time-oriented”logic operator by a dedicated and new defined MeBaL operator.Such an operator definition states, how an operator application is transformed into an appropiate method ing these techniques the query above can be expressed by:Here,the operators and substitute the corresponding methods.Observe that and are parts of the operator names.Variable bindings can be simulated by M’s assignment operator().The following query tests whether a tree has the heap property,i.e.whether each node is greater than all of its successors.The corresponding query in C TL is:Beside model checking for single lists and trees,list logic resp.C TL formulas can be used as selection predicates in object base queries.Assume that is a classof trees.Then the following MeBaL statement selects all instances of that have the heap property:The result of such a query would be a set of object identifiers.Arbitrary MeBaL statements can be used as selection predicates or atomic formulas.There is,however, the single constraint that these statements have to return a boolean value.Formulas can also be used to select single items of a list or a tree.It is also possible to nest the application of the resp.operator.The following statement checks whether each of the sublists of contains the value zero:Observe that the operator(always)is applied to the whole(outer)list,while the operator(eventually)is applied to each single(inner)list.The method facilitates the application of generic list methods to paths of trees.The following query yields all trees of that contain a path,where the overall sum is greater than ten:Beside the variable the following variables can be used in lambda expressions representing list logic or C TL formulas:denotes the actual position resp.the actual node number,denotes the actual path in a C TL path formula(this path is given as a list of node numbers),and denotes the actual position in a path while checking a C TL path formula.I close this section with a more complex query example.The request“Give the height and the number of nodes for all trees,that contain a path of length greater than or equal tofive with only non-negative elements”is expressed in M by:The variable and the predefined list method are used to verify the path length.The operator transforms the items of the result set into the de-sired format.For this,the transformation rule uses the tuple constructor.represents the unique object identificator,which is bound to.and are predefined methods for trees.5A Query Approach for DagsDue to the fact that C TL offers path quantification,it is on principial possible to also use C TL for dags.E.g.the C TL formula becomes true for a node of a dag ,if all paths from to some node that has no successor satisfy.Because dags are acyclic,it is guaranteed that there are afinite number of maximal paths that have tobe considered.Only the past oriented operator has to be adopted to apply C TL ingeneral to dags.Unfortunately,this approach leads to a severe problem.In contrast to trees,forwhich the number of maximal paths from a node to some leaf is linearly bound in thenumber of nodes of a tree,a dag may have an exponential number of such paths.For this reason,the query logic for dags is restricted to a variant of C TL.Observe thatC TL formulas are always state formulas,i.e.they become true for and are checked against some node.Therefore,constructing maximal paths and checking path formulascan be avoided,if such a restricted logic is used,as it will be shown below.Due to space limitations only a quite informal definition of the logic for dags, denoted by C TL,is given.Definition7(Syntax and Semantics of C TL)The syntax of C TL is defined analogously to C TL.C TL uses the future-oriented C TL operators and their past-oriented counterparts.The seman-tics of the future-oriented operators is given as in Definition6and Definition7.Thepast-oriented operators are defined analogously to their future-oriented counterparts.Now,the problem of efficient model checking for C TL formulas is considered.Thefixpoint characterizations of the logic operators can be used for it.E.g.we havethe followingfixpoint characterization for the C TL operator.I.e.is true at some node of a dag,if is true at and is true for eachsuccessor of.Such afixpoint characterization exists for each C TL operator withthe exception of the next()and previous()operators,cf.[Eme90]. The usage of thesefixpoint characterizations prevents the construction of maximal paths and model checking becomes more efficient than checking the formulas according to their semantic definition.Lemma1Let be a dag with nodes.Model checking for a C TL formula,where is a C TL operator,can be done by testing for at most nodes. Proof:The lemma is obviously true for the next and previous operators.For all other operators model checking is done due to theirfixpoint characterization.Here,the operator is used as an example.Assume,that the formula has to be checked for some node of.To achieve the result stated above,we simply proceed in a depth-first traversal and mark all nodes that have already been visited.For this,we add to each node of a marker,before the model checking is started.Moreover,we will store for each checked node the result of the check.Then we start the model checking and proceed recursively due to thefixpoint characterization of.Now,assume we have to check for a node.If has already been checked for,we instantly return the truth value,which is stored in the node.Otherwise we check for.If is not valid for,we mark as checked and return false.Otherwise we recursively checkfor each successor of.After that,we mark and return true,if all checks have beensuccessful and false otherwise.Observe that due to the marking the truth value foris computed at most once for each node,i.e.we have at most tests for.6SummaryIn this article query language concepts for the retrieval of lists,trees,and dags have been presented.The proposed concepts are based on a temporal logic approach.An already based on propositional linear time logic presented language for the retrieval of lists has been extended to unordered rooted trees by incorporating concepts from computational tree logic.The resulting language C TL is powerful and facilitates intelligible and easy query formulation.Moreover,it has been shown,how the temporal logic based languages for lists and trees have been integrated in M,an object base systems for discrete structures.Furthermore,the logic C TL for the retrieval of directed acyclic graphs has been presented and a technique to improve the efficiency of model checking for this logic has been proposed.General optimization issues for the retrieval of lists,trees,and dags may be the most important ones among the open problems.Up to now,selection of trees is implemented in the prototype system by means of verifying the C TL formula for each single tree within the base set.This may be rather time consuming.[AB94]gives an optimization technique for tree matching based retrieval of trees.This techniques could be reused,if C TL is extended by tree matching operators.Queries that use such operators could then be optimized.References[AB94]H.Argenton and P.Becker.Efficient retrieval of labeled binary trees.In S.Uemura and M.Yoshikawa,editors,Proceedings of the International Symposium on AdvancedDatabase Technologies and Their Integration,pages176–182,1994.[Bec94]P.Becker.M—an object-oriented model and method base system for discrete optimization problems.In D.Patel,Y.Sun,and S.Patel,editors,OOIS’94—Proceedings of the1994International Conference on Object Oriented InformationSystems,pages74–87.Springer,1994.[CACS94]V.Christophides,S.Abiteboul,S.Cluet,and M.Scholl.From structured documents to novel query facilities.In Proceedings of the ACM SIGMOD Conference,pages313–324,1994.[Cat94]R.G.G.Cattell,editor.The Object Database Standard:ODMG-93.Morgan Kaufmann,1994.[CES86] E.M.Clarke,E.A.Emerson,and A.P.Sistla.Automatic verification offinite-state concurrent systems using temporal logic spcifications.ACM TOPLAS,8(2):244–263,1986.[Eme90] E.A.Emerson.Temporal and modal logic.In J.van Leeuwen,editor,Handbook of Theoretical Computer Science,chapter16,pages995–1072.Elsevier,1990.[GT87]G.H.Gonnet and F.W.Tompa.Mind your grammer:a new approach to modelling text.In Proceedings of the13th VLDB Conference,pages339–346,1987.[Ric92]J.Richardson.Supporting lists in a data model(a timely approach).In Proceedings of the18th VLDB Conference,pages127–138,1992.。

相关文档
最新文档