Turtle: A Constraint Imperative Programming Language Martin Grabmüller and Petra Hofstedt Fakultät IV – Elektrotechnik und Informatik.

Slides:



Advertisements
Similar presentations
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Advertisements

Type Inference David Walker COS 320. Criticisms of Typed Languages Types overly constrain functions & data polymorphism makes typed constructs useful.
SCIP Optimization Suite
Introduction. IC-Parc2 ECLiPSe Components Constraint Logic Programming system, consisting of  A runtime core Data-driven computation, backtracking, garbage.
Programming Languages and Paradigms
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
INF 212 ANALYSIS OF PROG. LANGS Type Systems Instructors: Crista Lopes Copyright © Instructors.
Intermediate code generation. Code Generation Create linear representation of program Result can be machine code, assembly code, code for an abstract.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Representing programs Goals. Representing programs Primary goals –analysis is easy and effective just a few cases to handle directly link related things.
Chapter 6: User-Defined Functions I
Introduction to Fortran Fortran Evolution Drawbacks of FORTRAN 77 Fortran 90 New features Advantages of Additions.
Advanced Compilers CSE 231 Instructor: Sorin Lerner.
1 Introduction to Software Engineering Lecture 42 – Communication Skills.
ISBN Chapter 9 Subprograms. Copyright © 2006 Addison-Wesley. All rights reserved.1-2 Introduction Two fundamental abstraction facilities.
Encapsulation by Subprograms and Type Definitions
C++ Programming: From Problem Analysis to Program Design, Second Edition Chapter 6: User-Defined Functions I.
Role Analysis Victor Kunkac, Patric Lam, Martin Rinard Laboratory for Computer Science, MIT Presentation by George Caragea CMSC631,
Basic Definitions Data Structures: Data Structures: A data structure is a systematic way of organizing and accessing data. Or, It’s the logical relationship.
Chapter 6: User-Defined Functions I
Guide To UNIX Using Linux Third Edition
Python quick start guide
SEC(R) 2008 Intel® Concurrent Collections for C++ - a model for parallel programming Nikolay Kurtov Software and Services.
1 EECS 231 ADVANCED PROGRAMMING. 2 Staff Instructor Vana Doufexi Ford Building, 2133 Sheridan, #2-229 Teaching Assistant.
Chapter 6: User-Defined Functions I Instructor: Mohammad Mojaddam
OOPs Object oriented programming. Based on ADT principles  Representation of type and operations in a single unit  Available for other units to create.
CSC3315 (Spring 2009)1 CSC 3315 Programming Languages Hamid Harroud School of Science and Engineering, Akhawayn University
CISC105 General Computer Science Class 1 – 6/5/2006.
Programming Paradigms Procedural Functional Logic Object-Oriented.
Cosc 2150: Computer Organization
Chapter 06 (Part I) Functions and an Introduction to Recursion.
Copyright 1999 by Larry Fuhrer. Pascal Programming Getting Started...
CSC3315 (Spring 2008)1 CSC 3315 Subprograms Hamid Harroud School of Science and Engineering, Akhawayn University
Programming Languages and Paradigms Imperative Programming.
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
1 Alex Proctor and Brian Lee for CSCI 431 at UNCA, Fall 2002 ML (Meta Language) a brief introduction Alex Proctor and Brian Lee For CSCI 431 at the University.
OOPs Object oriented programming. Abstract data types  Representationof type and operations in a single unit  Available for other units to create variables.
Manish K Parmar PGT (CS) K V VVNagar Thursday, December 24, 2015 Lesson on USER DEFINED FUNCTION IN C++ Presented by Manish K Parmar PGT Computer Science.
FORTRAN History. FORTRAN - Interesting Facts n FORTRAN is the oldest Language actively in use today. n FORTRAN is still used for new software development.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 6: User-Defined Functions I.
Programming Languages
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 6: User-Defined Functions I.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Chapter 3: User-Defined Functions I
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 6: User-Defined Functions I.
Intermediate code generation. Code Generation Create linear representation of program Result can be machine code, assembly code, code for an abstract.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
PZ09A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ09A - Activation records Programming Language Design.
Ada, Scheme, R Emory Wingard. Ada History Department of Defense in search of high level language around Requirements drafted for the language.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Programming Languages Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
Introduction To Software Development Environment.
Unit 10 Code Reuse. Key Concepts Abstraction Header files Implementation files Storage classes Exit function Conditional compilation Command-line arguments.
What Do Computers Do? A computer system is
Chapter 6: User-Defined Functions I
Abstract Data Types and Encapsulation Concepts
Compiler Construction (CS-636)
Types of Programming Languages
Interfaces.
Abstract Data Types and Encapsulation Concepts
A programming language
For this assignment, copy and past the XHTML to a notepad file with the .html extension. Then add the code I ask for to complete the problems.
Overview of Programming Paradigms
RUN-TIME STORAGE Chuen-Liang Chen Department of Computer Science
Algebraic Expressions & Solving Equations
Presentation transcript:

