Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
se2aa4_cs2me3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
W. Spencer Smith
se2aa4_cs2me3
Commits
d4f5838d
Commit
d4f5838d
authored
7 years ago
by
W. Spencer Smith
Browse files
Options
Downloads
Patches
Plain Diff
Changes to T4 slides to fix some of the specification syntax
parent
44b43f5b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tutorials/T04-A2Example/slides/T4.pdf
+0
-0
0 additions, 0 deletions
Tutorials/T04-A2Example/slides/T4.pdf
Tutorials/T04-A2Example/slides/T4.tex
+37
-78
37 additions, 78 deletions
Tutorials/T04-A2Example/slides/T4.tex
with
37 additions
and
78 deletions
Tutorials/T04-A2Example/slides/T4.pdf
+
0
−
0
View file @
d4f5838d
No preview for this file type
This diff is collapsed.
Click to expand it.
Tutorials/T04-A2Example/slides/T4.tex
+
37
−
78
View file @
d4f5838d
...
@@ -130,8 +130,8 @@ McMaster University\\ }
...
@@ -130,8 +130,8 @@ McMaster University\\ }
\frametitle
{
What is a MIS?
}
\frametitle
{
What is a MIS?
}
\begin{itemize}
\item
Module Interface Specification
\begin{itemize}
\item
Module Interface Specification
\item
Specifices externally observable behaviour of a module
\item
Specifices externally observable behaviour of a module
\item
Not in language of implementation,
but
uses mathematical
and application
language
\item
Not in language of implementation, uses mathematical language
\item
I
nternal i
mplementations are not included in
a
MIS
\item
Implementation
detail
s are not included in
the
MIS
\end{itemize}
\end{itemize}
\end{frame}
\end{frame}
...
@@ -193,7 +193,7 @@ McMaster University\\ }
...
@@ -193,7 +193,7 @@ McMaster University\\ }
Consider the following triangle:
Consider the following triangle:
\begin{figure}
[h]
\begin{figure}
[h]
\centering
\centering
\includegraphics
[width=0.5\textwidth]
{
triangle.png
}
%
\includegraphics[width=0.5\textwidth]{triangle.png}
\end{figure}
\end{figure}
We are using the following inequality which is called inequality equation to know the possibility of having triangle with three points A, B and C:
We are using the following inequality which is called inequality equation to know the possibility of having triangle with three points A, B and C:
...
@@ -233,7 +233,7 @@ N/A
...
@@ -233,7 +233,7 @@ N/A
\textbf
{
Syntax
}
\\
\textbf
{
Syntax
}
\\
Exported Types:
Exported Types:
\newline
\newline
p
ointT = ?
P
ointT = ?
\end{frame}
\end{frame}
...
@@ -248,13 +248,13 @@ pointT = ?
...
@@ -248,13 +248,13 @@ pointT = ?
\hline
\hline
\textbf
{
Routine name
}
&
\textbf
{
In
}
&
\textbf
{
Out
}
&
\textbf
{
Exceptions
}
\\
\textbf
{
Routine name
}
&
\textbf
{
In
}
&
\textbf
{
Out
}
&
\textbf
{
Exceptions
}
\\
\hline
\hline
init
&
real, real
&
p
ointT
&
~
\\
new PointT
&
real, real
&
P
ointT
&
~
\\
\hline
\hline
xcoord
&
~
&
real
&
~
\\
xcoord
&
~
&
real
&
~
\\
\hline
\hline
ycoord
&
~
&
real
&
~
\\
ycoord
&
~
&
real
&
~
\\
\hline
\hline
dist
&
p
ointT
&
real
&
~
\\
dist
&
P
ointT
&
real
&
~
\\
\hline
\hline
\end{tabular}
\end{tabular}
...
@@ -277,10 +277,7 @@ None
...
@@ -277,10 +277,7 @@ None
~
\newline
~
\newline
\textbf
{
Assumptions
}
\textbf
{
Assumptions
}
init() is called for each abstract object before any other access routine is called for that object
None
\end{frame}
\end{frame}
...
@@ -294,7 +291,7 @@ init() is called for each abstract object before any other access routine is cal
...
@@ -294,7 +291,7 @@ init() is called for each abstract object before any other access routine is cal
\textbf
{
Access Routine Semantics
}
\\
\textbf
{
Access Routine Semantics
}
\\
init
(
$
x, y
$
):
PointT
(
$
x, y
$
):
\begin{itemize}
\begin{itemize}
\item
transition:
$
xc, yc :
=
x, y
$
\item
transition:
$
xc, yc :
=
x, y
$
\item
output:
$
out :
=
\mathit
{
self
}$
\item
output:
$
out :
=
\mathit
{
self
}$
...
@@ -319,17 +316,11 @@ init($x, y$):
...
@@ -319,17 +316,11 @@ init($x, y$):
\item
exception: none
\item
exception: none
\end{itemize}
\end{itemize}
\end{frame}
\end{frame}
% --------------------------------------------------
% --------------------------------------------------
\begin{frame}
[fragile]
\begin{frame}
[fragile]
\frametitle
{
MIS Interface
}
\frametitle
{
MIS Interface
}
...
@@ -369,16 +360,6 @@ From the MIS we can deduce the interface of the code will look like:
...
@@ -369,16 +360,6 @@ From the MIS we can deduce the interface of the code will look like:
% --------------------------------------------------
% --------------------------------------------------
%
%
%
%
%
%
% --------------------------------------------------
\subsection
{
TriangleADT Module
}
\subsection
{
TriangleADT Module
}
\begin{frame}
\begin{frame}
\frametitle
{
TriangleADT
}
\frametitle
{
TriangleADT
}
...
@@ -406,13 +387,13 @@ TriangleADT = ?\\
...
@@ -406,13 +387,13 @@ TriangleADT = ?\\
\tabcolsep
=0.09cm
\tabcolsep
=0.09cm
\begin{tabular}
{
| l | l | l | l |
}
\begin{tabular}
{
| l | l | l | l |
}
\hline
\hline
\textbf
{
Routine name
}
&
\textbf
{
In
}
&
\textbf
{
Out
}
&
\textbf
{
Except
ions
}
\\
\textbf
{
Routine name
}
&
\textbf
{
In
}
&
\textbf
{
Out
}
&
\textbf
{
Except
.
}
\\
%\hline
%\hline
%init & \multirow{2}{*}{Note 1} & Triangle & \\ \cline{1-3}
%init & \multirow{2}{*}{Note 1} & Triangle & \\ \cline{1-3}
\hline
\hline
init
&
p
ointT,
p
ointT,
p
ointT
&
TriangleADT
&
~
\\
new TriangleT
&
P
ointT,
P
ointT,
P
ointT
&
TriangleADT
&
~
\\
\hline
\hline
sides
&
&
&
~
\\
sides
&
&
seq[3] of real
&
~
\\
\hline
\hline
inequality
\char
`
_
theorem
&
~
&
boolean
&
LINE~
\\
inequality
\char
`
_
theorem
&
~
&
boolean
&
LINE~
\\
\hline
\hline
...
@@ -432,97 +413,82 @@ area\char`_of\char`_triangle & & real & LINE ~\\
...
@@ -432,97 +413,82 @@ area\char`_of\char`_triangle & & real & LINE ~\\
State Variables:
State Variables:
$
p
1
$
: pointT
\\
$
p
1
$
: PointT
\\
$
p
2
$
: pointT
\\
$
p
2
$
: PointT
\\
$
p
3
$
: pointT
\\
$
p
3
$
: PointT
\\
$
AB
$
: real
\\
$
AC
$
: real
\\
$
BC
$
: real
\\
~
\newline
~
\newline
\textbf
{
State Invariant
}
\textbf
{
State Invariant
}
None
None
~
\newline
~
\newline
\textbf
{
Assumptions
}
\textbf
{
Assumptions
}
init() is called for each abstract object before any other access routine is called for that object
None
\end{frame}
\end{frame}
% --------------------------------------------------
% --------------------------------------------------
\begin{frame}
\begin{frame}
\textbf
{
Access Routine Semantics
}
\\
\textbf
{
Access Routine Semantics
}
\\
init(
$
p
1
, p
2
, p
3
$
):
new TriangleT(
$
a, b, c
$
):
\begin{itemize}
\begin{itemize}
\item
transition:
$
a, b, c :
=
p
1
, p
2
, p
3
$
\item
transition:
$
p
1
, p
2
, p
3
:
=
a, b, c
$
\item
output:
$
out :
=
\mathit
{
self
}$
\item
output:
$
out :
=
\mathit
{
self
}$
\item
exception: none
\item
exception: none
\end{itemize}
\end{itemize}
\noindent
sides():
\noindent
sides():
\begin{itemize}
\begin{itemize}
\item
transition:
$
AB, AC, BC :
=
pointT.dist
(
self.a,self.b
)
,
$
\item
output:
$
out :
=
[
p
1
.dist
(
p
2
)
, p
1
.dist
(
p
3
)
, p
2
.dist
(
p
3
)]
$
\\
$
pointT.dist
(
slef.a,self.c
)
, pointT.dist
(
self.b,self.c
)
$
\item
output:
$
out :
=
\mathit
{
self
}$
\item
exception: none
\item
exception: none
\end{itemize}
\end{itemize}
\end
{
frame
}
\end
{
frame
}
% --------------------------------------------------
\begin
{
frame
}
\begin
{
frame
}
\noindent
inequality
theorem():
\noindent
inequality
\_
theorem():
\begin{itemize}
\begin{itemize}
\item
output:
$$
out :
=
\mathrm
{
(
self.AB
+
self.AC > self.BC
\quad
and
\quad
self.AB
+
self.BC
}$$
\item
output:
$$
\mathrm
{
> self.AC
\quad
and
\quad
self.AC
+
self.BC >self.AB
)
}$$
$
out :
=
((
self.sides
[
0
]
+
self.slide
[
1
])
> self.sides
[
2
]
$
$
\wedge
(
self.sides
[
1
]
+
self.slide
[
2
])
> self.sides
[
0
]
$
$
\wedge
(
self.sides
[
0
]
+
self.slide
[
2
])
> self.sides
[
1
]
$
)
\item
exception:
\item
exception:
\\
ex := ((
self.a
.xcoord()==
self.b
.xcoord() ==
self.c
.xcoord()
or
\\
ex := ((
p1
.xcoord()==
p2
.xcoord() ==
p3
.xcoord()
$
\vee
$
\\
self.a
.ycoord()==
self.b
.ycoord() ==
self.c
.ycoord())
$
\Rightarrow
\mbox
{
LINE
}
)
$
\\
p1
.ycoord()==
p2
.ycoord() ==
p3
.ycoord())
$
\Rightarrow
\mbox
{
LINE
}
)
$
\end{itemize}
\end{itemize}
\end{frame}
\end{frame}
% --------------------------------------------------
% --------------------------------------------------
\begin{frame}
\begin{frame}
\noindent
perimeter
of
triangle(
$
$
):
\noindent
perimeter
\_
of
\_
triangle(
$
$
):
\begin{itemize}
\begin{itemize}
\item
output:
$$
out :
=
\mathrm
{
self.AB
+
self.AC
+
self.BC
}
$$
\item
output:
$$
out :
=
self.sides
[
0
]+
self.sides
[
1
]+
self.sides
[
2
]
$$
\item
exception:
\item
exception:
\\
ex := ((
self.a
.xcoord()==
self.b
.xcoord() ==
self.c
.xcoord()
or
\\
ex := ((
p1
.xcoord()==
p2
.xcoord() ==
p3
.xcoord()
$
\vee
$
\\
self.a
.ycoord()==
self.b
.ycoord() ==
self.c
.ycoord())
$
\Rightarrow
\mbox
{
LINE
}
)
$
\\
p1
.ycoord()==
p2
.ycoord() ==
p3
.ycoord())
$
\Rightarrow
\mbox
{
LINE
}
)
$
\end{itemize}
\end{itemize}
\noindent
area of triangle(
$
$
):
\noindent
area of triangle(
$
$
):
\begin{itemize}
\begin{itemize}
\item
output :
$$
out :
=
\mathit
{
\sqrt
[
2
]
{
P
/
2
(
P
/
2
-
self.AB
)(
P
/
2
-
self.AC
)(
P
/
2
-
self.BC
)
}}$$
\item
output :
$
out :
=
$
${
\sqrt
[
2
]
{
P
/
2
(
P
/
2
-
self.sides
[
0
])(
P
/
2
-
self.sides
[
1
])(
P
/
2
-
self.sides
[
2
])
}}$
\item
exception:
\item
exception:
\\
ex := ((
self.a
.xcoord()==
self.b
.xcoord() ==
self.c
.xcoord()
or
\\
ex := ((
p1
.xcoord()==
p2
.xcoord() ==
p3
.xcoord()
$
\vee
$
\\
self.a
.ycoord()==
self.b
.ycoord() ==
self.c
.ycoord())
$
\Rightarrow
\mbox
{
LINE
}
)
$
\\
p1
.ycoord()==
p2
.ycoord() ==
p3
.ycoord())
$
\Rightarrow
\mbox
{
LINE
}
)
$
\end{itemize}
\end{itemize}
\textbf
{
Local Constants
}
\\
\textbf
{
Local Function
}
\\
P := self.AB+self.AC+self.BC
P := perimeter
\_
of
\_
triangle( )
\end{frame}
\end{frame}
% --------------------------------------------------
% --------------------------------------------------
\begin{frame}
[fragile]
\begin{frame}
[fragile]
\frametitle
{
MIS Interface
}
\frametitle
{
MIS Interface
}
...
@@ -548,7 +514,6 @@ From the MIS we can deduce the interface of the code will look like:
...
@@ -548,7 +514,6 @@ From the MIS we can deduce the interface of the code will look like:
\end{lstlisting}
\end{lstlisting}
\end{frame}
\end{frame}
% --------------------------------------------------
% --------------------------------------------------
...
@@ -559,14 +524,10 @@ From the MIS we can deduce the interface of the code will look like:
...
@@ -559,14 +524,10 @@ From the MIS we can deduce the interface of the code will look like:
\textbf
{
See TriangleADT for implementation.
}
\\
\textbf
{
See TriangleADT for implementation.
}
\\
\end{center}
\end{center}
\end{frame}
\end{frame}
% --------------------------------------------------
% --------------------------------------------------
% -----------------------------------------------------
\begin{frame}
\begin{frame}
\frametitle
{
Implementation files
}
\frametitle
{
Implementation files
}
\begin{itemize}
\begin{itemize}
...
@@ -575,6 +536,4 @@ From the MIS we can deduce the interface of the code will look like:
...
@@ -575,6 +536,4 @@ From the MIS we can deduce the interface of the code will look like:
\end{frame}
\end{frame}
\end{document}
\end{document}
This diff is collapsed.
Click to expand it.
W. Spencer Smith
@smiths
mentioned in issue
#20 (closed)
·
7 years ago
mentioned in issue
#20 (closed)
mentioned in issue #20
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment