Merge branch 'master' of git.vanoverloop.xyz:Danacus/university-stuff

master
Daan Vanoverloop 2022-03-27 14:50:04 +02:00
commit db403d3f74
Signed by: Danacus
GPG Key ID: F2272B50E129FC5C
37 changed files with 1130 additions and 5 deletions

Binary file not shown.

BIN
Gvdi/les5.rnote 100644

Binary file not shown.

BIN
Gvdi/les6.rnote 100644

Binary file not shown.

View File

@ -1,6 +1,18 @@
- "Ze beschouwen de universele turingmachine als het meest passende model
voor allerlei door ingenieurs ontworpen producten (zoals iPhones, laptops, desktops...).".
Hoe moet ik dit interpreteren? Beweert men dat je een computer
moet ontwerpen zoals turingmachine (dus met een tape en een automaat)?
Of heeft men het puur over de functies die zo een machines kunnen berekenen?
- Is uw voorkeur voor tilde-notatie beïnvloed door uw filosofische zienswijze?
- Stel dat je een perfecte kloon van een mens zou kunnen maken, atoom voor atoom, heb je dan een intelligente computer gemaakt?
Is deze computer dan krachtiger dan een turingmachine?
- Programmeerbare machines, te vaag?
- Waarom Turing bewust in kamp A gepubliceerd terwijl hij in kamp B zat? -> Hilbertprogramma, beslisbaarheidsprobleem "oplossen"
- Hobson in kamp B maar toch pleitte hij voor een wetmatigheid? -> op constructieve wijze kan je enkel een deel van de wiskunde beschrijven
- Kunnen we veronderstellen of er toeval is of dat er gewoon ongekende waarden zijn? Bijvoorbeeld bij een dobbelsteen hangt dat niet af van de hoek waarmee we een dobbelsteen gooien.
- Waarom noemt Turing het een choice machine? Ik zie de choice niet in de machine.
- Is de choice machine van Turing een niet-deteministische turingmachine?
- ACE machines hebben een meester nodig (die een mens is), dus kunnen ze geen mens simuleren? Kan de meester zelf een ACE machine of turingmachine zijn?
- "Ze beschouwen de universele turingmachine als het meest passende model voor allerlei door ingenieurs ontworpen producten (zoals iPhones, laptops, desktops...).".
Hoe moet ik dit interpreteren? Beweert men dat je een computer moet ontwerpen zoals turingmachine (dus met een tape en een automaat)?
Of heeft men het puur over de functies die zo een machines kunnen berekenen?
- Wat is toch het voordeel om alles te bestempelen als zijnde een turingmachine? Kan je voorbeelden aanhalen waarin dat zo gebleken is? Wat vond Turing er zelf van?

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
MCS/ModCheck.rnote 100644

Binary file not shown.

View File

@ -0,0 +1,96 @@
vocabulary V {
type Time isa nat
partial Next(Time) : Time
Start : Time
type Person
type Book
owns(Time, Person, Book)
I_owns(Person, Book) // Initial predicate for owns
C_owns(Time, Person, Book)
Cn_owns(Time, Person, Book)
give(Time, Person, Book, Person)
}
structure S : V {
Time = {0..5}
Person = { Bob; John; Mary; }
Book = { B1; B2; B3; }
// Initially
I_owns = { Bob,B1; John,B2; Mary,B3; }
}
theory timeTheo : V {
{
Start = MIN[:Time].
! t: Next(t) = t + 1 <- Time(t + 1).
}
}
theory T : V {
{
// Successor State Action Axiom & Inertia
! p[Person] b[Book]: owns(Start, p, b) <- I_owns(p, b).
! t[Time] p[Person] b[Book]: owns(Next(t), p, b) <- C_owns(t, p, b).
! t[Time] p[Person] b[Book]: owns(Next(t), p, b) <- owns(t, p, b) & ~Cn_owns(t, p, b).
}
{
// Expressing causations
// TODO: when is owns caused?
! t[Time] p[Person] b[Book]: C_owns(t, p, b) <- ?p2[Person]: give(t, p2, b, p).
// TODO: when is owns uncaused?
! t[Time] p[Person] b[Book]: Cn_owns(t, p, b) <- ?p2[Person]: give(t, p, b, p2).
}
// Preconditions
// - A person needs to own a book if he wants to give it away
! t[Time] p[Person] b[Book] p2[Person]: give(t, p, b, p2) => owns(t, p, b).
// - A book can be given to only one person
! t[Time] p[Person] b[Book] p2[Person] p3[Person]: give(t, p, b, p2) & give(t, p, b, p3) => p2 = p3.
// - A person cannot give a book to himself
!t [Time] p[Person] b[Book] p2[Person]: give(t, p, b, p2) => p ~= p2.
}
procedure findmodels() {
local timeExpanded = calculatedefinitions(timeTheo, S)
stdoptions.nbmodels = 5
printmodels(modelexpand(T, timeExpanded))
}
procedure simulate() {
stdoptions.nbmodels = 5
print("----> Starting interactive simulation")
local states = initialise(T, S)
// use one of those initial states to continue with (again and again and ...)
while true do
printmodels(states)
print("Please enter which state to use")
local num = tonumber(io.read("*line"))
if num == nil then
break
elseif num < 1 or num > 5 then
break
end
local chosen = states[num]
states = progress(T, chosen)
end
}
procedure main() {
// This method lets you walk through your solutions interactively
//simulate()
// This method (defined above) simply searches models of your theory
findmodels()
}

