COMPUTATIONAL MODELS Chapter No. 1. What Is Computational Model? zThe common basis of programming language and computer architecture is known as computational.

Slides:



Advertisements
Similar presentations
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Advertisements

Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Principles of programming languages 1: Introduction (with a simple language) Isao Sasano Department of Information Science and Engineering.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Chapter 5: Elementary Data Types Properties of types and objects –Data objects, variables and constants –Data types –Declarations –Type checking –Assignment.
COEN Expressions and Assignment
ISBN Chapter 3 Describing Syntax and Semantics.
The Concept of Computer Architecture
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
Tutorial 6 & 7 Symbol Table
High-Level Programming Languages
Why Behavioral Wait statement Signal Timing Examples of Behavioral Descriptions –ROM.
Programming Languages Structure
Chapter 8 High-Level Programming Languages Nell Dale John Lewis.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
CSE S. Tanimoto Syntax and Types 1 Representation, Syntax, Paradigms, Types Representation Formal Syntax Paradigms Data Types Type Inference.
Lesson 6. Refinement of the Operator Model This page describes formally how we refine Figure 2.5 into a more detailed model so that we can connect it.
Describing Syntax and Semantics
CSE 341, S. Tanimoto Concepts 1- 1 Programming Language Concepts Formal Syntax Paradigms Data Types Polymorphism.
1 Chapter 5: Names, Bindings and Scopes Lionel Williams Jr. and Victoria Yan CSci 210, Advanced Software Paradigms September 26, 2010.
Computer Architecture Computational Models Ola Flygt V ä xj ö University
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
Imperative Programming
Chapter 1 - Introduction
 The design of the imperative languages is based directly on the von Neumann architecture  Efficiency is the primary concern  Low-level specifications:
Chapter 6 Programming Languages. © 2005 Pearson Addison-Wesley. All rights reserved 6-2 Chapter 6: Programming Languages 6.1 Historical Perspective 6.2.
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Chapter 6 Programming Languages © 2007 Pearson Addison-Wesley. All rights reserved.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
Chapter 6 Programming Languages (1) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Design Concepts By Deepika Chaudhary.
Algorithm Design.
Unit 2 Architectural Styles and Case Studies | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
TIVDM2Functional Programming Language Concepts 1 Concepts from Functional Programming Languages Peter Gorm Larsen.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Theory of Programming Languages Introduction. What is a Programming Language? John von Neumann (1940’s) –Stored program concept –CPU actions determined.
Chapter 8 High-Level Programming Languages. 2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Logical and Functional Programming
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
1-1 1 Introduction  Programming linguistics: concepts and paradigms syntax, semantics, and pragmatics language processors.  Historical development of.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
THE CONCEPT OF COMPUTER ARCHITECTURE Chapter No. 2.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Engineering Algorithms, Compilers, & Lifecycle.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
Functional Programming
Programming Languages 2nd edition Tucker and Noonan
Introduction to Algorithms
Why study programming languages?
Information Science and Engineering
CS 326 Programming Languages, Concepts and Implementation
Representation, Syntax, Paradigms, Types
Computer Programming.
Chap. 6 :: Control Flow Michael L. Scott.
Representation, Syntax, Paradigms, Types
Chap. 6 :: Control Flow Michael L. Scott.
What would be our focus ? Geometry deals with Declarative or “What is” knowledge. Computer Science deals with Imperative or “How to” knowledge 12/25/2018.
High Level Programming Languages
Representation, Syntax, Paradigms, Types
Chapter 6: Programming Languages
What would be our focus ? Geometry deals with Declarative or “What is” knowledge. Computer Science deals with Imperative or “How to” knowledge 2/23/2019.
Introduction to Algorithms
Principles of Programming Languages
Representation, Syntax, Paradigms, Types
Chapter 15 Functional Programming 6/1/2019.
Presentation transcript:

COMPUTATIONAL MODELS Chapter No. 1

What Is Computational Model? zThe common basis of programming language and computer architecture is known as computational model. zProvides higher level of abstraction than the programming language and the architecture. zComputational model is the combination of the above two.

What Is Computational Model? cont’n zE.g Von Neuman Architecture and imperative languages, reduction architecture and functional languages.

What Is Computational Model? cont’n

What is a computer program? zIt is an executable representation of some algorithm designed to solve some real world problem. zThere are thus two elements to a computer program: zLogic - what we what the program to achieve. zControl - how we are going to achieve the end goal. ALGORITHM = LOGIC + CONTROL

Imperative Languages zModel of computation based on a step by step sequences of commands. zProgram states exactly how the result is to be obtained. zDestructive assignment of variables.

Imperative Languages con’t zOrder of execution is crucial, commands can only be understood in context of previous computation due to side effects. zControl is the responsibility of the programmer. zE.g ALGOL, Pascal, Ada and C

Functional Languages zA program in a functional language consists of a set of (possibly recursive) function definitions and expression whose value is output as the program's result. zFunctional languages are one kind of declarative language. zDeclarative languages allow the programmer to concentrate on the logic of an algorithm (declarative languages are goal driven,control is not the concern of the programmer)

