首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 828 毫秒
1.
This paper proposes to specify semantic definitions for logic programming languages such as Prolog in terms of an oracle which specifies the control strategy and identifies which clauses are to be applied to resolve a given goal. The approach is quite general. It can be applied to Prolog to specify both operational and declarative semantics as well as other logic programming languages. Previous semantic definitions for Prolog typically encode the sequential depth-first search of the language into various mathematical frameworks. Such semantics mimic a Prolog interpreter in the sense that following the "leftmost" infinite path in the computation tree excludes computation to the right of this path from being considered by the semantics. The basic idea in this paper is to abstract away from the sequential control of Prolog and to provide a declarative characterization of the clauses to apply to a given goal. The decision whether or not to apply a clause is viewed as a query to an oracle which is specified from within the semantics and reasoned about from outside. This approach results in simple and concise semantic definitions which are more useful for arguing the correctness of program transformations and providing the basis for abstract interpretations than previous proposals.  相似文献   

2.
Ken Slonneger 《Software》1993,23(12):1379-1397
Several authors have suggested translating denotational semantics into prototype interpreters written in high-level programming languages to provide evaluation tools for language designers. These implementations have generally been understandable when restricted to direct denotational semantics. This paper considers using two declarative programming languages, Prolog and Standard ML, to implement an interpreter that follows the continuation semantics of a small imperative programming language, called Gull. Each of the two declarative languages presents certain difficulties related to evaluation strategies and expressiveness. The implementations are compared in terms of their ease of use for prototyping, their resemblance to the denotational definitions, and their efficiency.  相似文献   

3.
A formal model of analogy is introduced in the logic programming setting, and an analogical reasoning program (called DIANA, i.e. Declarative Inference by ANAlogy) is developed in accordance with precise procedural and declarative semantics. Given the source and target domains of analogy as two logic programsP s andP t , together with a specificationS of the analogical correspondence between predicate symbols, atoms involving these symbols are analogically derived fromP=P s P t givenS, which are not derivable fromP s orP t orP s P t alone. In this paper, the requirements of the analogical process are first stated. The declarative semantics of analogy is then given, by defining the least analogical model ofP as an extension of the classical semantics of Horn clauses. A procedural semantics is also described, in terms of an extension of SLD resolution. Both semantics rely on implicit analogical axioms defining the kind of analogical reasoning envisaged. The implementation of DIANA has been done in Reflective Prolog, a metalogic programming language previously developed by the first two authors. It is shown that analogical axioms can be viewed as an instance of reflection axioms used in Reflective Prolog. By exploiting this feature, the implementation of DIANA is argued to be sound w.r.t. the defined semantics. Examples of analogical reasoning in DIANA are also described. By comparison with the AI literature on analogy, it is claimed that this is the first approach which gives a declarative semantics to analogical reasoning, thanks to the possibility of carrying over in this field the basic logic programming concepts.  相似文献   

4.
Preference logic programming (PLP) is an extension of logic programming for declaratively specifying problems requiring optimization or comparison and selection among alternative solutions to a query. PLP essentially separates the programming of a problem itself from the criteria specification of its solution selection. In this paper we present a declarative method for specifying preference logic programs. The method introduces a precise formalization for the syntax and semantics of PLP. The syntax of a preference logic program contains two disjoint sets of definite clauses, separating a core program specifying a general computational problem from its preference rules for optimization; the semantics of PLP is given based on the Herbrand model and fixed point theory, where how preferences affects the least Herbrand model of a logic program is interpreted as a sequence of meta-level mapping operations. In addition, we present an operational semantics based on a new resolution strategy and a memoized recursive algorithm for computing strictly stratified logic programs with well-formed preferences, and further show that the operational semantics of such a preference logic program is consistent to its declarative semantics.  相似文献   

5.
Shared Prolog is a parallel logic language based on the blackboard interpretation of logic programming. In such an interpretation a logic program is seen as a set of rules executed by a set of agents cooperating via a shared working memory called the blackboard. A distributed interpreter for Shared Prolog was implemented and described in another paper, where the blackboard was a centralized data structure. In this paper we show how the blackboard can be distributed using some static analysis techniques. The basic idea is to perform an abstract interpretation starting from the Shared Prolog operational semantics to generate data structures which represent possible interactions and links among agents. The resulting data structures are used to reduce the number of run time communication operations in an implementation distributed over a network of workstations.  相似文献   