View File

@ -0,0 +1,104 @@
vocabulary V {
type Time isa nat
type Position isa nat
type Remote constructed from { A, B }
partial Next(Time) : Time
Start : Time
// Actions
open(Time, Remote)
close(Time, Remote)
// Fluents
position(Time, Position)
I_position(Position)
C_position(Time, Position)
Cn_position(Time, Position)
opening(Time)
I_opening
C_opening(Time)
Cn_opening(Time)
closing(Time)
I_closing
C_closing(Time)
Cn_closing(Time)
}
theory timeTheo : V {
{
Start = MIN[:Time].
! t[Time]: Next(t) = t + 1 <- Time(t + 1).
}
}
structure S : V {
Time = {0..20}
Position = {0..5}
I_position = { 1 }
I_opening = { }
I_closing = { }
open = { 1, A; 12, B }
close = { 10, A }
}
theory T : V {
// Preconditions
// none?
{ // Successor State Axiom: position
!p [Position]: position(Start, p) <- I_position(p).
!t [Time] p [Position]: position(Next(t), p) <- C_position(t, p).
!t [Time] p [Position]: position(Next(t), p) <- position(t, p) & ~Cn_position(t, p).
}
{ // Sucessor State Axiom: opening
opening(Start) <- I_opening.
!t [Time]: opening(Next(t)) <- C_opening(t).
!t [Time]: opening(Next(t)) <- opening(t) & ~Cn_opening(t).
}
{ // Sucessor State Axiom: closing
closing(Start) <- I_closing.
!t [Time]: closing(Next(t)) <- C_closing(t).
!t [Time]: closing(Next(t)) <- closing(t) & ~Cn_closing(t) & ~C_opening(t).
}
{ // Causes
!t [Time] p [Position]: C_position(t, p + 1) <- position(t, p) & opening(t).
!t [Time] p [Position]: C_position(t, p - 1) <- position(t, p) & closing(t).
!t [Time] p [Position] p2 [Position]: Cn_position(t, p) <- C_position(t, p2) & p2 ~= p.
!t [Time]: C_opening(t) <- ?r [Remote]: open(t, r).
!t [Time]: Cn_opening(t) <- position(t, 5).
!t [Time]: C_closing(t) <- ?r [Remote]: close(t, r) & ~C_opening(t).
!t [Time]: Cn_closing(t) <- position(t, 1).
}
}
procedure simulate() {
stdoptions.nbmodels = 20
print("----> Starting interactive simulation")
local states = initialise(T, S)
// use one of those initial states to continue with (again and again and ...)
while true do
printmodels(states)
print("Please enter which state to use")
local num = tonumber(io.read("*line"))
if num == nil then
break
elseif num < 1 or num > 5 then
break
end
local chosen = states[num]
states = progress(T, chosen)
end
}
procedure main() {
//simulate()
print(onemodel(merge(T, timeTheo), S))
}

View File

