CSCI 1302 - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

CSCI 1302

Description:

Modularity and abstraction critical. Handle scope. Manage complexity of instructions and data ... Expressed as two elementary components connected via a boolean ... – PowerPoint PPT presentation

Number of Views:58
Avg rating:3.0/5.0
Slides: 22
Provided by: jonpr
Category:
Tags: csci | abstraction

less

Transcript and Presenter's Notes

Title: CSCI 1302


1
CSCI 1302
  • History and Overview of Programming Languages

2
Evolution
  • You know about op-codes
  • Fun?
  • Not human-friendly
  • Open to errors
  • Move towards a more human-centered endeavor
  • Assembly languages a first start

3
From Op-Codes to Assembly
  • 156C
  • 166D
  • 5056
  • 306E
  • C000
  • LD R5, Price
  • LD R6, ShippingCharge
  • ADDI R0, R5 R6
  • ST R0, TotalCost
  • HLT

4
Problems with 2nd Generation Language (Assembly)
  • Machine specific
  • Still low-level processing
  • Hex to instruction
  • Memory address to variable identifier
  • Need more abstraction

5
3rd Generation Languages
  • Specific to task
  • Mathematical (FORTRAN)
  • List Processing AI (Lisp)
  • Systems (C)
  • Business Logic (COBOL)
  • Translated/compiled into machine-level
    instructions
  • Alternatively interpreted JIT
  • Machine independence portability available

6
Software Development Paradigms
Machine-centric
Human-centric
Lisp
Functional
C
C
Machine Languages
Object-oriented
C
ImperativeProcedural
Prolog
Declarative
1960
1970
1980
1990
2000
1950
7
Imperative/Procedural
  • Given problem
  • Derive algorithm to solve problem
  • Implement algorithm as series of commands
    (imperatives)
  • Modularity and abstraction critical
  • Handle scope
  • Manage complexity of instructions and data

8
Declarative
  • Describe/declare the problem
  • Language system provides general-purpose
    problem-solving algorithm
  • Enter problem statement
  • Solution(s) derived
  • Example
  • Horses run fast
  • Jack is a horse
  • Jack runs fast - TRUE

9
Functional
  • Given primitives of the language
  • Define small functions that accept input and
    generate output
  • Chain small functions together to generate
    complex solutions
  • Nested complexities
  • Examples
  • (Divide (Sum Numbers) (Count Numbers))
  • (First (Sort Numbers))

10
Object-Oriented
  • Collection of data methods that act on the data
  • Message passing
  • Inheritance
  • Collaborative and large-scale software
    development
  • Combination of imperative units

11
Primitives of Languages
  • Data types
  • Variables (instances of types)
  • Data structures (heterogeneous and homogeneous
    collections)
  • Constants
  • Assignment
  • Control statements (goto, if-then, loop)
  • Comments (for the humans)

12
Primitives of Languages (cont)
  • Procedures (modular abstraction)
  • Functions (return/resolve-to-a value)
  • Parameter passing
  • By reference by value
  • Actual formal
  • Input/Output

13
Translation Process
  • Begin with source (your code)
  • Lexical Analysis (tokenize)
  • Parsing (conform to valid syntax) into statements
  • Code generation into machine-level instructions
  • End with object program

14
Program Preparation
  • Begin with object program
  • Link (establishes connections between object
    programs) generates load module
  • Loader (take load module into memory and execute
    program)

15
CSCI 1302
  • Declarative Programming and Prolog

16
Assumptions
  • General problem-solving algorithm
  • Formal logic rules
  • AND
  • OR
  • NOT
  • IMPLIES
  • Seek resolution

17
Logical Deduction Examples
  • A Kermit is a prince
  • B Miss Piggy is an actress
  • A or B
  • B and not A
  • A -gt B

18
Determining Resolvents
  • Given
  • P or Q
  • R or not Q
  • Conclude
  • P or R

P or Q
R or not Q
P or R
19
Determining Resolvents (cont)
  • Given
  • P or Q
  • R or not Q
  • not R
  • Conclude
  • P

P or Q
R or not Q
not R
P or R
P
20
Clause Form
  • Expressed as two elementary components connected
    via a boolean OR
  • P or Q
  • P -gt Q
  • Translates to Q or not P
  • P and Q
  • Translates to

21
FIN
Write a Comment
User Comments (0)
About PowerShow.com