scispace - formally typeset
Search or ask a question

Showing papers on "Functional logic programming published in 2003"


01 Jan 2003
TL;DR: A well-typed Curry program is defined in this paper as a Curry program where all its rules are welltyped with a unique assignment of type schemes to defined functions and all local declarations are eliminated by the transformations described in Appendix D.7.
Abstract: ion: A[x/τ ] ` e :: τ ′ A ` \x->e :: τ → τ ′ if τ is a type expression Existential: A[x/τ ] ` e :: τ ′ A ` let x free in e :: τ ′ if τ is a type expression Figure 1: Typing rules for Curry programs where T is a type constructor of arity n, as defined by a datatype declaration (cf. Section 2.1),7 and τ1, . . . , τn are type expressions (note that list, tuple and function types have the special syntax [·], (·,· · ·,·), and ·->· as described above). For instance, [(Int,a)]->a is a type expression containing the type variable a. A type scheme is a type expression with a universal quantification for some type variables, i.e., it has the form ∀α1, . . . , αn.τ (n ≥ 0; in case of n = 0, the type scheme is equivalent to a type expression). A function type declaration f::τ is considered as an assignment of the type scheme ∀α1, . . . , αn.τ to f , where α1, . . . , αn are all type variables occurring in τ . The type τ is called a generic instance of the type scheme ∀α1, . . . , αn.τ ′ if there is a substitution σ = {α1 7→ τ1, . . . , αn 7→ τn} on the types with σ(τ ′) = τ . The types of all defined functions are collected in a type environment A which is a mapping from identifiers to type schemes. It contains at least the type schemes of the defined functions and an assignment of types for some local variables. An expression e is well-typed and has type τ w.r.t. a type environment A if A ` e :: τ is derivable according to the inference rules shown in Figure 1. A defining equation f t1 . . . tn = e [where x free] is well-typed w.r.t. a type environment A if A(f) = ∀α1, . . . , αm.τ [and A(x) is a type expression] and A ` \t1-> · · · \tn->e :: τ is derivable according to the above inference rules. A conditional equation l | c = r is considered (for the purpose of typing) as syntactic sugar for l = cond c r where cond is a new function with type scheme A(cond) = ∀α.Success→ α→ α. A program is well-typed if all its rules are well-typed with a unique assignment of type schemes to defined functions.8 Note that the following recursive definition is a well-typed Curry program according to the definition above (and the type definitions given in the prelude, cf. Appendix B): f :: [a] -> [a] f x = if length x == 0 then fst (g x x) else x g :: [a] -> [b] -> ([a],[b]) g x y = (f x, f y) We assume here that all type constructors introduced by type synonyms (cf. Section 2.2) are replaced by their definitions. Here we assume that all local declarations are eliminated by the transformations described in Appendix D.7.

260 citations


Proceedings ArticleDOI
11 Jan 2003
TL;DR: Some existing programming tools are discussed, their drawbacks are explained, and why Expresso is different is described, and a detailed list of typical errors made by novice programmers is included, used in the construction of the Expresso tool.
Abstract: Programming in Java can be a daunting task for introductory students, one that is only compounded by the cryptic compiler error messages they see when they first start to write actual code. This article details a project conducted by faculty and advanced students in the creation of an educational tool for Java programming, called Expresso. This paper discusses some existing programming tools, explains their drawbacks, and describes why Expresso is different. We also include a detailed list of typical errors made by novice programmers, used in the construction of the Expresso tool.

220 citations


Proceedings ArticleDOI
25 Aug 2003
TL;DR: Extensions to the Excel spreadsheet that integrate user-defined functions into the spreadsheet grid, rather than treating them as a "bolt-on" are described.
Abstract: We describe extensions to the Excel spreadsheet that integrate user-defined functions into the spreadsheet grid, rather than treating them as a "bolt-on". Our first objective was to bring the benefits of additional programming language features to a system that is often not recognised as a programming language. Second, in a project involving the evolution of a well-established language, compatibility with previous versions is a major issue, and maintaining this compatibility was our second objective. Third and most important, the commercial success of spreadsheets is largely due to the fact that many people find them more usable than programming languages for programming-like tasks. Thus, our third objective (with resulting constraints) was to maintain this usability advantage.Simply making Excel more like a conventional programming language would not meet these objectives and constraints. We have therefore taken an approach to our design work that emphasises the cognitive requirements of the user as a primary design criterion. The analytic approach that we demonstrate in this project is based on recent developments in the study of programming usability, including the Cognitive Dimensions of Notations and the Attention Investment model of abstraction use. We believe that this approach is also applicable to the design and extension of other programming languages and environments.