6.
对象式逻辑程序设计语言LKO的说明性语义   总被引:2,自引:0,他引:2  
徐殿祥  关国梁 《计算机学报》1996,19(11):841-847
本文基于逻辑程序设计语言的良基模型语义,探讨了对象逻辑程序设计语言LKO的说明性语义,该语义由组合迭代的极小不动点定义,具有构造性和组合性,迷在LKO中进一步引入非单调继承和逻辑奠定了基础。  相似文献   

7.
The Graphical Kernel System GKS is so well established as a standard for graphics programming that quite a number of models for multiprocessor and distributed environments have already been suggested. It is therefore necessary to consider new languages and methodologies capable of supporting its distributed implementation. In this context, clausal logic languages provide suitable means for describing the system in a declarative form and, moreover, ensure the applicability of meta-programming techniques for specifying the semantics of implementation. The Prolog language, extended with communication and modularization structures required by the distributed programming, is thus here considered as a feasible means for establishing a model of GKS organized in functional modules which could be supported by different processors. For such a model a two-level implementation scheme is outlined and a reconfiguration and personalization methodology is suggested.  相似文献   

8.
AOPLID是一种面向agent程序设计语言。本文旨在对AOPLID语言进行时序扩充,使之能表达并处理带时间参数的并发行动,基于离线方式下AOPLID程序的语义,用Prolog语言实现时序AOPLID语言(TAOPLID)的离线解释嚣。首先,我们对经典情境演算进行适当改造,使之能描述合时间变元的行动,因为持续行动一般可认为是具有瞬时开始行动和瞬时终止行动的过程,所以可以将一个持续动作分解为两个时间上互不相交的瞬时动作,再引入一个新的关系流刻画这两个瞬时动作的执行情况,从而可在扩充后的情境演算中表达带时间参数的并发行动。其次,为使TAOPLID离线解释嚣方便处理以集合方式表示的TAOPLID程序,设计并实现了TAOPLID预处理嚣,它将TAO—PLID程序的集合形式转换成Prolog子句形式,然后通过TAPOLID离线解释嚣对其解释生成一可执行的原子行动序列。  相似文献   

9.
The problem of computational completeness of Horn clause logic programs is revisited. The standard results on representability of all computable predicates by Horn clause logic programs are not related to the real universe on which logic programs operate. SLD-resolution, which is the main mechanism to execute logic programs, may give answer substitutions with variables. As the main result we prove that computability by Horn clause logic programs is equivalent to standard computability over the Herbrand universe with variables. The semantics we use isS-semantics introduced by Falaschi et al. [3]. As an application of the main result we prove the existence of a metainterpreter for a sublanguage of real Prolog, written in the language of Horn clauses with the S-semantics. We also show that the traditional semantics of Prolog do not reflect its computational behavior from the viewpoint of recursion theory.This article is a revised version of [13]. The work was essentially done during author's visit to ECRC.  相似文献   

10.
 Starting from unification based on similarity, a logic programming language, called LIKEness in LOGic (Likelog) is derived, thorougly relying on similarity. An operational semantics and a fix-point semantics of the language are defined, using an extension principle for fuzzy operators. The two approaches are proved to be related and a fuzzy extension of the least Herbrand model is given. One of the principal feature of such a logic programming language is to allow flexible query answering to deductive databases, which we show through an example. Moreover, we describe a system for web information retrieval through Likelog. I want to thank Ferrante Formato with whom I started and I continued this research and Prof. Giangiacomo Gerla for his great support and contribution given to this field.  相似文献   

11.
This paper describes the coupling of logic programming with Icon, which is a programming language aimed at string processing. Icon and Prolog have many similarities and their integration is feasible and desirable because the weaknesses of one can be compensated for by the strengths of the other. In our case, a Prolog interpreter was written as an Icon procedure that can be linked and called by an Icon program. This interpreter deals with all Icon data types and can be called in the context of the goal-directed evaluation of Icon. We give an example showing the power of this symbiosis between these two languages where a Prolog call in Icon is a generator and an Icon call in a Prolog clause is a built-in predicate.  相似文献   

12.
Adaptable software systems and architectures give the programmer the ability to create applications that might customize themselves to runtime-emerging requirements. Computational reflection is a programming language technique that is commonly used to achieve the development of this kind of systems. Most runtime reflective systems use Meta-Object Protocols (MOPs). However, MOPs restrict the amount of features an application can customize, and the way they can express its own adaptation. Furthermore, this kind of systems uses a fixed programming language: they develop an interpreter, not a whole language-independent platform.What we present in this paper a non-restrictive reflective platform, called nitrO, that achieves a real computational-environment jump, making every application and language feature adaptable at runtime—without any previously defined restriction. Moreover, the platform has been built using a generic interpreter, in which the reflection mechanism is independent of the language selected by the programmer. Different applications may dynamically adapt each other, regardless of the programming language they use.  相似文献   

