Software as Math - PowerPoint PPT Presentation

About This Presentation
Title:

Software as Math

Description:

It could be said that these subjects define the mathematical basis ... Big Ben and a wristwatch. Two decks of cards, each a different color. A Good Example... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 16
Provided by: ryanj5
Learn more at: https://www.cse.unr.edu
Category:
Tags: ben | big | math | software

less

Transcript and Presenter's Notes

Title: Software as Math


1
Software as Math
(or why you should be paying attention in this
class)
  • Ryan Luna
  • Javier Garcia

2
Overview
  • What the heck is discrete math?
  • Algebraic Specifications
  • Theories and Models
  • Specification Morphisms
  • Homomorphisms and Isomorphisms
  • Useful applications!!

3
Discrete Mathematics
  • What is discrete mathematics?
  • Discrete mathematics is the part of
    mathematics devoted to the study of discrete
    objects where discrete refers to consisting of
    distinct or unconnected elements.
  • It could be said that these subjects define the
    mathematical basis for computing.
  • A key reason for the growth in importance of
    discrete mathematics is that information is
    stored and manipulated by computing machines in a
    discrete fashion.

4
Algebraic Specifications
  • An algebra consists of a set (sort) and a
    collection of operators defined over this set.
  • A good example
  • Natural Numbers 0,1,2,3,
  • Operators - x
  • Each operator is defined over two elements in
    the sort.
  • An algebra is multi-sorted if it includes
    multiple sorts.

5
How does this relate to me?
  • A good example of a multi-sorted algebra is the
    Abstract Data Type programming style.
  • Remember
  • When defining an ADT we define
  • 1) Collection of types
  • 2) Set of functions and procedures for
    those types

6
Binary Search Tree ADT
  • Sort Any elementary or user defined data type.
  • BSTree ltintgt myTree
  • BSTree ltstringgt strTree
  • Operators The functions written for the tree.
  • void BSTree ltADTgt insert (ADT element)
  • void BSTree ltADTgt remove (ADT element)
  • void BSTree ltADTgt retrieve (ADT element)

7
Heap ADT
  • Sort Any elementary or user defined data type.
  • Heap ltintgt myTbl
  • Heapltstringgt strTbl
  • Operators Implementation of the Heap.
  • void insert (ADT element)
  • ADT removeMax ()
  • void clear()

8
Theories and Models
  • Suppose a computer program could take an
    algebraic specification and from it generate all
    its implications this set of true statements
    would be the theory associated with the algebraic
    specification.
  • A theory models a system if
  • 1) Every observable behavior of the system is
    a theorem
  • in the theory. (Completeness)
  • 2) Every theorem in the theory corresponds to
    a behavior
  • in the system. (Consistency)
  • EMC2

9
Specification Morphisms
  • Why do we care, really?
  • Software development is all about changing
    models.
  • Software Design Process
  • Specification morphism represents the
    transformation of one specification into another.

10
Homomorphisms
  • A homomorphism exists between two specifications
    if every thing true in A
  • is true in B.
  • A ? B, but A ? B.

Homomorphism between A and B.A is more abstract
than B.B is more general than A.
Homomorphism between C, A and BB is more general
than A or C.B represents both A and C.
11
Isomorphisms
  • An isomorphism exists between A and B when the
    two specifications represent the same theory.
  • Specifications are structurally identical.
  • Used less often in software engineering because
    they are too strong.
  • Physical examples
  • Big Ben and a wristwatch
  • Two decks of cards, each a different color

12
A Good Example
  • Consider two data structures a stack and a list.
  • A homomorphism exists between the stack and the
    list.
  • Stack ? List

13
Another Good Example
  • Consider several data structures
  • A queue, a stack, and a list.
  • We can define a homomorphism between the queue
    and the list, as well as the stack and the list.
  • Stack ? List and Queue ? List

No homomorphism exists between a stack and a
queue!
14
Finally
  • Algebraic specifications relate well to ADT
    programming
  • Knowing homomorphisms between two specifications
    can make life easier!
  • Set Theory and Functions can have real
    applications!

15
Questions?
Write a Comment
User Comments (0)
About PowerShow.com