198 citations


Book ChapterDOI
15 Jul 2003
TL;DR: This programming language is an extension of 3APL and allows the programmer to implement agents’ mental attitudes like beliefs, goals, plans, and actions, and agents' reasoning rules by means of which agents can modify their mental attitudes.
Abstract: This paper presents the specification of a programming language for cognitive agents. This programming language is an extension of 3APL (An Abstract Agent Programming Language) and allows the programmer to implement agents’ mental attitudes like beliefs, goals, plans, and actions, and agents’ reasoning rules by means of which agents can modify their mental attitudes. The formal syntax and semantics of this language is presented as well as a discussion on the deliberation cycle and an example.

189 citations


Proceedings ArticleDOI
26 Mar 2003
TL;DR: It is shown how automated support can be provided for identifying refactoring opportunities by using the technique of logic meta programming to detect so-called bad smells and by defining a framework that uses this information to propose adequate refactorings.
Abstract: We show how automated support can be provided for identifying refactoring opportunities, e.g., when an application's design should be refactored and which refactoring(s) in particular should be applied. Such support is achieved by using the technique of logic meta programming to detect so-called bad smells and by defining a framework that uses this information to propose adequate refactorings. We report on some initial but promising experiments that were applied using the proposed techniques.

166 citations


Proceedings ArticleDOI
26 Oct 2003
TL;DR: A comprehensive comparison of generics in six programming languages is reported on, identifying eight language features necessary to provide powerful generics and that their absence causes serious difficulties for programmers.
Abstract: Many modern programming languages support basic generic programming, sufficient to implement type-safe polymorphic containers. Some languages have moved beyond this basic support to a broader, more powerful interpretation of generic programming, and their extensions have proven valuable in practice. This paper reports on a comprehensive comparison of generics in six programming languages: C++, Standard ML, Haskell, Eiffel, Java (with its proposed generics extension), and Generic C. By implementing a substantial example in each of these languages, we identify eight language features that support this broader view of generic programming. We find these features are necessary to avoid awkward designs, poor maintainability, unnecessary run-time checks, and painfully verbose code. As languages increasingly support generics, it is important that language designers understand the features necessary to provide powerful generics and that their absence causes serious difficulties for programmers.

142 citations


Proceedings ArticleDOI
26 Oct 2003
TL;DR: The term aspect-oriented programming (AOP) has come to describe the set of programming mechanisms developed specifically to express crosscutting concerns, which are composed, or woven, with traditionally encapsulated functionality referred to as components.
Abstract: The term aspect-oriented programming (AOP) has come to describe the set of programming mechanisms developed specifically to express crosscutting concerns. Since crosscutting concerns cannot be properly modularized within object-oriented programming, they are expressed as aspects and are composed, or woven, with traditionally encapsulated functionality referred to as components.Many AOP models exist, but their implementations are typically coupled with a single language. To allow weaving of existing components with aspects written in the language of choice, AOP requires a language-independent tool.

118 citations



Journal ArticleDOI
TL;DR: In this paper, the Defeasible Logic Programming (DeLP) framework and its semantics are compared to classical logic programming frameworks, and it is shown that DeLP is a proper extension of NLP.

70 citations


Journal Article
TL;DR: A novel way to achieve this is presented, based on adding the notion of names from the work on Nominal Logic and FreshML to the λ -calculus of proof terms for the necessity fragment of modal logic S4, which provides a more fine-grained control over free variables of object programs when compared to the existing languages for meta-programming.

60 citations



