A Language Prototyping Tool based on Semantic Building Blocks

Size: px
Start display at page:

Download "A Language Prototyping Tool based on Semantic Building Blocks"

Transcription

1 A Language Prototyping Tool based on Semantic Building Blocks J. E. Labra Gayo, J. M. Cueva Lovelle, M. C. Luengo Díez, and B. M. González Rodríguez Department of Computer Science, University of Oviedo C/ Calvo Sotelo S/N, 3307, Oviedo, Spain Abstract. We present a Language Prototyping System that facilitates the modular development of interpreters from semantic specifications. The theoretical basis of our system is the integration of ideas from generic programming and modular monadic semantics. The system is implemented as a domain-specific language embedded in Haskell and contains an interactive framework for language prototyping. In the monadic approach, the semantic spscification of a programming language is captured as a function Σ M V where Σ represents the abstract syntax, M the computational monad, and V the domain value. In order to obtain more extensibility, we use folds or catamorphisms over the fixpoint of non-recursive pattern functors that capture the structure of the abstract syntax. For each pattern functor F, the semantic specifications are defined as independent F-Algebras whose carrier is M V, where M is the computational monad and V models the domain value. The copmputational monad M can itself be obtained from the composition of several monad transformers applied to a base monad, and the domain value V can be defined using extensible union types. In this paper, we also show that when the abstract syntax contains several categories, it is possible to define many-sorted algebras obtaining the same modularity. 1 Introduction E. Moggi [39] applied monads to denotational semantics in order to capture the notion of computation and the intuitive idea of separating computations from values. After his work, there was some interest in the development of modular interpreters using monads [49,43,10]. The problem was that, in general, it is not possible to compose two monads to obtain a new monad [25]. A proposed solution was the use of monad transformers [33,32] which transform a given monad into a new one adding new operations. This approach was called modular monadic semantics. In a different context, the definition of recursive datatypes as least fixpoints of pattern functors and the calculating properties that can be obtained be means

2 of folds or catamorphisms led to a complete discipline which could be named as generic programming [3,34,35]. In [9], L. Duponcheel proposed the combined use of folds or catamorphisms with modular monadic semantics allowing the independent specification of the abstract syntax, the computational monad and the domain value. Following [36], we applied monadic folds to modular monadic semantics allowing the separation between recursive evaluation and semantic specification [28,29,30]. In practice, the abstract syntax is usually formed from n mutually recursive categories, In this paper we show how we can extend our previous work to handle many-sorted algebras. The paper is organized as follows. In section 2 we give an informal presentation of modular monadic semantics defining some monad transformers. Section 3 presents the basic concepts from generic programming extending previous work to handle many-sorted algebras. In section 4 we specify the semantics of a simple imperative programming language from reusable components. Along the paper, we use Haskell syntax with some freedom in the use of mathematical operators and datatype declarations. As an example, the predefined datatype data Either a b = Left a Right b could be defined with our notation as α β L α R β We also omit the type constructors in some definitions for brevity. The notions we use from category theory are defined in the paper, so it is not a prerequisite. 2 Modular Monadic Semantics A monad M captures the intuitive notion of computation. In this way, the type M α represents a computation the returns a value of type α In functional programming, a monad can be defined as a type constructor M with 2 operations return : α M α ( =) : M α (α M β) M β which satisfy a number of laws (see [47,49,48]). Example 1. The simplest monad is the identity monad Id α α return = λx x m = f = f x

3 In the rest of the paper, we will use the do-notation defined as: do { m; e } m = λ do { e } do { x m; e } m = λ x do { e } do { let exp; e } let exp in do { e } do { e } e It is possible to define monads that capture different kinds of computations, like partiality, nondeterminism, side-effects, exceptions, continuations, interactions, etc. [39,40,5]. Table 1 presents two classes of monads that will be used in the rest of the paper. Table 1. Some classes of monads Name Operations Environment Access rdenv : M Env inenv : Env M α M α State transformer update : (State State) M State fetch : M State set : State M State When describing the semantics of a programming language using monads, the main problem is the combination of different classes of monads. It is not possible to compose two monads to obtain a new monad in general [25]. Nevertheless, a monad transformer T can transform a given monad M into a new monad T M that has new operations and maintains the operations of M. The idea of monad transformer is based on the notion of monad morphism that appeared in Moggi s work [39] and was later proposed in [33]. The definition of a monad transformer is not straightforward because there can be some interactions between the intervening operations of the different monads. These interactions are considered in more detail in [31,32,33] and in [17] it is shown how to derive a backtracking monad transformer from its specification. Our system contains a library of predefined monad transformers corresponding to each class of monad and the user can also define new monad transformers. When defining a monad transformer T over a monad M, it is necessary to specify the new return and ( =), the lift : M α T M α operation that transforms any operation in M into an operation in the new monad T M, and the new operations provided by the new monad. Table 2 presents the definitions of the two monad transformers that will be used in the paper. 2.1 Extensible domains [33] defines extensible union types using multi-parameter type classes. Although we are not going to give the full details, we can assume that if α is a subtype

4 Table 2. Some monad transformers with their definitions Environment reader T Env M α Env M α return x = λρ returnx x = f = λρ (xρ) =(λa f a ρ) lift x = λρ x =return rdenv = λρ returnρ inenv ρ x = λ x ρ State transformer T State M α State M (α, State) return x = λς return(x, ς) x = f = λς (xς) =(λ(v, ς ) f v ς ) lift x = λς x =(λx return(x, ς)) update f = λς return(ς, f ς) fetch = update (λς ς) set ς = update (λ ς) of β, which will be denoted as α β, then we have the functions : α β and : β α. We also assume that α (α β) and that β (α β). As an example, if we define a domain of integers and booleans as Int Bool, then ( 3) belongs to that domain and to further extensions of it. 3 Generic Programming concepts 3.1 Functors, Algebras and Catamorphisms As in the case of monads, functors also come from category theory but can easily be defined in a functional programming setting. A functor F can be defined as a type constructor that transforms values of type α into values of type F α and a function map F : (α β) F α F β. The fixpoint of a functor F can be defined as µf In (F (µf)) In the above definition, we explicitly write the type constructor In because we will refer to it later. A recursive datatype can be defined as the fixpoint of a non-recursive functor that captures its shape. Example 2. The following inductive datatype for arithmetic expressions Term Term N Int Term + Term Term Term

5 can be defined as the fixpoint of the functor A T x N Int x + x x x where the map T is 1 : map T : (α β) (T α Tβ) map T f (N n) = n map T f (x 1 + x 2 ) = f x 1 + f x 2 map T f (x 1 x 2 ) = f x 1 f x 2 Once we have the shape functor T, we can obtain the recursive datatype as the fixpoint of T Term µt In this way, the expression can be represented as In ((In (N 2)) + (In (N 3))) : Term The sum of two functors F and G, denoted by F G can be defined as (F G) x F x G x where map F G is map F G : (α β) (F G) α (F G) β map F G f (L x) = L (map F f x) map F G f (R x) = R (map G f x) Using the sum of two functors, it is possible to extend recursive datatypes. Example 3. We can define a new pattern functor for boolean expressions B x = B Bool x == x x < x and the composed recursive datatype of arithmetic and boolean expressions can easily be defined as Expr µ(t B) Given a functor F, an F-algebra is a function ϕ F : F α α where α is called the carrier. An homomorphism between two F-algebras ϕ : F α α and ψ : F β β is a function h : α β which satisfies 1 h. ϕ = ψ. map F h In the rest of the paper we omit the definition of map functions as they can be automatically derived from the shape of the functor.