13.
动态模糊逻辑程序设计语言的指称语义   总被引:1,自引:0,他引:1  
文献[8]借鉴Dijkstra的监督命令程序结构,给出了动态模糊逻辑程序设计语言的基本框架结构.在此基础上,进一步扩充和完善,并根据指称语义的原理和方法,用结构归纳法给出动态模糊逻辑程序设计语言的指称语义,主要包括:动态模糊程序设计语言的语义域、语义函数及其指称语义.最后给出了一个动态模糊程序设计语言的例子以观察程序的运行过程.  相似文献   

14.
Abstract

In the past we developed a semantics for a restricted annotated logic language for inheritance reasoning. Here we generalize it to annotated Horn logic programs. We first provide a formal account of the language, describe its semantics, and provide an interpreter written in Prolog for it. We then investigate its relationship to Belnap's 4-valued logic, Gelfond and Lifschitz's semantics for logic programs with negation, Brewka's prioritized default logics and other annotated logics due to Kifer et al.  相似文献   

15.
16.
Semantics of EqL     
The formal semantics of a novel language, called EqL, are presented for first-order functional and Horn logic programming. An EqL program is a set of conditional pattern-directed rules, where the conditions are expressed as a conjunction of equations. The programming paradigm provided by this language may be called equational programming. The declarative semantics of equations is given in terms of their complete set of solutions, and the operational semantics for solving equations is an extension of reduction, called object refinement. The correctness of the operational semantics is established through the soundness and completeness theorems. Examples are given to illustrate the language and its semantics.<>  相似文献   

17.
The paper provides an overview of the s-semantic approach to the semantics of logic programs which had been developed about twenty years ago. The aim of such an approach was that of providing a suitable base for program analysis by means of a semantics which really captures the operational behavior of logic programs, and thus offers useful notions of observable program equivalences. The semantics is given in terms of extended interpretations, which are more expressive than Herbrand interpretations, extends the standard Herbrand semantics, and can be obtained as a result of both top-down and bottom-up constructions. The approach has been applied to several extensions of positive logic programs and used to develop semantic-based techniques for program analysis, verification and transformation.  相似文献   

18.
This paper describes a technique to generate complex, moving picture experts group (MPEG) data streams containing packets which range through a selected set of variants, as allowed by the grammar of the packet stream. The Prolog logic programming language has been used, whose declarative power allows data generation almost directly from the grammar, i.e. without the need for explicitly programming a grammar traversal mechanism as would be the case with an imperative language. A reasonably declarative style of grammar and variation definition is achieved, and at the same time, a reasonably efficient generation process. The basic idea is to use a declarative fragment of Prolog for the grammar, but to use imperative features of Prolog for matters like packet enumeration and packet payload generation. Generation of test data from grammars is not new, nor is the use of Prolog programs for generation of test data, but as far as we know, the combination of both has not reported on in the literature, nor its application to MPEG demultiplexers/decoders.  相似文献   

19.
Lawry's label semantics for modeling and computing with linguistic information in natural language provides a clear interpretation of linguistic expressions and thus a transparent model for real‐world applications. Meanwhile, annotated logic programs (ALPs) and its fuzzy extension AFLPs have been developed as an extension of classical logic programs offering a powerful computational framework for handling uncertain and imprecise data within logic programs. This paper proposes annotated linguistic logic programs (ALLPs) that embed Lawry's label semantics into the ALP/AFLP syntax, providing a linguistic logic programming formalism for development of automated reasoning systems involving soft data as vague and imprecise concepts occurring frequently in natural language. The syntax of ALLPs is introduced, and their declarative semantics is studied. The ALLP SLD‐style proof procedure is then defined and proved to be sound and complete with respect to the declarative semantics of ALLPs. © 2010 Wiley Periodicals, Inc.  相似文献   

20.
Computational reflection is gaining interest in practical applications as witnessed by the use of reflection in the Java programming environment and recent work on reflective middleware. Reflective systems offer many different reflection programming interfaces, the so-called Meta-Object Protocols (MOPs). Their design is subject to a number of constraints relating to, among others, expressive power, efficiency and security properties. Since these constraints are different from one application to another, it would be desirable to easily provide specially-tailored MOPs.In this paper, we present a generic reification technique based on program transformation. It enables the selective reification of arbitrary parts of object-oriented meta-circular interpreters. The reification process is of fine granularity: individual objects of the run-time system can be reified independently. Furthermore, the program transformation can be applied to different interpreter definitions. Each resulting reflective implementation provides a different MOP directly derived from the original interpreter definition.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号