Programming Languages

Slides:



Advertisements
Similar presentations
Lisp. Versions of LISP Lisp is an old language with many variants Lisp is alive and well today Most modern versions are based on Common Lisp LispWorks.
Advertisements

Primitive Recursive Functions (Chapter 3)
BNF. What is BNF? BNF stands for “Backus-Naur Form,” after the people who invented it BNF is a metalanguage--a language used to describe another language.
1 Introduction to Prolog References: – – Bratko, I., Prolog Programming.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Translator Architecture Code Generator ParserTokenizer string of characters (source code) string of tokens abstract program string of integers (object.
1 Programming Languages and Paradigms Lisp Programming.
Overview of Previous Lesson(s) Over View  Front end analyzes a source program and creates an intermediate representation from which the back end generates.
Lambda Calculus and Lisp PZ03J. Lambda Calculus The lambda calculus is a model for functional programming like Turing machines are models for imperative.
Chapter 3 Functional Programming. Outline Introduction to functional programming Scheme: an untyped functional programming language.
Elementary Data Types Prof. Alamdeep Singh. Scalar Data Types Scalar data types represent a single object, i.e. only one value can be derived. In general,
CS 355 – Programming Languages
1 Functional programming Languages And a brief introduction to Lisp and Scheme.
Program Design and Development
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 14 Functional Programming It is better to.
PSUCS322 HM 1 Languages and Compiler Design II Formal Semantics Material provided by Prof. Jingke Li Stolen with pride and modified by Herb Mayer PSU Spring.
CS-341 Dick Steflik Introduction. C++ General purpose programming language A superset of C (except for minor details) provides new flexible ways for defining.
CSC321: Programming Languages14-1 Programming Languages Tucker and Noonan Chapter 14: Functional Programming 14.1 Functions and the Lambda Calculus 14.2.
Jump to first page PKI2001 (TIFR, Mumbai) ASN.1 Abstract Syntax Notation One ASN.1 is a standard way to describe a message(a unit application data) that.
The Data Element. 2 Data type: A description of the set of values and the basic set of operations that can be applied to values of the type. Strong typing:
(5.1) COEN Functional Languages  Functional programming basics  Atoms and lists; cons  Useful primitive functions  Predicates  Arithmetic functions.
DEDUCTIVE DATABASE.
Syntax & Semantic Introduction Organization of Language Description Abstract Syntax Formal Syntax The Way of Writing Grammars Formal Semantic.
Imperative Programming Part One. 2 Overview Outline the characteristics of imperative languages Discuss other features of imperative languages that are.
The Data Element. 2 Data type: A description of the set of values and the basic set of operations that can be applied to values of the type. Strong typing:
CIS Computer Programming Logic
CSC3315 (Spring 2009)1 CSC 3315 Programming Paradigms Scheme Language Hamid Harroud School of Science and Engineering, Akhawayn University
Chapter 3: Data Types and Operators JavaScript - Introductory.
Syntax Specification and BNF © Allan C. Milne Abertay University v
Lec 6 Data types. Variable: Its data object that is defined and named by the programmer explicitly in a program. Data Types: It’s a class of Dos together.
30/09/04 AIPP Lecture 3: Recursion, Structures, and Lists1 Recursion, Structures, and Lists Artificial Intelligence Programming in Prolog Lecturer: Tim.
CS 1031 Linked Lists Definition of Linked Lists Examples of Linked Lists Operations on Linked Lists Linked List as a Class Linked Lists as Implementations.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
Programming Paradigms Backus Naur Form and Syntax Diagrams.
JavaScript Syntax and Semantics. Slide 2 Lecture Overview Core JavaScript Syntax (I will not review every nuance of the language)
Chapter 5: Sequences, Mathematical Induction, and Recursion 5.9 General Recursive Definitions and Structural Induction 1 Erickson.
Semantics. Semantics is a precise definition of the meaning of a syntactically and type-wise correct program. Ideas of meaning: –Operational Semantics.
Recognizing PL/SQL Lexical Units. 2 home back first prev next last What Will I Learn? List and define the different types of lexical units available in.
Lisp Functional Language or Applicative Language –Achieves its effect by applying functions, either recursively or through composition Powerful, expressive,
Introduction to ACL2 CS 680 Formal Methods for Computer Verification Jeremy Johnson Drexel University.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
1 COSC3306: Programming Paradigms Lecture 10: Applicative Programming Specifications Haibin Zhu, Ph.D. Computer Science Nipissing University (C) 2003.
Lecture 3: Count Programs, While Programs and Recursively Defined Functions 虞台文 大同大學資工所 智慧型多媒體研究室.
Sequence Control Syntax and Semantics Jian Xu March 3, 2004 CS706, CAS McMaster.
November 12, 2009Theory of Computation Lecture 17: Calculations on Strings II 1 Numerical Representation of Strings First, we define two primitive recursive.
Sum of Arithmetic Sequences. Definitions Sequence Series.
 Data Type is a basic classification which identifies different types of data.  Data Types helps in: › Determining the possible values of a variable.
Functional Programming in ACL2 Jeremy Johnson Kurt Schmidt Drexel University.
CS 3304 Comparative Languages
Denotational Semantics
Organization of Programming Languages
JavaScript Syntax and Semantics
(Functional Programming) Reference: R.Sebesta, Chapter 15
Syntax versus Semantics
Backus Naur form.
Lecture 2: Introduction to Algorithms
Elements of Programming Languages
FP Foundations, Scheme In Text: Chapter 14.
PHP.
CMSC 202 Java Primer 2.
CS 36 – Chapter 11 Functional programming Features Practice
BNF 23-Feb-19.
Programming Languages
The Data Element.
Introduction Reading: Sections 1.5 – 1.7.
If-statements & Indefinite Loops
Numerical Representation of Strings
The Data Element.
Programming Languages
Lisp.
Presentation transcript:

Programming Languages Meeting 9 November 1/2, 2016

Functional Programming Languages Work with pure FP languages No assignment statement No loops No objects or methods Still have sequence implemented as composition Recall [s1;s2] = [s2]○ [s1] Still have if – then – else Loops are replaced by recursion

FP (2) Four components Objects Primitive functions Functional forms Function definition mechanism, for secondary functions

Objects The only data type Not the objects from Java, but: Objects Atoms Lists of objects The symbol called bottom, signifying “undefined”

Atoms Forms of atoms sequence of characters, a string, an identifier sequence of digits, an integer [perhaps with sign] syntax of a real number T, meaning true F, meaning false

Functions Functions on the set of objects, the only operation on objects Programs are constructed using composition of functions. Two types of functions Entire: Defined on all objects Partial: Defined on some, but not all objects

Notation for Semantics One line function specification with choices, developed by John Backus Symbols : apply the function to the argument is defined as −> if – then ; else

Primitives Our set of primitives: first last head tail atom? null? list?

More Primitives appendr appendl length The arithmetic functions The comparison functions

Functional Forms The four Cs constant composition denoted by overbar depends on one object composition denoted by centered small circle depends on two functions

Functional Forms (2) construction conditional denoted by [ ] depends on n functions [f]:x <−> <f:x> (n=1) conditional denoted using −> and ; depends on a predicate and two functions

Functional Forms (3) apply to all insert (also known as reduce) denoted by αf depends on one function works only on lists insert (also known as reduce) denoted by /f depends on one function with a number of properties