2219091
Meta-programming through typeful code representation
By allowing the programmer to write code that can generate code at run-time, meta-programming offers a powerful approach to program construction. For instance, meta-programming can often be employed to enhance program efficiency and facilitate the construction of generic programs. However, meta-programming, especially in an untyped setting, is notoriously error-prone. In this paper, we aim at making meta-programming less error-prone by providing a type system to facilitate the construction of correct meta-programs. We first introduce some code constructors for constructing typeful code representation in which program variables are replaced with deBruijn indices, and then formally demonstrate how such typeful code representation can be used to support meta-programming. The main contribution of the paper lies in recognition and then formalization of a novel approach to typed meta-programming that is practical, general and flexible.
18847301
A Typeful Approach to Object-Oriented Programming with Multiple Inheritance
The wide practice of objected oriented programming (OOP) in current software practice is evident. Despite extensive studies on typing programming objects, it is still undeniably a challenging research task to design a type system that can satisfactorily account for a variety of features (e.g., binary methods and multiple inheritance) in OOP. In this paper, we present a typeful approach to implementing objects that makes use of a recently introduced notion of guarded datatypes. In particular, we demonstrate how the feature of multiple inheritance can be supported with this approach, presenting a simple and general account for multiple inheritance in a typeful manner.
61965299
Implementing typeful program transformations
The notion of program transformation is ubiquitous in programming language studies on interpreters, compilers, partial evaluators, etc. In order to implement a program transformation, we need to choose a representation in the meta language, that is, the programming language in which we construct programs, for representing object programs, that is, the programs in the object language on which the program transformation is to be performed. In practice, most representations chosen for typed object programs are typeless in the sense that the type of an object program cannot be reflected in the type of its representation. This is unsatisfactory as such typeless representations make it impossible to capture in the type system of the meta language various invariants in a program transformation that are related to the types of object programs. In this paper, we propose an approach to implementing program transformations that makes use of a first-order typeful program representation formed in Dependent ML (DML), where the type of an object program as well as the types of the free variables in the object program can be reflected in the type of the representation of the object program. We introduce some programming techniques needed to handle this typeful program representation, and then present an implementation of a CPS transform function where the relation between the type of an object program and that of its CPS transform is captured in the type system of DML. In a broader context, we claim to have taken a solid step along the line of research on constructing certifying compilers.
2409417
Implementing Cut Elimination: A Case Study of Simulating Dependent Types in Haskell
Gentzen’s Hauptsatz – cut elimination theorem – in sequent calculi reveals a fundamental property on logic connectives in various logics such as classical logic and intuitionistic logic. In this paper, we implement a procedure in Haskell to perform cut elimination for intuitionistic sequent calculus, where we use types to guarantee that the procedure can only return a cut-free proof of the same sequent when given a proof of a sequent that may contain cuts. The contribution of the paper is two-fold. On the one hand, we present an interesting (and somewhat unexpected) application of the current type system of Haskell, illustrating through a concrete example how some typical use of dependent types can be simulated in Haskell. On the other hand, we identify several problematic issues with such a simulation technique and then suggest some approaches to addressing these issues in Haskell.
820529
Combining programming with theorem proving
Applied Type System (ATS) is recently proposed as a framework for designing and formalizing (advanced) type systems in support of practical programming. In ATS, the definition of type equality involves a constraint relation, which may or may not be algorithmically decidable. To support practical programming, we adopted a design in the past that imposes certain restrictions on the syntactic form of constraints so that some effective means can be found for solving constraints automatically. Evidently, this is a rather em ad hoc design in its nature. In this design, which we claim to be both novel and practical. Instead of imposing syntactical restrictions on constraints, we provide a means for the programmer to construct proofs that attest to the validity of constraints. In particular, we are to accommodate a programming paradigm that enables the programmer to combine programming with theorem proving. Also we present some concrete examples in support of the practicality of this design.
45241367
Meta-programming through typeful code representation
By allowing the programmer to write code that can generate code at run-time, meta-programming offers a powerful approach to program construction. For instance, meta-programming can often be employed to enhance program efficiency and facilitate the construction of generic programs. However, meta-programming, especially in an untyped setting, is notoriously error-prone. In this paper, we aim at making meta-programming less error-prone by providing a type system to facilitate the construction of correct meta-programs. We first introduce some code constructors for constructing typeful code representation in which program variables are represented in terms of deBruijn indexes, and then formally demonstrate how such typeful code representation can be used to support meta-programming. With our approach, a particular interesting feature is that code becomes first-class values, which can be inspected as well as executed at run-time. The main contribution of the paper lies in the recognition and then the formalization of a novel approach to typed meta-programming that is practical, general and flexible.
16803440
A Compilation Model for Aspect-Oriented Polymorphically Typed Functional Languages
Introducing aspect orientation to a polymorphically typed functional language strengthens the importance of type-scoped advices; i.e., advices with their effects harnessed by type constraints. As types are typically treated as compile time entities, it is highly desirable to be able to perform static weaving to determine at compile time the chaining of type-scoped advices to their associated join points. In this paper, we describe a compilation model, as well as its implementation, that supports static type inference and static weaving of programs in an aspect-oriented polymorphically typed lazy functional language, AspectFun. We present a type-directed weaving scheme that coherently weaves type-scoped advices into the base program at compile time. We state the correctness of the static weaving with respect to the operational semantics of AspectFun. We also demonstrate how control-flow based pointcuts (such as cflowbelow) are compiled away, and highlight several type-directed optimization strategies that can improve the efficiency of woven code.
20073710
On a class of Hamiltonian laceable 3-regular graphs
Abstract Using the concept of brick-products, Alspach and Zhang showed in Alspach and Zhang (1989) that all cubic Cayley graphs over dihedral groups are Hamiltonian. It is also conjectured that all brick-products C(2n, m, r) are Hamiltonian laceable, in the sense that any two vertices at odd distance apart can be joined by a Hamiltonian path. In this paper, we shall study the Hamiltonian laceability of brick-products C(2n, m, r) with only one cycle (i.e. m = 1). To be more specific, we shall provide a technique with which we can show that when the chord length r is 3, 5, 7 or 9, the corresponding brick-products are Hamiltonian laceable. Let s = gcd((r + 1)/2, n) and t = gcd((r − 1)/2, n). We then show that the brick-product C(2n, 1, r) is Hamiltonian laceable if (i) st is even; (ii) s is odd and rs  r + 1 + 3s (mod 4n); or (iii) t is odd and rt  r − 1 − 3t (mod 4n). In general, when n is sufficiently large, say n ⩾ r2 − r + 1, then the brick-product is also Hamiltonian laceable.
21308144
EmoEars: An Emotion Recognition System for Mandarin Speech
In this paper, an emotion recognition system for mandarin speech is presented. Five basic human emotions including angry, fear, happy, neutral and sad are investigated. The recognizer is based on neural network with OCON and ACON architecture. Some novel feature selection methods are also added as optional tool to enhance the efficiency and classification accuracy. The system can train speaker dependent emotion speech model through online emotional utterance recording. Experiment results show that emotion can be recognized through neural network model, the best mean accuracy is 86.7%. In addition, the feature selection module is effective to reduce the compute load and increase the generalization ability of the recognizer.
9048744
Web-based simulation experiments
The use of the World Wide Web and Java-based mobile code provides new opportunities for distributed simulation. First, the infrastructure provided by the Internet eliminates the need for multiprocessor hardware, making it feasible to distribute simulation models over different hardware platforms through the Internet. Second, "Internet-aware" mobile Java code makes the applications fully portable and reusable. These enabling technologies are already exploited for distributed simulation modeling. This paper reports on the preliminary results of an on-going effort to construct a parallel discrete event simulation support system to distribute simulation experiments over the Internet with a view on simulation optimization. A research prototype for ranking and selection problems is described. The overall project goals are discussed.
21349955
A unified optimization framework for microelectronics industry
In this paper, an object-oriented unified optimization framework (UOF) for general problem optimization is proposed. Based on evolutionary algorithms, numerical deterministic methods, and C++ objective design, the UOF possesses real-world applications for various optimization problems. The UOF is with interface between defining a general problem and generic solver; hence the two areas are bridged. The UOF's components are categorized into problem and solver parts, and they work independently. Therefore, the reusable high level code allows the adaptation to new problem and solver quickly. Practical applications in microelectronics industry confirm the functionality of the developed unified optimization framework.