Proceedings ArticleDOI
17 Mar 2003
TL;DR: In this paper, the authors take a look at strategic programming from an aspect-oriented programming perspective and compare it with adaptive programming, which is a well-established aspectual approach to the traversal of object structures.
Abstract: Strategic programming is a generic programming idiom for processing compound data such as terms or object structures. At the heart of the approach is the separation of two concerns: basic dataprocessing computations vs. traversal schemes. Actual traversals are composed by passing the former as arguments to the latter. Traversal schemes can be defined by the strategic programmer using a combinator style that relies on primitives for layered traversal.In this paper, we take a look at strategic programming from an aspect-oriented programming perspective. Throughout the paper, we compare strategic programming with adaptive programming, which is a well-established aspectual approach to the traversal of object structures. We start from the observation that aspect-oriented programming terms, e.g., crosscutting, join point, and advice can be instantiated for aspectual traversal approaches.

Proceedings ArticleDOI
11 Jan 2003
TL;DR: The purpose of this panel is to confront the wide variety of opinions on the role of language paradigms in teaching programming to enrich the understanding of how to teach programming.
Abstract: The purpose of this panel is to confront the wide variety of opinions on the role of language paradigms in teaching programming. We have selected four divergent opinions:Armstrong says that concurrent programming is considered difficult because it is taught in the wrong paradigm, namely imperative or object-oriented programming. Instead, concurrency should be taught using a paradigm that makes it simple.Flatt says that everyone should be taught how to program, not just computer science majors. Further, programming should be taught as an extension of what students already know, which is algebra. More important than a particular paradigm, however, is teaching students a design process.Magnusson says that object-oriented programming must be the first and principal paradigm, because it is best for teaching how to analyze problems and structure solutions. Other paradigms can be taught after students have a solid understanding of OO.Van Roy says that programming should be taught in terms of concepts, not paradigms. Common paradigms (functional, OO, etc.) then appear naturally, depending on the concepts used..The panel will confront these opinions to enrich our understanding of how to teach programming.

01 Jan 2003
TL;DR: This work overviews how linear logic has been used to design new and more expressive logic programming languages and describes briefly some applications and implementation issues for them.
Abstract: Logic programming can be given a foundation in sequent calculus by viewing computation as the process of building a cut-free sequent proof bottom-up. The first accounts of logic programming as proof search were given in classical and intuitionistic logic. Given that linear logic allows richer sequents and richer dynamics in the rewriting of sequents during proof search, it was inevitable that linear logic would be used to design new and more expressive logic programming languages. We overview how linear logic has been used to design such new languages and describe briefly some applications and implementation issues for them.

01 Jan 2003
TL;DR: This paper compares strategic programming with adaptive programming, which is a well-established aspectual approach to the traversal of object structures, and starts from the observation that aspect-oriented programming terms, e.g., crosscutting, join point, and advice can be instantiated for aspectual traversal approaches.
Abstract: Strategic programming is a generic programming idiom for processing compound data such as terms or object structures. At the heart of the approach is the separation of two concerns: basic data-processing computations vs. traversal schemes. Actual traversals can be composed by passing the former as arguments to the latter. Traversal schemes can be defined by the strategic programmer using a combinator style that relies on primitives for layered traversal. In this paper, we adopt an aspect-oriented view on strategic programming. This necessitates the instantiation of aspect-oriented terms such as crosscutting, join point, and advice. More specifically, we compare strategic programming with adaptive programming, which is a well-established aspectual approach to the traversal of object structures.

01 Jan 2003
TL;DR: This thesis introduces tabled higher-order logic programming, a novel execution model where some redundant information is eliminated using selective memorization and uses tabled proof search in the meta-theorem prover to reason efficiently with and about deductive systems.
Abstract: A logical framework is a general meta-language for specifying and implementing deductive systems, given by axioms and inference rules. Based on a higher-order logic programming interpretation, it supports executing logical systems and reasoning with and about them, thereby reducing the effort required for each particular logical system. In this thesis, we describe different techniques to improve the overall performance and the expressive power of higher-order logic programming. First, we introduce tabled higher-order logic programming, a novel execution model where some redundant information is eliminated using selective memorization. This extends tabled computation to the higher-order setting and forms the basis of the tabled higher-order logic programming interpreter. Second, we present efficient data-structures and algorithms for higher-order proof search. In particular, we describe a higher-order assignment algorithm which eliminates many unnecessary occurs checks and develop higher-order term indexing. These optimizations are crucial to make tabled higher-order logic programming successful in practice. Finally, we use tabled proof search in the meta-theorem prover to reason efficiently with and about deductive systems. It takes full advantage of higher-order assignment and higher-order term indexing. As experimental results demonstrate, these optimizations taken together constitute a significant step toward exploring the full potential of logical frameworks in practice.

