\documentclass[12pt,a4paper]{article}

\usepackage{amstext}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{stmaryrd}
\usepackage{enumerate}
\usepackage{alltt}
\usepackage[latin1]{inputenc}
\usepackage{cancel}
\usepackage{fancyhdr}
\usepackage{listings}
%\usepackage{gastex}
\usepackage{pstricks}
\usepackage{pst-node}
%\usepackage{ngerman}

\title{\textsc{Embedded Systems \\ \large Assignment 3}}
\author{\shortstack[c]{Jan Hendrik Dithmar\\ \scriptsize 2031259} \and \shortstack[c]{Pascal Gwosdek\\ \scriptsize 2505221}}
\date{}

\pagestyle{fancy}

\lhead{Assignment 3}
\chead{}
\rhead{Dithmar (2031259), Gwosdek (2505221)}
\lfoot{Embedded Systems}
\cfoot{Page \thepage}
\rfoot{SS 2007}

\begin{document}

\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}

\newcommand{\exercise}[1]{\subsection{#1}}
\renewcommand{\theenumi}{\textbf{\alph{enumi}}}

\newcommand{\AND}{\ensuremath{\wedge}}
\newcommand{\OR}{\ensuremath{\vee}}
\newcommand{\SetR}{\ensuremath{\mathbb{R}}}
\newcommand{\SetN}{\ensuremath{\mathbb{N}}}
\newcommand{\SetC}{\ensuremath{\mathbb{C}}}
\newcommand{\SetZ}{\ensuremath{\mathbb{Z}}}
\newcommand{\SetQ}{\ensuremath{\mathbb{Q}}}
\newcommand{\SetB}{\ensuremath{\mathbb{B}}}
\newcommand{\QED}{\ensuremath{\hspace*{\fill}\square}}
\newcommand{\FLASH}{\ensuremath{\hspace*{\fill}\lightning}}
\newcommand{\OnotO}{\ensuremath{\mathcal{O}}}
\newcommand{\bild}[2]{
	\begin{figure}[htpb]
		\centering
			\includegraphics[#1]{#2}\\[0.2cm]
	\end{figure}
	}

\newcommand{\m}[1]{\begin{pmatrix}#1\end{pmatrix}}
\newcommand{\+}{\phantom{-}}
\newcommand{\f}{\frac}

\maketitle

\thispagestyle{empty}

\newpage
\setcounter{page}{1}
\setcounter{section}{3}

\exercise{Statecharts}
\begin{center}
\includegraphics[height=0.95\textheight]{problem1}
\end{center}

\exercise{Statecharts}
\begin{enumerate}
%a
\item The next resulting superstep is S6.
\begin{itemize}
\item We start in S1, S4, S7. The event EV is consumed. F is generated and X is set to 1. S1 moves to S2.
\item S4 moves to S5, because F was generated. Y := 1 is done.
\item S7 moves to S8, because the condition [X = 1] holds.
\item S2 moves to S3, because the condition [Y = 1] holds. Z is set to 1.
%\item S8 moves to S9, because F was generated.
\item S5 moves to S6, because the condition [Z = 1] holds.
\end{itemize}
%b
\item The transition between S8 and S9 does not fire, because you can only consume an internally generated event one time. Due to the fact that F is already consumed when taking
the transition from S4 to S5, the transition between S8 and S9 cannot fire.
%c
\item At the end of the superstep, the chart leaves the AND-superstate, because after F is generated, Y is set to 1, which leads to the fact that the transition between S2 and
S3 fires. While firing, Z is set to 1 which allows the transition between S5 and S6 to fire.
\end{enumerate}

\newpage
\exercise{Petri nets}
\begin{enumerate}
\item \
\begin{center}
\includegraphics[width=\textwidth]{problem3a}
\end{center}
\item \
\begin{center}
\includegraphics[width=\textwidth]{problem3b}
\end{center}
\end{enumerate}

\end{document}
