Build.bat - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Build.bat

Description:

make heavy use of subroutines. Logic languages. formal specifications and theorem proving ... of assignment operations makes function-oriented programs much ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 11
Provided by: davidbru
Category:
Tags: bat | build

less

Transcript and Presenter's Notes

Title: Build.bat


1
Build.bat
  • wicont -c xcode escape ebcdic
  • wicont -c parsell1 readll1 semstk eulerscn
  • wicont -fs euler eulersem eulerint parsell1
    readll1 semstk eulerscn

2
T0exp.eul
  • begin new a new y new z ( declare vbls )
  • a lt- list 2 ( make 'a' a list )
  • y lt- 2 ( assign y a value of 2 )
  • a1 lt- y 4 ( a1 2 4 )
  • out a1 ( display 2 4 )
  • a2 lt- 2 ( assign value to a2 )
  • out a1 a2 ( display 16 2 )
  • ( NOTE NO semicolon on next to last line of
    program )
  • end

3
Nonimperative Programming Models
  • Imperative - focus on how the computer should do
    its work
  • C, Pascal, Fortran
  • Declarative - focus on what the computer should
    do
  • functional - modeled after lambda calculus
  • Lisp

4
Functional and Logic Languages
  • Functional languages
  • make heavy use of subroutines
  • Logic languages
  • formal specifications and theorem proving

5
Historical Origins
  • imperative and functional models
  • Turing, Church, Kleene, Post in the 1930s
  • Turing machine computes in an imperative way
  • Church's model of computing is called the lambda
    calculus based on the notion of parameterized
    expressions
  • Logic programming is tied to the notion of
    constructive proofs

6
Programmers View
  • imperative programmer
  • To compute the gcd of a and b, check to see if a
    and b are equal. If so, print one of them and
    stop. Otherwise, replace the larger one by their
    difference and repeat.
  • functional programmer
  • The gcd of a and b is defined to be a when a and
    b are equal, and to be the gcd of c and d when a
    and b are unequal, where c is the smaller of a
    and b, and d is their difference.

7
Programmers ViewLogic Programmer
  • The proposition gcd (a, b, g) is true if
  • (1) a, b, and g are all equal, or
  • (2) there exist numbers c and d such that c is
    the minimum of a and b (i.e., min (a, b, c) is
    true), d is their difference (i.e., minus (a, b,
    d) is true), and gcd(c, d, g) is true. To compute
    the gcd of a given pair of numbers, search for a
    number g (and various numbers c and d) for which
    these two rules allow one to prove that gcd (a,
    b, g) is true.

8
Characteristics of Function-Oriented Programming
Languages
  • emphasis on the use of pure functions
  • minimal use of assignment operations
  • high level of abstraction
  • lack of dependence on assignment operations
    allows function-oriented programs to be evaluated
    in many different orders
  • absence of assignment operations makes
    function-oriented programs much more amenable to
    mathematical proof and analysis than are
    imperative programs

9
Functional Languages
  • First-class function values and higher-order
    functions
  • Extensive polymorphism
  • List types and operators
  • Recursion
  • Structured function returns
  • Constructors (aggregates) for structured objects
  • Garbage collection

10
Overview of Scheme
  • runs a "read-eval-print" loop
  • ( 3 4) prints 7
  • 7 prints 7
  • (( 3 4))
  • '( 3 4) evaluates to ( 3 4)
  • (if (gt a 0) ( 2 3) ( 2 "foo") )
  • (char? x) is x a character?
  • (string? x) is x a string?
  • (number? x) is x a number?
  • (list? x) is x a (proper) list?
Write a Comment
User Comments (0)
About PowerShow.com