PLT: Lecture 2 - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

PLT: Lecture 2

Description:

Fixity (conventions): Horizontal: Prefix; Infix. Outfix. Postfix ... Fixity (Continued): Vertical Elements: Superfix; Vertical Infix; Subfix; Vertical Outfix; ... – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 13
Provided by: deptSc7
Category:
Tags: plt | fixity | lecture

less

Transcript and Presenter's Notes

Title: PLT: Lecture 2


1
PLT Lecture 2
  • Compilation and Mathematical Notation

2
1st Ever Program
3
Semantic TranslationThe Role of the Compiler
  • This translation machine (compiler) is feasable
    because its input (program source) has
  • A structure which is described in a reference
    manual
  • Semantics that can be described in terms of (and
    attached to) that structure.

4
(No Transcript)
5
Compiler Architecture
  • Shows Good Separation of Concerns
  • Shows Interpreter Possibility
  • For
  • High Level Portability
  • Much Less Work
  • Against
  • Slower Execution
  • Non Persistent Executable

6
Re-engineering tool Architecture
  • A Program view may be
  • Graphical Representation
  • Metrics
  • Translated Source Code
  • Re-factored Source Code
  • Which may in turn by taken as an input to the
    re-engineering tool

7
Reengineering Architecture
8
Mathematical Notations
  • Arithmetic / Algebraic Notations include
  • Symbols
  • Operator symbols
  • Operand symbols
  • Literals
  • Variables
  • Punctuation symbols
  • Conventions
  • Where symbols should be placed with respect to
    each other
  • These allow the building of more complex
    expressions from simpler ones

9
Operator Properties
  • Arity
  • Unary
  • Binary
  • Ternary
  • Variable
  • Fixity (conventions)
  • Horizontal
  • Prefix
  • Infix
  • Outfix
  • Postfix

10
Operator Properties Continued
  • Fixity (Continued)
  • Vertical Elements
  • Superfix
  • Vertical Infix
  • Subfix
  • Vertical Outfix
  • Invisibilty
  • abc
  • Exp(2,3) 2 to the power of 3 23
  • alta1, a2, a3,.angt. ai implies the selector
    operator (ith element) from that sequence

11
More Complex Calculations
  • Elementary operations
  • More complex operations
  • Intermediate naming option
  • Delocalizes the original formula
  • Introduces many new symbols
  • Generalizing operands
  • Literal
  • Variable
  • Result of earlier operation
  • Expression
  • Sub-Expressions as operands in nesting
    expressions

12
Notational Conventions (that enable this nesting)
  • Stretchable Operators
  • Square root
  • Any more?
  • Special Delimiters
  • Over-lines, Overbraces
  • Illustrate for quadratic equations
  • Illustrate refined notation
  • Expression Trees
  • Highly readable (humans and Computers)
  • Eliminate delimiters
  • Space for annotation
  • Extensively used in compilers
Write a Comment
User Comments (0)
About PowerShow.com