Skip to content
Snippets Groups Projects
Commit 0646b697 authored by W. Spencer Smith's avatar W. Spencer Smith
Browse files

Addition of L09 on MIS (abstract object)

parent 9caccc51
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,7 @@
\item Multiple assignment statement
\item Conditional rules
\item Finite state machines
\item Circle intersection example
\end{itemize}
\end{frame}
......
No preview for this file type
......@@ -22,7 +22,7 @@
\mode<presentation>{}
\input{../def-beamer}
\Drafttrue
\Draftfalse
\newcommand{\topicTitle}{09 Module Interface Specification (H\&S Ch.\ 7, Ghezzi Ch.\ 4)}
\ifDraft
......@@ -44,13 +44,14 @@
\begin{itemize}
\item Administrative details
\item pdfnup
\item Overview of MIS
\item MIS Template
\begin{itemize}
\item Syntax
\item Semantics
\end{itemize}
\item Sequence example
\item Sequence example (abstract object)
\end{itemize}
\end{frame}
......@@ -64,17 +65,12 @@ TBD
\else
{
\begin{itemize}
\item Assignment 1
\begin{itemize}
\item Files due by midnight January 28
\item E-mail partner files by January 28
\item Lab report due February 2
\item Using Python 2.7, doxygen, make, LaTeX, git
\item Make sure everything runs on mills
\item \structure{Use the folder structure and filenames given!}
\item Partner Files: January 28, 2018
\item Part 2: January 31, 2018
\end{itemize}
\item Questions on assignment?
\end{itemize}
}
\fi
......@@ -82,6 +78,23 @@ TBD
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{pdfnup}
\begin{itemize}
\item If you like to print the lecture and/or tutorial slides consider printing
4 (or more) slides per page
\item Consider using
\href{https://warwick.ac.uk/fac/sci/statistics/staff/academic-research/firth/software/pdfjam/}{pdfjam}
\item pdfjam provides pdfnup for ``n-upping'' pages
\item \texttt{alias pdfnup='pdfnup --nup 2x2 --frame true --paper letterpaper --scale 0.9'}
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Sequences}
\begin{itemize}
......@@ -189,7 +202,11 @@ TBD
\item Show access routines in tabular form
\begin{itemize}
\item Important design decisions are made at this point
\item Later we will discuss qualities of a good interface, like minimal,
essential, etc.
\item The goal is to have the syntax match many implementation languages
\item The mapping to a programming language will not always be the same; it
depends on the syntax of the programming language
\end{itemize}
\end{itemize}
\end{frame}
......@@ -197,7 +214,7 @@ TBD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Syntax of a Sequence Module}
\frametitle{Syntax of a Sequence Module (Abstract Object)}
\textbf{Exported Constants}\\
~\newline
......@@ -216,17 +233,17 @@ MAX\_SIZE = 100\\
\hline
\textbf{Routine name} & \textbf{In} & \textbf{Out} & \textbf{Exceptions}\\
\hline
seq\_init & ~ & ~ & ~\\
Seq\_init & ~ & ~ & ~\\
\hline
seq\_add & integer, integer & ~ & FULL, POS\\
Seq\_add & integer, integer & ~ & FULL, POS\\
\hline
seq\_del & integer & ~ & POS\\
Seq\_del & integer & ~ & POS\\
\hline
seq\_setval & integer, integer & ~ & POS\\
Seq\_setval & integer, integer & ~ & POS\\
\hline
seq\_getval & integer & integer & POS\\
Seq\_getval & integer & integer & POS\\
\hline
seq\_size & ~ & integer & ~\\
Seq\_size & ~ & integer & ~\\
\hline
\end{tabular}
......@@ -296,7 +313,7 @@ seq\_size & ~ & integer & ~\\
~\newline
\textbf{Assumptions}\\
seq\_init() is called before any other access program
Seq\_init() is called before any other access program
\end{frame}
......@@ -316,7 +333,7 @@ $s$: sequence of integer
~\newline
\textbf{Assumptions}\\
seq\_init() is called before any other access program
Seq\_init() is called before any other access program
\end{frame}
......@@ -334,7 +351,7 @@ $| s | \leq \mbox{MAX\_SIZE}$
~\newline
\textbf{Assumptions}\\
seq\_init() is called before any other access program
Seq\_init() is called before any other access program
\end{frame}
......@@ -345,13 +362,13 @@ seq\_init() is called before any other access program
\textbf{Access Routine Semantics}\\
~\newline
seq\_init():
Seq\_init():
\begin{itemize}
\item transition: \structure{What should the state transition be?}
\item exception: none
\end{itemize}
~\newline
\noindent seq\_add($i, p$):
\noindent Seq\_add($i, p$):
\begin{itemize}
\item transition: $s := s[0..i-1] || <p> || s[i..\structure{?}]$
\item exception: $exc := (|s| = \structure{?})$ \structure{What exceptions? How
......@@ -368,13 +385,13 @@ seq\_init():
\textbf{Access Routine Semantics}\\
~\newline
seq\_init():
Seq\_init():
\begin{itemize}
\item transition: $s := < >$
\item exception: none
\end{itemize}
~\newline
\noindent seq\_add($i, p$):
\noindent Seq\_add($i, p$):
\begin{itemize}
\item transition: $s := s[0..i-1] || <p> || s[i..|s|-1]$
\item exception: $exc := (|s| = \structure{?})$ \structure{What exceptions? How
......@@ -391,13 +408,13 @@ seq\_init():
\textbf{Access Routine Semantics}\\
~\newline
seq\_init():
Seq\_init():
\begin{itemize}
\item transition: $s := < >$
\item exception: none
\end{itemize}
~\newline
\noindent seq\_add($i, p$):
\noindent Seq\_add($i, p$):
\begin{itemize}
\item transition: $s := s[0..i-1] || <p> || s[i..|s|-1]$
\item exception: $exc := (|s| = \mbox{MAX\_SIZE} \Rightarrow \mbox{FULL} ~ | ~ i \notin [0..|s|] \Rightarrow
......@@ -411,19 +428,19 @@ seq\_init():
\begin{frame}
\frametitle{Access Routine Semantics Continued}
\noindent seq\_del($i$):
\noindent Seq\_del($i$):
\begin{itemize}
\item transition: $s := \structure{?}$
\item exception: $exc := \structure{?}$
\end{itemize}
~\newline
\noindent seq\_setval($i, p$):
\noindent Seq\_setval($i, p$):
\begin{itemize}
\item transition: $\structure{?}$
\item exception: $\structure{?}$
\end{itemize}
~\newline
\noindent seq\_getval($i$):
\noindent Seq\_getval($i$):
\begin{itemize}
\item output: $\structure{?}$
\item exception: $\structure{?}$
......@@ -436,19 +453,19 @@ seq\_init():
\begin{frame}
\frametitle{Access Routine Semantics Continued}
\noindent seq\_del($i$):
\noindent Seq\_del($i$):
\begin{itemize}
\item transition: $s := s[0..i-1] || s[i+1..|s|-1]$
\item exception: $exc := \structure{?}$
\end{itemize}
~\newline
\noindent seq\_setval($i, p$):
\noindent Seq\_setval($i, p$):
\begin{itemize}
\item transition: $\structure{?}$
\item exception: $\structure{?}$
\end{itemize}
~\newline
\noindent seq\_getval($i$):
\noindent Seq\_getval($i$):
\begin{itemize}
\item output: $\structure{?}$
\item exception: $\structure{?}$
......@@ -460,19 +477,19 @@ seq\_init():
\begin{frame}
\frametitle{Access Routine Semantics Continued}
\noindent seq\_del($i$):
\noindent Seq\_del($i$):
\begin{itemize}
\item transition: $s := s[0..i-1] || s[i+1..|s|-1]$
\item exception: $exc := (i \notin [0..|s|-1] \Rightarrow \mbox{POS})$
\end{itemize}
~\newline
\noindent seq\_setval($i, p$):
\noindent Seq\_setval($i, p$):
\begin{itemize}
\item transition: $\structure{?}$
\item exception: $exc := (i \notin [0..|s|-1] \Rightarrow \mbox{POS})$
\end{itemize}
~\newline
\noindent seq\_getval($i$):
\noindent Seq\_getval($i$):
\begin{itemize}
\item output: $\structure{?}$
\item exception: $exc := (i \notin [0..|s|-1] \Rightarrow \mbox{POS})$
......@@ -484,19 +501,19 @@ seq\_init():
\begin{frame}
\frametitle{Access Routine Semantics Continued}
\noindent seq\_del($i$):
\noindent Seq\_del($i$):
\begin{itemize}
\item transition: $s := s[0..i-1] || s[i+1..|s|-1]$
\item exception: $exc := (i \notin [0..|s|-1] \Rightarrow \mbox{POS})$
\end{itemize}
~\newline
\noindent seq\_setval($i, p$):
\noindent Seq\_setval($i, p$):
\begin{itemize}
\item transition: $s[i] := p$
\item exception: $exc := (i \notin [0..|s|-1] \Rightarrow \mbox{POS})$
\end{itemize}
~\newline
\noindent seq\_getval($i$):
\noindent Seq\_getval($i$):
\begin{itemize}
\item output: $\structure{?}$
\item exception: $exc := (i \notin [0..|s|-1] \Rightarrow \mbox{POS})$
......@@ -508,19 +525,19 @@ seq\_init():
\begin{frame}
\frametitle{Access Routine Semantics Continued}
\noindent seq\_del($i$):
\noindent Seq\_del($i$):
\begin{itemize}
\item transition: $s := s[0..i-1] || s[i+1..|s|-1]$
\item exception: $exc := (i \notin [0..|s|-1] \Rightarrow \mbox{POS})$
\end{itemize}
~\newline
\noindent seq\_setval($i, p$):
\noindent Seq\_setval($i, p$):
\begin{itemize}
\item transition: $s[i] := p$
\item exception: $exc := (i \notin [0..|s|-1] \Rightarrow \mbox{POS})$
\end{itemize}
~\newline
\noindent seq\_getval($i$):
\noindent Seq\_getval($i$):
\begin{itemize}
\item output: $out := s[i]$
\item exception: $exc := (i \notin [0..|s|-1] \Rightarrow \mbox{POS})$
......@@ -533,7 +550,7 @@ seq\_init():
\begin{frame}
\frametitle{Access Routine Semantics Continued}
\noindent seq\_size():
\noindent Seq\_size():
\begin{itemize}
\item output: $\structure{?}$
\item exception: \structure{?}
......@@ -546,7 +563,7 @@ seq\_init():
\begin{frame}
\frametitle{Access Routine Semantics Continued}
\noindent seq\_size():
\noindent Seq\_size():
\begin{itemize}
\item output: $out := | s |$
\item exception: none
......@@ -556,4 +573,14 @@ seq\_init():
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Homework}
\structure{How would you implement Seq in Python? Remember Seq is an abstract
object.}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment