首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 15 毫秒
1.
针对函数式程序模板元编程的通用性问题,以应用类型系统ATS(Applied Type System)为例,提出了一种基于元建模的模板元编程实现方法。基于ATS模板元编程给出从枚举类型Datatype到Function的生成实例;通过元建模构造了包含Datatype与Function定义的ATS元模型;详细描述了Datatype模型到Function模型的转换;最后以一个基于元建模的ATS模板元编程为例,讨论了该方法的使用效果。实验结果表明该方法可以提高ATS模板元编程的通用性。  相似文献   

2.
3.
本文介绍基于函数式语言的元编程系统,讨论元编程系统特别是同构系统的语言特点。从程序反射的角度分析元编程系统对程序设计语言在自我表示、自我分析和控制等方面的要求。以 MetaML 和 Template Haskell 为例论述在函数式语言中为了支持元编程需要扩展的机制,包括语法、语义、类型系统、安全的变量使用等,以及它们的实现方案、各方案的特点。最后总结一些元编程系统的共同点,并预测未来的发展趋势。  相似文献   

4.
Approaches to typing logic programs often exclude various features of Standard Prolog. The system “Typical for annotated Prolog” (TaP) is a pragmatic approach to type checking programs written in Prolog without restricting the scope of the language. TaP checks Prolog programs that are extended with type declarations that support parametric polymorphism and subtyping. The purpose of this paper is to present an approach that extends Typical by meta-types for handling Prolog meta-programming techniques.  相似文献   

5.
We present a logic-based programming language that features meta-level composition operations over programs. Object programs are parameterised named collections of definite clauses which may contain formulae of the form A in Pexp, where A is a standard atomic formula and Pexp is a program expression obtained by applying composition operations over named object programs. The semantics of the language is presented in two different equivalent styles. An operational, top-down semantics is given by means of inference rules, while a denotational, bottom-up semantics is given via an immediate consequence operator associated with program expressions. A meta-programming implementation of the language is also presented by transforming the operational inference rules into meta-level axioms. Several programming examples are discussed to illustrate the expressive power of the language.  相似文献   

6.
We describe a Prolog-based approach to the development of language processors (such as preprocessors, frontends, evaluators, tools for software modification and analysis). The design of the corresponding environment Laptob for prological language processing is outlined. Language processor definitions in Laptob are basically Prolog programs. The programs might contain grammars, that is, we consider logic grammars. The programs can be typed, and they can be higher-order. The adaptation and composition of the logic programs themselves is supported by meta-programming. The environment offers tool support for efficient scanning, testing, and application development based on a make-system. We report on recent and ongoing applications of the Prolog-based approach.  相似文献   

7.
针对基于关系型数据库的地理信息传播模型在互联网虚拟计算环境下的不足,提出了一种基于文档数据库的全栈式地理信息传播模型。该模型以多粒度地理特征的映射规约分析计算和文档数据库的多版本并发控制为框架,用统一的内建域指定语言作为传播媒介描述载体,结合数据的运行时元编程和地理服务的REST风格部署,实现地理空间数据的动态开放式传播,证明非结构化地理空间数据的传播模型能满足逻辑语义和物理存储双重易扩展性。  相似文献   

8.

Logic programming, with its declarative bias as well as unification and the direct representation of linguistic structures, is well qualified for meta-programming, i.e., programs working with representations of other programs as their data. However, constraint techniques seem necessary in order to fully exploit this paradigm. In the DEMOII system, the language of constraint handling rules (CHRs) has been used in order to provide a functionality that appears difficult to obtain without such means. For example, reversibility of a meta-interpreter, which can be obtained by means of constraints, turns it into a powerful program generator; in the same way, negation-as-failure implemented by means of constraints provides an incremental evaluation of integrity constraints. This paper focuses on the design of such constraints and their implementation by means of CHR.  相似文献   