6 We consider a new category with F-algebras as objects and homomorphisms between F-algebras as morphisms. In this category, In : F(µF) µf is an initial object, i.e. for any F-algebra ϕ : F α α there is a unique homomorphism ([ϕ]) : µf α satisfying the above equation. ([ϕ]) is called fold or catamorphism and satisfies a number of calculational properties [3,6,35,42]. It can be defined as: ([ ]) : (Fα α) (µf α) ([ϕ]) (In x) = ϕ ( map F ([ϕ]) x) Example 4. We can obtain a simple evaluator for arithmetic expressions defining an T-algebra whose carrier is the type m v, where m is, in this case, any kind of monad, and Int is a subtype of v. ϕ T : (Monad m, Int v) T(m v) m v ϕ T (Num n) = return ( n) ϕ T (e 1 + e 2 ) = do v 1 e 1 v 2 e 2 return( ( v 1 + v 2 )) ϕ T (e 1 e 2 ) = do v 1 e 1 v 2 e 2 return( ( v 1 v 2 )) Applying a catamorphism over ϕ T terms: we obtain the evaluation function for eval Term : (Monad m, Int v) Term m v eval Term = ([ϕ T ]) The operator allows to obtain a (F G)-algebra from an F-algebra ϕ and a G-algebra ψ : (F α α) (G α α) (F G)α α (ϕ ψ)(l x) = ϕ x (ϕ ψ)(r x) = ψ x Example 5. The above definition allows to extend the evaluator of example 4 to arithmetic and boolean expressions. We can specify the semantics of boolean expressions with the following B- algebra ϕ B : (Monad m, Bool v) B(m v) m v ϕ B (B b) = return ( b)

7 ϕ B (e 1 == e 2 ) = do v 1 e 1 v 2 e 2 return( ( v 1 == v 2 )) ϕ B (e 1 < e 2 ) = do v 1 e 1 v 2 e 2 return( ( v 1 < v 2 )) Now, the new evaluator of boolean and arithmetic expressions is automatically obtained as a catamorphism over the (T B)-algebra. eval Expr : (Monad m, Int v, Bool v) Expr m v eval Expr = ([ϕ T ϕ B ]) The theory of catamorphisms can be extended to monadic catamorphisms as described in [12,19,28,30]. 3.2 Many-sorted algebras and catamorphisms The abstract syntax of a programming language is usually divided in several mutually recursive categories. It is possible to extend the previous definitions to handle many-sorted algebras. In this section, we present the theory for n = 2, but it can be defined for any number of sorts [11,37,21,41]. A bifunctor F is a type constructor that assigns a type F α β to a pair of types α and β and an operation bimap F : (α γ) (β δ) (F α β F γ δ) The fixpoint of two bifunctors F and G is a pair of values (µ 1 FG,µ 2 FG) that can be defined as: µ 1 FG In 1 (F (µ 1 FG) (µ 2 FG)) µ 2 FG In 2 (G (µ 1 FG) (µ 2 FG)) Given two bifunctors F and G, a two-sorted F, G-algebra is a pair of functions (ϕ, ψ) such that: ϕ : F α β α ψ : G α β β where α, β are called the carriers of the two-sorted algebra. It is possible to define F, G-homomorphisms and a new category where (In 1, In 2 ) form the initial object. This allows the definition of bicatamorphisms as: ([, ]) 1 : (F α β α) (G α β β) (µ 1 FG α) ([ϕ, ψ]) 1 (In 1 x) = ϕ (bimap F ([ϕ, ψ]) 1 ([ϕ, ψ]) 2 x)