Declarative Langauge zModel of computation based on a system where relationships are specified directly in terms of the constituents of the input data. zMade up of sets of definitions or equations describing relations which specify what is to be computed, not how it is to be computed. zNon-destructive assignment of variables. zOrder of execution does not matter (no side effects). zExpressions/definitions can be used as values. zProgrammer no longer responsible for control.

Interpretation of the Concept of a Computational Model zThe computational model comprises of three sets of abstraction: Computational Model Basic Items of Computation Problem Description Model Execution Model

Basic Items of Computation zThis is the specification of the items the computation refers to the kind computations (operations) that can be performed on them. zE.g of items of computations are: ydata, objects or messages, arguments and functions, elements of sets and predicate declared on them.

Problem Description Model zRefers to both style and method of problem description. Problem Description Model StyleMethod

Problem Description Style zIt specifies how the problems in a particular computational model are described. Style Procedura l Declarative

Procedural Style zIn a procedural style the algorithm for solving the problem is stated. A particular solution is then declared. (Imperative languages uses procedural style) int nfac (int n) { int fac = 1; if (n > 0) for ( int i = 2; i <= n; i++ ) fac = fac * i; return fac; }

Declarative Style zFacts and relationships related to the problem have to be stated. Declarative Style Using Functions (applicative computational model ) Using predicts (predict logic based computational model)

Declarative Style zFunctional style yrelationships are expressed using functions. z E.g. (square (n) (* n n)) zThis is a function square,that express the relationship between the input n and the output value n*n. z Logic style yrelationships are declared using expressions known as clauses. z E.g. square(N, M):- M is N*N z Clauses can be used to express both facts and rules.

Problem Description Method zProcedural style ythe problem description model states how a solution of the given problem has to described. z Declarative style ythe problem description model states how the problem itself has to be described.

Execution Model zExecution model consists of three components. Interpretation of the computation Execution Semantics Execution Model Control of the execution sequence

Interpretation of the Execution zHow to perform the computation? zIt relates to problem description method z Problem description method and the interpretation of the computation mutually determines and presumes each other. zIn Von Neumann computational model, problem description is the sequence of instructions which specify data and sequence of control instructions and the execution of the given sequence of instructions is the interpretation of the computation.

Execution Semantics zA rule that prescribes how a single execution step is to be performed. zThe rule is associated with the chosen problem description method and how the execution of the computation is interpreted.

Execution Semantics State transition semantics SLD- resolution Execution Model Dataflow semantics Reduction semantics

Control of the Execution Sequence Control of the execution sequence Control Driven Data Driven Demand Driven

Control Driven zIn control driven execution it is assumed there exist a program consisting of sequence of instructions. zThe execution sequence implicitly given by the order of the instructions zExplicit control instructions can also be used to specify a departure from the implicit execution sequence.

Data Driven zIt is characterized by the fact that an operation is activated as soon as the data is available. zAlso, known as eager evaluation.

Demand Driven zThe operations will be activated only when their execution is needed to achieve the final result. zAlso known as lazy evaluation because the ‘delayed until needed ‘ philosophy is applied.

Relationships Between the Concepts of Computational Model, Programming Language and the Architecture Computational model Computer architecture Programming language Specification tool Implementation tool

Basic Computational Models zTuring zvon Neumann zdataflow zapplicative zobject based zpredicate logic based

Von Neumann Computational Model zBasic items of computation ydata is the basic item of computation ydata items are identified by names in order to distinguish between different data items used in the same computation. yThe named entities are known as variables in a programming language and in architectures yMultiple data assignments are allowed.

Von Neumann Computational Model zProblem description model yThe computational task is specified as a sequence of instructions (Procedural Model). zExecution model ythe computation is performed according to the given sequence of instructions. yInstruction execution follows a state transition semantics and the model behaves just like finite state machine. yEach instruction transfers the state of the machine to the present state to next one, in a definite way as specified by the semantics of the instruction.

Corresponding programming languages Corresponding architectures Computational Model

Key Concepts Related to Computational Model zGranularity yFrom computational model’s point of view granularity is interpreted as the complexity of the items computation. yFrom parallel architectures point of view granularity is interpreted as size of parallel computations that can be executed without any synchronization or communication.. yGranularity can be classified as fine grained and coarse grained.

Granularity Low High Language Class Conventional assembly language Conventional High language Granularity Example Fig 1.21 The interpretation of granularity for programming languages

Key Concepts Related to Computational Model zTyping ythe concept of typing is used at a higher level in connection with programming languages but from computational model’s point of view typing of languages and architecture is closely related. yIn typed languages there exist a concept of data type and the compiler or interpreter checks the consistency of the types used in function invocation, expressions etc. ythe language may be strongly typed or weakly typed. yStrongly typed languages are Pascal, Miranda, hope, C

Typing yWeekly type languages are LISP, FP. They are also know as untyped languages yTyped architectures are commonly known as tagged. yThey provide a mechanism for typing the data being stored or processed, by extending the data word by tag. yThe tag contain the type identification and usually 3- 5 bits long. yTagging bridge the gap between untyped architecture and weakly typed language