9.
This paper introduces a variant of nominal abstract syntax in which bindable names are represented by normal meta-variables as opposed to a separate class of globally fresh names. Distinct meta-variables can be instantiated with the same concrete name, which we call aliasing. The possible aliasing patterns are controlled by explicit constraints on the distinctness (freshness) of names. This approach has already been used in the nominal meta-programming language ??ML. We recap that language and develop a theory of contextual equivalence for it. The central result of the paper is that abstract syntax trees (ASTs) involving binders can be encoded into ??ML in such a way that ??-equivalence of ASTs corresponds with contextual equivalence of their encodings. This is novel because the encoding does not rely on the existence of globally fresh names and fresh name generation, which are fundamental to the correctness of the pre-existing encoding of abstract syntax into FreshML.  相似文献   

10.
Zero is an experimental statically typed, fully object-oriented reflective programming language. Reflective features cover introspection as well as structural and behavioural reflection. The reflective facilities include safe method and class replacements and detailed modification of methods. These enable Zero programs to quickly accommodate to run-time requirements. Behavioural reflection is realised using handlers (hooks), which may be attached to all language constructs based on closures. Zero provides an efficient static typing system with run-time extensions. Methods are first class values and are represented as objects when such representation is required. By using such representation, Zero provides elegant use of statically typed higher-order methods.  相似文献   

11.
This paper introduces a novel mechanism to perform intercession (a form of reflection) in an object‐oriented programming language with the goal of making the language extensible from within itself. The proposed mechanism builds upon a mirror‐based architecture, leading to a reusable reflective application programming interface that cleanly separates interface from implementation details. However, support for intercession has been limited in contemporary mirror‐based architectures. This is due to the fact that mirror‐based architectures only support reflection explicitly triggered by metaprograms, while intercession requires reflection implicitly triggered by the language interpreter. This work reconciles mirrors with intercession in the context of an actor‐based, object‐oriented programming language named AmbientTalk. We describe this language's full reflective architecture, highlighting its novel mirror‐based approach to reflect upon both objects and concurrently executing actors. Subsequently, we apply AmbientTalk's mirror‐based reflection to implement two language features, which crucially depend on intercession, to wit future‐type message passing and leased object references. Copyright © 2008 John Wiley & Sons, Ltd.  相似文献   

12.
介绍了以构造一个具有更小的需信任计算基础的Java虚拟机系统为目的的研究工作,将一种类型安全的低级语言TLL应用到Java虚拟机的即时编译器中.TLL的类型系统基于多态的类型化入演算,它具有丰富的表现力且能够编码各种高级语言的抽象.基于TLL的一个虚拟机原型系统已经实现,它可以作为实现一个具有微小的需信任计算基础的Java虚拟机的起点.  相似文献   

13.
14.
We argue that a logic programming language with a higher-order intuitionistic logic as its foundation can be used both to naturally specify and implement tactic-style theorem provers. The language extends traditional logic programming languages by replacing first-order terms with simply-typed -terms, replacing first-order unification with higher-order unification, and allowing implication and universal quantification in queries and the bodies of clauses. Inference rules for a variety of inference systems can be naturally specified in this language. The higher-order features of the language contribute to a concise specification of provisos concerning variable occurrences in formulas and the discharge of assumptions present in many inference systems. Tactics and tacticals, which provide a framework for high-level control over search for proofs, can be directly and naturally implemented in the extended language. This framework serves as a starting point for implementing theorem provers and proof systems that can integrate many diversified operations on formulas and proofs for a variety of logics. We present an extensive set of examples that have been implemented in the higher-order logic programming language Prolog.  相似文献   

15.
Although we have recently seen an increase of good, free game engine editors, general purpose scenario (level) editors are still lagging behind in terms of functionalities and ease of use. Using them to create game scenarios can be difficult as they often expose general engine capabilities instead of limiting the toolset to fit game-specific requirements. They often require programming skills to use, which introduce additional user skill requirements, and configuring them for a specific game can be equally difficult. In this paper we have developed SpringBoard, an open source scenario editor for games using the SpringRTS engine. Extending it to support game and level requirements is achieved with multi-level meta-programming, while still providing a system that is integrated with the GUI editor and therefore intuitive to use. Our meta-programming system has support for trigger elements (events, functions and actions), custom (composite) data types, scoped data access, higher order functions and actions, and data synchronization mechanics. This novel approach allows us to have the full expressiveness of the underlying programming language, while exposing a user-friendly GUI that consists of terminology familiar to the domain expert.  相似文献   