Journal ArticleDOI
01 Jun 2003
TL;DR: The mathematics prerequisites required for programming are discussed and it is argued that Information Science departments should insist that students receive a firm foundation in traditional mathematical skills and that the use of instructional technology should reinforce these skills and not detract from them.
Abstract: This paper argues in favor of teaching a course in Procedural Programming first before a course in Object Oriented Programming. The basis of the argument is that considered as a paradigm, Object Oriented Programming comes in addition to the Procedural Programming paradigm and not as a replacement for it. In addition, we discuss the mathematics prerequisites required for programming and argue that Information Science departments should insist that students receive a firm foundation in traditional mathematical skills and that the use of instructional technology should reinforce these skills and not detract from them.

Proceedings ArticleDOI
26 Oct 2003
TL;DR: This paper suggests that the next breakthrough would require looking even closer to the way humans have been thinking and describing complex systems for thousand of years using natural languages, which contain a number of elements that make descriptions concise, effective and understandable.
Abstract: Software understanding for documentation, maintenance or evolution is one of the longest-standing problems in Computer Science. The use of "high-level" programming paradigms and object-oriented languages helps, but fundamentally remains far from solving the problem. Most programming languages and systems have fallen prey to the assumption that they are supposed to capture idealized models of computation inspired by deceptively simple metaphors such as objects and mathematical functions. Aspect-oriented programming languages have made a significant breakthrough by noticing that, in many situations, humans think and describe in crosscutting terms. In this paper we suggest that the next breakthrough would require looking even closer to the way humans have been thinking and describing complex systems for thousand of years using natural languages. While natural languages themselves are not appropriate for programming, they contain a number of elements that make descriptions concise, effective and understandable. In particular, natural languages referentiality is a key factor in supporting powerful program organizations that can be easier understood by humans.

Patent
25 Aug 2003
TL;DR: In this article, a universal programming language conversion between two different sequential programming languages, e.g., sequential procedural and sequential object oriented programming languages is discussed, where classes in a framework are instantiated to capture semantics of the parsed source program independent of syntax and execution model of the sequential programs.
Abstract: An apparatus and method for universal programming language conversion between two different sequential programming languages, e.g., sequential procedural and sequential object oriented programming languages. In particular, conversion is between a source program in a first programming language and a target program in a second programming language. Initially, the source program in the first programming language is parsed using a parsing interface specific to the first programming language. All syntax from the parsed source program is then stripped or removed. Classes in a framework are instantiated to capture semantics of the parsed source program independent of syntax and execution model of the sequential programming languages. The classes are C++ classes representing fundamental core constructs of all sequential programming languages. A semantic representation of the parsed source program without any syntax is produced. The semantic representation is received at a printer interface specific to the second programming language and syntax of the target program in the second programming language is added. This same process can be used for either high-level conversion or compilation depending on whether the target programming language is high level or low level, respectively.