Turtle: A Constraint Imperative Programming Language Martin Grabmüller and Petra Hofstedt Fakultät IV – Elektrotechnik und Informatik Technische Universität Berlin Berlin, Germany

Turtle: A Constraint Imperative Programming Language2 Constraint Imperative Programming Imperative –Stateful, time-dependent –Useful for modelling interactive systems –Side-effecting I/O Constraint-based –Declarative –High-level problem specifications –Separate solving algorithm Constraint imperative programming combines advantages –Suitable algorithms for varying requirements –Clean specification and efficient execution

Turtle: A Constraint Imperative Programming Language3 Turtle: Language Design Imperative base language –Procedural language (procedures, statements, loops, assignments) –Functional extensions (HOF, algebraic data types, polymorphism) Constraint programming extensions –Constrainable variables –Constraint statements –User-defined constraints –Constraint solvers

Turtle: A Constraint Imperative Programming Language4 Constraint Extensions Constrainable variables var x: !int := var 0; –Constraint type –Variable object Constraint statements require 0 <= x and x <= 0 in y := x; end; –Constraint conjunction –Body statements –Constraint hierarchies 0 x:...

Turtle: A Constraint Imperative Programming Language5 Constraint Extensions User-defined constraints –Abstract over constraint conjunctions constraint domain(x: !int, min: int, max: int) require min <= x and x <= max; end ; require domain(x, 2, 9) and domain(y, 4, 6); Constraint solvers –Maintain conjunction of active constraints –Check satisfiability and calculate variable assignments

Turtle: A Constraint Imperative Programming Language6 Example 1 constraint all_different (l: list of !int) 2 while (tl l <> null) do 3 var ll: list of !int := tl l; 4 while (ll <> null) do 5 require hd l <> hd ll; 6 ll := tl ll; 7 end; 8 l := tl l; 9 end; 10 end; 11 var a: !int := var 0, b: !int := var 0, c: !int := var 0; 12 require all_different ([a, b, c]) in... end;

Turtle: A Constraint Imperative Programming Language7 Constraint Analysis var y: int := 4; var x: !int := var 0; require 10*x + 10 > 3*y - 1; Constant expression: *y Constrainable variable with coefficient: 10*x

Turtle: A Constraint Imperative Programming Language8 Code Generation 10*x > *y – 1 Constant expression: *y Constrainable variable and coefficient: 10*x 1 push-constant 0 // constraint strength '0' 2 push-constant 3 // constraint kind `>' 3 push-constant 1 // number of constrainable variables 4 push-variable y // calculate the constant term... 5 load-constant 3 6 mul 7 push 8 load-constant add 10 push 11 push-variable x // load constrainable variable object 12 push-constant add-constraint // add the constraint to the store

Turtle: A Constraint Imperative Programming Language9 Conclusion Turtle: constraint imperative programming language –Imperative base language –Functional language features –Constraint extensions Implementation –Standard compiler and constraint analysis –Run-time system with garbage collection and OS interface –Library with utility modules Future work –More and better constraint solvers –Language support for nondeterministic computation