commit 67b4db7ed152b3e9a20647e35a4fbc5497805952 Author: reijix Date: Fri Jun 9 15:40:08 2023 +0200 Initial commit (some exercises done already) diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..f13528c --- /dev/null +++ b/.gitignore @@ -0,0 +1,289 @@ +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs +*.lzo +*.lzs + +# uncomment this for glossaries-extra (will ignore makeindex's style files!) +# *.ist + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Comment the next line if you want to keep your tikz graphics files +*.tikz +*-tikzDictionary + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices and outlines +*.xyc +*.xyd + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# gummi +.*.swp + +# KBibTeX +*~[0-9]* + +# TeXnicCenter +*.tps + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# Makeindex log files +*.lpz + +# vscode +/.vscode + +#/template-art/** +#!/template-art/**/ +#!/template-art/**/.gitkeep + +main.pdf +main-poster.pdf +*.pdf +slides +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md new file mode 100755 index 0000000..17bb178 --- /dev/null +++ b/README.md @@ -0,0 +1,133 @@ +![FAU_1-ANIMATION](https://user-images.githubusercontent.com/44805883/169285233-f2065c06-0dcc-49a3-9afe-242e1f2e6e05.gif) + +> :loudspeaker: **UPDATE:** The logo files are now included in this repository. + +# :film_projector: fau-beamer + +A LaTeX beamer template according to the 2021 [style guide](https://www.intern.fau.de/kommunikation-marketing-und-corporate-identity/corporate-identity/) of [Friedrich-Alexander-Universität Erlangen-Nürnberg](https://www.fau.de/). + +The given template allows you to create LaTeX presentations with the [beamer class](https://ctan.org/pkg/beamer?lang=en) in the corporate style of FAU. + +## :gear: Usage and Most Important Options + +To use this template you can either clone this repository or download the code. The example document should provide a basic introduction how to set up a document with this template. We are only going over the most important steps here. + +Typically you would start your LaTeX document with + +```LaTeX +\documentclass[]{beamer} +\usepackage[]{styles/beamerthemefau} +``` + +where the first line loads the beamer class and the second line employs the template. In the following we will explain some of the optional arguments you can pass to ```beamerthemefau```. + +## :fleur_de_lis: Choosing The Institute + +The option ```institute``` specifies which institute template should be used. For example + +```LaTeX +\usepackage[institute=FAU]{styles/beamerthemefau} +``` + +can be used to use the generic FAU style. The following style are available + +* ```[institute=FAU]```: Generic style for FAU, + +* ```[institute=Med]```: style for Medizinische Fakultät, + +* ```[institute=Nat]```: style for Naturwissenschaftliche Fakultät, + +* ```[institute=Phil]```: style for Philosophische Fakultät und Fachbereich Theologie, + +* ```[institute=RW]```: style for Rechts- und Wirtschaftswissenschaftliche Fakultät, + +* ```[institute=Tech]```: style for Technische Fakultät + +This option influences + +1. the color scheme, + +2. the left word mark for the title page + +see the sections on [colors](##Colors) and [logos](##Logos). The default option is ```[institute=FAU]```. + +## 🖼️ Frames + +The following image displays the appearance of a normal frame employing the fau theme. + +image + +Next to standard frame option of the ```beamer``` class, this theme +additionally provides the following option. + +- ```begin{frame}[title] ... \end{frame}```: This option changes the appearance of the frame to a title theme. It will change the background color the font size, the font color and the headline, as displayed below. This can be useful when you want to employ an outline in the same style as the overview at the begin of each section: + ``` + \begin{frame}[title]{-} + \tableofcontents + \end{frame} + ``` +image + +- ```begin{frame}[titleimage] ... \end{frame}```: This option yields the same behavior as the option above, where additionally the title art is placed in the background, as displayed below. This can be, e.g., employed for the title page. + ``` + \begin{frame}[t,titleimage]{-} + \titlepage% + \end{frame} + ``` +image + + +- ```begin{truplainframe}...\end{trueplainframe}```: This option yields a frame, where the sidebar, headline and footer are completely turned off. This will be implemented as a normal frame option in future versions. + + +## :paintbrush: Colors + +The template employs the color scheme as specified by the FAU style guide. Each institute has two colors a base color and a dark base color. These colors are available via the commands ```\BaseColor``` and ```\BaseDarkColor``` + +| Institute | ```\BaseColor``` | RGB | ```\BaseDarkColor``` | RGB | +| --------- | ---------------- | --- | ----------------- | --- | +| FAU | | 0,47,108 | | 4,30,66 | +| Med | | 0, 163, 224 | | 0, 97, 160 | +| Nat | | 67, 176, 42 | | 34, 136, 72 | +| Phil | | 255, 184, 28 | | 232, 119, 34 | +| RW | | 200, 16, 46 | | 151,27,47 | +| Tech | | 119, 159, 181 | | 65, 116, 141 | + + +## :copyright: Logos + +The logo files are now included in this repo!!! + +The files and the version of the [FAU corporate](https://www.intern.fau.de/kommunikation-marketing-und-corporate-identity/vorlagen/praesentationsvorlagen-powerpoint/) website are outdated and are soon to be replaced. + +The following files + +* ```FAUWortmarkeBlau.pdf``` +* ```FAUWortmarkeWhite.pdf``` + +are the same for every institute and are therefore placed directly in the ```/template-art``` folder. The files for each institute are now placed in the subfolder ```/```, where you find + + +* ```Kennung.pdf``` +* ```KennungWhite.pdf``` +* ```Title.jpg``` + +You can add additional logos to the title of the frames via the options + +* ```SecondLogo=``` +* ```ThirdLogo=``` + +## :wrench: Misc + +You can use the option ```[scale=]``` to scale the canvas size. +By default the canvas dimensions are + +* 338.7 mm x 238.1 mm for 16:9 +* 254 mm x 190.5 mm for 4:3 + +## :paperclip: Questions or Remarks +If you have questions about specific features or found an error you can either write an email to the author (see below) or raise an issue here. + +## :beer: Credit +This template was designed by [Tim Roith](https://timroith.github.io/) using the given style from the FAU corporate style guide 2021. + diff --git a/bibliography.bib b/bibliography.bib new file mode 100755 index 0000000..77a654d --- /dev/null +++ b/bibliography.bib @@ -0,0 +1,18 @@ + +@article{bungert2021bregman, + title={A Bregman Learning Framework for Sparse Neural Networks}, + author={Leon Bungert and Tim Roith and Daniel Tenbrinck and Martin Burger}, + year={2021}, + eprint={2105.04319}, + archivePrefix={arXiv}, + primaryClass={cs.LG} +} + +@article{bungert2021neural, + title={Neural Architecture Search via Bregman Iterations}, + author={Leon Bungert and Tim Roith and Daniel Tenbrinck and Martin Burger}, + year={2021}, + eprint={2106.02479}, + archivePrefix={arXiv}, + primaryClass={cs.LG} +} \ No newline at end of file diff --git a/slides06.tex b/slides06.tex new file mode 100755 index 0000000..fbfa7f7 --- /dev/null +++ b/slides06.tex @@ -0,0 +1,511 @@ +% .............................................................................. +% Demo of the fau-beamer template. +% +% Copyright 2022 by Tim Roith +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. +% +% ------------------------------------------------------------------------------ +\documentclass[final]{beamer} + +% ======================================================================================== +% Theme: inner, outer, font and colors +% ---------------------------------------------------------------------------------------- +\usepackage[institute=Tech, + %SecondLogo = template-art/FAUWortmarkeBlau.pdf, + %ThirdLogo = template-art/FAUWortmarkeBlau.pdf, + %WordMark=None, + aspectratio=169, + fontsize=11, + fontbaselineskip=13, + scale=1. + ]{styles/beamerthemefau} + + +% ---------------------------------------------------------------------------------------- +% Input and output encoding +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +% ---------------------------------------------------------------------------------------- +% Language settings +\usepackage[german]{babel} + +% ======================================================================================== +% Fonts +% - Helvet is loaded by styles/beamerfonts +% - We use serif for math environements +% - isomath is used for upGreek letters +% ---------------------------------------------------------------------------------------- +\usepackage{isomath} +%\usefonttheme[onlymath]{serif} +\usepackage{mathpartir} +\usepackage{exscale} +\usepackage{anyfontsize} +\setbeamercolor{alerted text}{fg=BaseColor} +% ---------------------------------------------------------------------------------------- +% custom commands for symbols +\usepackage{styles/symbols} + +\usepackage{tikz-cd} +\usetikzlibrary{cd, babel} + +% ======================================================================================== +% Setup for Titlepage +% ---------------------------------------------------------------------------------------- +\title[fau-beamer]{Theorie der Programmierung} +\subtitle{\texorpdfstring{Übung 06 - der (ungetypte) $\lambda$-Kalkül II}{Übung 06 - der (ungetypte) Lambda-Kalkül II}} +\author[L. Vatthauer]{ +Leon Vatthauer} +% + +% Instead of \institute you can also use the \thanks command +% ------------------------------------------------ +%\author[T. Roith]{ +%Tim Roith\thanks{Friedrich-Alexander Universität Erlangen-Nürnberg, Department Mathematik}\and% +%Second Author\thanks{Second Insitute}\and% +%Third Author\thanks{Third Insitute}% +%} + +\date{\today} + + +% ================================================ +% Bibliography +% ------------------------------------------------ +\usepackage{csquotes} +\usepackage[style=alphabetic, %alternatively: numeric, numeric-comp, and other from biblatex + defernumbers=true, + useprefix=true,% + giveninits=true,% + hyperref=true,% + autocite=inline,% + maxcitenames=5,% + maxbibnames=20,% + uniquename=init,% + sortcites=true,% sort citations when multiple entries are passed to one cite command + doi=true,% + isbn=false,% + url=false,% + eprint=false,% + backend=biber% + ]{biblatex} +\addbibresource{bibliography.bib} +\setbeamertemplate{bibliography item}[text] +\babeltags{en=english} + +% ================================================ +% Hyperref and setup +% ------------------------------------------------ +\usepackage{hyperref} +\hypersetup{ + colorlinks = true, + final=true, + plainpages=false, + pdfstartview=FitV, + pdftoolbar=true, + pdfmenubar=true, + pdfencoding=auto, + psdextra, + bookmarksopen=true, + bookmarksnumbered=true, + breaklinks=true, + linktocpage=true, + urlcolor=BaseColor, + citecolor=BaseColor, + linkcolor=BaseColor, + unicode = true +} + +% ================================================ +% Additional packages +% ------------------------------------------------ +\usepackage{listings} +\usepackage{lstautogobble} % Fix relative indenting +\usepackage{color} % Code coloring +\usepackage{zi4} % Nice font + +\definecolor{bluekeywords}{rgb}{0.13, 0.13, 1} +\definecolor{greencomments}{rgb}{0, 0.5, 0} +\definecolor{redstrings}{rgb}{0.9, 0, 0} +\definecolor{graynumbers}{rgb}{0.5, 0.5, 0.5} +\lstset{ + autogobble=true, + columns=fullflexible, + showspaces=false, + showtabs=false, + breaklines=true, + showstringspaces=false, + breakatwhitespace=true, + escapeinside={(*@}{@*)}, + commentstyle=\color{greencomments}, + keywordstyle=\color{bluekeywords}, + stringstyle=\color{redstrings}, + numberstyle=\color{graynumbers}, + basicstyle=\ttfamily\normalsize, + mathescape=true, + %frame=l, + framesep=12pt, + xleftmargin=.1\textwidth,%12pt, + tabsize=4, + captionpos=b +} +% end of listings setup + +% ================================================ +% Various custom commands +% ------------------------------------------------ +%\setbeameroption{show notes on second screen} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname pdfsuppresswarningpagegroup\endcsname\relax +\else + \pdfsuppresswarningpagegroup=1\relax +\fi +% Change color for cite locally +\newcommand{\colorcite}[3]{{\hypersetup{citecolor=#1}{\cite[#2]{#3}}}} +% ------------------------------------------------ +% ================================================ +% The main document +% ------------------------------------------------ +\begin{document} +% Title page +\begin{frame}[t,titleimage]{-} +\titlepage% +\end{frame} + +\newcommand{\isaeq}{=_\alpha^?} +\newcommand{\isbr}{\rightarrow_\beta^?} + +\newcommand{\betared}{\rightarrow_\beta} +\newcommand{\alphaeq}{=_\alpha} +\newcommand{\deltared}{\rightarrow_\delta} +\newcommand{\etared}{\rightarrow_\eta} +\newcommand{\betadeltared}{\rightarrow_{\beta\delta}^*} + +\newcommand{\ceil}[1]{\lceil {#1} \rceil} + +\newcommand{\definitionAlphaEq}{ + \begin{block}{$\alpha$-Äquivalenz} + Zwei Terme $t_1, t_2$ heißen $\alpha$-Äquivalent, wenn sie durch Umbenennung gebundener Variablen auseinander hervorgehen. Formal: + $$\lambda x.t \alphaeq \lambda y.t[y / x]\quad\text{wenn } y \not\in FV(t)$$ + \end{block} +} + +\newcommand{\definitionBetaReduction}{ + \begin{block}{$\beta$-Reduktion} + Die $\beta$-Reduktion modelliert das Ausrechnen einer Funktionsanwendung, z.B: $(\lambda x.3 + x)\, 5 \betared 3 + 5$ + + Die Einschrittreduktion $\betared$ ist: + $$C((\lambda x.t)\,s) \rightarrow_\beta C(t[s / x])$$ + \end{block} +} +\newcommand{\churchnumerals}{ + \begin{block}{Church-Numerale} + \begin{equation*}\ceil{n} := \lambda f\,a.\underbrace{f(f(f(\ldots f}_n\, a)))\tag{1}\end{equation*} + \noindent + \begin{minipage}{0.45\textwidth} + \begin{align*} + &zero = \lambda f\,a.a\\ + &succ\,n = \lambda f\,a.f\,(n\,f\,a) + \end{align*} + \end{minipage} + \begin{minipage}{0.45\textwidth} + \begin{alignat*}{2} + &one &&= succ\,zero\\ + &two &&= succ\,one\\ + &three &&= succ\,two\\ + &four &&= succ\,three + \end{alignat*} + \end{minipage} + \end{block} +} + +\AtBeginSection{} +\lstset{ + morekeywords={if, then, else} +} +% Introduction +\section{Church-Numerale} +\begin{frame}[t, fragile]{Church-Numerale} + Wir betrachten erneut die Church-Kodierung natürlicher Zahlen vom vorigen Übungsblatt: + $$\ceil{n} := \lambda f\,a.\,\underbrace{f(f(f(\ldots f}_{n}\,a)))$$ + mit einheitlicher Kodierung + + \noindent + \begin{minipage}{.45\textwidth} + \begin{lstlisting} + zero = $\lambda$ f a. a + succ n = $\lambda$ f a. f (n f a) + \end{lstlisting} + \end{minipage} + \begin{minipage}{.45\textwidth} + \begin{lstlisting} + one = succ zero + two = succ one + three = succ two + four = succ three + \end{lstlisting} + \end{minipage} + + sowie den Operationen \texttt{add} und \texttt{mult} mit der entsprechenden Semantik. + \\\;\\ + \textbf{Notation: } Von nun an schreiben wir \texttt{s + t} und \texttt{s * t} anstelle von \texttt{add s t} und \texttt{mult s t} und verwenden die $\beta\delta$-Regeln + \[ + \ceil{n} + \ceil{m} \betadeltared \ceil{n + m} \qquad\qquad\qquad \ceil{n} * \ceil{m} \betadeltared \ceil{n \cdot m} + \] +\end{frame} + +\section{Aufgabe 1 - Church-Kodierung von Booleans} + +\begin{frame}[t]{Aufgabe 1.1}{Church-Kodierung von Booleans} + Boolesche Wahrheitswerte werden als $\lambda$-Terme wie folgt definiert: + \begin{alignat*}{2} + &true &&= \lambda x\,y.\,x\\ + &false &&= \lambda x\,y.\,y\\ + &ite &&= \lambda b\,x\,y.\,b\,x\,y + \end{alignat*} + \,\\ + Zeigen Sie, das für alle $\lambda$-Terme $s$ und $t$ gilt: + + \centering + $$ite\,true\,s\,t \betadeltared s\quad\quad\quad\quad\quad\quad ite\,false\,s\,t \betadeltared t$$ + +\end{frame} + +\begin{frame}[t]{Aufgabe 1.2}{Church-Kodierung von Booleans} + Boolesche Wahrheitswerte werden als $\lambda$-Terme wie folgt definiert: + \begin{alignat*}{2} + &true &&= \lambda x\,y.\,x\\ + &false &&= \lambda x\,y.\,y\\ + &ite &&= \lambda b\,x\,y.\,b\,x\,y + \end{alignat*} + \,\\ + Vervollständigen Sie die folgenden Funktionsdefinitionen so, dass sie (unter normaler Reduktion) boolesche Negation, exklusives Oder und Implikation berechnen: + \begin{alignat*}{2} + ¬\,b &&= \ldots\\ + &xor\,b1\,b2 &&= \ldots\\ + &imp\,b1\,b2 &&= \ldots + \end{alignat*} + \,\\ + \textbf{Notation: } Von nun an schreiben wir „\textbf{if} $s$ \textbf{then} $t$ \textbf{else} $u$“ anstelle von „$ite\; s\; t\; u$“ + +\end{frame} + +\section{Aufgabe 2 - Rekursive Definitionen} +\begin{frame}[t]{Aufgabe 2}{Rekursive Definitionen} + + In den meisten funktionalen Programmiersprachen sind \textit{rekursive} Funktionsdefinitionen zulässig, das heißt, die definierte Funktion darf auf der rechten Seite einer solchen Funktionsdefinition vorkommen. + Rekursive Funktionsdefinitionen entsprechen - wie in Übung 2, Blatt 5 - $\delta$-Reduktionen. + \\\,\\ + \textbf{Hinweis.}\quad Nehmen Sie an, dass die Subtraktion von natürlichen Zahlen (in Form von Church-Numeralen) im $\lambda$-Kalkül darstellbar ist, d.h. für $n \geq 1$ gilt $\ceil{n} - \ceil{1} \betadeltared \ceil{n - 1}$, + und dass ebenso die üblichen Vergleichsoperationen möglich sind, d.h. $\ceil{n} \leq \ceil{1} \leftrightarrow_{\beta\delta}^* true$, wenn $n \leq 1$ usw. Siehe dazu Aufgabe 4. +\end{frame} + +\newcommand{\hintone}{ + \begin{block}{Hinweis} + \centering + $\ceil{n} - \ceil{1} \betadeltared \ceil{n - 1}$ für $n \geq 1$ + \[ + \ceil{n} \leq \ceil{m} \leftrightarrow_{\beta\delta}^* + \begin{cases} + true & \text{falls } n \leq m\\ + false & \text{sonst} + \end{cases} + \] + \[ + \ceil{n} == \ceil{m} \leftrightarrow_{\beta\delta}^* + \begin{cases} + true & \text{falls } n = m\\ + false & \text{sonst} + \end{cases} + \] + \end{block} +} + +\begin{frame}[t, fragile]{Aufgabe 2.1}{Rekursive Definitionen} + + Wir betrachten die folgende rekursive Funktion: + \begin{lstlisting} + fact n = if n $\leq$ $\ceil{1}$ then $\ceil{1}$ else n * (fact (n - $\ceil{1}$)) + \end{lstlisting} + \,\\ + Zeigen Sie, dass $fact \ceil{3} \betadeltared \ceil{6}$. + \\\vfill + \hintone +\end{frame} + +\begin{frame}[t, fragile]{Aufgabe 2.2}{Rekursive Definitionen} + + Schreiben Sie eine rekursive Funktion $odd$, sodass: + \[ + odd\,\ceil{n} = \begin{cases} + true & \text{falls } n \text{ gerade}\\ + false & \text{sonst} + \end{cases} + \] + \hintone +\end{frame} + +\begin{frame}[t, fragile]{Aufgabe 2.3}{Rekursive Definitionen} + + Schreiben Sie eine rekursive Funktion $halve$, sodass: + \begin{lstlisting}[] + ($\ceil{2}$ * halve $\ceil{n}$) + (if odd $\ceil{n}$ then $\ceil{1}$ else $\ceil{0}$) $\betadeltared$ $\ceil{n}$ + \end{lstlisting} + \hintone +\end{frame} + +\newcommand{\reductionstrats}{ + \noindent\centering + \begin{minipage}{.48\textwidth} + \begin{block}{Applikative Reduktion $\rightarrow_a$} + \begin{itemize} + \item $(\lambda x.t)\,s \rightarrow_a t[s/x]$, wenn $t$ und $s$ normal + \item $\lambda x.t \rightarrow_a \lambda x.t'$, wenn $t \rightarrow_a t'$ + \item $t\,s \rightarrow_a t'\,s$, wenn $t \rightarrow_a t'$\\\,\\ + \item $t\,s \rightarrow_a t\,s'$, wenn $s \rightarrow_a s'$ und $t$ normal\\\,\\ + \end{itemize} + \end{block} + \end{minipage} + \begin{minipage}{.48\textwidth} + \begin{block}{Normale Reduktion $\rightarrow_n$} + \begin{itemize} + \item $(\lambda x.t)\,s \rightarrow_n t[s/x]$ + \item $\lambda x.t \rightarrow_n \lambda x.t'$, wenn $t \rightarrow_n t'$ + \item $t\,s \rightarrow_n t'\,s$, wenn $t \rightarrow_n t'$ und $t$ keine $\lambda$-Abstraktion + \item $t\,s \rightarrow_n t\,s'$, wenn $s \rightarrow_n s'$ und $t$ normal und keine $\lambda$-Abstraktion + \end{itemize} + \end{block} + \end{minipage} +} + +\section{Aufgabe 3 - Auswertungsstrategien} + +\begin{frame}[t]{Aufgabe 3}{Auswertungsstrategien} + +In der Vorlesung haben Sie verschiedene Reduktionsstrategien für den ungetypten $\lambda$-Kalkül kennengelernt. +Diese unterscheiden sich hauptsächlich in den Zeitpunkten, zu denen $\beta$-Redexe \textit{kontrahiert} werden, also wann in einem Term die $\beta$-Regel angewandt wird. +\vfill +\reductionstrats +\end{frame} + + +\begin{frame}[t]{Aufgabe 3.1}{Auswertungsstrategien} + + Welcher Redex im $\lambda$-Term + \begin{enumerate} + \item[(a)] $(\lambda x.\lambda y.\,y\,(\lambda z.\,x))\,(u\, u)\,(\lambda v.\,v\,((\lambda w.\,w)\,(\lambda w.\,w)))$ + \item[(b)] $(\lambda u.\,u\,(\lambda y.\,z))\,(\lambda x.\,x\,((\lambda v.\,v)\,w))$ + \end{enumerate} + muss nicht kontrahiert werden, um die Normalform zu erreichen? Reduzieren Sie den Term durch $\beta\delta$-Reduktion zur Normalform, ohne diesen Redex zu kontrahieren. + \vfill + \reductionstrats +\end{frame} + +\begin{frame}[t]{Aufgabe 3.2}{Auswertungsstrategien} + + Wir schreiben wie aus der Vorlesung bekannt $I = (\lambda x.\,x)$ und $\Omega = (\lambda x.\,x\,x)$. + + Reduzieren Sie den Term $\lambda f.\,f\,I\,(\Omega\,\Omega)(\lambda x\,y.\,x\,x)$ mittels + \begin{enumerate} + \item[(a)] applikativer Reduktion, + \item[(b)] normaler Reduktion. + \end{enumerate} + Unterstreichen Sie in jedem Schritt den zu reduzierenden Redex. Betrachten Sie in dieser Aufgabe $\delta$-Reduktion als explizite Schritte! + \vfill + \reductionstrats +\end{frame} + +\begin{frame}[t, fragile]{Aufgabe 3.3 a)}{Auswertungsstrategien} + + Man erinnere sich an folgende auf Church-Kodierungen definierten Funktionen: + + \lstset{ + morecomment=[f][\color{greencomments}][0]{--} + } + \begin{minipage}{.2\textwidth} + \begin{lstlisting} + -- Allgemein + twice = $\lambda$f x. f (f x) + \end{lstlisting} + \end{minipage} + \begin{minipage}{.25\textwidth} + \begin{lstlisting} + -- Church-Booleans + true = $\lambda$ x y. x + false = $\lambda$ x y. y + \end{lstlisting} + \end{minipage} + \begin{minipage}{.45\textwidth} + \begin{lstlisting} + -- Church-Paare + pair = $\lambda$ a b select. select a b + fst = $\lambda$ p. p ($\lambda$ x y. x) + snd = $\lambda$ p. p ($\lambda$ x y. y) + \end{lstlisting} + \end{minipage} + + Geben Sie die ersten fünf $\beta\delta$-Reduktionsschritte des Terms + \begin{lstlisting} + twice fst (pair (pair true false) true) + \end{lstlisting} + unter \textbf{a) normaler} und b) applikativer Reduktion an. Markieren Sie (durch Unterstreichen) in jedem Schritt den zu reduzierenden Redex. + + \begin{block}{Normale Reduktion $\rightarrow_n$} + \begin{itemize} + \item $(\lambda x.t)\,s \rightarrow_n t[s/x]$ + \item $\lambda x.t \rightarrow_n \lambda x.t'$, wenn $t \rightarrow_n t'$ + \item $t\,s \rightarrow_n t'\,s$, wenn $t \rightarrow_n t'$ und $t$ keine $\lambda$-Abstraktion + \item $t\,s \rightarrow_n t\,s'$, wenn $s \rightarrow_n s'$ und $t$ normal und keine $\lambda$-Abstraktion + \end{itemize} + \end{block} +\end{frame} + +\begin{frame}[t, fragile]{Aufgabe 3.3 b)}{Auswertungsstrategien} + + Man erinnere sich an folgende auf Church-Kodierungen definierten Funktionen: + + \lstset{ + morecomment=[f][\color{greencomments}][0]{--} + } + \begin{minipage}{.2\textwidth} + \begin{lstlisting} + -- Allgemein + twice = $\lambda$f x. f (f x) + \end{lstlisting} + \end{minipage} + \begin{minipage}{.25\textwidth} + \begin{lstlisting} + -- Church-Booleans + true = $\lambda$ x y. x + false = $\lambda$ x y. y + \end{lstlisting} + \end{minipage} + \begin{minipage}{.45\textwidth} + \begin{lstlisting} + -- Church-Paare + pair = $\lambda$ a b select. select a b + fst = $\lambda$ p. p ($\lambda$ x y. x) + snd = $\lambda$ p. p ($\lambda$ x y. y) + \end{lstlisting} + \end{minipage} + + Geben Sie die ersten fünf $\beta\delta$-Reduktionsschritte des Terms + \begin{lstlisting} + twice fst (pair (pair true false) true) + \end{lstlisting} + unter a) normaler und \textbf{b) applikativer} Reduktion an. Markieren Sie (durch Unterstreichen) in jedem Schritt den zu reduzierenden Redex. + + \begin{block}{Applikative Reduktion $\rightarrow_a$} + \begin{itemize} + \item $(\lambda x.t)\,s \rightarrow_a t[s/x]$, wenn $t$ und $s$ normal + \item $\lambda x.t \rightarrow_a \lambda x.t'$, wenn $t \rightarrow_a t'$ + \item $t\,s \rightarrow_a t'\,s$, wenn $t \rightarrow_a t'$ + \item $t\,s \rightarrow_a t\,s'$, wenn $s \rightarrow_a s'$ und $t$ normal + \end{itemize} + \end{block} +\end{frame} + +% input exmple sections +%\input{sections/01_Intro_Landscape} +\end{document} \ No newline at end of file diff --git a/styles/beamercolorthemefau.sty b/styles/beamercolorthemefau.sty new file mode 100755 index 0000000..e574df0 --- /dev/null +++ b/styles/beamercolorthemefau.sty @@ -0,0 +1,67 @@ +% .............................................................................. +% This file assigns the color scheme for the beamer environments. +% +% Copyright 2022 by Tim Roith +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. +% +% ------------------------------------------------------------------------------ + +\ProvidesPackage{styles/beamercolorthemefau} +% .............................................................................. +\RequirePackage{ifthen} +% .............................................................................. +\DeclareOptionBeamer{institute}{% + \PassOptionsToPackage{#1}{styles/fau-colors}% +} + +\ProcessOptionsBeamer +% .............................................................................. +\RequirePackage{styles/fau-colors} +% .............................................................................. +\selectcolormodel{rgb} +\mode +% .............................................................................. +\setbeamercolor{title page}{fg=TitleFont,bg=BaseColor} +\setbeamercolor{title page headline}{bg=white} +\setbeamercolor{title page block}{fg=TitleFont,bg=BaseColor} +\setbeamercolor{title page logo}{fg=TitleFont} +% .............................................................................. +\setbeamercolor{section page}{fg=TitleFont,bg=BaseColor} +\setbeamercolor{section page headline}{bg=TitleFont} +\setbeamercolor{section page block}{fg=TitleFont,bg=BaseColor} +\setbeamercolor{section page logo}{fg=TitleFont} +% .............................................................................. + +% .............................................................................. +% Color themes for frame sepcification. +% ------------------------------------------------------------------------------ +\setbeamercolor{headline}{fg=BaseColor,bg=white} +\setbeamercolor{headline title}{fg=TitleFont,bg=BaseColor} + +\setbeamercolor{separation line}{bg=SeparationLineColor} +\setbeamercolor{separation line title}{bg=SeparationLineColor} + +\setbeamercolor{sidebar title}{fg=BaseColor,bg=BaseColor} + +\setbeamercolor{frametitle title}{fg=TitleFont,bg=BaseColor} +\setbeamercolor{footline title}{fg=TitleFont, bg=BaseColor} + +\setbeamercolor{white background}{fg=white,bg=white} +\setbeamercolor{poster title}{fg=red,bg=white} +% .............................................................................. + +\setbeamercolor{block title}{bg=BaseDarkColor,fg=TitleFont} +\setbeamercolor{block poster title}{bg=BaseDarkColor,fg=TitleFont} +\setbeamercolor{block body}{bg=BaseColorD,fg=black} +\setbeamercolor{structure}{fg=BaseColor} + +\setbeamercolor{section in toc}{fg=BaseColor} +\setbeamercolor{subsection in toc}{fg=BaseColor} + +\setbeamercolor{outline}{fg=red,bg=red} +\setbeamercolor{outlineB}{fg=blue,bg=blue} + +\setbeamercolor{default}{fg=black} +\mode diff --git a/styles/beamerfontthemefau.sty b/styles/beamerfontthemefau.sty new file mode 100755 index 0000000..5f8e239 --- /dev/null +++ b/styles/beamerfontthemefau.sty @@ -0,0 +1,154 @@ +% .............................................................................. +% The font theme for the fau-beamer template. Parts of the following code were +% copied from a template designed by Balthasar Reuther. +% +% Copyright 2022 by Tim Roith +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. +% +% ------------------------------------------------------------------------------ + +\ProvidesPackage{styles/beamerfontthemefau} +\RequirePackage{fp} + +% .............................................................................. +% Font sizes. +% ------------------------------------------------------------------------------ +\def\fau@font@fontscale{1.} +\def\fau@font@fontsize{11} +\def\fau@font@baselineskip{13} +\def\fau@font@baselinescale{1.} +\def\fau@font@globalscale{1.} +\DeclareOptionBeamer{fontsize}{\def\fau@font@fontsize{#1}} +\DeclareOptionBeamer{fontbaselineskip}{\def\fau@font@baselineskip{#1}} +\DeclareOptionBeamer{fontscale}{\def\fau@font@fontscale{#1}} +\DeclareOptionBeamer{scale}{\def\fau@font@globalscale{#1}} +\DeclareOptionBeamer{baselinescale}{\def\fau@font@baselinescale{#1}} + +% .............................................................................. +\ProcessOptionsBeamer +\mode +% .............................................................................. + +% Helvetica +\RequirePackage{lmodern} +\RequirePackage{textcomp} +\RequirePackage{fix-cm} +\RequirePackage[scaled=0.92]{helvet} + +% .............................................................................. +% scalable vector fonts +% .............................................................................. +% this code is copied from the beamerposter package +% ------------------------------------------------------------------------------ +\FPeval{\globalscale}{\fau@font@globalscale} +% define baselinescale +\FPeval{\baselinescale}{\fau@font@baselineskip/13} % normalize +\FPeval{\baselinescale}{baselinescale * 1.7} % adjust to larger canvas +\FPeval{\baselinescale}{globalscale * baselinescale} % apply global scale +\FPupn{\baselinescale}{0.442 baselinescale * 2 round} +% define fontscale +\FPeval{\fontscale}{\fau@font@fontsize/11} % normalize +\FPeval{\fontscale}{fontscale * 1.9} % adjust to larger canvas +\FPeval{\fontscale}{globalscale * fontscale} % apply global scale +\FPupn{\fontscale}{0.442 fontscale * 2 round} + + +% -------------------------- +\edef\fontSizeX{12} +\edef\fontSizeY{14} +\FPupn{\resulttinyX}{fontscale fontSizeX * 2 round} +\FPupn{\resulttinyY}{baselinescale fontSizeY * 2 round} +\renewcommand*{\tiny}{\fontsize{\resulttinyX}{\resulttinyY}\selectfont} + +\edef\fontSizeX{14.4}\edef\fontSizeY{18} +\FPupn{\resultscriptsizeX}{fontscale fontSizeX * 2 round} +\FPupn{\resultscriptsizeY}{fontscale fontSizeY * 2 round} +\renewcommand*{\scriptsize}{\fontsize{\resultscriptsizeX}{\resultscriptsizeY}\selectfont} + +\edef\fontSizeX{17.28}\edef\fontSizeY{22} +\FPupn{\resultfootnotesizeX}{fontscale fontSizeX * 2 round} +\FPupn{\resultfootnotesizeY}{baselinescale fontSizeY * 2 round} +\renewcommand*{\footnotesize}{\fontsize{\resultfootnotesizeX}{\resultfootnotesizeY}\selectfont} + +\edef\fontSizeX{20.74}\edef\fontSizeY{25} +\FPupn{\resultsmallX}{fontscale fontSizeX * 2 round} +\FPupn{\resultsmallY}{baselinescale fontSizeY * 2 round} +\renewcommand*{\small}{\fontsize{\resultsmallX}{\resultsmallY}\selectfont} + +\edef\fontSizeX{24.88}\edef\fontSizeY{30} +\FPupn{\resultnormalsizeX}{fontscale fontSizeX * 2 round} +\FPupn{\resultnormalsizeY}{baselinescale fontSizeY * 2 round} +\renewcommand*{\normalsize}{\fontsize{\resultnormalsizeX}{\resultnormalsizeY}\selectfont} + +\edef\fontSizeX{29.86}\edef\fontSizeY{37} +\FPupn{\resultlargeX}{fontscale fontSizeX * 2 round} +\FPupn{\resultlargeY}{baselinescale fontSizeY * 2 round} +\renewcommand*{\large}{\fontsize{\resultlargeX}{\resultlargeY}\selectfont} + +\edef\fontSizeX{35.83}\edef\fontSizeY{45} +\FPupn{\resultLargeX}{fontscale fontSizeX * 2 round} +\FPupn{\resultLargeY}{baselinescale fontSizeY * 2 round} +\renewcommand*{\Large}{\fontsize{\resultLargeX}{\resultLargeY}\selectfont} + +\edef\fontSizeX{43}\edef\fontSizeY{54} +\FPupn{\resultLARGEX}{fontscale fontSizeX * 2 round} +\FPupn{\resultLARGEY}{baselinescale fontSizeY * 2 round} +\renewcommand*{\LARGE}{\fontsize{\resultLARGEX}{\resultLARGEY}\selectfont} + +\edef\fontSizeX{51.6}\edef\fontSizeY{64} +\FPupn{\resulthugeX}{fontscale fontSizeX * 2 round} +\FPupn{\resulthugeY}{baselinescale fontSizeY * 2 round} +\renewcommand*{\huge}{\fontsize{\resulthugeX}{\resulthugeY}\selectfont} + +\edef\fontSizeX{61.92}\edef\fontSizeY{77} +\FPupn{\resultHugeX}{fontscale fontSizeX * 2 round} +\FPupn{\resultHugeY}{baselinescale fontSizeY * 2 round} +\renewcommand*{\Huge}{\fontsize{\resultHugeX}{\resultHugeY}\selectfont} + +\edef\fontSizeX{74.3}\edef\fontSizeY{93} +\FPupn{\resultveryHugeX}{fontscale fontSizeX * 2 round} +\FPupn{\resultveryHugeY}{baselinescale fontSizeY * 2 round} +\def\veryHuge{} +\renewcommand*{\veryHuge}{\fontsize{\resultveryHugeX}{\resultveryHugeY}\selectfont} + +\edef\fontSizeX{89.16}\edef\fontSizeY{112} +\FPupn{\resultVeryHugeX}{fontscale fontSizeX * 2 round} +\FPupn{\resultVeryHugeY}{baselinescale fontSizeY * 2 round} +\def\VeryHuge{} +\renewcommand*{\VeryHuge}{\fontsize{\resultVeryHugeX}{\resultVeryHugeY}\selectfont} + +\edef\fontSizeX{107}\edef\fontSizeY{134} +\FPupn{\resultVERYHugeX}{fontscale fontSizeX * 2 round} +\FPupn{\resultVERYHugeY}{baselinescale fontSizeY * 2 round} +\def\VERYHuge{} +\renewcommand*{\VERYHuge}{\fontsize{\resultVERYHugeX}{\resultVERYHugeY}\selectfont} + +\AtBeginDocument{\normalsize\selectfont} + +% set the normalfont (default) +\renewcommand*{\normalfont}{\normalsize} +\newcommand{\LARGELarge}{\fontsize{\resultLARGEX}{\resultLargeY}\selectfont} +% + +\setbeamerfont{title}{size=\huge,series=\bfseries} +\setbeamerfont{subtitle}{size=\Large,series=\mdseries} +%\setbeamerfont{frametitle}{size=\LARGELarge, series=\bfseries} +\setbeamerfont{frametitle}{size=\LARGE, series=\bfseries} +\setbeamerfont{framesubtitle}{size=\large,series=\mdseries} +\setbeamerfont{block title}{size=\large,series=\bfseries} +\setbeamerfont{footline}{size=\scriptsize} +\setbeamerfont{subsection in toc}{size=\Large,series=\mdseries} +\setbeamerfont{default}{size=\normalsize, series=\mdseries} +% .............................................................................. +% equal font sizes for all levels +\setbeamerfont{itemize/enumerate body}{size=\normalsize} +\setbeamerfont{itemize/enumerate subbody}{size=\normalsize} +\setbeamerfont{itemize/enumerate subsubbody}{size=\normalsize} +% .............................................................................. +% caption size +%\setbeamerfont{caption}{size=\scriptsize} + + +\mode \ No newline at end of file diff --git a/styles/beamerinnerthemefau.sty b/styles/beamerinnerthemefau.sty new file mode 100755 index 0000000..f9bf7ed --- /dev/null +++ b/styles/beamerinnerthemefau.sty @@ -0,0 +1,244 @@ +% .............................................................................. +% The inner beamer theme accoridng to the FAU corporate style guide 2021, see +% +% https://www.intern.fau.de/kommunikation-marketing-und-corporate-identity/corporate-identity/ +% +% +% Copyright 2022 by Tim Roith +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. +% +% ------------------------------------------------------------------------------ + +\ProvidesPackage{styles/beamerinnerthemefau} +\RequirePackage{fp} + +\newdimen\fau@inner@WordMarkTitleHeight +\newdimen\fau@inner@WordMarkTitleWidth +\newdimen\fau@inner@TitleTitleSkip +\newdimen\fau@inner@HeaderHeight +\newdimen\fau@inner@TitleHeight +\newdimen\fau@inner@TitleLineHeight +\newdimen\fau@inner@RightMargin + +% ------------------------------------------------------------------------------ +% Dimensions +\def\fau@inner@XScale{1.} +\def\fau@inner@YScale{1.} +\DeclareOptionBeamer{XScale}{\def\fau@inner@XScale{#1}} % scale factor for x dimension +\DeclareOptionBeamer{YScale}{\def\fau@inner@YScale{#1}} % scale factor for y dimension + + +\DeclareOptionBeamer{WordMarkTitleHeight}{\fau@inner@WordMarkTitleHeight=#1} +\DeclareOptionBeamer{WordMarkTitleWidth}{\fau@inner@WordMarkTitleWidth=#1} +\DeclareOptionBeamer{TitleTitleSkip}{\fau@inner@TitleTitleSkip=#1} +\DeclareOptionBeamer{HeaderHeight}{\fau@inner@HeaderHeight=#1} +\DeclareOptionBeamer{TitleHeight}{\fau@inner@TitleHeight=#1} +\DeclareOptionBeamer{TitleLineHeight}{\fau@inner@TitleLineHeight=#1} +\DeclareOptionBeamer{RightMargin}{\fau@inner@RightMargin=#1} + +\DeclareOptionBeamer{WordMarkTitle}{\def\fau@inner@WordMarkTitle{#1}} +\DeclareOptionBeamer{TitleArt}{\def\fau@inner@TitleArt{#1}} + +% .............................................................................. +\ProcessOptionsBeamer +\RequirePackage{tikz} +\RequirePackage{graphicx} +\mode +% ------------------------------------------------------------------------------ +% Scale the dimensions +\fau@inner@WordMarkTitleHeight=\fau@inner@YScale\dimexpr\fau@inner@WordMarkTitleHeight +\fau@inner@WordMarkTitleWidth=\fau@inner@XScale\dimexpr\fau@inner@WordMarkTitleWidth +\fau@inner@TitleTitleSkip=\fau@inner@YScale\dimexpr\fau@inner@TitleTitleSkip +\fau@inner@HeaderHeight=\fau@inner@YScale\dimexpr\fau@inner@HeaderHeight +\fau@inner@TitleHeight=\fau@inner@YScale\dimexpr\fau@inner@TitleHeight +\fau@inner@TitleLineHeight=\fau@inner@YScale\dimexpr\fau@inner@TitleLineHeight +\fau@inner@RightMargin=\fau@inner@YScale\dimexpr\fau@inner@RightMargin + +% .............................................................................. +% Title page +% ------------------------------------------------------------------------------ +\define@key{beamerframe}{titleimage}[true]{% + \setbeamertemplate{background}{ + \vbox to \paperheight{% + \vfill% + \includegraphics[% + width=\paperwidth,% + height=\dimexpr\paperheight-% + \fau@inner@HeaderHeight-% + \fau@inner@TitleHeight-% + \fau@inner@TitleLineHeight]{\fau@inner@TitleArt}% + }% + }% + \setbeamertemplate{headline}[headline title] + %\setbeamertemplate{sidebar left}[sidebar title theme] + \setbeamertemplate{sidebar left}{} + \setbeamertemplate{frametitle}[frametitle title] + \setbeamertemplate{footline}[footline off] + \setbeamercolor{background canvas}{bg=BaseColor}% + \setbeamercolor{section in toc}{fg=TitleFont}% + \setbeamercolor{subsection in toc}{fg=TitleFont}% + \hypersetup{linkcolor=TitleFont}% + \usebeamerfont{title}% + \setbeamercolor{footnote}{fg=TitleFont}% + \setbeamercolor{footnote mark}{fg=TitleFont}% + \usebeamercolor[fg]{title page}% +} + +\define@key{beamerframe}{title}[true]{% + \setbeamertemplate{headline}[headline title] + \setbeamertemplate{sidebar left}[sidebar title theme] + \setbeamertemplate{frametitle}[frametitle title] + \setbeamertemplate{footline}[footline off] + \setbeamercolor{background canvas}{bg=BaseColor}% + \setbeamercolor{section in toc}{fg=TitleFont}% + \setbeamercolor{subsection in toc}{fg=TitleFont}% + \hypersetup{linkcolor=TitleFont}% + \usebeamerfont{title}% + \setbeamercolor{footnote}{fg=TitleFont}% + \setbeamercolor{footnote mark}{fg=TitleFont}% + \usebeamercolor[fg]{title page}% +} +% .............................................................................. +% Actual plain environment +% This removes the left sidbar of a plain frame +% ------------------------------------------------------------------------------ +\providebool{fau@blank} +\define@key{beamerframe}{blank}[true]{% + \booltrue{fau@blank} + \begingroup + \beamer@plainframetrue% + \def\beamer@frametemplate{\beamer@frametemplate@plain} + \setlength{\hoffset}{-\beamer@leftsidebar} + \addtolength{\textwidth}{\beamer@leftsidebar} + \addtolength{\textwidth}{\beamer@rightmargin} + \setlength{\hsize}{\textwidth} + \setlength{\columnwidth}{\textwidth} +} + +\apptocmd{\beamer@reseteecodes}{% + \ifbool{fau@blank}{ + \endgroup + \boolfalse{fau@blank}}{} +} + + +\setbeamertemplate{title page}{% +{\usebeamerfont{title}{\inserttitle}}\\ +% if a subtitle is given insert it here +\ifx\insertsubtitle\empty\else% +{\usebeamerfont{subtitle}\parbox{0.9\textwidth}{\insertsubtitle}}% +\fi\leavevmode\\[.5em] +% +% insert authors +\ifx\insertauthor\empty\else% +{\parbox{0.9\textwidth}{ +\usebeamerfont{default}\textbf{\insertauthor}}% +}\leavevmode\newline +\fi% +% insert institute name +\ifx\insertinstitute\empty\else% + {\usebeamerfont{default}\insertinstitute} +\fi% +% +% insert date +\ifx\insertdate\empty\else% + {\usebeamerfont{default}\insertdate}% +\fi% +%}% +}% + + + + + +% .............................................................................. +% Section page +% ------------------------------------------------------------------------------ + +\AtBeginSection{% +{% +%\usebeamercolor[fg]{normal text} +\begin{frame}[title]{-} +\usebeamerfont{title}% +\hypersetup{linkcolor=TitleFont}% +\tableofcontents[currentsection]% +\end{frame} +}% +}% +% -------------------------------------------------------------------------- + +% .............................................................................. +% Boxes and list +% ------- +% +% We define the bullet points for list and box behaviour. +% ------------------------------------------------------------------------------ + +\setbeamertemplate{itemize items}[triangle] % adapt height of itemize rectangles +\setbeamertemplate{itemize item}{\raisebox{0.22ex}{$\bullet$}\hskip0.1em} +\setbeamertemplate{itemize subitem}{\raisebox{0.22ex}{$\circ$}\hskip0.1em} +\setbeamertemplate{navigation symbols}{} % no navigation symbols +% ------------------------------------------------------------------------------ + +% .............................................................................. +% Text alignemnt +% ------- +% +% Adjust the space that is justed in a frame. +% ------------------------------------------------------------------------------ + +\setbeamersize +{ + text margin left=0cm, + text margin right=\fau@inner@RightMargin +} +% ------------------------------------------------------------------------------ + + +\setbeamertemplate{block begin}{% + \vspace*{\fau@inner@YScale\dimexpr1ex}% + \begin{beamercolorbox}[sep=\fau@inner@YScale\dimexpr5pt]{block title} + \usebeamerfont*{block title}\insertblocktitle% + \end{beamercolorbox}% + \nointerlineskip% + \usebeamerfont{block body}% + \begin{beamercolorbox}[% + sep=\fau@inner@YScale\dimexpr5pt + ]{block body}% +}% + +\setbeamertemplate{block end}{% +\end{beamercolorbox} +\vspace*{\fau@inner@YScale\dimexpr0.2ex} +} + + + + +% .............................................................................. +% ToC +% ------- +% +% We want numbered sections in Toc. Additionally we specify of shaded toc. +% ------------------------------------------------------------------------------ +\setbeamertemplate{section in toc}[sections numbered] +\setbeamertemplate{subsection in toc}[subsections numbered] + +\setbeamertemplate{section in toc shaded}{% +\begin{colormixin}{0!BaseColorA}% +\usebeamertemplate{section in toc}% +\end{colormixin}% +\unskip% +} + +\setbeamertemplate{subsection in toc shaded}{% +\begin{colormixin}{0!BaseColorA}% +\usebeamertemplate{subsection in toc}% +\end{colormixin}% +\unskip% +} +% .............................................................................. +% Reset mode to all +\mode \ No newline at end of file diff --git a/styles/beamerouterthemefau.sty b/styles/beamerouterthemefau.sty new file mode 100755 index 0000000..b348b35 --- /dev/null +++ b/styles/beamerouterthemefau.sty @@ -0,0 +1,393 @@ + + +% .............................................................................. +% The outer beamer theme accoridng to the FAU corporate style guide 2021, see +% +% https://www.intern.fau.de/kommunikation-marketing-und-corporate-identity/corporate-identity/ +% +% +% Copyright 2022 by Tim Roith +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. +% +% ------------------------------------------------------------------------------ + +\ProvidesPackage{styles/beamerouterthemefau} +% .............................................................................. +\newdimen\fau@outer@SideBarWidthLeft % width of the left sidbar +\newdimen\fau@outer@HeaderHeight % header height without separation line +\newdimen\fau@outer@HeaderTitleHeight +\newdimen\fau@outer@LineWidthThick % thick linewidth +\newdimen\fau@outer@LineWidthThin % thin linewidth +\newdimen\fau@outer@TitleHeight % title height +\newdimen\fau@outer@TitleSkip +\newdimen\fau@outer@TitleLineHeight +\newdimen\fau@outer@TitleTitleSkip +\newdimen\fau@outer@FootHeight +\newdimen\fau@outer@FootLineSkip +\newdimen\fau@outer@WordMarkHeight +\newdimen\fau@outer@WordMarkWidth +\newdimen\fau@outer@WordMarkTitleHeight +\newdimen\fau@outer@WordMarkTitleWidth +\newdimen\fau@outer@WordMarkLeftHeight +\newdimen\fau@outer@WordMarkLeftWidth +\newdimen\fau@outer@WordMarkBoxWidth +\newdimen\fau@outer@TitleSkipLeft +% +% dimensions for lobal use +% +\newdimen\FrameHeight +\newdimen\TitleHeight +% +\newif\iffau@outer@InsertTotalFoot\fau@outer@InsertTotalFootfalse +\newif\iffau@outer@InsertSecondLogo\fau@outer@InsertSecondLogofalse +\newif\iffau@outer@InsertThirdLogo\fau@outer@InsertThirdLogofalse +% .............................................................................. +% Dimensions +% ------- +% +% We define the relevant dimensions for this template. +% ------------------------------------------------------------------------------ +\def\fau@inner@XScale{1.} +\def\fau@inner@YScale{1.} +\DeclareOptionBeamer{XScale}{\def\fau@inner@XScale{#1}} % scale factor for x dimension +\DeclareOptionBeamer{YScale}{\def\fau@inner@YScale{#1}} % scale factor for y dimension + +\DeclareOptionBeamer{SideBarWidthLeft}{\fau@outer@SideBarWidthLeft=#1} +\DeclareOptionBeamer{HeaderHeight}{\fau@outer@HeaderHeight=#1} +\DeclareOptionBeamer{HeaderTitleHeight}{\fau@outer@HeaderTitleHeight=#1} +\DeclareOptionBeamer{TitleHeight}{\fau@outer@TitleHeight=#1} +\DeclareOptionBeamer{TitleLineHeight}{\fau@outer@TitleLineHeight=#1} +\DeclareOptionBeamer{TitleSkip}{\fau@outer@TitleSkip=#1} +\DeclareOptionBeamer{TitleTitleSkip}{\fau@outer@TitleTitleSkip=#1} +\DeclareOptionBeamer{TitleSkipLeft}{\fau@outer@TitleSkipLeft=#1} +\DeclareOptionBeamer{LineWidthThick}{\fau@outer@LineWidthThick=#1} +\DeclareOptionBeamer{LineWidthThin}{\fau@outer@LineWidthThin=#1} +\DeclareOptionBeamer{FootHeight}{\fau@outer@FootHeight=#1} +\DeclareOptionBeamer{FootLineSkip}{\fau@outer@FootLineSkip=#1} +\DeclareOptionBeamer{WordMarkHeight}{\fau@outer@WordMarkHeight=#1} +\DeclareOptionBeamer{WordMarkWidth}{\fau@outer@WordMarkWidth=#1} +\DeclareOptionBeamer{WordMarkTitleHeight}{\fau@outer@WordMarkTitleHeight=#1} +\DeclareOptionBeamer{WordMarkTitleWidth}{\fau@outer@WordMarkTitleWidth=#1} +\DeclareOptionBeamer{WordMarkLeftHeight}{\fau@outer@WordMarkLeftHeight=#1} +\DeclareOptionBeamer{WordMarkLeftWidth}{\fau@outer@WordMarkLeftWidth=#1} +\DeclareOptionBeamer{WordMarkBoxWidth}{\fau@outer@WordMarkBoxWidth=#1} +% +\DeclareOptionBeamer{InsertTotalFoot}{\fau@outer@InsertTotalFoottrue} +\DeclareOptionBeamer{WordMark}{\def\fau@outer@WordMark{#1}} +\DeclareOptionBeamer{WordMarkTitle}{\def\fau@outer@WordMarkTitle{#1}} +\DeclareOptionBeamer{WordMarkTitleLeft}{\def\fau@outer@WordMarkTitleLeft{#1}} +\DeclareOptionBeamer{SecondLogo}{% + \def\fau@outer@SecondLogo{#1}% + \fau@outer@InsertSecondLogotrue% +} +\DeclareOptionBeamer{ThirdLogo}{% + \def\fau@outer@ThirdLogo{#1}% + \fau@outer@InsertThirdLogotrue% +} +% ------------------------------------------------------------------------------ + +% .............................................................................. +\ProcessOptionsBeamer +\mode +% .............................................................................. +% Scale the dimensions +% ------------------- +\fau@outer@SideBarWidthLeft=\fau@inner@XScale\dimexpr\fau@outer@SideBarWidthLeft +\fau@outer@HeaderHeight=\fau@inner@YScale\dimexpr\fau@outer@HeaderHeight +\fau@outer@HeaderTitleHeight=\fau@inner@YScale\dimexpr\fau@outer@HeaderTitleHeight +\fau@outer@LineWidthThick=\fau@inner@YScale\dimexpr\fau@outer@LineWidthThick +\fau@outer@LineWidthThin=\fau@inner@YScale\dimexpr\fau@outer@LineWidthThin +\fau@outer@TitleHeight=\fau@inner@YScale\dimexpr\fau@outer@TitleHeight +\fau@outer@TitleSkip=\fau@inner@YScale\dimexpr\fau@outer@TitleSkip +\fau@outer@TitleLineHeight=\fau@inner@YScale\dimexpr\fau@outer@TitleLineHeight +\fau@outer@TitleTitleSkip=\fau@inner@YScale\dimexpr\fau@outer@TitleTitleSkip +\fau@outer@FootHeight=\fau@inner@YScale\dimexpr\fau@outer@FootHeight +\fau@outer@FootLineSkip=\fau@inner@YScale\dimexpr\fau@outer@FootLineSkip +\fau@outer@WordMarkHeight=\fau@inner@YScale\dimexpr\fau@outer@WordMarkHeight +\fau@outer@WordMarkWidth=\fau@inner@XScale\dimexpr\fau@outer@WordMarkWidth +\fau@outer@WordMarkTitleHeight=\fau@inner@YScale\dimexpr\fau@outer@WordMarkTitleHeight +\fau@outer@WordMarkTitleWidth=\fau@inner@XScale\dimexpr\fau@outer@WordMarkTitleWidth +\fau@outer@WordMarkLeftHeight=\fau@inner@YScale\dimexpr\fau@outer@WordMarkLeftHeight +\fau@outer@WordMarkLeftWidth=\fau@inner@XScale\dimexpr\fau@outer@WordMarkLeftWidth +\fau@outer@WordMarkBoxWidth=\fau@inner@XScale\dimexpr\fau@outer@WordMarkBoxWidth +% .............................................................................. +% +% +% +\setlength{\FrameHeight}{\dimexpr\paperheight-\fau@outer@HeaderHeight-\fau@outer@TitleHeight-\fau@outer@FootHeight-6mm} +\setlength{\TitleHeight}{\fau@outer@TitleHeight} +% .............................................................................. +\RequirePackage{tikz} +\RequirePackage{graphicx} + +% .............................................................................. +% Headline +% ------- +% +% This section specifies the behaviour of the frame headline. +% ------------------------------------------------------------------------------ + + + +\defbeamertemplate{headline}{headline default}{% +\begin{beamercolorbox}[% + wd=\paperwidth,% + ht=\fau@outer@HeaderHeight,% + dp=0ex,sep=0pt]{headline}% +\end{beamercolorbox}% +}% + +\defbeamertemplate{headline}{headline title}{% +\begin{beamercolorbox}[wd=\paperwidth, + ht=\fau@outer@HeaderHeight, dp=0ex,sep=0pt]{headline title}% +\end{beamercolorbox}% +% +}% +\setbeamertemplate{headline}[headline default] +% .............................................................................. +% Frame title +% ----------- +% +% ------------------------------------------------------------------------------ +\newlength{\titlelength} +\newsavebox{\titlebox} + +\newcommand{\frametitlewrapper}[9]{% +\nointerlineskip% +\begin{beamercolorbox}[dp=0cm, sep=0.0cm,left, + wd=\dimexpr\paperwidth-\fau@outer@SideBarWidthLeft, + ht=\dimexpr\fau@outer@TitleHeight+#8]{frametitle}% +% +\vbox to\dimexpr\fau@outer@TitleHeight+#8{% +% +% hbox for title +% +\hbox to \dimexpr\paperwidth-\fau@outer@SideBarWidthLeft{% +\begin{beamercolorbox}[dp=0cm, sep=0.0cm,left, + wd=\dimexpr#9\paperwidth-\fau@outer@SideBarWidthLeft, + ht=\dimexpr\fau@outer@TitleHeight-\fau@outer@LineWidthThick]{#1}% +\vbox to\dimexpr\dimexpr\fau@outer@TitleHeight-\fau@outer@LineWidthThick-#7{% +\ifnum#4=0% + \usebeamerfont{frametitle}\insertframetitle\\% + %\baselineskip=.3\fau@outer@TitleHeight% + % + \ifx\insertframesubtitle\empty\else% + {\usebeamerfont{framesubtitle}\insertframesubtitle}% + \fi% +\else% + \includegraphicsdefault[ + width=2\fau@outer@WordMarkLeftWidth,% + height=2\fau@outer@WordMarkLeftHeight,% + keepaspectratio + ]{\fau@outer@WordMarkTitleLeft}% +\fi% +\vfil% +% +}% +\end{beamercolorbox}% +\hfil% +% +% insert additional logo +% +\FPeval{\fau@LogoFactor}{1-#9}% +\ifnum#4=0% + \FPeval{\fau@WMBFactor}{0.5}% +\else% + \FPeval{\fau@WMBFactor}{1.0}% +\fi% +% +% +\begin{beamercolorbox}[ + dp=0cm, sep=0.0cm,right,% + wd=\dimexpr\fau@LogoFactor\paperwidth-\fau@outer@TitleSkipLeft, + ht=\dimexpr\fau@outer@TitleHeight-\fau@outer@LineWidthThick]{#1}% +% +\vbox to\dimexpr\fau@outer@TitleHeight-\fau@outer@LineWidthThick{% +\hbox to\dimexpr\fau@LogoFactor\paperwidth-\fau@outer@TitleSkipLeft{% +\iffau@outer@InsertThirdLogo% + \includegraphics[ + width=#5,% + height=#6,% + keepaspectratio% + ]{\fau@outer@ThirdLogo}% + %\fi% +\fi% +% +\hfil +% +\iffau@outer@InsertSecondLogo% + \includegraphics[ + width=#5,% + height=#6,% + keepaspectratio% + ]{\fau@outer@SecondLogo}% + \hfil% +\fi% +% +% insert fau word mark +% +\includegraphicsdefault[width=#5,% + height=#6,% + keepaspectratio]{#3}% +}% +\vfil% +}% +% +\end{beamercolorbox}% +% +\begin{beamercolorbox}[dp=0cm, sep=0.0cm,right,% + wd=\fau@outer@TitleSkipLeft,% + ht=\dimexpr\fau@outer@TitleHeight-\fau@outer@LineWidthThick]{#1}% +\end{beamercolorbox}% +}% +% +% separation line +% +\nointerlineskip% +\begin{beamercolorbox}[dp=0cm,left,sep=0cm, + wd=\dimexpr\paperwidth-\fau@outer@SideBarWidthLeft, + ht=\fau@outer@LineWidthThick]{#2}% +\end{beamercolorbox}% +% +% Line height offset +% +\nointerlineskip% +\begin{beamercolorbox}[dp=0cm, sep=0.0cm,right,% + wd=\dimexpr\paperwidth-\fau@outer@SideBarWidthLeft,% + ht=#8]{#1}% +\end{beamercolorbox}% +}% +\end{beamercolorbox}% +}% +% +% +\defbeamertemplate{frametitle}{frametitle default}{% +\frametitlewrapper{}%1 + {separation line}%2 + {\fau@outer@WordMark}%3 + {0}%4 + {\fau@outer@WordMarkWidth}%5 + {\fau@outer@WordMarkHeight}%6 + {\fau@outer@TitleSkip}%7 + {0pt}%8 + {0.65}%9 +}% +% +% +% +% +% +\defbeamertemplate{frametitle}{frametitle title}{% +\frametitlewrapper{frametitle title}%1 + {separation line title}%2 + {\fau@outer@WordMarkTitle}%3 + {1}%4 + {\fau@outer@WordMarkTitleWidth}%5 + {\fau@outer@WordMarkTitleHeight}%6 + {\fau@outer@TitleTitleSkip}%7 + {\fau@outer@TitleLineHeight}%8 + {.5}%#9 +}% +% +% +\setbeamertemplate{frametitle}[frametitle default]% +%------------------------------------------------------------------------------ + + + + +% .............................................................................. +% Sidebar +% ------- +% +% This section specifies the behaviour of the sidbar. +% ------------------------------------------------------------------------------ + +\setbeamersize{sidebar width left=\fau@outer@SideBarWidthLeft} +% ------------------------------------------------------------------------------ +\defbeamertemplate{sidebar left}{sidebar title theme}{% +\begin{beamercolorbox}[dp=0pt,sep=0pt,% + wd=\fau@outer@SideBarWidthLeft,% + ht=\dimexpr\paperheight-\fau@outer@FootHeight-\fau@outer@HeaderHeight]{sidebar title}% +% +\end{beamercolorbox}% +}% + +\setbeamertemplate{sidebar left}{}% + + + +% .............................................................................. +% Footline +% ------------------------------------------------------------------------------ + +\newcommand{\footwrapper}[2]{% +\begin{beamercolorbox}[wd=\paperwidth,ht=\fau@outer@FootHeight]{#1}% +\hbox to \paperwidth{% +\hskip\dimexpr\fau@outer@SideBarWidthLeft% +\vbox to \fau@outer@FootHeight{% +\begin{beamercolorbox}[wd=\dimexpr\paperwidth-\fau@outer@SideBarWidthLeft, + ht=\fau@outer@LineWidthThin,dp=0pt,sep=0pt]{#2}% +\end{beamercolorbox}% +\nointerlineskip% +\hbox to \dimexpr\paperwidth-\fau@outer@SideBarWidthLeft{% +% +% left side of the footer +% +\begin{beamercolorbox}[dp=0pt,sep = \fau@outer@FootLineSkip,% + leftskip= -\fau@outer@FootLineSkip,% + wd=\dimexpr.5\paperwidth-\fau@outer@SideBarWidthLeft,% + ht=\dimexpr\fau@outer@FootHeight-\fau@outer@LineWidthThin]{footline}% +\ifx\insertshortinstitute\empty\else% + \insertshortinstitute\quad% +\fi% +\ifx\insertshortauthor\empty\else% + \insertshortauthor\quad% +\fi% +\ifx\insertshorttitle\empty\else% + \insertshorttitle% +\fi% +% +\end{beamercolorbox}% +\hfil% +% +% rigth side of the footer +% +\begin{beamercolorbox}[dp=0pt,sep = \fau@outer@FootLineSkip,% + rightskip=\dimexpr\fau@outer@SideBarWidthLeft-\fau@outer@FootLineSkip,% + wd=\dimexpr.5\paperwidth,% + ht=\dimexpr\fau@outer@FootHeight-\fau@outer@LineWidthThin]{footline}% +\hfill% +\insertdate\qquad% +\insertframenumber% +\iffau@outer@InsertTotalFoot +/\inserttotalframenumber% +\fi% +\end{beamercolorbox}% +}% +}% +}% +\end{beamercolorbox}% +}% +% +\defbeamertemplate{footline}{footline default}{% +\footwrapper{}{separation line} +}% + +\defbeamertemplate{footline}{footline off}{}% + +% shaded footline for title/section page +\defbeamertemplate{footline}{footline title}{% +\footwrapper{footline title}{separation line title} +}% +% +\setbeamertemplate{footline}[footline default] +% ------------------------------------------------------------------------------ + + + + +% ------------------------------------------------------------------------------ +\mode \ No newline at end of file diff --git a/styles/beamerposterthemefau.sty b/styles/beamerposterthemefau.sty new file mode 100755 index 0000000..14ecb0f --- /dev/null +++ b/styles/beamerposterthemefau.sty @@ -0,0 +1,368 @@ +\ProvidesPackage{styles/beamerposterthemefau} +% .............................................................................. +\RequirePackage{xifthen} +\RequirePackage{geometry} +\RequirePackage{tikz} +\RequirePackage{graphicx} +% .............................................................................. + +% .............................................................................. +% Dimesnions and conditionals +% ------- +% +% Define the necessary variables for the template +% ------------------------------------------------------------------------------ +\newif\iffau@isfau\fau@isfautrue +\newif\iffau@isphil\fau@isphilfalse +\newif\iffau@isrewi\fau@isrewifalse +\newif\iffau@ismed\fau@ismedfalse +\newif\iffau@isnat\fau@isnatfalse +\newif\iffau@istech\fau@istechfalse +\newif\iffau@poster@InsertExtraLogo\fau@poster@InsertExtraLogofalse +\newcount\fau@dina + +\newdimen\pageheight +\newdimen\pagewidth +\newdimen\fau@poster@SideBarWidthRight +\newdimen\fau@poster@SideBarWidthLeft % width of the left sidbar +\newdimen\fau@poster@HeaderHeight % header height without separation line +\newdimen\fau@poster@HeaderTitleHeight +\newdimen\fau@poster@TitleHeight % title height +\newdimen\fau@poster@FootHeight +\newdimen\fau@poster@WordMarkHeight +\newdimen\fau@poster@WordMarkWidth +\newdimen\fau@poster@WordMarkRightHeight +\newdimen\fau@poster@WordMarkRightWidth +\newdimen\fau@poster@WordMarkRightSkip +\newdimen\fau@poster@FootLineSkip + + +% .............................................................................. +% Institute +% ------- +% +% Define which insitute template should be used. +% ------------------------------------------------------------------------------ +\def\inst{FAU} +\DeclareOptionBeamer{institute}{% + \PassOptionsToPackage{institute=#1}{styles/beamercolorthemefau} + \ifthenelse{\equal{#1}{FAU}}{\fau@isfautrue\def\inst{FAU}}{\fau@isfaufalse}% + \ifthenelse{\equal{#1}{Phil}}{\fau@isphiltrue\def\inst{Phil}}{\fau@isphilfalse}% + \ifthenelse{\equal{#1}{RW}}{\fau@isrewitrue\def\inst{RW}}{\fau@isrewifalse}% + \ifthenelse{\equal{#1}{Med}}{\fau@ismedtrue\def\inst{Med}}{\fau@ismedfalse}% + \ifthenelse{\equal{#1}{Nat}}{\fau@isnattrue\def\inst{Nat}}{\fau@isnatfalse}% + \ifthenelse{\equal{#1}{Tech}}{\fau@istechtrue\def\inst{Tech}}{\fau@istechfalse}% +} + +% .............................................................................. +% Logos +% ------- +% +% Define the logo file path +% ------------------------------------------------------------------------------ +\def\WordMark{template-art/FAUWortmarkeBlau.pdf} + +% The following are dependent on the institute +\def\WordMarktRight{template-art/\inst /\inst Kennung.pdf} + +% Declare options for user specification +\DeclareOptionBeamer{WordMark}{\def\WordMark{#1}}% +\DeclareOptionBeamer{WordMarkTitleRight}{\def\WordMarkTitleLeft{#1}} +\DeclareOptionBeamer{ExtraLogo}{% + \fau@poster@InsertExtraLogotrue% + \def\ExtraLogo{#1}% +} + +% fall back to default image, if the images are not in the folder +\newcommand{\includegraphicsdefault}[2][width=\linewidth]{% +\IfFileExists{#2}% +{\includegraphics[#1]{#2}}% +{%\includegraphics[#1]{template-art/default-image} +\PackageWarning{beamerthemefau}{Warning: File #2 not found in includegraphicsdefault.}% +}% +}% + + +% .............................................................................. +% Poster Size +% ------- +% +% Declare the poster size, which is later passed to the beamerposter package. +% Addionally we pass the portrait option. +% ------------------------------------------------------------------------------ +\DeclareOptionBeamer{size}{% + \PassOptionsToPackage{size=#1,scale=1.4}{beamerposter}% + \ifthenelse{\equal{#1}{a0}}{\fau@dina=0}{}% + \ifthenelse{\equal{#1}{a1}}{\fau@dina=1}{}% + \ifthenelse{\equal{#1}{a2}}{\fau@dina=2}{}% + \ifthenelse{\equal{#1}{a3}}{\fau@dina=3}{}% + \ifthenelse{\equal{#1}{a4}}{\fau@dina=4}{}% +} + +\PassOptionsToPackage{orientation=portrait}{beamerposter} + +% .............................................................................. +% Url and Signature for footer. +% ------------------------------------------------------------------------------ +\def\fau@url{} +\DeclareOptionBeamer{url}{% + \def\fau@url{#1} +} + +\def\fau@signature{} +\DeclareOptionBeamer{signature}{% + \def\fau@signature{#1} +} +% ------------------------------------------------------------------------------ + +% .............................................................................. +% Process options. +% ------------------------------------------------------------------------------ +%\ExecuteOptionsBeamer{url=www.fau.de} +\ExecuteOptionsBeamer{signature=} +\ProcessOptionsBeamer +\selectcolormodel{rgb} +\mode +% ------------------------------------------------------------------------------ +\RequirePackage{beamerposter} + + +\ifcase\fau@dina %a0 + \def\factor{3.31} + % .............................................................................. + % Font size. + % ------------------------------------------------------------------------------ + \PassOptionsToPackage{Size=38}{styles/beamerfontthemefau} + \PassOptionsToPackage{BaseLineSkip=45}{styles/beamerfontthemefau} +\else + \PackageError{beamerposterthemefau}{Option 'size' must be one of 'a0', 'a1', 'a2', 'a3', or 'a4'.}{} +\fi + +% .............................................................................. +% Dimensions for page layout +% ------------------------------------------------------------------------------ +\setlength{\fau@poster@SideBarWidthLeft}{\factor\dimexpr30.6pt\relax} +\setlength{\fau@poster@SideBarWidthRight}{\factor\dimexpr 15pt\relax} +\setlength{\fau@poster@HeaderHeight}{\factor\dimexpr20pt\relax} +\setlength{\fau@poster@HeaderTitleHeight}{\factor\dimexpr11.3pt\relax} +\setlength{\fau@poster@TitleHeight}{\factor\dimexpr200.0pt\relax} + +\setlength{\fau@poster@FootHeight}{\factor\dimexpr25.5pt\relax} +\setlength{\fau@poster@FootLineSkip}{.5\fau@poster@FootHeight} + +\setlength{\fau@poster@WordMarkHeight}{\factor\dimexpr130.0pt\relax} +\setlength{\fau@poster@WordMarkWidth}{\factor\dimexpr260.0pt\relax} +\setlength{\fau@poster@WordMarkRightHeight}{\factor\dimexpr60pt\relax} +\setlength{\fau@poster@WordMarkRightWidth}{\factor\dimexpr250pt\relax} +\setlength{\fau@poster@WordMarkRightSkip}{\factor\dimexpr15pt\relax} + +% ------------------------------------------------------------------------------ +\usepackage{styles/beamerfontthemefau} +\usepackage{styles/beamercolorthemefau} +\usepackage{styles/beamerinnerthemefau} +\usepackage{styles/beamerouterthemefau} +% ------------------------------------------------------------------------------ + +% .............................................................................. +% Head Line +% ------------------------------------------------------------------------------ + +\setbeamertemplate{headline}{% +\hbox to \paperwidth{% +\begin{beamercolorbox}[wd=\dimexpr\paperwidth-\fau@poster@SideBarWidthRight, + ht=\fau@poster@HeaderHeight, dp=0ex,sep=0pt]{}% +\end{beamercolorbox}% +% +\begin{beamercolorbox}[wd=\dimexpr\fau@poster@SideBarWidthRight, + ht=\fau@poster@HeaderHeight, dp=0ex,sep=0pt]{sidebar title}% +\end{beamercolorbox}% +}% +}% + +% .............................................................................. +% Frame title +% ------------------------------------------------------------------------------ + +\setbeamertemplate{frametitle}{% +\usebeamerfont{frametitle}% +\nointerlineskip% +\newdimen\titlewidth +\setlength{\titlewidth}{\dimexpr\paperwidth-\fau@poster@SideBarWidthLeft-\fau@poster@SideBarWidthRight} +\vbox to\dimexpr\fau@poster@TitleHeight{% +\begin{beamercolorbox}[dp=0cm, sep=0.0cm,left, + wd=\titlewidth, + ht=\fau@poster@WordMarkHeight]{}% +% +% FAU Word Mark +% +\begin{beamercolorbox}[dp=0pt, sep=0pt, + wd=.5\titlewidth, + ht=\fau@poster@WordMarkHeight]{}% +\vbox to\fau@poster@WordMarkHeight{% +\includegraphicsdefault[width=\fau@poster@WordMarkWidth,% + height=\fau@poster@WordMarkHeight,% + keepaspectratio]{\WordMark}\vfill}% +\end{beamercolorbox}% +% +% Rigth side word mark and extra logo +% +\begin{beamercolorbox}[dp=0pt, sep=0pt,% + wd=.5\titlewidth, + ht=\fau@poster@WordMarkHeight]{}% +\vbox to\fau@poster@WordMarkHeight{% +\vskip \fau@poster@WordMarkRightSkip% +\hbox to .5\titlewidth{% +\includegraphicsdefault[width=\fau@poster@WordMarkRightWidth,% + height=\fau@poster@WordMarkRightHeight,% + keepaspectratio]{\WordMarktRight}\hfill}% +% +% Extra Logo +% +\iffau@poster@InsertExtraLogo% +\vskip \fau@poster@WordMarkRightSkip% +\hbox to\dimexpr.5\titlewidth-\fau@poster@SideBarWidthRight{% +\includegraphicsdefault[width=\fau@poster@WordMarkRightWidth,% + height=\dimexpr\fau@poster@WordMarkHeight-\fau@poster@WordMarkRightHeight-2\fau@poster@WordMarkRightSkip,% + keepaspectratio]{\ExtraLogo}\hfill}% +\fi% +\vfill}% +\end{beamercolorbox}% +\end{beamercolorbox}% +% +% Insert author and title +% +\nointerlineskip% +\begin{beamercolorbox}[dp=0cm, sep=0.0cm,left,% + wd=\dimexpr\titlewidth,% + ht=\dimexpr\fau@poster@TitleHeight-\fau@poster@WordMarkHeight]{}% +\vbox to \dimexpr\fau@poster@TitleHeight-\fau@poster@WordMarkHeight{% +% +% Title +% +\hbox to \titlewidth {% +{\usebeamerfont{title}% +\color{BaseDarkColor}\parbox{\titlewidth}{\inserttitle}\hfill}% +}% +% +% +% +\hbox to \titlewidth {% +% +% subtitle +% +\ifx\insertsubtitle\empty\else% + {\usebeamerfont{subtitle}\parbox{\titlewidth}{\insertsubtitle}\hfill}% +\fi% +}% +\hbox to \titlewidth {% +% +% authors +% +\ifx\insertauthor\empty\else + {\usebeamerfont{subtitle}\parbox{\titlewidth}{\textbf{\insertauthor}}\hfill}% +\fi +}% +\vfill% +}% +\end{beamercolorbox}% +}% +}% + +% .............................................................................. +% Sidebar +% ------- +% +% This section specifies the behaviour of the sidbar. +% ------------------------------------------------------------------------------ + +\setbeamersize{sidebar width left=\fau@poster@SideBarWidthLeft} +\setbeamersize{sidebar width right=\fau@poster@SideBarWidthRight} +% +\setbeamertemplate{sidebar right}{% +\begin{beamercolorbox}[dp=0pt,sep=0pt,% + wd=\fau@poster@SideBarWidthRight,% + ht=\dimexpr\paperheight-\fau@poster@FootHeight-\fau@poster@HeaderHeight]{sidebar title}% +% +\end{beamercolorbox}% +}% + +\setbeamertemplate{sidebar left}{}% + +% .............................................................................. +% Footline +% ------------------------------------------------------------------------------ + +\setbeamertemplate{footline}{% +\begin{beamercolorbox}[wd=\paperwidth,ht=\fau@poster@FootHeight]{}% +\hbox to \paperwidth{% +\hskip\dimexpr\fau@poster@SideBarWidthLeft% +% +% left side of the footer +% +\begin{beamercolorbox}[dp=0pt,sep = \fau@poster@FootLineSkip,% + leftskip= 0pt,% + wd=\dimexpr.5\paperwidth-\fau@poster@SideBarWidthLeft,% + ht=\dimexpr\fau@poster@FootHeight]{}% +\normalsize\textbf{\fau@url}% +% +\end{beamercolorbox}% +\hfil% +% +% rigth side of the footer +% +\begin{beamercolorbox}[dp=0pt,% + sep = \fau@poster@FootLineSkip,% + rightskip=\dimexpr\fau@poster@SideBarWidthLeft,% + wd=\dimexpr.5\paperwidth-\fau@poster@SideBarWidthRight,% + ht=\dimexpr\fau@poster@FootHeight]{}% +\hfill% +\normalsize\textbf{\fau@signature}% +\end{beamercolorbox}% +\hfil% +\begin{beamercolorbox}[dp=0pt, sep = 0pt, + wd=\fau@poster@SideBarWidthRight,% + ht=\dimexpr\fau@poster@FootHeight]{sidebar title}% +\end{beamercolorbox}% +}% +\end{beamercolorbox}% +}% + +% .............................................................................. +% Blocks +% ------- +% Modifications for Blocks +% ------------------------------------------------------------------------------ + +\newdimen\BoxHeight% +\newsavebox{\AgBox}% +\savebox{\AgBox}{\usebeamerfont{block title} Ag}% +\setlength{\BoxHeight}{1.8\ht\AgBox}% + +\setbeamertemplate{block begin}{% +\vspace*{1ex}% +\ifx\insertblocktitle\empty% +\else% +\begin{beamercolorbox}[dp=0pt, ht=\BoxHeight, + rightskip=-0.2\BoxHeight, + leftskip=0.2\BoxHeight,]{block poster title}% +\vbox to \BoxHeight {% +\vfil% +\usebeamerfont*{block title}\insertblocktitle% +\vfil% +}% +\end{beamercolorbox}% +\fi% +\nointerlineskip% +\usebeamerfont{block body}% +\begin{beamercolorbox}[% +sep=5pt% +]{block body}% +}% + +\setbeamertemplate{block end}{% +\end{beamercolorbox}% +\vspace*{0.2ex}% +} + + +\mode \ No newline at end of file diff --git a/styles/beamerthemefau.sty b/styles/beamerthemefau.sty new file mode 100755 index 0000000..54a3977 --- /dev/null +++ b/styles/beamerthemefau.sty @@ -0,0 +1,270 @@ +% .............................................................................. +% The main theme file for the fau-beamer template according to the FAU +% corporate style guide 2021, see +% https://www.intern.fau.de/kommunikation-marketing-und-corporate-identity/corporate-identity/ +% +% +% for use with LaTeX. +% +% This template was written by Tim Roith. +% +% Copyright 2022 by Tim Roith +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. +% +% ------------------------------------------------------------------------------ + +\ProvidesPackage{styles/beamerthemefau} +% .............................................................................. +\RequirePackage{xifthen} +\RequirePackage{geometry} +% .............................................................................. +\newif\iffau@isfau\fau@isfautrue +\newif\iffau@isphil\fau@isphilfalse +\newif\iffau@isrewi\fau@isrewifalse +\newif\iffau@ismed\fau@ismedfalse +\newif\iffau@isnat\fau@isnatfalse +\newif\iffau@istech\fau@istechfalse + +% .............................................................................. +% Institute +% ------- +% +% Define which insitute template should be used. +% ------------------------------------------------------------------------------ +\def\inst{FAU} +\DeclareOptionBeamer{institute}{% + \PassOptionsToPackage{institute=#1}{styles/beamercolorthemefau} + \ifthenelse{\equal{#1}{FAU}}{\fau@isfautrue\def\inst{FAU}}{\fau@isfaufalse}% + \ifthenelse{\equal{#1}{Phil}}{\fau@isphiltrue\def\inst{Phil}}{\fau@isphilfalse}% + \ifthenelse{\equal{#1}{RW}}{\fau@isrewitrue\def\inst{RW}}{\fau@isrewifalse}% + \ifthenelse{\equal{#1}{Med}}{\fau@ismedtrue\def\inst{Med}}{\fau@ismedfalse}% + \ifthenelse{\equal{#1}{Nat}}{\fau@isnattrue\def\inst{Nat}}{\fau@isnatfalse}% + \ifthenelse{\equal{#1}{Tech}}{\fau@istechtrue\def\inst{Tech}}{\fau@istechfalse}% +} + +% .............................................................................. +% Aspect ratio +% ------------------------------------------------------------------------------ +\def\aspectratio{169}% +\DeclareOptionBeamer{aspectratio}{% + \ifthenelse{\equal{#1}{169}}{\def\aspectratio{#1}}{}% 16:9 + \ifthenelse{\equal{#1}{43}}{\def\aspectratio{#1}}{}% 4:3 +}% + +% Define size scaling of the document +\def\scale{1}% default +\DeclareOptionBeamer{scale}{% + \def\scale{#1}% + \PassOptionsToPackage{scale=#1}{styles/beamerfontthemefau} +}% + +% .............................................................................. +% FontSize +% ------------------------------------------------------------------------------ +\DeclareOptionBeamer{fontsize}{% + \PassOptionsToPackage{fontsize=#1}{styles/beamerfontthemefau} +}% + +\DeclareOptionBeamer{fontbaselineskip}{% + \PassOptionsToPackage{fontbaselineskip=#1}{styles/beamerfontthemefau} +}% + +\DeclareOptionBeamer{fontscale}{% + \PassOptionsToPackage{fontscale=#1}{styles/beamerfontthemefau} +}% +% +\DeclareOptionBeamer{BaseLineSkip}{% + \PassOptionsToPackage{baselinescale=#1}{styles/beamerfontthemefau} +}% + +% .............................................................................. +% File paths for template art +% ------- +% +% We define the pathe to the logos and pictures taking into account the +% institute. +% ------------------------------------------------------------------------------ +% defaults + +\def\WordMark{template-art/FAUWortmarkeBlau.pdf} +\def\WordMarkTitle{template-art/FAUWortmarkeWhite.pdf} + +% The following are dependent on the institute +\def\WordMarkTitleLeft{template-art/\inst /\inst KennungWhite.pdf} +\def\TitleArt{template-art/\inst /\inst Title.jpg} + +% Declare options for user specification +\DeclareOptionBeamer{WordMark}{\def\WordMark{#1}}% +\DeclareOptionBeamer{WordMarkTitle}{\def\WordMarkTitle{#1}} +\DeclareOptionBeamer{WordMarkTitleLeft}{\def\WordMarkTitleLeft{#1}} +\DeclareOptionBeamer{TitleArt}{\def\TitleArt{#1}} +\DeclareOptionBeamer{SecondLogo}{\PassOptionsToPackage{SecondLogo=#1}{styles/beamerouterthemefau}} +\DeclareOptionBeamer{ThirdLogo}{\PassOptionsToPackage{ThirdLogo=#1}{styles/beamerouterthemefau}} +% fall back to default image, if the images are not in the folder +\newcommand{\includegraphicsdefault}[2][width=\linewidth]{% +\IfFileExists{#2}% +{\includegraphics[#1]{#2}}% +{%\includegraphics[#1]{template-art/default-image}% +\PackageWarning{beamerthemefau}{Warning: File #2 not found in includegraphicsdefault.}% +}% +}% + + +% .............................................................................. +\ProcessOptionsBeamer +\selectcolormodel{rgb} +\mode +% ------------------------------------------------------------------------------ + + +% .............................................................................. +% Dimensions for outer theme +% ------- +% +% We define the relevant dimensions for the outer theme. +% ------------------------------------------------------------------------------ +% Aspect ratio: 16:9 +\ifthenelse{\equal{\aspectratio }{169}}{% + \PassOptionsToPackage{SideBarWidthLeft=14.4mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{HeaderHeight=5.mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{HeaderTitleHeight=4mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{TitleHeight=33mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{TitleLineHeight=10mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{TitleTitleSkip=3.5mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{TitleSkip=5mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{TitleSkipLeft=5.5mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{LineWidthThick=2mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{LineWidthThin=.5mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{FootHeight=9mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{FootLineSkip=3mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkHeight=17mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkWidth=34mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkTitleHeight=25.4mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkTitleWidth=50.2mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkLeftHeight=12mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkLeftWidth=74mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkBoxWidth=60mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkSkip=12mm}{styles/beamerouterthemefau} + % + \PassOptionsToPackage{XScale=\scale}{styles/beamerouterthemefau} + \PassOptionsToPackage{YScale=\scale}{styles/beamerouterthemefau} +}{}% +% Aspect ratio: 4:3 +\ifthenelse{\equal{\aspectratio }{43}}{% + \gdef\fau@outer@XScale{\scale} + \gdef\fau@outer@YScale{\scale} + \PassOptionsToPackage{SideBarWidthLeft=10.8mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{HeaderHeight=5mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{HeaderTitleHeight=4mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{TitleHeight=30mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{TitleLineHeight=10mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{TitleTitleSkip=3.5mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{TitleSkip=2.5mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{TitleSkipLeft=4.5mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{LineWidthThick=2mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{LineWidthThin=.5mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{FootHeight=9mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{FootLineSkip=3mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkHeight=12.6mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkWidth=24.5mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkTitleHeight=21.9mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkTitleWidth=40.0mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkLeftHeight=12mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkLeftWidth=50mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkBoxWidth=60mm}{styles/beamerouterthemefau} + \PassOptionsToPackage{WordMarkSkip=12mm}{styles/beamerouterthemefau} + % + \PassOptionsToPackage{XScale=\scale}{styles/beamerouterthemefau} + \PassOptionsToPackage{YScale=\scale}{styles/beamerouterthemefau} +}{}% +% +\PassOptionsToPackage{InsertTotalFoot}{styles/beamerouterthemefau} +\PassOptionsToPackage{WordMark=\WordMark}{styles/beamerouterthemefau} +\PassOptionsToPackage{WordMarkTitle=\WordMarkTitle}{styles/beamerouterthemefau} +\PassOptionsToPackage{WordMarkTitleLeft=\WordMarkTitleLeft}{styles/beamerouterthemefau} +% ------------------------------------------------------------------------------ + + + + +% .............................................................................. +% Dimensions for inner theme +% ------- +% +% We define the relevant dimensions for the inner theme in 16:9. +% ------------------------------------------------------------------------------ +\ifthenelse{\equal{\aspectratio }{169}}{% + \PassOptionsToPackage{TitleTitleSkip=3.5mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{WordMarkTitleHeight=21.9mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{WordMarkTitleWidth=55.2mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{HeaderHeight=5mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{TitleHeight=30mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{TitleLineHeight=10mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{RightMargin=3.5mm}{styles/beamerinnerthemefau} + % + \PassOptionsToPackage{XScale=\scale}{styles/beamerinnerthemefau} + \PassOptionsToPackage{YScale=\scale}{styles/beamerinnerthemefau} +}{}% + +\ifthenelse{\equal{\aspectratio }{43}}{% + \PassOptionsToPackage{TitleTitleSkip=3.5mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{WordMarkTitleHeight=25.4mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{WordMarkTitleWidth=46.0mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{HeaderHeight=5mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{TitleHeight=30mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{TitleLineHeight=10mm}{styles/beamerinnerthemefau} + \PassOptionsToPackage{RightMargin=3.5mm}{styles/beamerinnerthemefau} + % + \PassOptionsToPackage{XScale=\scale}{styles/beamerinnerthemefau} + \PassOptionsToPackage{YScale=\scale}{styles/beamerinnerthemefau} +}{}% + +\PassOptionsToPackage{WordMarkTitle=\WordMarkTitle}{styles/beamerinnerthemefau} + +\PassOptionsToPackage{TitleArt=\TitleArt}{styles/beamerinnerthemefau} +% ------------------------------------------------------------------------------ + +% .............................................................................. +% Default options for frame +% ------------------------- +\BeforeBeginEnvironment{frame}{% + \setbeamertemplate{background}{} + \setbeamertemplate{headline}[headline default]% + \setbeamertemplate{frametitle}[frametitle default]% + \setbeamertemplate{sidebar left}{}% + \setbeamercolor{background canvas}{bg=white}% + \setbeamertemplate{footline}[footline default]% + \setbeamertemplate{footline}[footline default] + \hypersetup{linkcolor=BaseColor}% + \usebeamerfont{default}% + \usebeamercolor[fg]{default}% + \setbeamercolor{footnote}{fg=black}% + \setbeamercolor{footnote mark}{fg=black}% +} + +% .............................................................................. +% Geometry of the layout +% ------- +\ifthenelse{\equal{\aspectratio }{169}}{% + \geometry{paperwidth=\scale\dimexpr338.7mm,paperheight=\scale\dimexpr190.5mm}% for 16:9 +}{}% +\ifthenelse{\equal{\aspectratio }{43}}{% + \geometry{paperwidth=\scale\dimexpr720pt,paperheight=\scale\dimexpr540pt}% for 4:3 +}{}% + + +\usepackage{styles/beamerfontthemefau} +\usepackage{styles/beamercolorthemefau} +\usepackage{styles/beamerinnerthemefau} +\usepackage{styles/beamerouterthemefau} + +% .............................................................................. +% Patch for label alignment +% ------- +\patchcmd{\beamer@inserttarget} +{\hbox{#1}}{\ifmmode#1\else\hbox{#1}\fi}{}{} +% .............................................................................. +\mode +% ------------------------------------------------------------------------------ \ No newline at end of file diff --git a/styles/fau-colors.sty b/styles/fau-colors.sty new file mode 100755 index 0000000..f98c39b --- /dev/null +++ b/styles/fau-colors.sty @@ -0,0 +1,142 @@ +% .............................................................................. +% This file defines the color scheme for the diffferent institutions of the FAU, +% accoridng to the corporate style guide 2021, see +% +% https://www.intern.fau.de/kommunikation-marketing-und-corporate-identity/corporate-identity/ +% +% +% for use with LaTeX. +% +% Copyright 2022 by Tim Roith +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. +% +% ------------------------------------------------------------------------------ + +\ProvidesPackage{styles/fau-colors} +\RequirePackage{xcolor} +\newcounter{faucolors@institutecounter}\setcounter{faucolors@institutecounter}{-1} +\newif\iffaucolors@isFAU\faucolors@isFAUtrue +\newif\iffaucolors@isPhil\faucolors@isPhilfalse +\newif\iffaucolors@isRW\faucolors@isRWfalse +\newif\iffaucolors@isMed\faucolors@isMedfalse +\newif\iffaucolors@isNat\faucolors@isNatfalse +\newif\iffaucolors@isTech\faucolors@isTechfalse + +\DeclareOption{FAU}{% + \faucolors@isFAUtrue + \stepcounter{faucolors@institutecounter} +} +\DeclareOption{Phil}{% + \faucolors@isPhiltrue + \stepcounter{faucolors@institutecounter} +} +\DeclareOption{RW}{% + \faucolors@isRWtrue + \stepcounter{faucolors@institutecounter} +} +\DeclareOption{Med}{% + \faucolors@isMedtrue + \stepcounter{faucolors@institutecounter} +} +\DeclareOption{Nat}{% + \faucolors@isNattrue + \stepcounter{faucolors@institutecounter} +} +\DeclareOption{Tech}{% + \faucolors@isTechtrue + \stepcounter{faucolors@institutecounter} +} +\ProcessOptions\relax + +\ifnum\value{faucolors@institutecounter}>0 + \PackageError{fau-colors}{Options 'FAU', 'Phil', 'RW', 'Med', 'Nat', and 'Tech' are mutually exclusive. Please only specify one of these options.}{} +\fi + +% .............................................................................. +% Define the colors and their respective dark versions for each institute. +% ------------------------------------------------------------------------------ + +% FAU University colors +\definecolor{FAUBlue}{RGB}{0,47,108} +\definecolor{FAUDarkBlue}{RGB}{4,30,66} + +% Phil colors +\definecolor{PhilYellow}{RGB}{255, 184, 28} +\definecolor{PhilOrange}{RGB}{232, 119, 34} + +% RW colors +\definecolor{RWRed}{RGB}{200, 16, 46} +\definecolor{RWDarkRed}{RGB}{151,27,47} + +% Med colors +\definecolor{MedBlue}{RGB}{0, 163, 224} +\definecolor{MedDarkBlue}{RGB}{0, 97, 160} + +% Nat colors +\definecolor{NatGreen}{RGB}{67, 176, 42} +\definecolor{NatDarkGreen}{RGB}{34, 136, 72} + +% Tech colors +\definecolor{TechMetallic}{RGB}{119, 159, 181} +\definecolor{TechDarkMetallic}{RGB}{65, 116, 141} + +% .............................................................................. +% Assign the colors +% - BaseColor +% - BaseDarkColor +% according to the specified institute. +% ------------------------------------------------------------------------------ +\colorlet{TitleFont}{white} + +\iffaucolors@isFAU + \colorlet{BaseColor}{FAUBlue} + \colorlet{BaseDarkColor}{FAUDarkBlue} + \colorlet{SeparationLineColor}{BaseColor!62.5} +\fi + +\iffaucolors@isPhil + \colorlet{BaseColor}{PhilYellow} + \colorlet{BaseDarkColor}{PhilOrange} + \colorlet{SeparationLineColor}{PhilOrange} + \colorlet{TitleFont}{black} +\fi + +\iffaucolors@isRW + \colorlet{BaseColor}{RWRed} + \colorlet{BaseDarkColor}{RWDarkRed} + \colorlet{SeparationLineColor}{RWDarkRed} +\fi + +\iffaucolors@isMed + \colorlet{BaseColor}{MedBlue} + \colorlet{BaseDarkColor}{MedDarkBlue} + \colorlet{SeparationLineColor}{MedDarkBlue} +\fi + +\iffaucolors@isNat + \colorlet{BaseColor}{NatGreen} + \colorlet{BaseDarkColor}{NatDarkGreen} + \colorlet{SeparationLineColor}{NatDarkGreen} +\fi + +\iffaucolors@isTech + \colorlet{BaseColor}{TechMetallic} + \colorlet{BaseDarkColor}{TechDarkMetallic} + \colorlet{SeparationLineColor}{TechDarkMetallic} +\fi + +% .............................................................................. +% Define different shades for BaseColor and BaseDarkColor +% ------------------------------------------------------------------------------ +% +\colorlet{BaseColorA}{BaseColor!62.5} +\colorlet{BaseColorB}{BaseColor!37.5} +\colorlet{BaseColorC}{BaseColor!25.0} +\colorlet{BaseColorD}{BaseColor!12.5} + +\colorlet{BaseDarkColorA}{BaseDarkColor!62.5} +\colorlet{BaseDarkColorB}{BaseDarkColor!37.5} +\colorlet{BaseDarkColorC}{BaseDarkColor!25.0} +\colorlet{BaseDarkColorD}{BaseDarkColor!12.5} \ No newline at end of file diff --git a/styles/symbols.sty b/styles/symbols.sty new file mode 100755 index 0000000..85561b8 --- /dev/null +++ b/styles/symbols.sty @@ -0,0 +1,43 @@ +% .............................................................................. +% +% Some useful commands and macros. +% ------------------------------------------------------------------------------ + +\ProvidesPackage{styles/symbols}[2022/01/27 Defines symbols and useful macros. + Author: Tim Roith] +% +\ProcessOptions\relax +% ======================================================================================== +% Required Packages +% ---------------------------------------------------------------------------------------- +\RequirePackage{amsmath,amsthm,amssymb} +\RequirePackage{dsfont} +% ---------------------------------------------------------------------------------------- +% +% ======================================================================================== +% Command definition for commands +% ---------------------------------------------------------------------------------------- +\newcommand{\norm}[1]{\left\|#1\right\|} +\newcommand{\tv}{\mathrm{TV}} +\newcommand{\argmin}{\mathrm{arg}\min} +\newcommand{\st}{\;:\;} +\renewcommand{\H}{\mathcal{H}} +\newcommand{\X}{\mathcal{X}} +\newcommand{\Y}{\mathcal{Y}} +\newcommand{\V}{\mathcal{V}} +\newcommand{\calN}{\mathcal{N}} +\newcommand{\ran}{\mathrm{ran}} +\newcommand{\dom}{\mathrm{dom}} +\newcommand{\R}{\mathbb{R}} +\newcommand{\N}{\mathbb{N}} +\renewcommand{\d}{\mathrm{d}} +\newcommand{\sg}{\zeta} +\renewcommand{\div}{\operatorname{div}} +\newcommand{\rot}{\operatorname{rot}} +\newcommand{\tex}{T_\mathrm{ex}} +\newcommand{\calA}{\mathcal{A}} +\newcommand{\red}[1]{\textcolor{red}{#1}} +\newcommand{\sgn}{\operatorname{sign}} +\newcommand{\calJ}{\mathcal{J}} +\newcommand{\dist}{\mathrm{dist}} +% ---------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/template-art/FAU/FAUTitle.jpg b/template-art/FAU/FAUTitle.jpg new file mode 100755 index 0000000..ef12edd Binary files /dev/null and b/template-art/FAU/FAUTitle.jpg differ diff --git a/template-art/Med/MedTitle.jpg b/template-art/Med/MedTitle.jpg new file mode 100755 index 0000000..463fbbe Binary files /dev/null and b/template-art/Med/MedTitle.jpg differ diff --git a/template-art/Nat/NatTitle.jpg b/template-art/Nat/NatTitle.jpg new file mode 100755 index 0000000..72c34f3 Binary files /dev/null and b/template-art/Nat/NatTitle.jpg differ diff --git a/template-art/Phil/PhilTitle.jpg b/template-art/Phil/PhilTitle.jpg new file mode 100755 index 0000000..df44aa2 Binary files /dev/null and b/template-art/Phil/PhilTitle.jpg differ diff --git a/template-art/RW/RWTitle.jpg b/template-art/RW/RWTitle.jpg new file mode 100755 index 0000000..809014f Binary files /dev/null and b/template-art/RW/RWTitle.jpg differ diff --git a/template-art/Tech/TechTitle.jpg b/template-art/Tech/TechTitle.jpg new file mode 100755 index 0000000..195daab Binary files /dev/null and b/template-art/Tech/TechTitle.jpg differ diff --git a/texfiles/slides04.tex b/texfiles/slides04.tex new file mode 100755 index 0000000..8bc9100 --- /dev/null +++ b/texfiles/slides04.tex @@ -0,0 +1,236 @@ +% .............................................................................. +% Demo of the fau-beamer template. +% +% Copyright 2022 by Tim Roith +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. +% +% ------------------------------------------------------------------------------ +\documentclass[final, handout]{beamer} + +% ======================================================================================== +% Theme: inner, outer, font and colors +% ---------------------------------------------------------------------------------------- +\usepackage[institute=Tech, + %SecondLogo = template-art/FAUWortmarkeBlau.pdf, + %ThirdLogo = template-art/FAUWortmarkeBlau.pdf, + %WordMark=None, + aspectratio=169, + fontsize=11, + fontbaselineskip=13, + scale=1. + ]{styles/beamerthemefau} +% ---------------------------------------------------------------------------------------- +% Input and output encoding +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +% ---------------------------------------------------------------------------------------- +% Language settings +\usepackage[german]{babel} + +% ======================================================================================== +% Fonts +% - Helvet is loaded by styles/beamerfonts +% - We use serif for math environements +% - isomath is used for upGreek letters +% ---------------------------------------------------------------------------------------- +\usepackage{isomath} +\usefonttheme[onlymath]{serif} +\usepackage{exscale} +\usepackage{anyfontsize} +\setbeamercolor{alerted text}{fg=BaseColor} +% ---------------------------------------------------------------------------------------- +% custom commands for symbols +\usepackage{styles/symbols} + +\usepackage{tikz-cd} +\usetikzlibrary{cd, babel} + +% ======================================================================================== +% Setup for Titlepage +% ---------------------------------------------------------------------------------------- +\title[fau-beamer]{Theorie der Programmierung} +\subtitle{Übung 04 - Konfluenz und kritische Paare} +\author[L. Vatthauer]{ +Leon Vatthauer} +% + +% Instead of \institute you can also use the \thanks command +% ------------------------------------------------ +%\author[T. Roith]{ +%Tim Roith\thanks{Friedrich-Alexander Universität Erlangen-Nürnberg, Department Mathematik}\and% +%Second Author\thanks{Second Insitute}\and% +%Third Author\thanks{Third Insitute}% +%} + +\date{\today} + + +% ================================================ +% Bibliography +% ------------------------------------------------ +\usepackage{csquotes} +\usepackage[style=alphabetic, %alternatively: numeric, numeric-comp, and other from biblatex + defernumbers=true, + useprefix=true,% + giveninits=true,% + hyperref=true,% + autocite=inline,% + maxcitenames=5,% + maxbibnames=20,% + uniquename=init,% + sortcites=true,% sort citations when multiple entries are passed to one cite command + doi=true,% + isbn=false,% + url=false,% + eprint=false,% + backend=biber% + ]{biblatex} +\addbibresource{bibliography.bib} +\setbeamertemplate{bibliography item}[text] + + +% ================================================ +% Hyperref and setup +% ------------------------------------------------ +\usepackage{hyperref} +\hypersetup{ + colorlinks = true, + final=true, + plainpages=false, + pdfstartview=FitV, + pdftoolbar=true, + pdfmenubar=true, + pdfencoding=auto, + psdextra, + bookmarksopen=true, + bookmarksnumbered=true, + breaklinks=true, + linktocpage=true, + urlcolor=BaseColor, + citecolor=BaseColor, + linkcolor=BaseColor +} + + +% ================================================ +% Additional packages +% ------------------------------------------------ + + +% ================================================ +% Various custom commands +% ------------------------------------------------ +%\setbeameroption{show notes on second screen} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname pdfsuppresswarningpagegroup\endcsname\relax +\else + \pdfsuppresswarningpagegroup=1\relax +\fi +% Change color for cite locally +\newcommand{\colorcite}[3]{{\hypersetup{citecolor=#1}{\cite[#2]{#3}}}} +% ------------------------------------------------ +% ================================================ +% The main document +% ------------------------------------------------ +\begin{document} +% Title page +\begin{frame}[t,titleimage]{-} +\titlepage% +\end{frame} + +% Introduction +\begin{frame}[fragile, t]{Definitionen} +Sei $T$ ein TES. +\begin{enumerate} + \item Terme $s, s'$ heißen \textbf{zusammenführbar} (zf.), wenn ein q existiert, sodass $s \rightarrow^* q$ und $s' \rightarrow^* q$ + \item T heißt \textbf{konfluent} (CR), wenn für alle Terme $t, s, s'$ mit $t \rightarrow^* s, t \rightarrow^* s'$ die Terme $s, s'$ zf. sind. + \item T heißt \textbf{lokal konfluent} (WCR), wenn für alle Terme $t, s, s'$ mit $t \rightarrow s, t \rightarrow s'$ die Terme $s, s'$ zf. sind. +\end{enumerate} +\ \\\ \\ +\pause +\noindent% +\begin{minipage}[t]{0.45\textwidth} +\centering\underline{CR} +\[ + \begin{tikzcd} + & t \arrow[dl, "*" {below, near end}] \arrow[dr, "*" {below, near end}] + \\ s \arrow[dr, dashrightarrow, "*" {below, near end}] & & s' \arrow[dl, dashrightarrow, "*" {below, near end}] + \\ & q + \end{tikzcd} +\] +\end{minipage} +\hfill +\begin{minipage}[t]{0.45\textwidth} +\centering\underline{WCR} +\[ + \begin{tikzcd} + & t \arrow[dl] \arrow[dr] + \\ s \arrow[dr, dashrightarrow, "*" {below, near end}] & & s' \arrow[dl, dashrightarrow, "*" {below, near end}] + \\ & q + \end{tikzcd} +\] +\end{minipage} + +\end{frame} + +\begin{frame}[fragile, t]{Newman's Lemma und kritische Paare} +\begin{block}{Newman's Lemma} + SN $\land$ WCR $\Rightarrow$ CR +\end{block} +\pause +\begin{block}{Kritisches Paar} + Betrachte zwei Regeln $l_1 \rightarrow_0 r_1$ und $l_2 \rightarrow_0 r_2$ mit $FV(l_1) \cap FV(l_2) = \emptyset$ \\(ggf. durch Umbenennung der Variablen).\\ + Finde einen Term (\textit{nicht nur Variable!}) mit $l_1 = C(t)$, sodass $\sigma = mgu(t, l_2)$.\\ + Dann ist $(r_1\sigma, C(r_2)\sigma)$ ein kritisches Paar. +\end{block} +\pause +\begin{block}{Triviales kritisches Paar} + Ein kritisches Paar $(r_1\sigma, C(r_2)\sigma)$ heißt \textit{trivial}, wenn die Ersetzungsregeln bis auf Umbenennung gleich sind und $C(\cdot) = (\cdot)$ +\end{block} +\pause +\begin{block}{Critical Pair Lemma} + Ein Termersetzungssystem $T$ ist genau dann lokal konfluent (WCR), wenn in $T$ alle (nicht triviale) kritische Paare zf. sind. + +\end{block} + +\end{frame} + +\begin{frame}[t]{Aufgabe 1}{Kritische Paare berechnen} + Wir betrachten erneut das Termersetzungssystem aus Blatt 2, Aufgabe 1: + \begin{align} + A \cdot x &\rightarrow_0 B \cdot (C \cdot x)\\ + C \cdot (D \cdot x) &\rightarrow_0 B \cdot (C \cdot x)\\ + B \cdot (x \cdot y) &\rightarrow_0 A \cdot (D \cdot x)\\ + B \cdot (B \cdot x) &\rightarrow_0 D \cdot x + \end{align} + Bestimmen Sie nun alle kritischen Paare des Systems und geben Sie dazu jeweils die involvierten Regeln sowie den entsprechenden allgemeinsten Unifikator an. + + \pause + \begin{block}{Kritisches Paar} + Betrachte zwei Regeln $l_1 \rightarrow_0 r_1$ und $l_2 \rightarrow_0 r_2$ mit $FV(l_1) \cap FV(l_2) = \emptyset$ \\(ggf. durch Umbenennung der Variablen).\\ + Finde einen Term (\textit{nicht nur Variable!}) mit $l_1 = C(t)$, sodass $\sigma = mgu(t, l_2)$.\\ + Dann ist $(r_1\sigma, C(r_2)\sigma)$ ein kritisches Paar. + \end{block} +\end{frame} + +\begin{frame}[t]{Aufgabe 2}{Konfluenz mittels Newman's Lemma} + Wir betrachten erneut das Termersetzungssystem aus Blatt 3, Übung 1: + \begin{align} + x \odot (y \oplus z) &\rightarrow_0 (x \odot y) \oplus (x \odot z)\\ + (x \oplus y) \oplus z &\rightarrow_0 x \oplus (y \oplus z) + \end{align} + Nun möchten wir zeigen, dass es konfluent ist. Da wir bereits gezeigt haben, dass das System SN ist, genügt es nach Newman's Lemma zu zeigen, dass es \textit{lokal konfluent} ist.\\ + Ihre Aufgabe ist es also, die lokale Konfluenz des Systems zu zeigen, d.h. alle kritischen Paare des Systems zu bestimmen und anschließend für jedes Paar zu zeigen, dass es zusammengeführt werden kann. + \pause + \begin{block}{Kritisches Paar} + Betrachte zwei Regeln $l_1 \rightarrow_0 r_1$ und $l_2 \rightarrow_0 r_2$ mit $FV(l_1) \cap FV(l_2) = \emptyset$ \\(ggf. durch Umbenennung der Variablen).\\ + Finde einen Term (\textit{nicht nur Variable!}) mit $l_1 = C(t)$, sodass $\sigma = mgu(t, l_2)$.\\ + Dann ist $(r_1\sigma, C(r_2)\sigma)$ ein kritisches Paar. + \end{block} +\end{frame} + +% input exmple sections +%\input{sections/01_Intro_Landscape} +\end{document} \ No newline at end of file diff --git a/texfiles/slides05.tex b/texfiles/slides05.tex new file mode 100755 index 0000000..4b2c4d6 --- /dev/null +++ b/texfiles/slides05.tex @@ -0,0 +1,394 @@ +% .............................................................................. +% Demo of the fau-beamer template. +% +% Copyright 2022 by Tim Roith +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. +% +% ------------------------------------------------------------------------------ +\documentclass[final]{beamer} + +% ======================================================================================== +% Theme: inner, outer, font and colors +% ---------------------------------------------------------------------------------------- +\usepackage[institute=Tech, + %SecondLogo = template-art/FAUWortmarkeBlau.pdf, + %ThirdLogo = template-art/FAUWortmarkeBlau.pdf, + %WordMark=None, + aspectratio=169, + fontsize=11, + fontbaselineskip=13, + scale=1. + ]{styles/beamerthemefau} +% ---------------------------------------------------------------------------------------- +% Input and output encoding +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +% ---------------------------------------------------------------------------------------- +% Language settings +\usepackage[german]{babel} + +% ======================================================================================== +% Fonts +% - Helvet is loaded by styles/beamerfonts +% - We use serif for math environements +% - isomath is used for upGreek letters +% ---------------------------------------------------------------------------------------- +\usepackage{isomath} +\usefonttheme[onlymath]{serif} +\usepackage{exscale} +\usepackage{anyfontsize} +\setbeamercolor{alerted text}{fg=BaseColor} +% ---------------------------------------------------------------------------------------- +% custom commands for symbols +\usepackage{styles/symbols} + +\usepackage{tikz-cd} +\usetikzlibrary{cd, babel} + +% ======================================================================================== +% Setup for Titlepage +% ---------------------------------------------------------------------------------------- +\title[fau-beamer]{Theorie der Programmierung} +\subtitle{\texorpdfstring{Übung 05 - der (ungetypte) $\lambda$-Kalkül}{Übung 05 - der (ungetypte) Lambda-Kalkül}} +\author[L. Vatthauer]{ +Leon Vatthauer} +% + +% Instead of \institute you can also use the \thanks command +% ------------------------------------------------ +%\author[T. Roith]{ +%Tim Roith\thanks{Friedrich-Alexander Universität Erlangen-Nürnberg, Department Mathematik}\and% +%Second Author\thanks{Second Insitute}\and% +%Third Author\thanks{Third Insitute}% +%} + +\date{\today} + + +% ================================================ +% Bibliography +% ------------------------------------------------ +\usepackage{csquotes} +\usepackage[style=alphabetic, %alternatively: numeric, numeric-comp, and other from biblatex + defernumbers=true, + useprefix=true,% + giveninits=true,% + hyperref=true,% + autocite=inline,% + maxcitenames=5,% + maxbibnames=20,% + uniquename=init,% + sortcites=true,% sort citations when multiple entries are passed to one cite command + doi=true,% + isbn=false,% + url=false,% + eprint=false,% + backend=biber% + ]{biblatex} +\addbibresource{bibliography.bib} +\setbeamertemplate{bibliography item}[text] +\babeltags{en=english} + +% ================================================ +% Hyperref and setup +% ------------------------------------------------ +\usepackage{hyperref} +\hypersetup{ + colorlinks = true, + final=true, + plainpages=false, + pdfstartview=FitV, + pdftoolbar=true, + pdfmenubar=true, + pdfencoding=auto, + psdextra, + bookmarksopen=true, + bookmarksnumbered=true, + breaklinks=true, + linktocpage=true, + urlcolor=BaseColor, + citecolor=BaseColor, + linkcolor=BaseColor, + unicode = true +} + +% ================================================ +% Additional packages +% ------------------------------------------------ + + +% ================================================ +% Various custom commands +% ------------------------------------------------ +%\setbeameroption{show notes on second screen} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname pdfsuppresswarningpagegroup\endcsname\relax +\else + \pdfsuppresswarningpagegroup=1\relax +\fi +% Change color for cite locally +\newcommand{\colorcite}[3]{{\hypersetup{citecolor=#1}{\cite[#2]{#3}}}} +% ------------------------------------------------ +% ================================================ +% The main document +% ------------------------------------------------ +\begin{document} +% Title page +\begin{frame}[t,titleimage]{-} +\titlepage% +\end{frame} + +\newcommand{\isaeq}{=_\alpha^?} +\newcommand{\isbr}{\rightarrow_\beta^?} + +\newcommand{\betared}{\rightarrow_\beta} +\newcommand{\alphaeq}{=_\alpha} +\newcommand{\deltared}{\rightarrow_\delta} +\newcommand{\etared}{\rightarrow_\eta} +\newcommand{\betadeltared}{\rightarrow_{\beta\delta}^*} + +\newcommand{\ceil}[1]{\lceil {#1} \rceil} + +\newcommand{\definitionAlphaEq}{ + \begin{block}{$\alpha$-Äquivalenz} + Zwei Terme $t_1, t_2$ heißen $\alpha$-Äquivalent, wenn sie durch Umbenennung gebundener Variablen auseinander hervorgehen. Formal: + $$\lambda x.t \alphaeq \lambda y.t[y / x]\quad\text{wenn } y \not\in FV(t)$$ + \end{block} +} + +\newcommand{\definitionBetaReduction}{ + \begin{block}{$\beta$-Reduktion} + Die $\beta$-Reduktion modelliert das Ausrechnen einer Funktionsanwendung, z.B: $(\lambda x.3 + x)\; 5 \betared 3 + 5$ + + Die Einschrittreduktion $\betared$ ist: + $$C((\lambda x.t)\;s) \rightarrow_\beta C(t[s / x])$$ + \end{block} +} +\newcommand{\churchnumerals}{ + \begin{block}{Church-Numerale} + \begin{equation*}\ceil{n} := \lambda f\;a.\underbrace{f(f(f(\ldots f}_n\; a)))\tag{1}\end{equation*} + \noindent + \begin{minipage}{0.45\textwidth} + \begin{align*} + &zero = \lambda f\;a.a\\ + &succ\;n = \lambda f\;a.f\;(n\;f\;a) + \end{align*} + \end{minipage} + \begin{minipage}{0.45\textwidth} + \begin{alignat*}{2} + &one &&= succ\;zero\\ + &two &&= succ\;one\\ + &three &&= succ\;two\\ + &four &&= succ\;three + \end{alignat*} + \end{minipage} + \end{block} +} + +\AtBeginSection{} + +% Introduction +\section{Der (ungetypte) Lambda-Kalkül} +\subsection{Terme und Konventionen} +\begin{frame}[t]{Der (ungetypte) $\lambda$-Kalkül}{Terme und Konventionen} + \begin{block}{$\lambda$-Terme} + $$t ::= x\;\vert\;t_1t_2\;\vert\;\lambda x.t \quad\quad (x \in V)$$ + \end{block} + \pause + \begin{block}{Konventionen} + \begin{itemize} + \item Applikation ist \textit{links-assoziativ}: \quad $x\;y\;z = (x\;y)\;z$ + \item Abstraktion reicht so weit wie möglich (Vgl. Quantoren in GLoIn) + \item Aufeinanderfolgende Abstraktionen werden zusammengefasst: \quad $\lambda x. \lambda y. \lambda z. y\; x = \lambda x\;y\;z.y\;x$ + \end{itemize} + \end{block} +\end{frame} +\subsection{Freie Variablen und Substitution} +\begin{frame}[t]{Der (ungetypte) $\lambda$-Kalkül}{Freie Variablen und Substitution} + \begin{block}{Freie Variablen} + Sei $t$ ein $\lambda$-Term, $FV(t)$ ist dann definiert durch: + \begin{alignat*}{2} + &FV(x) &&= \{x\} \quad (\text{für } x \in V)\\ + &FV(t\;s) &&= FV(t) \cup FV(s)\\ + &FV(\lambda x.t) &&= FV(t) \setminus \{x\} + \end{alignat*} + \end{block} + \pause + \begin{block}{Substitution} + + Eine Substitution ist eine Abbildung $\sigma : V_0 \rightarrow T(V)$, wobei $V_0 \subseteq V$ (\textit{endliche} Teilmenge). + + Die Anwendung einer Substitution auf $\lambda$-Terme ist ebenfalls rekursiv definiert: + \begin{alignat*}{2} + &x\sigma &&= \sigma (x)\\ + &(t\;s)\sigma &&= (t\sigma)\;(s\sigma)\\ + &(\lambda x.t)\sigma &&= \lambda y.(t\sigma') + \end{alignat*} + \centering mit $y$ frisch, also $y \not\in FV(\sigma(z))$ für alle $z \in FV(\lambda x.t)$ und $\sigma' = \sigma [x \mapsto y]$ + \end{block} +\end{frame} +\subsection{Alpha-Äquivalenz und Beta-Reduktion} +\begin{frame}[t]{Der (ungetypte) $\lambda$-Kalkül}{$\alpha$-Äquivalenz und $\beta$-Reduktion} + \definitionAlphaEq + \pause + \definitionBetaReduction +\end{frame} + +\section{Aufgabe 1 - Alpha-Äquivalenz und Beta-Reduktion} + +\begin{frame}[t]{Aufgabe 1.1}{$\alpha$-Äquivalenz und $\beta$-Reduktion} +Entscheiden Sie für jedes der folgenden Paare von $\lambda$-Termen, ob die Terme jeweils $\alpha$-Äquivalent zueinander sind: +\begin{itemize} + \item[(a)] $\lambda x\;y.x\;y \isaeq \lambda u\;v.u\;v$ + \item[(b)] $\lambda x\;y.x\;y \isaeq \lambda u\;v.v\;u$ + \item[(c)] $(\lambda x.x\;x)(\lambda y.y\;y) \isaeq (\lambda x.x\;x)(\lambda x.x\;x)$ +\end{itemize} + +\vfill + +\definitionAlphaEq + +\end{frame} + +\begin{frame}[t]{Aufgabe 1.2}{$\alpha$-Äquivalenz und $\beta$-Reduktion} +Entscheiden Sie in jedem der folgenden Fälle, ob der jeweilige Reduktionsschritt eine zulässige $\beta$-Reduktion darstellt: +\begin{itemize} + \item[(a)] $(\lambda x\;y\;z.x\;y\;z)(\lambda y.y\;y) \isbr \lambda y\;z.(\lambda y.y\;y)\;y\;z$ + \item[(b)] $(\lambda x\;y\;z.x\;y\;z)(y\;y) \isbr \lambda y\;z.(y\;y)\;y\;z$ + \item[(c)] $(\lambda x\;y\;z.x\;y\;z)(y\;y) \isbr \lambda y\;z.(u\;u)\;y\;z$ + \item[(d)] $(\lambda x\;y\;z.x\;y\;((\lambda u.u\;x) (y\;y)))\;u\;v \isbr (\lambda x\;y\;z.x\;y\;((y\;y)\;x))\;u\;v$ +\end{itemize} + +\vfill + +\definitionBetaReduction + +\end{frame} +\section{Aufgabe 2 - \foreignlanguage{english}{We Are Not Anonymous (Functions)}} +\begin{frame}[t]{Aufgabe 2}{\foreignlanguage{english}{We Are Not Anonymous (Functions)}} + +Funktionale Programmiersprachen wie zum Beispiel Haskell oder ML erweitern den $\lambda$-Kalkül um verschiedene Konstrukte. +Insbesondere werden \textit{Definitionen} verwendet, um Funktionen zu benennen. Beispielsweise können wir die folgenden drei Gleichungen angeben: + +\begin{center} + $flip = \lambda f\;x\;y.f\;y\;x$ \quad\quad $const = \lambda x\;y.x$ \quad\quad $twice = \lambda f\;x.f\;(f\;x)$ +\end{center} +und sie als - von links nach rechts zu lesende - Reduktionsregeln betrachten, die bei der Auswertung eines $\lambda$-Terms angewendet werden können. +Um sie von $\beta$-Reduktionen zu unterscheiden, werden solche Reduktionen als $\delta$-Reduktionen bezeichnet. +Beispielsweise ist mit den obigen Definitionen die folgende Reduktion möglich: +$$(\lambda f.f\;u)\; const \rightarrow_\beta const\;u \rightarrow_\delta (\lambda x\;y.x)\;u \rightarrow_\beta \lambda y.u$$ +\textbf{Hinweis:}\quad Eine derartige Reduktion, bei der sowohl $\beta$- als auch $\delta$-Schritte vorkommen können, bezeichnen wir ab sofort als $\beta\delta$-Reduktion. + +\end{frame} + +\begin{frame}[t]{Aufgabe 2.1}{\foreignlanguage{english}{We Are Not Anonymous (Functions)}} + Ermitteln Sie die $\beta\delta$-Normalformen der folgenden Terme: + \begin{itemize} + \item[(a)] $flip\;const\;twice$ + \item[(b)] $twice\;flip$ + \end{itemize} + + + \vfill + + + \definitionBetaReduction + + \begin{block}{$\delta$-Reduktion} + \begin{align*} + &flip = \lambda f\;x\;y.f\;y\;x\\ + &const = \lambda x\;y.x\\ + &twice = \lambda f\;x.f\;(f\;x) + \end{align*} + + Beispiel: $(\lambda f.f\;u)\; const \rightarrow_\beta const\;u \rightarrow_\delta (\lambda x\;y.x)\;u \rightarrow_\beta \lambda y.u$ + \end{block} +\end{frame} + +\begin{frame}[t]{Aufgabe 2.2}{\foreignlanguage{english}{We Are Not Anonymous (Functions)}} + + Tatsächlich ist es in den angegebenen Programmiersprachen praktischerweise auch möglich, + Funktionsargumente auf der linken Seite einer Funktionsdefinition anzugeben. + Die obigen Definitionen würden dann beispielsweise wie folgt geschrieben werden: + \begin{alignat*}{2} + &flip\;f &&= \lambda x\;y. f\;y\;x\\ + &const\;x\;y &&= x\\ + &twice\;f\;x &&= f\;(f\;x) + \end{alignat*} + + Die mit diesen Definitionen verbundenen Reduktionsregeln sind nun nicht mehr offensichtlich; + deshalb verwenden wir Großbuchstaben $F, X, Y$, um Variablen, die in einem Term vorkommen, + von Variablen, die durch eine Abstraktion gebunden werden können, zu unterscheiden. + Außerdem verwenden wir zur Verdeutlichung explizite Klammerung: + \begin{alignat*}{2} + &flip\;F &&\rightarrow_\delta (\lambda x\;y.f\;y\;x)[F/x]\\ + &(const\;X)\;Y &&\rightarrow_\delta x[X/x, Y/y]\\ + &(twice\;F)\;X &&\rightarrow_\delta (f\;(f\;x))[X/x, F/f] + \end{alignat*} +\end{frame} + +\begin{frame}[t]{Aufgabe 2.2}{\foreignlanguage{english}{We Are Not Anonymous (Functions)}} + Entscheiden Sie, welche der folgenden $\lambda$-Terme bezüglich dieser neuen Definitionen $\beta\delta$-Normalformen sind: + \begin{itemize} + \item[(a)] $\lambda x.flip\;x$ + \item[(b)] $\lambda x.const\;x$ + \item[(c)] $const\;flip\;twice$ + \end{itemize} + \vfill + \begin{block}{Neue $\delta$-Reduktion} + \begin{alignat*}{2} + &flip\;F &&\rightarrow_\delta (\lambda x\;y.f\;y\;x)[F/x]\\ + &(const\;X)\;Y &&\rightarrow_\delta x[X/x, Y/y]\\ + &(twice\;F)\;X &&\rightarrow_\delta (f\;(f\;x))[X/x, F/f] + \end{alignat*} + \end{block} +\end{frame} + +\begin{frame}[t]{Aufgabe 3}{Church-Numerale} + +Funktionale Sprachen fügen weiterhin \textit{eingebaute} Typen (\foreignlanguage{english}{\textit{built-in types}}) zum $\lambda$-Kalkül hinzu und erlauben auch die Definition von benutzerdefinierten Typen (\textit{\texten{user-defined types}}). +Diese Typen können jedoch prinzipiell allesamt unter Einsatz der sogenannten \textit{Church-Kodierung} direkt als $\lambda$-Terme kodiert werden. +\\\;\\ +Eine natürliche Zahl $n$ wird durch einen $\lambda$-Term $\ceil{n}$ kodiert, der eine gegebene Funktion $f$ wiederholt $n$-mal auf einen Startwert $a$ anwendet, was wir informell als $n$ „Iterationen“ von $f$ startend bei $a$ ansehen können: +\begin{equation*}\ceil{n} := \lambda f\;a.\underbrace{f(f(f(\ldots f}_n\; a)))\tag{1}\end{equation*} + +Wir kodieren dies einheitlich wie folgt: + +\noindent +\begin{minipage}{0.45\textwidth} + \begin{align*} + &zero = \lambda f\;a.a\\ + &succ\;n = \lambda f\;a.f\;(n\;f\;a) + \end{align*} +\end{minipage} +\begin{minipage}{0.45\textwidth} + \begin{alignat*}{2} + &one &&= succ\;zero\\ + &two &&= succ\;one\\ + &three &&= succ\;two\\ + &four &&= succ\;three + \end{alignat*} +\end{minipage} +\end{frame} +\section{Aufgabe 3 - Church-Numerale} +\begin{frame}[t]{Aufgabe 3.1}{Church-Numerale} + Zeigen Sie, dass für jede natürliche Zahl $n$ gilt: $succ\; \ceil{n} \betadeltared \ceil{n + 1}$ + + \vfill + \churchnumerals +\end{frame} + +\begin{frame}[t]{Aufgabe 3.2}{Church-Numerale} + Definieren Sie die Addition und Multiplikation natürlicher Zahlen bezüglich dieser Kodierung. Vervollständigen Sie also die folgenden Definitionen: + $$add \;n \;m = \ldots \quad\quad\quad\quad\quad mult\; n\; m = \ldots$$ + derart, dass für alle $x$ und $y$ gilt: + $$add\;\ceil{x}\;\ceil{y} \betadeltared \ceil{x + y}\quad\quad\quad\quad\quad mult\;\ceil{x}\;\ceil{y} \betadeltared \ceil{x \cdot y}$$ + \vfill + \churchnumerals +\end{frame} + +% input exmple sections +%\input{sections/01_Intro_Landscape} +\end{document} \ No newline at end of file diff --git a/texfiles/slides07.tex b/texfiles/slides07.tex new file mode 100755 index 0000000..0626421 --- /dev/null +++ b/texfiles/slides07.tex @@ -0,0 +1,249 @@ +% .............................................................................. +% Demo of the fau-beamer template. +% +% Copyright 2022 by Tim Roith +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. +% +% ------------------------------------------------------------------------------ +\documentclass[final]{beamer} + +% ======================================================================================== +% Theme: inner, outer, font and colors +% ---------------------------------------------------------------------------------------- +\usepackage[institute=Tech, + %SecondLogo = template-art/FAUWortmarkeBlau.pdf, + %ThirdLogo = template-art/FAUWortmarkeBlau.pdf, + %WordMark=None, + aspectratio=169, + fontsize=11, + fontbaselineskip=13, + scale=1. + ]{styles/beamerthemefau} +% ---------------------------------------------------------------------------------------- +% Input and output encoding +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +% ---------------------------------------------------------------------------------------- +% Language settings +\usepackage[german]{babel} + +% ======================================================================================== +% Fonts +% - Helvet is loaded by styles/beamerfonts +% - We use serif for math environements +% - isomath is used for upGreek letters +% ---------------------------------------------------------------------------------------- +\usepackage{isomath} +\usefonttheme[onlymath]{serif} +\usepackage{exscale} +\usepackage{anyfontsize} +\setbeamercolor{alerted text}{fg=BaseColor} +% ---------------------------------------------------------------------------------------- +% custom commands for symbols +\usepackage{styles/symbols} + +\usepackage{tikz-cd} +\usetikzlibrary{cd, babel} + +% ======================================================================================== +% Setup for Titlepage +% ---------------------------------------------------------------------------------------- +\title[fau-beamer]{Theorie der Programmierung} +\subtitle{\texorpdfstring{Übung 07 - Rekursion und der einfach getypte $\lambda$-Kalkül}{Übung 05 - Rekursion und der einfach getypte Lambda-Kalkül}} +\author[L. Vatthauer]{ +Leon Vatthauer} +% + +% Instead of \institute you can also use the \thanks command +% ------------------------------------------------ +%\author[T. Roith]{ +%Tim Roith\thanks{Friedrich-Alexander Universität Erlangen-Nürnberg, Department Mathematik}\and% +%Second Author\thanks{Second Insitute}\and% +%Third Author\thanks{Third Insitute}% +%} + +\date{\today} + + +% ================================================ +% Bibliography +% ------------------------------------------------ +\usepackage{csquotes} +\usepackage[style=alphabetic, %alternatively: numeric, numeric-comp, and other from biblatex + defernumbers=true, + useprefix=true,% + giveninits=true,% + hyperref=true,% + autocite=inline,% + maxcitenames=5,% + maxbibnames=20,% + uniquename=init,% + sortcites=true,% sort citations when multiple entries are passed to one cite command + doi=true,% + isbn=false,% + url=false,% + eprint=false,% + backend=biber% + ]{biblatex} +\addbibresource{bibliography.bib} +\setbeamertemplate{bibliography item}[text] +\babeltags{en=english} + +% ================================================ +% Hyperref and setup +% ------------------------------------------------ +\usepackage{hyperref} +\hypersetup{ + colorlinks = true, + final=true, + plainpages=false, + pdfstartview=FitV, + pdftoolbar=true, + pdfmenubar=true, + pdfencoding=auto, + psdextra, + bookmarksopen=true, + bookmarksnumbered=true, + breaklinks=true, + linktocpage=true, + urlcolor=BaseColor, + citecolor=BaseColor, + linkcolor=BaseColor, + unicode = true +} + +% ================================================ +% Additional packages +% ------------------------------------------------ +\usepackage{listings} +\usepackage{lstautogobble} % Fix relative indenting +\usepackage{color} % Code coloring +\usepackage{zi4} % Nice font + +\definecolor{bluekeywords}{rgb}{0.13, 0.13, 1} +\definecolor{greencomments}{rgb}{0, 0.5, 0} +\definecolor{redstrings}{rgb}{0.9, 0, 0} +\definecolor{graynumbers}{rgb}{0.5, 0.5, 0.5} +\lstset{ + %autogobble, + columns=fullflexible, + showspaces=false, + showtabs=false, + breaklines=true, + showstringspaces=false, + breakatwhitespace=true, + escapeinside={(*@}{@*)}, + commentstyle=\color{greencomments}, + keywordstyle=\color{bluekeywords}, + stringstyle=\color{redstrings}, + numberstyle=\color{graynumbers}, + basicstyle=\ttfamily\normalsize, + mathescape=true, + %frame=l, + framesep=12pt, + xleftmargin=.1\textwidth,%12pt, + tabsize=4, + captionpos=b +} +% end of listings setup + +% ================================================ +% Various custom commands +% ------------------------------------------------ +%\setbeameroption{show notes on second screen} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname pdfsuppresswarningpagegroup\endcsname\relax +\else + \pdfsuppresswarningpagegroup=1\relax +\fi +% Change color for cite locally +\newcommand{\colorcite}[3]{{\hypersetup{citecolor=#1}{\cite[#2]{#3}}}} +% ------------------------------------------------ +% ================================================ +% The main document +% ------------------------------------------------ +\begin{document} +% Title page +\begin{frame}[t, titleimage]{-} +\titlepage% +\end{frame} + +\newcommand{\isaeq}{=_\alpha^?} +\newcommand{\isbr}{\rightarrow_\beta^?} + +\newcommand{\betared}{\rightarrow_\beta} +\newcommand{\alphaeq}{=_\alpha} +\newcommand{\deltared}{\rightarrow_\delta} +\newcommand{\etared}{\rightarrow_\eta} +\newcommand{\betadeltared}{\rightarrow_{\beta\delta}^*} + +\newcommand{\ceil}[1]{\lceil {#1} \rceil} + +\newcommand{\definitionAlphaEq}{ + \begin{block}{$\alpha$-Äquivalenz} + Zwei Terme $t_1, t_2$ heißen $\alpha$-Äquivalent, wenn sie durch Umbenennung gebundener Variablen auseinander hervorgehen. Formal: + $$\lambda x.t \alphaeq \lambda y.t[y / x]\quad\text{wenn } y \not\in FV(t)$$ + \end{block} +} + +\newcommand{\definitionBetaReduction}{ + \begin{block}{$\beta$-Reduktion} + Die $\beta$-Reduktion modelliert das Ausrechnen einer Funktionsanwendung, z.B: $(\lambda x.3 + x)\; 5 \betared 3 + 5$ + + Die Einschrittreduktion $\betared$ ist: + $$C((\lambda x.t)\;s) \rightarrow_\beta C(t[s / x])$$ + \end{block} +} +\newcommand{\churchnumerals}{ + \begin{block}{Church-Numerale} + \begin{equation*}\ceil{n} := \lambda f\;a.\underbrace{f(f(f(\ldots f}_n\; a)))\tag{1}\end{equation*} + \noindent + \begin{minipage}{0.45\textwidth} + \begin{align*} + &zero = \lambda f\;a.a\\ + &succ\;n = \lambda f\;a.f\;(n\;f\;a) + \end{align*} + \end{minipage} + \begin{minipage}{0.45\textwidth} + \begin{alignat*}{2} + &one &&= succ\;zero\\ + &two &&= succ\;one\\ + &three &&= succ\;two\\ + &four &&= succ\;three + \end{alignat*} + \end{minipage} + \end{block} +} + +\AtBeginSection{} + +% Introduction +\section{Aufgabe 1 - Rekursive Definitionen II} +\begin{frame}[t, fragile]{Aufgabe 1}{Rekursive Definitionen II} + + Wir erinnern uns an die rekursiv definierte Fakultätsfunktion vom letzten Blatt: + \begin{lstlisting}[language=haskell] + fact n = if n $\leq$ $\ceil{\texttt{1}}$ then $\ceil{\texttt{1}}$ else n * (fact (n - $\ceil{\texttt{1}}$)) + \end{lstlisting} + Wir wollen zeigen, dass \texttt{fact} tatsächlich eine korrekte Implementierung der Fakultätsfunktion ist, genauer, dass $fact \ceil{n} \betadeltared \ceil{n!}$ für jede natürliche Zahl $n$. + \\\;\\ + \begin{enumerate} + \item Bevor wir mit dem Beweis beginnen können, benötigen wir zunächst entsprechende Aussagen über die in obiger Definition von \texttt{fact} verwendeten Funktionen und Operationen. + Zum Beispiel benötigen wir, dass $\ceil{n} * \ceil{m} \betadeltared \ceil{n * m}$ für alle $n, m \in \mathbb{N}$. Ergänzen Sie die Aussagen für die restlichen Operationen. + Wir werden diese im Folgenden ohne gesonderten Beweis verwenden. + \\\;\\ + \pause + \item Beweisen Sie nun per Induktion, dass $fact \ceil{n} \betadeltared \ceil{n!}$ für alle $n \in \mathbb{N}$. Kennzeichnen Sie dabei, an welchen Stellen die Eigenschaften aus Teilaufgabe 1 einfließen. + \end{enumerate} +\end{frame} + +\section{Der einfach getypte Lambda-Kalkül} +\begin{frame}[t]{Der einfach getypte $\lambda$-Kalkül} + +\end{frame} + +% input exmple sections +%\input{sections/01_Intro_Landscape} +\end{document} \ No newline at end of file