Journal ArticleDOI
TL;DR: Oz as discussed by the authors is a multiparadigm language that supports logic programming as one of its major paradigms, and it has been shown that logic programming can help formulate practical solutions to algorithmic and search problems.
Abstract: Oz is a multiparadigm language that supports logic programming as one of its major paradigms. A multiparadigm language is designed to support different programming paradigms (logic, functional, constraint, object-oriented, sequential, concurrent, etc.) with equal ease. This paper has two goals: to give a tutorial of logic programming in Oz; and to show how logic programming fits naturally into the wider context of multiparadigm programming. Our experience shows that there are two classes of problems, which we call algorithmic and search problems, for which logic programming can help formulate practical solutions. Algorithmic problems have known efficient algorithms. Search problems do not have known efficient algorithms but can be solved with search. The Oz support for logic programming targets these two problem classes specifically, using the concepts needed for each. This is in contrast to the Prolog approach, which targets both classes with one set of concepts, which results in less than optimal support for each class. We give examples that can be run interactively on the Mozart system, which implements Oz. To explain the essential difference between algorithmic and search programs, we define the Oz execution model. This model subsumes both concurrent logic programming (committed-choice-style) and search-based logic programming (Prolog-style). Furthermore, as consequences of its multiparadigm nature, the model supports new abilities such as first-class top levels, deep guards, active objects, and sophisticated control of the search process. Instead of Horn clause syntax, Oz has a simple, fully compositional, higher-order syntax that accommodates the abilities of the language. We give a brief history of Oz that traces the development of its main ideas and we summarize the lessons learned from this work. Finally, we give many entry points into the Oz literature.

Proceedings ArticleDOI
Rex Page1
25 Aug 2003
TL;DR: Because functional languages provide useful and compact ways to express mathematical concepts, and because the choice of notation in mathematics courses is often at the discretion of the instructor, discrete mathematics courses provide an easy opportunity to enhance the education of students by exposing them to functional programming concepts.
Abstract: A three-year study collected information bearing on the question of whether studying mathematics improves programming skills. An analysis of the data revealed significant differences in the programming effectiveness of two populations of students: (1) those who studied discrete mathematics through examples focused on reasoning about software and (2) those who studied the same mathematical topics illustrated with more traditional examples. Functional programming played a central role in the study because it provides a straightforward framework for the presentation of concepts such as predicate logic and proof by induction. Such topics can be covered in depth, staying almost entirely within the context of reasoning about software. The intricate complexities in logic that mutable variables carry with them need not arise, early on, to confuse novices struggling to understand new ideas. In addition, because functional languages provide useful and compact ways to express mathematical concepts, and because the choice of notation in mathematics courses is often at the discretion of the instructor (in contrast to the notational restrictions often fiercely guarded by the faculty in programming courses), discrete mathematics courses, as they are found in most computer science programs, provide an easy opportunity to enhance the education of students by exposing them to functional programming concepts.

Book ChapterDOI
09 Dec 2003
TL;DR: The current proposals for the inclusion of modules in the ISO Prolog standard are not very consensual.
Abstract: The current proposals for the inclusion of modules in the ISO Prolog standard are not very consensual. Since a program-structuring feature is required for a production programming language, several alternatives have been explored over the years.

Proceedings ArticleDOI
01 Jan 2003
TL;DR: It is proposed to use metamodeling techniques to generate approximated mathematical models of these analyses which can be employed directly within a CP environment, expanding the scope of CP to applications that previously could not be solved by CP due to the unavailability of analytical equations.
Abstract: Constraint Programming (CP) is a promising technique for managing uncertainty in conceptual design. It provides efficient algorithms for reducing, as quickly as possible, the domains of the design and performance variables while complying to the engineering and performance constraints linking them. In addition, CP techniques are suitable to graphically represent 3D projections of the complete design space. This is a useful capability for a better understanding of the product concept’s degrees of freedom and a valuable alternative to optimization based upon the construction of an arbitrary preference aggregation function. Unfortunately, one of the main impediments for using Constraint Programming on industrial problems of practical interest is that constraints must be represented by analytical equations, which is not the case of hard mechanical performances such as meshing and finite element computations that are usually obtained after lengthy simulations. We propose to use metamodeling techniques (MM) to generate approximated mathematical models of these analyses which can be employed directly within a CP environment, expanding the scope of CP to applications that previously could not be solved by CP due to the unavailability of analytical equations. We show that there is a tradeoff between the metamodel fidelity and the resulting CP constraint tractability. A strategy to find this compromise is presented. The case study of a combustion chamber design shows amazingly that the compromise is to favor the simplest and the coarsest first-order response surface model.