@ -0,0 +1,109 @@
vocabulary V {
type Time isa nat
partial Next(Time) : Time
Start : Time
type Jug
type Liters isa nat
maxContents(Jug) : Liters
// Actions
type Action constructed from { Fill(Jug), Transfer(Jug, Jug, Liters), Empty(Jug) }
do(Time, Action)
// Fluents
contents(Time, Jug) : Liters
I_contents(Jug) : Liters
C_contents(Time, Jug, Liters)
Cn_contents(Time, Jug, Liters)
/* Not the best idea...
C_add(Time, Jug, Liters)
Cn_add(Time, Jug, Liters)
C_sub(Time, Jug, Liters)
Cn_sub(Time, Jug, Liters)
*/
}
theory timeTheo : V {
{
Start = MIN[:Time].
! t[Time]: Next(t) = t + 1 <- Time(t + 1).
}
}
structure S : V {
Time = {0..6}
Jug = { J3;J5; }
Liters = {0..10}
maxContents = { J5->5; J3->3; }
I_contents = { J3->0; J5->0; }
}
theory T : V {
// Preconditions
// Do not fill self
! t[Time] j[Jug] k[Jug] l[Liters]: do(t, Transfer(j, k, l)) => j ~= k.
// Do not fill full jug (optional)
! t[Time] j[Jug]: do(t, Fill(j)) => contents(t, j) ~= maxContents(j).
// Do not empty empty jug (optional)
! t[Time] j[Jug] : do(t, Empty(j)) => contents(t, j) ~= 0.
// The number of liters should match the current situation
// Transfer no more than what's contained in the jug.
!t[Time] j[Jug] k[Jug] l[Liters]: do(t, Transfer(j, k, l)) => l =< contents(t, j).
// Transfer no more than what can be filled in the receiving jug.
! t[Time] j[Jug] k[Jug] l[Liters]: do(t, Transfer(j, k, l)) => l =< maxContents(k) - contents(t, k).
// You can only transfer l liters from a jug if that jug currently has l liters of content.
! t[Time] j1[Jug] j2[Jug] l[Liters]: do(t, Transfer(j1, j2, l)) => contents(t, j1) = l | l = maxContents(j2) - contents(t, j2).
{ // Successor State Axiom
!j [Jug]: contents(Start, j) = I_contents(j).
!t [Time] j [Jug] l [Liters]: contents(Next(t), j) = l <- C_contents(t, j, l).
!t [Time] j [Jug] l [Liters]: contents(Next(t), j) = l <- contents(t, j) = l & ~Cn_contents(t, j, l).
}
{ // Causes
! t[Time] j[Jug] l[Liters] m[Liters]: Cn_contents(t, j, l) <- C_contents(t, j, m) & l ~= m.
!t [Time] j [Jug]: C_contents(t, j, maxContents(j)) <- do(t, Fill(j)).
!t [Time] j [Jug]: C_contents(t, j, 0) <- do(t, Empty(j)).
!t [Time] j [Jug] l [Liters]: C_contents(t, j, contents(t, j) + l) <- ?j2 [Jug] m [Liters]: do(t, Transfer(j2, j, m)) & l = contents(t, j) + m.
!t [Time] j [Jug] l [Liters]: C_contents(t, j, contents(t, j) + l) <- ?j2 [Jug] m [Liters]: do(t, Transfer(j, j2, m)) & l = contents(t, j) - m.
}
! t[Time]: ?=1 a[Action]: do(t, a).
//!t [Time] j [Jug]: contents(t, j) =< maxContents(j).
?t [Time] j [Jug]: contents(t, j) = 4.
}
procedure simulate() {
stdoptions.nbmodels = 20
print("----> Starting interactive simulation")
local states = initialise(T, S)
// use one of those initial states to continue with (again and again and ...)
while true do
printmodels(states)
print("Please enter which state to use")
local num = tonumber(io.read("*line"))
if num == nil then
break
elseif num < 1 or num > 5 then
break
end
local chosen = states[num]
states = progress(T, chosen)
end
}
procedure main() {
//simulate()
print(onemodel(merge(T, timeTheo), S))
}

View File

@ -0,0 +1,106 @@
vocabulary V {
type Time isa nat
partial Next(Time) : Time
Start : Time
type Player constructed from { A, B }
type Matches isa int
type Heap constructed from { P1, P2, P3, P4 }
// Actions
takes(Time, Player, Heap, Matches)
// Fluents
nb(Time, Heap, Matches)
I_nb(Heap, Matches)
C_nb(Time, Heap, Matches)
Cn_nb(Time, Heap, Matches)
turn(Time, Player)
winner(Time, Player)
gameOver(Time)
}
theory timeTheo : V {
{
Start = MIN[:Time].
! t[Time]: Next(t) = t + 1 <- Time(t + 1).
}
}
structure S : V {
Time = {0..20}
I_nb = { P1, 1; P2, 3; P3, 5; P4, 7 }
}
theory T : V {
// Preconditions
// The players take a number of matches away from a heap:
// at least one and at most as much as there are in the heap.
!t [Time] p [Player] h [Heap] m [Matches]: takes(t, p, h, m) => m >= 1 & ?m1 [Matches]: nb(t, h, m1) & m1 >= m.
// If it is your turn, you need to take some amount of matches from some heap
!t [Time] p [Player]: turn(t, p) => ?h [Heap] m [Matches]: takes(t, p, h, m).
// Only take matches when it is your turn
!t [Time] p [Player] h [Heap] m [Matches]: takes(t, p, h, m) => turn(t, p).
// Only take matches from one heap at a time
!t [Time] p [Player] h [Heap] m [Matches]: takes(t, p, h, m) =>
~?h2 [Heap] m2 [Matches]: h2 ~= h & takes(t, p, h2, m2).
!t [Time] p1 [Player] p2 [Player]: turn(Next(t), p1) & turn(t, p2) => p1 ~= p2.
!t [Time] p1 [Player] p2 [Player]: turn(t, p1) & turn(t, p2) => p1 = p2.
{ // Successor State Axiom
!m [Matches] h [Heap]: nb(Start, h, m) <- I_nb(h, m).
!t [Time] m [Matches] h [Heap]: nb(Next(t), h, m) <- C_nb(t, h, m).
!t [Time] m [Matches] h [Heap]: nb(Next(t), h, m) <- nb(t, h, m) & ~Cn_nb(t, h, m).
}
{ // Causes
!t [Time] h [Heap] m [Matches] d [Matches]: C_nb(t, h, m) <-
nb(t, h, m + d) & ?p [Player]: takes(t, p, h, d).
!t [Time] h [Heap] m [Matches]: Cn_nb(t, h, m) <-
?m2 [Matches]: C_nb(t, h, m2) & m ~= m2.
!t [Time] p [Player]: winner(t, p) <-
?o [Player] h [Heap] m [Matches]: o ~= p & takes(t, o, h, m) & C_nb(t, h, 0).
!t [Time]: gameOver(t) <- ?p [Player]: winner(t, p).
}
turn(Start, A).
}
procedure simulate() {
stdoptions.nbmodels = 20
print("----> Starting interactive simulation")
local states = initialise(T, S)
// use one of those initial states to continue with (again and again and ...)
while true do
printmodels(states)
print("Please enter which state to use")
local num = tonumber(io.read("*line"))
if num == nil then
break
elseif num < 1 or num > 5 then
break
end
local chosen = states[num]
states = progress(T, chosen)
end
}
procedure main() {
//simulate()
print(onemodel(merge(T, timeTheo), S))
}