8 ([, ]) 2 : (F α β α) (G α β β) (µ 2 FG β) ([ϕ, ψ]) 2 (In 2 x) = ψ (bimap G ([ϕ, ψ]) 1 ([ϕ, ψ]) 2 x) The sum of two bifunctors F and G is a new bifunctor F G and can be defined as: (F G) α β F α β G α β where the bimap operator is bimap F G : (α γ) (β δ) ((F G) α β ((F G) γ δ) bimap F G f g (L x) = L (bimap F G f g x) bimap F G f g (R x) = R (bimap F G f g x) In order to extend two-sorted algebras, we define the operators 1 and 2 as: ( 1 ) : (F α β α) (G α β α) (F G) α β α (φ 1 1 φ 2 ) (L x) = φ 1 x (φ 2 1 φ 2 ) (R x) = φ 2 x ( 2 ) : (F α β β) (G α β β) (F G) α β β (ψ 1 2 ψ 2 ) (L x) = ψ 1 x (ψ 2 2 ψ 2 ) (R x) = ψ 2 x 3.3 From functors to bifunctors When specifying several programming languages, it is very important to be able to share common blocks and to reuse the corresponding specifications. For example, arithmetic expressions should be specified in one place and their specification should be reused between different languages. In order to reuse specifications made using single-sorted algebras in a twosorted framework, it is necessary to extend functors to bifunctors. Given a functor F, we define the bifunctors F 2 1 and F 2 2 as: F 2 1 α β F α F 2 2 α β F β where the bimap operations are defined as bimap F 2 1 f g x = f x bimap F 2 2 f g x = g x Given an F-algebra, the operators ɛ 2 1 and ɛ 2 2 obtain the corresponding twosorted algebras ɛ 2 1 : (F α α) F 2 1 α β α ɛ 2 1 ϕ x = ϕ x ɛ 2 2 : (F β β) F 2 2 α β β ɛ 2 2 ϕ x = ϕ x

9 4 Specification of a simple imperative language 4.1 Abstract syntax A typical imperative programming language can be divided in two different worlds: expressions and commands. In our example, the expressions will be arithmetic, boolean and variables. The abstract syntax of arithmetic and boolean expressions are captured by the functors T and B defined in examples 2 and 3. Variables are defined using the functor V V x V Name We will define commands in two steps. Firstly, sequence and assignments are defined using the bifunctor S S e c c ; c String := e Secondly, control structures (conditional and loops) are defined using the bifunctor R R e c If e c c While e c In order to define the imperative languge, we need a bifunctor that represents the shape of expressions and another one representing commands. The bifunctor of expressions can be defined as an extension of the functor obtained as the sum of T, B and V E (T B V) 2 1 The bifunctor of commands is defined as the sum of the bifunctors S and R C S R Finally, the imperative language is the fixpoint of E and C Imp µ 2 E R 4.2 Computational structure In this simple language, the computational structure needs to access the environment and to transform a global state. We will use the monad Comp which is obtained by transforming the identity monad using the monad transformers T State and T Env defined in table 2. Comp (T State. T Env ) Id The domain value of expressions consist of integer and boolean values

10 Value Int Bool and the domain value of commands is the null type () 2 indicating that commands do not return any value. The state and environment are defined as: Env Name Loc State Loc Value where Loc represent memory locations. We will also use the notation ς {x/v} to represent the updated state ς which assigns v to x. 4.3 Semantic functions The semantic specification of arithmetic and boolean expressions were defined in the examples 4 and 5. We will reuse those specifications in the imperative language. With regard to variables, the V-algebra is ϕ V : V(Comp Value) Comp Value ϕ V (Var x) = do ρ rdenv ς fetch return(ς (ρ x)) The specification of sequence and assignment is ψ S : S (Comp Value) (Comp ()) Comp () ψ S (c 1 ; c 2 ) = do c 1 c 2 ψ S (x := e) = do v e ρ rdenv ς fetch set (ς {ρ x/v}) return () In the same way, the specification of conditional and repetitive commands is: ψ R : R (Comp Value) (Comp ()) Comp () ψ R (If e c 1 c 2 ) = do v e if v then c 1 else c 2 2 () is a predefined Haskell datatype that only contains the value ()

11 ψ R (While e c) = loop where loop = do v e if v then do { c ; loop } else return() Finally, the interpreter is automatically obtained as a bicatamorphism Inter Imp : Imp Comp () Inter Imp = ([ɛ 2 1(ϕ T ϕ B ϕ V ), ϕ S 2 ϕ R ]) 2 Although in the above definition we have explicitily written the particular algebras, it is not necessary to do so in the implementation because the overloading mechanism of Haskell allows to detect which is the corresponding algebra. 5 Conclusions and future work We have presented an integration of modular monadic semantics and generic programming concepts that allows the definition of programming languages from reusable semantic especifications. This approach has been implemented in a Language Prototyping System which allows to share semantic building blocks and provides an interactive framework for language testing. The system can be considered as another example of a domain-specific language embedded in Haskell [46,26,20]. This approach has some advantages: The development is easier as we can rely on the fairly good type system of Haskell, it is possible to obtain direct access to Haskell libraries and tools, and we do not need to define a new language with its syntax, semantics, type system, etc. At the same time, the main disadvantages are the mixture of error messages from the domain-specific language and the host language, Haskell type system limitations and the Haskell dependency which impedes the development of interpreters implemented in different languages. It would be interesting to define an independent domain specific meta-language for semantic specifications following [5,7,38]. On the theoretical side, [17] shows how to derive a backtracking monad transformer from its specification. That approach should be applied to other types of monad transformers and it would be interesting to define a general framework for the combination many-sorted algebras and monadic catamorphisms. It would also be fruitful to study the combination of algebras, coalgebras, monads and comonads in order to provide the semantics of interactive and object-oriented features [4,23,22,27,45]. Another line of research is the automatic derivation of compilers from the interpreters built. This line has already been started in [14,15].

12 With regard to the implementation, we have also made a simple version of the system using first-class polymorphism [24] and extensible records [13]. This allows the definition of monads as first class values and monad transformers as functions between monads without the need of type classes. However, this feature is still not fully implemented in current Haskell systems. Recent advances in generic programming would also improve the implementation [18,16]. At this moment, we have specified simple imperative, functional, objectoriented and logic programming languages. The specifications have been made in a modular way reusing common components of the different languages. The original goal of our research was to develop prototypes for the abstract machines underlying the integral object-oriented operating System Oviedo3 [2] whith the aim to test new features as security, concurrency, reflectiveness and distribution [8,44]. More information on the Language Prototyping System can be obtained at [1]. References 1. Language Prototyping System D. Álvarez, L. Tajes, F. Álvarez, M. A. Díaz, R. Izquierdo, and J. M. Cueva. An object-oriented abstract machine as the substrate for an object-oriented operating system. In J. Bosch and S. Mitchell, editors, Object Oriented Technology ECOOP 97, Jÿvaskÿla, Finland, June Springer Verlag, LNCS Roland Backhouse, Patrik Jansson, Johan Jeuring, and Lambert Meertens. Generic programming - an introduction. In S. D. Swierstra, P. R. Henriques, and J. N. Oliveira, editors, Advanced Functional Programming, volume 1608 of Lecture Notes in Computer Science. Springer, L. S. Barbosa. Components as processes: An exercise in coalgebraic modeling. In S. F. Smith and C. L. Talcott, editors, FMOODS Formal Methods for Open Object-Oriented Distributed Systems, pages , Stanford, USA, September Kluwer Academic Publishers. 5. N. Benton, J. Hughes, and E. Moggi. Monads and effects. In International Summer School On Applied Semantics APPSEM 2000, Caminha, Portugal, R. Bird and Oege de Moor. Algebra of Programming. Prentice Hall, Pietro Ceciarelli and Engenio Moggi. A syntactic approach to modularity in denotational semantics. In 5th Biennial Meeting on Category Theory and Computer Science, volume CTCS-5. CWI Technical Report, M. A. Díaz, D. Álvarez, A. García-Mendoza, F. Álvarez, L. Tajes, and J. M. Cueva. Merging capabilities with the object model of an object-oriented abstract machine. In S. Demeyer and J. Bosch, editors, Ecoop 98 Workshop on Distributed Object Security, volume 1543, pages LNCS, Luc Duponcheel. Writing modular interpreters using catamorphisms, subtypes and monad transformers. Utrecht University, David Espinosa. Semantic Lego. PhD thesis, Columbia University, Maarten M. Fokkinga. Law and Order in Algorithmics. PhD thesis, University of Twente, February Maarten M. Fokkinga. Monadic maps and folds for arbitrary datatypes. Memoranda Informatica 94-28, Dept. of Computer Science, Univ. of Twente, June 1994.

13 13. Benedict R. Gaster and Mark P. Jones. A Polymorphic Type System for Extensible Records and Variants. Technical Report NOTTCS-TR-96-3, Department of Computer Science, University of Nottingham, November William Harrison and Samuel Kamin. Modular compilers based on monad transformers. In Proceedings of the IEEE International Conference on Computer Languages, William Harrison and Samuel Kamin. Compilation as metacomputation: Binding time separation in modular compilers. In 5th Mathematics of Program Construction Conference, MPC2000, Ponte de Lima, Portugal, June R. Hinze. A generic programming extension for Haskell. In E. Meijer, editor, Proceedings of the 3rd Haskell Workshop, Paris, France, September The proceedings appear as a technical report of Universiteit Utrecht, UU-CS Ralf Hinze. Deriving backtracking monad transformers. In Roland Backhouse and J.Ñ. Oliveira, editors, Proceedings of the 2000 International Conference on Functional Programming, Montreal, Canada, September Ralf Hinze. A new approach to generic functional programming. In Conference Record of POPL 00: The 27th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, January Z. Hu and H. Iwasaki. Promotional transformation of monadic programs. In Workshop on Functional and Logic Programming, Susono, Japan, World Scientific. 20. P. Hudak. Domain-specific languages. In Peter H. Salus, editor, Handbook of Programming Languages, volume III, Little Languages and Tools. Macmillan Technical Publishing, H. Iwasaki, Z. Hu, and M. Takeichi. Towards manipulation of mutually recursive functions. In 3rd. Fuji International Symposium on Functional and Logic Programming (FLOPS 98), Kyoto, Japan, World Scientific. 22. B. Jacobs and E. Poll. A monad for basic java semantics. In T. Rus, editor, Algebraic Methodology and Software Technology, number 1816 in LNCS. Springer, Bart Jacobs. Coalgebraic reasoning about classes in object-oriented languages. In Coalgebraic Methods in Computer Science, number 11. Electronic Notes in Computer Science, Mark P. Jones. First-class Polymorphism with Type Inference. In Proceedings of the Twenty Fourth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Paris, France, January Mark P. Jones and L. Duponcheel. Composing monads. YALEU/DCS/RR 1004, Yale University, New Haven, CT, USA, S. Kamin. Research on domain-specific embedded languages and program generators. Electronic Notes in Theoretical Computer Science, Elsevier Press, 12, Richard B. Kieburtz. Designing and implementing closed domain-specific languages. Invited talk at the Workshop on Semantics, Applications and Implementation of Program Generation (SAIG), J. E. Labra. An implementation of modular monadic semantics using folds and monadic folds. In Workshop on Research Themes on Functional Programming, Third International Summer School on Advanced Functional Programming, Braga - Portugal, J. E. Labra, J. M. Cueva, and C. Luengo. Language prototyping using modular monadic semantics. In 3rd Latin-American Conference on Functional Programming, Recife - Brazil, March 1999.

14 30. J. E. Labra, J. M. Cueva, and M. C. Luengo. Modular development of interpreters from semantic building blocks. In The 12th Nordic Workshop on Programming Theory, Bergen, Norway, October University of Bergen. 31. Sheng Liang. Modular Monadic Semantics and Compilation. PhD thesis, Graduate School of Yale University, May Sheng Liang and Paul Hudak. Modular denotational semantics for compiler construction. In Programming Languages and Systems ESOP 96, Proc. 6th European Symposium on Programming, Linköping, volume 1058 of Lecture Notes in Computer Science, pages Springer-Verlag, Sheng Liang, Paul Hudak, and Mark P. Jones. Monad transformers and modular interpreters. In 22nd ACM Symposium on Principles of Programming Languages, San Francisco, CA. ACM, January Grant Malcolm. Data structures and program transformation. Science of Computer Programming, 14: , E. Meijer, M. M. Fokkinga, and R. Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In Functional Programming and Computer Architecture, pages Springer-Verlag, E. Meijer and J. Jeuring. Merging monads and folds for functional programming. In J. Jeuring and E. Meijer, editors, Advanced Functional Programming, Lecture Notes in Computer Science 925, pages Springer-Verlag, Erik Meijer. Calculating Compilers. PhD thesis, University of Nijmegen, February E. Moggi. Metalanguages and applications. In A. M. Pitts and P. Dybjer, editors, Semantics and Logics of Computation, Publications of the Newton Institute. Cambridge University Press, Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS , Edinburgh University, Dept. of Computer Science, June Lecture Notes for course CS 359, Stanford University. 40. Eugenio Moggi. Notions of computacion and monads. Information and Computation, (93):55 92, Alberto Pardo. Fusion of monadic (co)recursive programs. In Roland Backhouse and Tim Sheard, editors, Proceedings Workshop on Generic Programming, WGP 98, Marstrand, Sweden, 18 June Dept. of Computing Science, Chalmers Univ. of Techn., and Göteborg Univ., June Tim Sheard and Leonidas Fegaras. A fold for all seasons. In Proceedings 6th ACM SIGPLAN/SIGARCH Intl. Conf. on Functional Programming Languages and Computer Architecture, FPCA 93, Copenhagen, Denmark, 9 11 June 1993, pages ACM, New York, Guy L. Steele, Jr. Building interpreters by composing monads. In Conference record of POPL 94, 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages: Portland, Oregon, January 17 21, 1994, pages , New York, USA, ACM Press. 44. L. Tajes, F. Álvarez, D. Álvarez, M. A. Díaz, and J.M. Cueva. A computational model for a distributed object-oriented operating system based on a reflective abstract machine. In S. Demeyer and J. Bosch, editors, Ecoop 98 Workshop on Reflective Object-Oriented Programming and Systems, volume 1543, pages LNCS, Daniele Turi and Jan Rutten. On the foundations of final coalgebra semantics: non-well-founded sets, partial orders, metric spaces. Mathematical Structures in Computer Science, 8(5): , 1998.

15 46. Arie van Deursen, Paul Klint, and Joost Visser. Domain-specific languages: An annotated bibliography. ACM SIGPLAN Notices, 35(6):26 36, June P. Wadler. Comprehending monads. In ACM Conference on Lisp and Functional Programming, pages 61 78, Nice, France, June ACM Press. 48. P. Wadler. Monads for functional programming. Lecture notes for Marktoberdorf Summer School on Program Design Calculi, Springer-Verlag, Aug P. Wadler. The essence of functional programming. In POPL 92, Albuquerque, 1992.

LPS: A Language Prototyping System Using Modular Monadic Semantics

LPS: A Language Prototyping System Using Modular Monadic Semantics Electronic Notes in Theoretical Computer Science 44 No. 2 (2001) URL: http://www.elsevier.nl/locate/entcs/volume44.html 22 pages LPS: A Language Prototyping System Using Modular Monadic Semantics J. E.

More information

A tutorial on the universality and expressiveness of fold

A tutorial on the universality and expressiveness of fold J. Functional Programming 9 (4): 355 372, July 1999. Printed in the United Kingdom c 1999 Cambridge University Press 355 A tutorial on the universality and expressiveness of fold GRAHAM HUTTON University

More information

Object-Oriented Software Specification in Programming Language Design and Implementation

Object-Oriented Software Specification in Programming Language Design and Implementation Object-Oriented Software Specification in Programming Language Design and Implementation Barrett R. Bryant and Viswanathan Vaidyanathan Department of Computer and Information Sciences University of Alabama

More information

Categorical Monads and Computer Programming

Categorical Monads and Computer Programming London Mathematical Society Impact150 Stories 1 (2015) 9 14 C 2015 Author(s) doi:10.1112/i150lms/t.0002 Categorical Monads and Computer Programming Nick Benton Abstract The categorical notion of monad

More information

The countdown problem

The countdown problem JFP 12 (6): 609 616, November 2002. c 2002 Cambridge University Press DOI: 10.1017/S0956796801004300 Printed in the United Kingdom 609 F U N C T I O N A L P E A R L The countdown problem GRAHAM HUTTON

More information

Annotated bibliography for the tutorial on Exploring typed language design in Haskell

Annotated bibliography for the tutorial on Exploring typed language design in Haskell Annotated bibliography for the tutorial on Exploring typed language design in Haskell Oleg Kiselyov 1 and Ralf Lämmel 2 1 Fleet Numerical Meteorology and Oceanography Center, Monterey, CA 2 Universität

More information

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic Lars Birkedal Rasmus Ejlers Møgelberg Rasmus Lerchedahl Petersen IT University Technical Report Series TR-00-7 ISSN 600 600 February 00

More information

Functional Programming. Functional Programming Languages. Chapter 14. Introduction

Functional Programming. Functional Programming Languages. Chapter 14. Introduction Functional Programming Languages Chapter 14 Introduction Functional programming paradigm History Features and concepts Examples: Lisp ML 1 2 Functional Programming Functional Programming Languages The

More information

Computer Science at Kent

Computer Science at Kent Computer Science at Kent Transformation in HaRe Chau Nguyen-Viet Technical Report No. 21-04 December 2004 Copyright 2004 University of Kent Published by the Computing Laboratory, University of Kent, Canterbury,

More information

Type Classes with Functional Dependencies

Type Classes with Functional Dependencies Appears in Proceedings of the 9th European Symposium on Programming, ESOP 2000, Berlin, Germany, March 2000, Springer-Verlag LNCS 1782. Type Classes with Functional Dependencies Mark P. Jones Department

More information

POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful

POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful RALF HINZE Institute of Information and Computing Sciences Utrecht University Email: ralf@cs.uu.nl Homepage: http://www.cs.uu.nl/~ralf/

More information

Integrating Formal Models into the Programming Languages Course

Integrating Formal Models into the Programming Languages Course Integrating Formal Models into the Programming Languages Course Allen B. Tucker Robert E. Noonan Computer Science Department Computer Science Department Bowdoin College College of William and Mary Brunswick,

More information

Adding GADTs to OCaml the direct approach

Adding GADTs to OCaml the direct approach Adding GADTs to OCaml the direct approach Jacques Garrigue & Jacques Le Normand Nagoya University / LexiFi (Paris) https://sites.google.com/site/ocamlgadt/ Garrigue & Le Normand Adding GADTs to OCaml 1

More information

The Clean programming language. Group 25, Jingui Li, Daren Tuzi

The Clean programming language. Group 25, Jingui Li, Daren Tuzi The Clean programming language Group 25, Jingui Li, Daren Tuzi The Clean programming language Overview The Clean programming language first appeared in 1987 and is still being further developed. It was

More information

Programming Languages

Programming Languages Programming Languages Qing Yi Course web site: www.cs.utsa.edu/~qingyi/cs3723 cs3723 1 A little about myself Qing Yi Ph.D. Rice University, USA. Assistant Professor, Department of Computer Science Office:

More information

The Designer's Guide to VHDL

The Designer's Guide to VHDL The Designer's Guide to VHDL Third Edition Peter J. Ashenden EDA CONSULTANT, ASHENDEN DESIGNS PTY. LTD. ADJUNCT ASSOCIATE PROFESSOR, ADELAIDE UNIVERSITY AMSTERDAM BOSTON HEIDELBERG LONDON m^^ yj 1 ' NEW

More information

Linearly Used Effects: Monadic and CPS Transformations into the Linear Lambda Calculus

Linearly Used Effects: Monadic and CPS Transformations into the Linear Lambda Calculus Linearly Used Effects: Monadic and CPS Transformations into the Linear Lambda Calculus Masahito Hasegawa Research Institute for Mathematical Sciences, Kyoto University hassei@kurimskyoto-uacjp Abstract

More information

The Technology Behind a Graphical User Interface for an Equational Reasoning Assistant

The Technology Behind a Graphical User Interface for an Equational Reasoning Assistant The Technology Behind a Graphical User Interface for an Equational Reasoning Assistant Andy Gill Department of Computing Science, University of Glasgow Abstract The Haskell Equational Reasoning Assistant

More information

Moving from CS 61A Scheme to CS 61B Java

Moving from CS 61A Scheme to CS 61B Java Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you

More information

Chapter 15 Functional Programming Languages

Chapter 15 Functional Programming Languages Chapter 15 Functional Programming Languages Introduction - The design of the imperative languages is based directly on the von Neumann architecture Efficiency (at least at first) is the primary concern,

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

Run-time Variability Issues in Software Product Lines

Run-time Variability Issues in Software Product Lines Run-time Variability Issues in Software Product Lines Alexandre Bragança 1 and Ricardo J. Machado 2 1 Dep. I&D, I2S Informática Sistemas e Serviços SA, Porto, Portugal, alexandre.braganca@i2s.pt 2 Dep.

More information

Asymptotic Improvement of Computations over Free Monads

Asymptotic Improvement of Computations over Free Monads Asymptotic Improvement of Computations over Free Monads Janis Voigtländer Institut für Theoretische Informatik Technische Universität Dresden 01062 Dresden, Germany janis.voigtlaender@acm.org Abstract.

More information

Functional Programming

Functional Programming FP 2005 1.1 3 Functional Programming WOLFRAM KAHL kahl@mcmaster.ca Department of Computing and Software McMaster University FP 2005 1.2 4 What Kinds of Programming Languages are There? Imperative telling

More information

[Refer Slide Time: 05:10]

[Refer Slide Time: 05:10] Principles of Programming Languages Prof: S. Arun Kumar Department of Computer Science and Engineering Indian Institute of Technology Delhi Lecture no 7 Lecture Title: Syntactic Classes Welcome to lecture

More information

Domain specific language on automata: Design and Implementation problems. Loïc Fosse

Domain specific language on automata: Design and Implementation problems. Loïc Fosse Domain specific language on automata: Design and Implementation problems Loïc Fosse Technical Report n o 0305, revision 0.20, 2nd November 2003 Even if Domain Specific Languages (DSL) are not well-known,

More information

Coeffects: Unified static analysis of context-dependence

Coeffects: Unified static analysis of context-dependence Coeffects: Unified static analysis of context-dependence Tomas Petricek, Dominic Orchard and Alan Mycroft University of Cambridge, UK {tp322,dao29,am}@cl.cam.ac.uk Abstract. Monadic effect systems provide

More information

Implementing Generate-Test-and-Aggregate Algorithms on Hadoop

Implementing Generate-Test-and-Aggregate Algorithms on Hadoop Implementing Generate-Test-and-Aggregate Algorithms on Hadoop Yu Liu 1, Sebastian Fischer 2, Kento Emoto 3, Zhenjiang Hu 4 1 The Graduate University for Advanced Studies,Tokyo, Japan yuliu@nii.ac.jp 3

More information

Anatomy of Programming Languages. William R. Cook

Anatomy of Programming Languages. William R. Cook Anatomy of Programming Languages William R. Cook Copyright (C) 2013 2 Chapter 1 Preliminaries Preface What? This document is a series of notes about programming languages, originally written for students

More information

Curriculum Vitae. Shan Shan Huang

Curriculum Vitae. Shan Shan Huang Curriculum Vitae Shan Shan Huang College of Computing Georgia Institute of Technology 266 Ferst Drive Atlanta, GA 30332-0765 Phone: (404)275-3312 Email: ssh@cc.gatech.edu http://www.freeflygeek.com Research

More information

Applicative programming with effects

Applicative programming with effects Under consideration for publication in J. Functional Programming 1 F U N C T I O N A L P E A R L Applicative programming with effects CONOR MCBRIDE University of Nottingham ROSS PATERSON City University,

More information

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science Program Schedule CTech Computer Science Credits CS101 Computer Science I 3 MATH100 Foundations of Mathematics and

More information

The Open University s repository of research publications and other research outputs

The Open University s repository of research publications and other research outputs Open Research Online The Open University s repository of research publications and other research outputs Connectors for mobile programs Journal Article How to cite: Wermelinger, Michel and Fiadeiro, José

More information

Monads for functional programming

Monads for functional programming Monads for functional programming Philip Wadler, University of Glasgow Department of Computing Science, University of Glasgow, G12 8QQ, Scotland (wadler@dcs.glasgow.ac.uk) Abstract. The use of monads to

More information

EMBEDDED SOFTWARE DEVELOPMENT: COMPONENTS AND CONTRACTS

EMBEDDED SOFTWARE DEVELOPMENT: COMPONENTS AND CONTRACTS EMBEDDED SOFTWARE DEVELOPMENT: COMPONENTS AND CONTRACTS David URTING, Stefan VAN BAELEN, Tom HOLVOET and Yolande BERBERS {David.Urting, Stefan.VanBaelen, Tom.Holvoet, Yolande.Berbers}@cs.kuleuven.ac.be

More information

Semantic Analysis: Types and Type Checking

Semantic Analysis: Types and Type Checking Semantic Analysis Semantic Analysis: Types and Type Checking CS 471 October 10, 2007 Source code Lexical Analysis tokens Syntactic Analysis AST Semantic Analysis AST Intermediate Code Gen lexical errors

More information

Computing Concepts with Java Essentials

Computing Concepts with Java Essentials 2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Computing Concepts with Java Essentials 3rd Edition Cay Horstmann

More information

The Art of Interpretation for Domain-Specific Embedded Languages

The Art of Interpretation for Domain-Specific Embedded Languages The Art of Interpretation for Domain-Specific Embedded Languages Saswat Anand 1, Siau-Cheng Khoo 2, Dana N. Xu 2, and Ping Zhu 2 1 College of Computing, Georgia Institute of Technology 2 School of Computing,

More information

Jieh Hsiang Department of Computer Science State University of New York Stony brook, NY 11794

Jieh Hsiang Department of Computer Science State University of New York Stony brook, NY 11794 ASSOCIATIVE-COMMUTATIVE REWRITING* Nachum Dershowitz University of Illinois Urbana, IL 61801 N. Alan Josephson University of Illinois Urbana, IL 01801 Jieh Hsiang State University of New York Stony brook,

More information

Programming Language Concepts for Software Developers

Programming Language Concepts for Software Developers Programming Language Concepts for Software Developers Peter Sestoft IT University of Copenhagen, Denmark sestoft@itu.dk Abstract This note describes and motivates our current plans for an undergraduate

More information

KEEP THIS COPY FOR REPRODUCTION PURPOSES. I ~~~~~Final Report

KEEP THIS COPY FOR REPRODUCTION PURPOSES. I ~~~~~Final Report MASTER COPY KEEP THIS COPY FOR REPRODUCTION PURPOSES 1 Form Approved REPORT DOCUMENTATION PAGE I OMS No. 0704-0188 Public reoorting burden for this collection of information is estimated to average I hour

More information

NEW YORK CITY COLLEGE OF TECHNOLOGY/CUNY Computer Systems Technology Department

NEW YORK CITY COLLEGE OF TECHNOLOGY/CUNY Computer Systems Technology Department NEW YORK CITY COLLEGE OF TECHNOLOGY/CUNY Computer Systems Technology Department COURSE: CST1201 Programming Fundamentals (2 class hours, 2 lab hours, 3 credits) Course Description: This course is an intensive

More information

Infinite Pretty-printing in exene

Infinite Pretty-printing in exene Infinite Pretty-printing in exene Allen Stoughton Kansas State University Manhattan, KS 66506, USA allen@cis.ksu.edu http://www.cis.ksu.edu/~allen/home.html Abstract. We describe the design and implementation

More information

Publications of Rod Burstall, Infornmatics, University of Edinbugh, UK

Publications of Rod Burstall, Infornmatics, University of Edinbugh, UK Publications of Rod Burstall, Infornmatics, University of Edinbugh, UK 1. R.M. Burstall, R.A. Leaver and J.E. Sussams. Evaluation of transport costs for alternative factory sites a case study. Operational

More information

Regular Expressions and Automata using Haskell

Regular Expressions and Automata using Haskell Regular Expressions and Automata using Haskell Simon Thompson Computing Laboratory University of Kent at Canterbury January 2000 Contents 1 Introduction 2 2 Regular Expressions 2 3 Matching regular expressions

More information

Java (12 Weeks) Introduction to Java Programming Language

Java (12 Weeks) Introduction to Java Programming Language Java (12 Weeks) Topic Lecture No. Introduction to Java Programming Language 1 An Introduction to Java o Java as a Programming Platform, The Java "White Paper" Buzzwords, Java and the Internet, A Short

More information

Lecture 1: Introduction

Lecture 1: Introduction Programming Languages Lecture 1: Introduction Benjamin J. Keller Department of Computer Science, Virginia Tech Programming Languages Lecture 1 Introduction 2 Lecture Outline Preview History of Programming

More information

Curriculum Map. Discipline: Computer Science Course: C++

Curriculum Map. Discipline: Computer Science Course: C++ Curriculum Map Discipline: Computer Science Course: C++ August/September: How can computer programs make problem solving easier and more efficient? In what order does a computer execute the lines of code

More information

Extraction of certified programs with effects from proofs with monadic types in Coq

Extraction of certified programs with effects from proofs with monadic types in Coq Extraction of certified programs with effects from proofs with monadic types in Coq Marino Miculan 1 and Marco Paviotti 2 1 Dept. of Mathematics and Computer Science, University of Udine, Italy 2 IT University

More information

Translating Generalized Algebraic Data Types to System F

Translating Generalized Algebraic Data Types to System F Translating Generalized Algebraic Data Types to System F Martin Sulzmann and Meng Wang {sulzmann,wangmeng}@comp.nus.edu.sg School of Computing, National University of Singapore S16 Level 5, 3 Science Drive

More information

Checking Access to Protected Members in the Java Virtual Machine

Checking Access to Protected Members in the Java Virtual Machine Checking Access to Protected Members in the Java Virtual Machine Alessandro Coglio Kestrel Institute 3260 Hillview Avenue, Palo Alto, CA 94304, USA Ph. +1-650-493-6871 Fax +1-650-424-1807 http://www.kestrel.edu/

More information

Coinductive Big-Step Semantics for Concurrency

Coinductive Big-Step Semantics for Concurrency Coinductive Big-Step Semantics for Concurrency Tarmo Uustalu Institute of Cybernetics at Tallinn University of Technology, Akadeemia tee 21, 12618 Tallinn, Estonia tarmo@cs.ioc.ee In a paper presented

More information

Compiling CAO: from Cryptographic Specifications to C Implementations

Compiling CAO: from Cryptographic Specifications to C Implementations Compiling CAO: from Cryptographic Specifications to C Implementations Manuel Barbosa David Castro Paulo Silva HASLab/INESC TEC Universidade do Minho Braga, Portugal April 8, 2014 Grenoble Motivation Developing

More information

ML for the Working Programmer

ML for the Working Programmer ML for the Working Programmer 2nd edition Lawrence C. Paulson University of Cambridge CAMBRIDGE UNIVERSITY PRESS CONTENTS Preface to the Second Edition Preface xiii xv 1 Standard ML 1 Functional Programming

More information

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction Standard 2: Technology and Society Interaction Technology and Ethics Analyze legal technology issues and formulate solutions and strategies that foster responsible technology usage. 1. Practice responsible

More information

CS 3719 (Theory of Computation and Algorithms) Lecture 4

CS 3719 (Theory of Computation and Algorithms) Lecture 4 CS 3719 (Theory of Computation and Algorithms) Lecture 4 Antonina Kolokolova January 18, 2012 1 Undecidable languages 1.1 Church-Turing thesis Let s recap how it all started. In 1990, Hilbert stated a

More information

Relational Databases

Relational Databases Relational Databases Jan Chomicki University at Buffalo Jan Chomicki () Relational databases 1 / 18 Relational data model Domain domain: predefined set of atomic values: integers, strings,... every attribute

More information

Chapter 7: Functional Programming Languages

Chapter 7: Functional Programming Languages Chapter 7: Functional Programming Languages Aarne Ranta Slides for the book Implementing Programming Languages. An Introduction to Compilers and Interpreters, College Publications, 2012. Fun: a language

More information

First Class Overloading via Insersection Type Parameters

First Class Overloading via Insersection Type Parameters First Class Overloading via Insersection Type Parameters Elton Cardoso 2, Carlos Camarão 1, and Lucilia Figueiredo 2 1 Universidade Federal de Minas Gerais, camarao@dcc.ufmg.br 2 Universidade Federal de

More information

PROPERTECHNIQUEOFSOFTWARE INSPECTIONUSING GUARDED COMMANDLANGUAGE

PROPERTECHNIQUEOFSOFTWARE INSPECTIONUSING GUARDED COMMANDLANGUAGE International Journal of Computer ScienceandCommunication Vol. 2, No. 1, January-June2011, pp. 153-157 PROPERTECHNIQUEOFSOFTWARE INSPECTIONUSING GUARDED COMMANDLANGUAGE Neeraj Kumar Singhania University,

More information

Origin Tracking in Attribute Grammars

Origin Tracking in Attribute Grammars Origin Tracking in Attribute Grammars Kevin Williams and Eric Van Wyk University of Minnesota Stellenbosch, WG2.11, January 20-22, 2015 1 / 37 First, some advertising Multiple new faculty positions at

More information

Ralf Hinze Generic Programs and Proofs

Ralf Hinze Generic Programs and Proofs Ralf Hinze Generic Programs and Proofs Bonn, 2000 Für Anja, Lisa und Florian Brief contents 1 Introduction 1 2 Background 15 3 Generic programs 53 4 Generic proofs 87 5 Examples 107 6 Generic Haskell 147

More information

CSE 307: Principles of Programming Languages

CSE 307: Principles of Programming Languages Course Organization Introduction CSE 307: Principles of Programming Languages Spring 2015 R. Sekar Course Organization Introduction 1 / 34 Topics 1. Course Organization Info and Support Course Description

More information

A Multi-layered Domain-specific Language for Stencil Computations

A Multi-layered Domain-specific Language for Stencil Computations A Multi-layered Domain-specific Language for Stencil Computations Christian Schmitt, Frank Hannig, Jürgen Teich Hardware/Software Co-Design, University of Erlangen-Nuremberg Workshop ExaStencils 2014,

More information

Rigorous Software Development CSCI-GA 3033-009

Rigorous Software Development CSCI-GA 3033-009 Rigorous Software Development CSCI-GA 3033-009 Instructor: Thomas Wies Spring 2013 Lecture 11 Semantics of Programming Languages Denotational Semantics Meaning of a program is defined as the mathematical

More information

Exploring the Regular Tree Types

Exploring the Regular Tree Types Exploring the Regular Tree Types Peter Morris, Thorsten Altenkirch and Conor McBride School of Computer Science and Information Technology University of Nottingham Abstract. In this paper we use the Epigram

More information

Division of Mathematical Sciences

Division of Mathematical Sciences Division of Mathematical Sciences Chair: Mohammad Ladan, Ph.D. The Division of Mathematical Sciences at Haigazian University includes Computer Science and Mathematics. The Bachelor of Science (B.S.) degree

More information

TEHNICAL UNIVERSITY OF CLUJ-NAPOCA FACULTY OF ELECTRICAL ENGINEERING

TEHNICAL UNIVERSITY OF CLUJ-NAPOCA FACULTY OF ELECTRICAL ENGINEERING TEHNICAL UNIVERSITY OF CLUJ-NAPOCA FACULTY OF ELECTRICAL ENGINEERING Eng. Marius-Ștefan MUJI PHD THESIS (abstract) CONTRIBUTIONS TO THE DEVELOPMENT OF DATABASE-DRIVEN INFORMATION SYSTEMS Scientific advisor

More information

CS422 - Programming Language Design

CS422 - Programming Language Design 1 CS422 - Programming Language Design General Information and Introduction Grigore Roşu Department of Computer Science University of Illinois at Urbana-Champaign 2 General Information Class Webpage and

More information

AN INTELLIGENT TUTORING SYSTEM FOR LEARNING DESIGN PATTERNS

AN INTELLIGENT TUTORING SYSTEM FOR LEARNING DESIGN PATTERNS AN INTELLIGENT TUTORING SYSTEM FOR LEARNING DESIGN PATTERNS ZORAN JEREMIĆ, VLADAN DEVEDŽIĆ, DRAGAN GAŠEVIĆ FON School of Business Administration, University of Belgrade Jove Ilića 154, POB 52, 11000 Belgrade,

More information

A Tool for Generating Partition Schedules of Multiprocessor Systems

A Tool for Generating Partition Schedules of Multiprocessor Systems A Tool for Generating Partition Schedules of Multiprocessor Systems Hans-Joachim Goltz and Norbert Pieth Fraunhofer FIRST, Berlin, Germany {hans-joachim.goltz,nobert.pieth}@first.fraunhofer.de Abstract.

More information

Practical Generic Programming with OCaml

Practical Generic Programming with OCaml Practical Generic Programming with OCaml Jeremy Yallop LFCS, University of Edinburgh ML Workshop 2007 Instead of this... type α tree = Node of α Branch of (α tree) (α tree) val show_tree : (α string) (α

More information

Tail Recursion Without Space Leaks

Tail Recursion Without Space Leaks Tail Recursion Without Space Leaks Richard Jones Computing Laboratory University of Kent at Canterbury Canterbury, Kent, CT2 7NF rejukc.ac.uk Abstract The G-machine (Johnsson, 1987; Peyton Jones, 1987)

More information

Programming Language Pragmatics

Programming Language Pragmatics Programming Language Pragmatics THIRD EDITION Michael L. Scott Department of Computer Science University of Rochester ^ШШШШШ AMSTERDAM BOSTON HEIDELBERG LONDON, '-*i» ЩЛ< ^ ' m H NEW YORK «OXFORD «PARIS»SAN

More information

Advanced Functional Programming (9) Domain Specific Embedded Languages

Advanced Functional Programming (9) Domain Specific Embedded Languages Advanced Functional Programming (9) Domain Specific Embedded Languages Advanced Functional Programming (9) Domain Specific Embedded Languages, Universiteit Utrecht http://www.cs.uu.nl/groups/st/ February

More information

Code Generation for High-Assurance Java Card Applets

Code Generation for High-Assurance Java Card Applets Code Generation for High-Assurance Java Card Applets Alessandro Coglio Kestrel Institute 3260 Hillview Avenue, Palo Alto, CA 94304, USA Ph. +1-650-493-6871 Fax +1-650-424-1807 http://www.kestrel.edu/ coglio

More information

William Paterson University of New Jersey Department of Computer Science College of Science and Health Course Outline

William Paterson University of New Jersey Department of Computer Science College of Science and Health Course Outline William Paterson University of New Jersey Department of Computer Science College of Science and Health Course Outline 1. TITLE OF COURSE AND COURSE NUMBER: Object-Oriented Programming in Java, CIT 2420

More information

Towards a Framework for Generating Tests to Satisfy Complex Code Coverage in Java Pathfinder

Towards a Framework for Generating Tests to Satisfy Complex Code Coverage in Java Pathfinder Towards a Framework for Generating Tests to Satisfy Complex Code Coverage in Java Pathfinder Matt Department of Computer Science and Engineering University of Minnesota staats@cs.umn.edu Abstract We present

More information

Handlers in Action. Ohad Kammar<ohad.kammar@cl.cam.ac.uk>

Handlers in Action. Ohad Kammar<ohad.kammar@cl.cam.ac.uk> Ohad Kammar Higher-Order Programming and Effects (HOPE) September 8, 2012 joint with Sam Lindley and Nicolas Oury Isaac Newton Trust Computer Laboratory Exception handlers handle

More information

A STUDY OF SEMANTICS, TYPES AND LANGUAGES FOR DATABASES AND OBJECT-ORIENTED PROGRAMMING ATSUSHI OHORI. Computer and Information Science

A STUDY OF SEMANTICS, TYPES AND LANGUAGES FOR DATABASES AND OBJECT-ORIENTED PROGRAMMING ATSUSHI OHORI. Computer and Information Science A STUDY OF SEMANTICS, TYPES AND LANGUAGES FOR DATABASES AND OBJECT-ORIENTED PROGRAMMING ATSUSHI OHORI A DISSERTATION in Computer and Information Science Presented to the Faculties of the University of

More information

Computational Mathematics with Python

Computational Mathematics with Python Computational Mathematics with Python Basics Claus Führer, Jan Erik Solem, Olivier Verdier Spring 2010 Claus Führer, Jan Erik Solem, Olivier Verdier Computational Mathematics with Python Spring 2010 1

More information

Timber: A Programming Language for Real-Time Embedded Systems

Timber: A Programming Language for Real-Time Embedded Systems Timber: A Programming Language for Real-Time Embedded Systems Andrew P. Black, Magnus Carlsson, Mark P. Jones, Richard Kieburtz and Johan Nordlander Department of Computer Science and Engineering OGI School

More information

Non-Archimedean Probability and Conditional Probability; ManyVal2013 Prague 2013. F.Montagna, University of Siena

Non-Archimedean Probability and Conditional Probability; ManyVal2013 Prague 2013. F.Montagna, University of Siena Non-Archimedean Probability and Conditional Probability; ManyVal2013 Prague 2013 F.Montagna, University of Siena 1. De Finetti s approach to probability. De Finetti s definition of probability is in terms

More information

Rigorous Software Engineering Hoare Logic and Design by Contracts

Rigorous Software Engineering Hoare Logic and Design by Contracts Rigorous Software Engineering Hoare Logic and Design by Contracts Simão Melo de Sousa RELEASE (UBI), LIACC (Porto) Computer Science Department University of Beira Interior, Portugal 2010-2011 S. Melo de

More information

A Complexity Measure Based on Cognitive Weights

A Complexity Measure Based on Cognitive Weights International Journal of Theoretical and Applied Computer Sciences Volume 1 Number 1 (2006) pp. 1 10 (c) GBS Publishers and Distributors (India) http://www.gbspublisher.com/ijtacs.htm A Complexity Measure

More information

α α λ α = = λ λ α ψ = = α α α λ λ ψ α = + β = > θ θ β > β β θ θ θ β θ β γ θ β = γ θ > β > γ θ β γ = θ β = θ β = θ β = β θ = β β θ = = = β β θ = + α α α α α = = λ λ λ λ λ λ λ = λ λ α α α α λ ψ + α =

More information

Language. Johann Eder. Universitat Klagenfurt. Institut fur Informatik. Universiatsstr. 65. A-9020 Klagenfurt / AUSTRIA

Language. Johann Eder. Universitat Klagenfurt. Institut fur Informatik. Universiatsstr. 65. A-9020 Klagenfurt / AUSTRIA PLOP: A Polymorphic Logic Database Programming Language Johann Eder Universitat Klagenfurt Institut fur Informatik Universiatsstr. 65 A-9020 Klagenfurt / AUSTRIA February 12, 1993 Extended Abstract The

More information

A View Integration Approach to Dynamic Composition of Web Services

A View Integration Approach to Dynamic Composition of Web Services A View Integration Approach to Dynamic Composition of Web Services Snehal Thakkar, Craig A. Knoblock, and José Luis Ambite University of Southern California/ Information Sciences Institute 4676 Admiralty

More information

Using Patterns and Composite Propositions to Automate the Generation of Complex LTL

Using Patterns and Composite Propositions to Automate the Generation of Complex LTL University of Texas at El Paso DigitalCommons@UTEP Departmental Technical Reports (CS) Department of Computer Science 8-1-2007 Using Patterns and Composite Propositions to Automate the Generation of Complex

More information

Programming Languages

Programming Languages Programming Languages Programming languages bridge the gap between people and machines; for that matter, they also bridge the gap among people who would like to share algorithms in a way that immediately

More information

1.1 WHAT IS A PROGRAMMING LANGUAGE?

1.1 WHAT IS A PROGRAMMING LANGUAGE? 1 INTRODUCTION 1.1 What is a Programming Language? 1.2 Abstractions in Programming Languages 1.3 Computational Paradigms 1.4 Language Definition 1.5 Language Translation 1.6 Language Design How we communicate

More information

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition Java 6 'th edition Concepts INTERNATIONAL STUDENT VERSION CONTENTS PREFACE vii SPECIAL FEATURES xxviii chapter i INTRODUCTION 1 1.1 What Is Programming? 2 J.2 The Anatomy of a Computer 3 1.3 Translating

More information

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries First Semester Development 1A On completion of this subject students will be able to apply basic programming and problem solving skills in a 3 rd generation object-oriented programming language (such as

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

Chapter 1. Dr. Chris Irwin Davis Email: cid021000@utdallas.edu Phone: (972) 883-3574 Office: ECSS 4.705. CS-4337 Organization of Programming Languages

Chapter 1. Dr. Chris Irwin Davis Email: cid021000@utdallas.edu Phone: (972) 883-3574 Office: ECSS 4.705. CS-4337 Organization of Programming Languages Chapter 1 CS-4337 Organization of Programming Languages Dr. Chris Irwin Davis Email: cid021000@utdallas.edu Phone: (972) 883-3574 Office: ECSS 4.705 Chapter 1 Topics Reasons for Studying Concepts of Programming

More information

Cedalion A Language Oriented Programming Language (Extended Abstract)

Cedalion A Language Oriented Programming Language (Extended Abstract) Cedalion A Language Oriented Programming Language (Extended Abstract) David H. Lorenz Boaz Rosenan The Open University of Israel Abstract Implementations of language oriented programming (LOP) are typically

More information

Doctor of Philosophy in Computer Science

Doctor of Philosophy in Computer Science Doctor of Philosophy in Computer Science Background/Rationale The program aims to develop computer scientists who are armed with methods, tools and techniques from both theoretical and systems aspects

More information

Constructing Contracts: Making Discrete Mathematics Relevant to Beginning Programmers

Constructing Contracts: Making Discrete Mathematics Relevant to Beginning Programmers Constructing Contracts: Making Discrete Mathematics Relevant to Beginning Programmers TIMOTHY S. GEGG-HARRISON Winona State University Although computer scientists understand the importance of discrete

More information

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives Introduction to Programming and Algorithms Module 1 CS 146 Sam Houston State University Dr. Tim McGuire Module Objectives To understand: the necessity of programming, differences between hardware and software,

More information