Book ChapterDOI
13 Jan 2003
TL;DR: This paper describes a proposal to incorporate finite domain constraints in a functional logic system that integrates functions, higher-order patterns, partial applications, non-determinism, logical variables, currying, types, lazyness, domain variables, constraints and finite domain propagators.
Abstract: This paper describes a proposal to incorporate finite domain constraints in a functional logic system. The proposal integrates functions, higher-order patterns, partial applications, non-determinism, logical variables, currying, types, lazyness, domain variables, constraints and finite domain propagators.The paper also presents TOY(FD), an extension of the functional logic language TOYthat provides FD constraints, and shows, by examples, that TOY(FD) combines the power ofconstraint logic programming with the higher-order characteristics of functional logic programming.

Journal ArticleDOI
TL;DR: The semantics of the language, which is based on a generalisation of traditional failure semantics, is shown to be fully abstract with respect to observing of each terminating computation its final global store of information.

Proceedings ArticleDOI
27 Aug 2003
TL;DR: This paper presents a new evaluation strategy for functional logic programs described by weakly orthogonal conditional term rewriting systems that evaluates ground terms deterministically and shows that the transformation preserves weak orthogonality for the terms of interest.
Abstract: We present a new evaluation strategy for functional logic programs described by weakly orthogonal conditional term rewriting systems. Our notion of weakly orthogonal conditional rewrite system extends a notion of Bergstra and Klop and covers a large part of programs defined by conditional equations. Our strategy combines the flexibility of logic programming (computation of solutions for logic variables) with efficient evaluation methods from functional programming. In particular, it is the first known narrowing strategy for this class of programs that evaluates ground terms deterministically. This is achieved by a transformation of conditional term rewriting systems (CTRS) into unconditional ones which is sound and complete w.r.t. the semantics of the original CTRS. We show that the transformation preserves weak orthogonality for the terms of interest. This property allows us to apply a relatively efficient evaluation strategy for weakly orthogonal unconditional term rewriting systems (parallel narrowing) on the transformed programs.

Journal ArticleDOI
03 Dec 2003
TL;DR: The SCOOP model (Simple concurrent object-oriented programming) offers a comprehensive approach to building high-quality concurrent and distributed systems to provide programmers with a simple extension enabling them to produce concurrent applications with little more effort than sequential ones.
Abstract: The SCOOP model (Simple concurrent object-oriented programming) offers a comprehensive approach to building high-quality concurrent and distributed systems. The model takes advantage of the inherent concurrency implicit in object-oriented programming to provide programmers with a simple extension enabling them to produce concurrent applications with little more effort than sequential ones. In the paper, the authors discuss the basic concepts of the model, such as processors and separate objects. They also present SCOOPLI, a library implementation of SCOOP for the .NET platform. They show how SCOOP concepts are mapped to .NET constructs, and discuss distributed programming with SCOOPLI, with a focus on .NET Remoting capabilities. Several programming examples illustrate the discussion.

Book ChapterDOI
TL;DR: Not only can conceptual logic programs (CLPs) simulate finite answer set programming, they are also flexible enough to simulate reasoning in an expressive class of description logics, thus being able to play the role of ontology language, as well as rule language, on the Semantic Web.
Abstract: We integrate an expressive class of description logics (DLs) and answer set programming by extending the latter to support inverted predicates and infinite domains, features that are present in most DLs. The extended language, conceptual logic programming (CLP) proves to be a viable alternative for intuitively representing and reasoning nonmonotonically, in a decidable way, with possibly infinite knowledge. Not only can conceptual logic programs (CLPs) simulate finite answer set programming, they are also flexible enough to simulate reasoning in an expressive class of description logics, thus being able to play the role of ontology language, as well as rule language, on the Semantic Web.

Proceedings Article
01 Jan 2003
TL;DR: The functional language Camelot, which is a language of the ML family with extensions for explicit management of heap storage, and the intermediate language Grail,Which is a functional form of JVM bytecode, are described.
Abstract: We describe the functional language Camelot, which is a language of the ML family with extensions for explicit management of heap storage, and the intermediate language Grail, which is a functional form of JVM bytecode. A scheme for transforming Camelot into Grail is described. We also give some figures for execution times which show that Camelot programs perform reasonably well when compared with Java equivalents.