View File

@ -0,0 +1,71 @@
vocabulary V {
type Time isa nat
Start : Time
partial Next(Time) : Time
type Plate
// Fluents
clean(Time, Plate)
I_clean(Plate)
C_clean(Time, Plate)
Cn_clean(Time, Plate)
// Actions
cleanPlate(Time, Plate)
usePlate(Time, Plate)
}
structure S : V {
Time = {0..5}
Plate = { P1; P2; P3; P4; }
I_clean = { P1; P2; P3; P4; }
}
theory timeTheo : V {
{
Start = MIN[:Time].
! t[Time]: Next(t) = t + 1 <- Time(t + 1).
}
}
theory T : V {
// Preconditions
! t[Time] p [Plate]: cleanPlate(t, p) => ~clean(t, p).
! t[Time] p [Plate]: usePlate(t, p) => clean(t, p).
{ // Successor State Axiom
!p [Plate]: clean(Start, p) <- I_clean(p).
!t [Time] p [Plate]: clean(Next(t), p) <- C_clean(t, p).
!t [Time] p [Plate]: clean(Next(t), p) <- clean(t, p) & ~Cn_clean(t, p).
}
{ // Causes
!t [Time] p [Plate]: C_clean(t, p) <- cleanPlate(t, p).
!t [Time] p [Plate]: Cn_clean(t, p) <- usePlate(t, p).
}
// (Maybe, you can only clean one plate at a time?)
!t [Time] p1 [Plate] p2 [Plate]: cleanPlate(t, p1) & cleanPlate(t, p2) => p1 = p2.
!t [Time] p1 [Plate] p2 [Plate]: usePlate(t, p1) & usePlate(t, p2) => p1 = p2.
// There is always an extra clean plate
!t [Time]: ?p [Plate]: clean(t, p).
}
theory allDirty : V {
// Is it possible to make all your plates dirty?
?t [Time]: !p [Plate]: ~clean(t, p).
}
include <mx>
procedure main() {
S = calculatedefinitions(timeTheo, S)
local allconstraints = merge(T, allDirty)
print("This is the merged theory:")
print(allconstraints)
print("Searching for a model")
print(onemodel(allconstraints, S))
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,48 @@
\documentclass{sareport}
\usepackage{saquestions}
\usepackage{hyperref}
\usepackage{cleveref}
\addAuthor{FirstName3}{LastName3}{r000000}
\addAuthor{FirstName1}{A LastName1}{m000000}
\addAuthor{FirstName2}{B LastName2}{s000000}
\casename{Patient Monitoring Service (\textsc{pms})}
\phasenumber{Part 2}
\phasename{Architecture evaluation}
%\academicyear{20xx--20xx}
\begin{document}
\maketitle
\chapter*{Analysis and Evaluation}
\answerQ{00}
{%
Your answer to the question.
\todoinline{answer}
}{%
Pointers to the evidence that you've used to answer the question (figure numbers, section numbers, etc.), as well as assumptions that you've made but that aren't in the architectural description.
}{%
Your opinion on how the aspect you've investigated is handled in the current architecture, and possible improvements you'd propose.
}
\section*{E1 Design Extension}
\subsection*{Design Decisions}
\subsection*{Discussion}
% Add the necessary diagrams, don't forget to refer to them in your text, use \ref{label} or \cref{label}.
\begin{figure}
\centering
\includegraphics[]{example-image-a}
\caption{\label{fig:diagram}DiagramType and name}
\end{figure}
\end{document}

View File

@ -0,0 +1,13 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{saquestions}[2021/03/08 Answering SA Questions]
\RequirePackage{amssymb}
\RequirePackage{multido}
\newcommand{\markdiff}[1]{\multido{}{#1}{$\bigstar$}\,}
\DeclareDocumentCommand{\answerQ}{ O{0} O{} m m m m}{%
\noindent\textbf{Q#3} \markdiff{#1} #2
\begin{itemize}[noitemsep]
\item \textbf{Answer:} #4
\item \textbf{Evidence and assumptions:} #5
\item \textbf{Opinion and improvements:} #6
\end{itemize}%
}

View File

@ -0,0 +1,566 @@
%%
%% This is file `sareport.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% sareport.dtx (with options: `class')
%%
%% This is a generated file.
%%
%% Copyright (C) 2017-2018 by imec-DistriNet-KU Leuven
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3c of this license
%% or (at your option) any later version. The latest version of this
%% license is in:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% and version 1.3c or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[2013/03/31]
\ProvidesClass{sareport}
[2019/03/12 v1.39 Software Architecture Report]
\RequirePackage{ifthen}
\newboolean{anonymize}
\DeclareOption{peerreview}{%
\setboolean{anonymize}{true}%
}
\PassOptionsToClass{10pt,a4paper}{report}
\PassOptionsToPackage{english}{babel}
\PassOptionsToPackage{utf8}{inputenc}
\PassOptionsToPackage{T1}{fontenc}
\PassOptionsToPackage{a4paper}{geometry}
\PassOptionsToPackage{usenames,dvipsnames,svgnames,table}{xcolor}
\PassOptionsToPackage{inline}{enumitem}
\PassOptionsToPackage{first=0,last=1000}{lcg}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions\relax
\LoadClass{report}
\RequirePackage{babel}
\RequirePackage{inputenc}
\RequirePackage{fontenc}
\RequirePackage{graphicx}
\RequirePackage{geometry}
\RequirePackage{todonotes}
\RequirePackage{xcolor}
\RequirePackage{xparse}
\RequirePackage{expl3}
\RequirePackage{enumitem}
\RequirePackage{minitoc}
\IfFileExists{fontawesome.sty}{%
\RequirePackage{fontawesome}
}{%
\ClassWarning{sareport}{You do not have fontawesome.sty available.
\MessageBreak You are recommended to upgrade your LaTeX distribution.
}
\newcommand{\faExclamationTriangle}{!}
\newcommand{\faInfoCircle}{?}
\newcommand{\faCheck}{v}
\newcommand{\faClipboard}{}
}
\RequirePackage{advdate}
\RequirePackage{pdftexcmds,xparse}
\RequirePackage{totcount}
\RequirePackage{lcg}
\RequirePackage{tikz,pgfplots}
\usetikzlibrary{positioning,fit}
\pagenumbering{arabic}
\renewcommand*\ttdefault{cmvtt}
\newtoks\authors
\newtoks\academicyear
\newtoks\casename
\newtoks\phasename
\newtoks\phasenumber
\newtoks\groupname
\newtoks\course
\newtoks\department
\ifnum\month<10 \AdvYear{1} \fi
\academicyear{\AdvYear{-1}\the\year\AdvYear{1} -- \the\year}
\ifnum\month<10 \AdvYear{-1} \fi
\casename{{\color{red}SA Case Name}}
\phasename{{\color{red}Phase Name}}
\phasenumber{{\color{red} Phase Number}}
\course{%
{H09B5B: Software Architectuur}\\
{H07Z9B: Software Architecture}
}
\department{Department of\\Computer Science}
\ExplSyntaxOn
\cs_set_eq:Nc \sareport_strcmp:nn { pdf@strcmp }
\seq_new:N \g_sareport_author_list_seq
\int_gzero_new:N \g_author_size_int
\NewDocumentCommand{\addAuthor}{mmm}
{
\IfNoValueTF{#3}
{
}
{
\int_gincr:N \g_author_size_int
\ifthenelse{\equal{#3}{}}{%
\sareport_add_author:nnnN { #1 } { #2 } { } \g_author_size_int
}{%
\sareport_add_author:nnnN { #1 } { #2 } { (#3) } \g_author_size_int
}
}
}
\int_new:N \l_author_count_int
\tl_new:N \l_author_idx_tl
\NewDocumentCommand{\sortAuthors}{ }
{
\sareport_sort_authors:
\int_zero:N \l_author_count_int
\int_incr:N \l_author_count_int
\int_do_while:nn { \l_author_count_int <= \g_author_size_int }
{
\seq_gpop_left:NNTF \g_sareport_author_list_seq \l_author_idx_tl
{
\IfEmpty{\groupname} {%
\edef\tmp@groupname{\prop_item:cn {g_sareport_author_ \l_author_idx_tl _prop} { lnamestripped }}
\expandafter\groupname{\tmp@groupname}
} {%
\edef\tmptwo@groupname{--\prop_item:cn {g_sareport_author_ \l_author_idx_tl _prop} { lnamestripped }}
\groupname=\expandafter{\the\expandafter\groupname \tmptwo@groupname}
}
\IfEmpty{\authors} {%
\edef\tmp@authors{%
\prop_item:cn {g_sareport_author_ \l_author_idx_tl _prop} { fname } \noexpand &
\noexpand\textsc{\prop_item:cn {g_sareport_author_ \l_author_idx_tl _prop} { lname }} ~
\prop_item:cn {g_sareport_author_ \l_author_idx_tl _prop} { nbr }
}
\expandafter\authors{\tmp@authors}
} {%
\edef\tmptwo@authors{\noexpand\\
\prop_item:cn {g_sareport_author_ \l_author_idx_tl _prop} { fname } \noexpand &
\noexpand\textsc{\prop_item:cn {g_sareport_author_ \l_author_idx_tl _prop} { lname }} ~
\prop_item:cn {g_sareport_author_ \l_author_idx_tl _prop} { nbr }
}
\authors=\expandafter{\the\expandafter\authors \tmptwo@authors}
}
%\prop_show:c { g_sareport_author_ \l_author_idx_tl _prop }
} { }
\seq_gput_right:NV \g_sareport_author_list_seq { \l_author_idx_tl }
\int_incr:N \l_author_count_int
%\insertdata { \int_use:N \l_tmpa_int }
%\int_incr:N \l_tmpa_int
}
}
\tl_new:N \l_tmpid_int
\cs_new_protected:Npn \sareport_add_author:nnnN #1 #2 #3 #4
{
\tl_set:NV \l_tmpid_int { #4 }
\seq_gput_right:NV \g_sareport_author_list_seq { \l_tmpid_int }
\prop_new:c { g_sareport_author_ \l_tmpid_int _prop }
\prop_gput:cno { g_sareport_author_ \l_tmpid_int _prop } { sort } { \tl_lower_case:n {#2}\space\space\tl_lower_case:n {#1} }
\prop_gput:cnn { g_sareport_author_ \l_tmpid_int _prop } { fname } { #1 }
\prop_gput:cnn { g_sareport_author_ \l_tmpid_int _prop } { lname } { #2 }
\edef\@tmp{#2}
\prop_gput:cnx { g_sareport_author_ \l_tmpid_int _prop } { lnamestripped } { \expandafter\expandafter\expandafter\zap@space\expandafter\@tmp \space\@empty }
\prop_gput:cnn { g_sareport_author_ \l_tmpid_int _prop } { nbr } { #3 }
\prop_gput:cnx { g_sareport_author_ \l_tmpid_int _prop } { id } { \l_tmpid_int }
}
\cs_new_protected:Npn \sareport_sort_authors:
{
\seq_gsort:Nn \g_sareport_author_list_seq
{
\prop_get:cnN {g_sareport_author_ ##1 _prop} { sort } \tl_first
\prop_get:cnN {g_sareport_author_ ##2 _prop} { sort } \tl_snd
\sareport_string_compare:NnNTF \tl_first {>} \tl_snd {\sort_return_swapped:} {\sort_return_same:}
}
}
\prg_new_conditional:Npnn \sareport_string_compare:NnN #1 #2 #3 {TF}
{
\if_int_compare:w \sareport_strcmp:nn {#1}{#3} #2 \c_zero_int
\prg_return_true:
\else:
\prg_return_false:
\fi
}
\ExplSyntaxOff
\def\@makechapterhead#1{%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\Huge\bfseries \thechapter.
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
{\parindent \z@ \raggedright \normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\geometry{tmargin=3cm, bmargin=2.2cm, lmargin=2.2cm, rmargin=2cm}
\rand
\newtotcounter{InstructionCounter}
\def\IfEmpty#1#2#3{%
\edef\1{\the#1}%
\ifx\1\empty%
\expandafter\@firstoftwo%
\else%
\expandafter\@secondoftwo%
\fi%
{#2}{#3}%
}
\newcommand{\warning}[2][]{%
\stepcounter{InstructionCounter}%
\todo[inline, caption={2do},color=red!30, #1]{%
\noindent\makebox[\textwidth][c]{%
\begin{minipage}{0.975\textwidth}%
\textbf{\faExclamationTriangle{} Attention:} #2%
\end{minipage}%
}%
}%
}
\newcommand\note[2][]{%
\stepcounter{InstructionCounter}%
\todo[inline, caption={2do},color=orange!20, #1]{%
\noindent\makebox[\textwidth][c]{%
\begin{minipage}{0.975\textwidth}
\textbf{\faInfoCircle{} Note:} #2%
\end{minipage}%
}%
}%
}
\newcommand\hint[2][]{%
\stepcounter{InstructionCounter}%
\todo[inline, caption={2do},color=green!20, #1]{%
\noindent\makebox[\textwidth][c]{%
\begin{minipage}{0.975\textwidth}
\textbf{\faCheck{} Hint:} #2%
\end{minipage}%
}%
}%
}
\newcommand{\todoinline}[2][]{%
\stepcounter{InstructionCounter}%
\todo[inline, caption={2do},color=blue!20, #1]{%
\noindent\makebox[\textwidth][c]{%
\begin{minipage}{0.975\textwidth}
\textbf{\faClipboard{} TODO:} #2%
\end{minipage}%
}%
}%
}
\newcommand{\captioninstruction}{
\hint{Add any essential information, necessary for interpreting
the figure, in the caption. Be sure to add a separate short title
for inclusion in the list of figures:
\texttt{\textbackslash caption[shorttitle]\{longtitle\}}.\\
If your explanation becomes too long for the caption, you can
create a separate subsection. Don't forget to refer to the figure
and vice versa.
}%
}
\newcommand{\showdecisionsnotes}{
\smallskip
\note{This section discusses \emph{all} your architectural decisions
\emph{in-depth}.
First, \emph{all} decisions related to the non-functionals are
discussed in detail. Next, \emph{all} other decisions are listed
and discussed.
}
\smallskip
\hint{Don't just say \emph{what} you have done.
Explain \emph{why} you have done it.
}
\smallskip
}
\newcommand{\showcsnotes}{
\smallskip
\hint{No need to just repeat what we can see on the diagram.
Don't do this: \emph{As you can see on fig. x: comp A consists
of B and C, and C connects to D}.
But, please do explain if there is anything non-trivial (e.g., a
custom mapping from actors to external components on the
context diagram).
}
\smallskip
\captioninstruction{}
\smallskip
\hint{If you have any doubts about the size of your figures, it is
better to make your figure too large than too small. Alternatively,
you can test the readability by printing it.
}
\smallskip
\warning{With regard to the context diagram, recall the lectures on
what it means and should contain. Be sure not to miss any elements
here. This is a frequent source of errors.
}
\smallskip
\warning{Make sure your main component-and-connector and context
diagrams are consistent.
}
\smallskip
}
\newcommand{\showdecompnotes}{
\smallskip
\hint{No need to just repeat what we can see on the diagram.
Don't do this: \emph{As you can see on fig. x: comp A consists
of B and C, and C connects to D}.
But, please do explain if there is anything non-trivial
(e.g., a custom mapping from actors to external components on
the context diagram).
}
\smallskip
\captioninstruction
\smallskip
\warning{\emph{Consistency between views!} Be sure to check for
consistency between the client-server view and your
decompositions.
}
\smallskip
\warning{\emph{Consistency of a single decomposition!} Make sure that
every interface provided or required by the decomposed component,
is provided or required by a subcomponent in the decomposition.
}
\smallskip
}
\newcommand{\showdeploynotes}{
\smallskip
\hint{No need to just repeat what we can see on the diagram.
Don't do this: \emph{As you can see on fig. x: components A and B
are deployed on node C}.
But, please do explain if there is anything non-trivial (e.g., a
custom mapping from actors to external components on the context
diagram).
}
\smallskip
\captioninstruction
\smallskip
\warning{Connect nodes on the deployment diagram, \emph{not}
components.
}
\smallskip
\warning{\emph{Consistency between views!} Be sure to check for
consistency between the client-server/decomposition view and your
deployment view.
}
\smallskip
}
\newcommand{\showscenariosnotes}{
\smallskip
\hint{No need to just repeat what we can see on the diagram.
Don't do this: \emph{As you can see on fig. x: component A calls
operation b, next component C calls operation d}.
But, please do explain if there is anything non-trivial (e.g., a
custom mapping from actors to external components on the context
diagram).
}
\smallskip
\captioninstruction
\smallskip
\warning{Do include a list of which sequence diagrams together
illustrate a which scenario from the assignment.
}
\smallskip
\hint{Don't only model the `happy path' in your sequence diagrams.
Take into account the quality attributes. For example, what
happens when a certain component fails (Av) or overloads (P)?
Use the sequence diagrams to illustrate how you have achieved
the qualities in your architecture.
}
\smallskip
}
\newcommand{\showcatalognotes}{
\smallskip
\hint{Make sure the elements are sorted alphabetically.
You can use the \texttt{\textbackslash componentItem\{name\}
\{contents\}} command for this in your report.
Note that you cannot use newlines in the componentItem content,
but you can use \textbackslash\textbackslash.
}
\smallskip
\hint{Common interfaces such as, for example, ping can be described
separately so you don't have to repeat them for each component
that provides it.
}
\smallskip
\hint{Similarly, you can describe the exceptions separately as well,
so you don't have to repeat what they mean for each operation
that can throw them.
}
\smallskip
\warning{Don't forget to include the exceptions in the method
signature in the element catalog!
}
\smallskip
\warning{Interfaces are uniquely identified by their name, regardless
of the context (e.g., the component that provides it).
In other words, two interfaces with the same name are considered
identical.
}
\smallskip
\warning{Don't forget to document the external interfaces!}
\smallskip
}
\ExplSyntaxOn
\NewDocumentCommand{\componentItem}{mm}
{
\seq_put_right:Nn \l_sareport_comps_seq {#1}
\cs_new:cpn { sareport_comp_#1: } {
\subsection{#1}#2
}
}
\NewDocumentCommand{\printComponents}{ }
{
\seq_sort:Nn \l_sareport_comps_seq
{
\string_compare:nnnTF {##1} {>} {##2} {\sort_return_swapped:} {\sort_return_same:}
}
\seq_map_inline:Nn \l_sareport_comps_seq { \use:c { sareport_comp_##1: } }
}
\seq_new:N \l_sareport_comps_seq
\prg_new_conditional:Npnn \string_compare:nnn #1 #2 #3 {TF}
{
\if_int_compare:w \pdftex_strcmp:D {#1}{#3} #2 \c_zero_int
\prg_return_true:
\else:
\prg_return_false:
\fi
}
\ExplSyntaxOff
\newcommand{\sareport@shownoteswarning}{%
\todo[inline, caption={2do},color=red!30]{%
\noindent\makebox[\textwidth][c]{%
\begin{minipage}{0.975\textwidth}%
\textbf{\faExclamationTriangle{} Attention:}
Your report still contains
\total{InstructionCounter} instructions or
comments.
Make sure to delete all of them for the final
version.
(Run \texttt{pdflatex} at least two times
after removing them to make sure this warning
disappears.)
\end{minipage}%
}%
}%
}%
\definecolor{sareport@stampink}{RGB}{0 34 85}
\newcommand{\sareport@stampsubmission}[4][0]{%
\rotatebox[]{#1}{%
\begin{tikzpicture}[remember picture,overlay,pencildraw/.style={sareport@stampink,decorate,opacity=.5,decoration={random steps,segment length=2.8pt,amplitude=0.4pt}},
txtln/.style={sareport@stampink,node distance=0,inner sep=0pt,outer sep=0pt,opacity=.8,font=\Large,text width=2cm,text depth = 10pt},
txttn/.style={node distance=0,inner sep=0pt,outer sep=0pt,opacity=1,font=\Large,align=left,text depth = 10pt}]
\node [txttn,anchor=north east,xshift=-1.5cm,yshift=-5cm] (tt) at (current page.north east) {\texttt{#2}};
\node [txtln] (tl) [left = of tt] {\texttt{Course:}};
\node [txtln] (ml) [below = of tl] {\texttt{Attn:}};
\node [txtln] (bl) [below = of ml] {\texttt{Date:}};
\node [txttn] (mt) [right = of ml] {\texttt{#3}};
\node [txttn] (bt) [right = of bl] {\texttt{#4}};
\node[pencildraw,draw,line width=.8mm,fit={(tl) (ml) (bl) (tt) (mt) (bt)}, inner sep=10pt] (rect) {};
\end{tikzpicture}}}
\newcommand{\sareport@printsubmissioninfo}{}
\newcommand{\setprintsubmissioninfo}[3]{%
\renewcommand{\sareport@printsubmissioninfo}{%
\sareport@stampsubmission[3]{#1}{#2}{#3}
}%
}
\definecolor{kuleng}{RGB}{13,112,183}
\renewcommand{\maketitle}{%
\pagenumbering{Alph}
\begin{titlepage}
\newpage
\thispagestyle{empty}
\frenchspacing
%\hspace{-0.2cm}
\vspace*{-4em}%
\noindent%
\IfFileExists{KULeuven.pdf}{%
\includegraphics[width=0.33\textwidth]{KULeuven}
}{%
\ClassWarning{sareport}{The file KULeuven.pdf is missing.}
}
\smallskip\noindent
\fcolorbox{white}{kuleng}{
\parbox{0.313\textwidth}{\color{white}
\centering
\sffamily \bfseries
\MakeUppercase{\the\department}}}
\smallskip
\hspace{\stretch{1}}
\vspace*{5cm}\sareport@printsubmissioninfo{}
%\vfill
\begin{center}
\begin{minipage}[t]{\textwidth}
\begin{center}
{\LARGE {\rmfamily \bfseries \the\casename}\\