16.
We provide a very simple model of a reflective facility based onthe pure -calculus, and we show that its theory of contextual equivalenceis trivial: two terms in the language are contextually equivalent iff theyare -congruent.  相似文献   

17.
Procedurally reflective programming languages enable user programs to semantically extend the language itself, by permitting them to run at the level of the language implementation with access to their context. The reflective tower, first introduced by Brian Smith, is the principal architecture for such languages. It is informally described as an infinitely ascending tower of metacircular interpreters, connected by a mechanism that allows programs at one level to run at the next higher level. Various accounts of the reflective tower have been published, including a metacircular definition, operational definitions, and denotational definitions. We present an operational account of the main aspects of the reflective tower, which we claim is simpler than previous accounts. Our approach is to implement a finite tower where each level literally runs the level directly below it. A complete Scheme implementation is included.An earlier version of this paper appeared inProceedings of the International Workshop on New Models for Software Architecture '92: Reflection and Meta-level Architecture, November 1992. This material is based on work supported by the National Science Foundation under Grants NSF CCR 89-01919 and NSF CCR 90-00597.  相似文献   

18.
Inspired by ACTORS [7, 17], we have implemented an interpreter for a LISP-like language, SCHEME, based on the lambda calculus [2], but extended for side effects, multiprocessing, and process synchronization. The purpose of this implementation is tutorial. We wish to: 1.alleviate the confusion caused by Micro-PLANNER, CONNIVER, etc., by clarifying the embedding of non-recursive control structures in a recursive host language like LISP. 2.explain how to use these control structures, independent of such issues as pattern matching and data base manipulation. 3.have a simple concrete experimental domain for certain issues of programming semantics and style. This paper is organized into sections. The first section is a short reference manual containing specifications for all the unusual features of SCHEME. Next, we present a sequence of programming examples which illustrate various programming styles, and how to use them. This will raise certain issues of semantics which we will try to clarify with lambda calculus in the third section. In the fourth section we will give a general discussion of the issues facing an implementor of an interpreter for a language based on lambda calculus. Finally, we will present a completely annotated interpreter for SCHEME, written in MacLISP [13], to acquaint programmers with the tricks of the trade of implementing non-recursive control structures in a recursive language like LISP.This report describes research done at the Artificial Intelligence Laboratory of the Massachusetts Institute of Technology. Support for the laboratory's artificial intelligence research is provided in part by the Advanced Research Projects Agency of the Department of Defense under Office of Naval Research contract N00014-75-C-0643.  相似文献   

19.
Higher-order representations of objects such as programs, proofs, formulas, and types have become important to many symbolic computation tasks. Systems that support such representations usually depend on the implementation of an intensional view of the terms of some variant of the typed lambda calculus. New notations have been proposed for the lambda calculus that provide an excellent basis for realizing such implementations. There are, however, several choices in the actual deployment of these notations the practical consequences of which are not currently well understood. We attempt to develop such an understanding here by examining the impact on performance of different combinations of the features afforded by such notations. Among the facets examined are the treatment of bound variables, eagerness and laziness in substitution and reduction, the ability to merge different structure traversals into one, and the virtues of annotations on terms that indicate their dependence on variables bound by external abstractions. We complement qualitative assessments with experiments conducted by executing programs in a language that supports an intensional view of lambda terms while varying relevant aspects of the implementation of the language. Our study provides insights into the preferred approaches to representing and reducing lambda terms and also exposes characteristics of computations that have a somewhat unanticipated effect on performance.  相似文献   

20.
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.  相似文献   

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

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