\documentclass[noanswers,addpoints,10pt]{exam}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[most]{tcolorbox}
\usepackage{datetime}
\usepackage{enumerate}
\usepackage{enumitem}
\usepackage{xltxtra}
\usepackage{listings}

\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{makecell}
\usepackage{multicol}
\usepackage{multirow}

\usepackage{tabularx}
\usepackage{textcomp}
\usepackage{tikz}
\usetikzlibrary{arrows,automata,decorations.pathmorphing,backgrounds,positioning,fit}
\usepackage{pgf-umlcd}

% compact itemized and then enumerated
\setlist{leftmargin=*,
  noitemsep,
  topsep=5pt,
  parsep=0pt,
  partopsep=0pt,
}

\setlist[enumerate]{leftmargin=*,
  itemsep=2pt,
  topsep=0pt,
  parsep=0pt,
  partopsep=0pt,
}


\usepackage{fontspec}
\setmainfont{Gentium Basic}
\setmonofont{Comic Code}[
  Scale          = 0.80,
  UprightFont    = *-Regular,
  ItalicFont     = *-Italic,
  BoldFont       = *-Bold,
  BoldItalicFont = *-Bold Italic
]

\lstset{
  basicstyle=\ttfamily,
}

\DeclareMathOperator{\limplies}{\Rightarrow}
\DeclareMathOperator{\liff}{\iff}
\DeclareMathOperator{\lxor}{\oplus}
\DeclareMathOperator{\qeq}{\overset{?}{=}}
\DeclareMathOperator{\modulus}{\mathbf{mod}}
\DeclareMathOperator{\even}{even}
\DeclareMathOperator{\odd}{odd}
\DeclareMathOperator{\ddiv}{|}
\DeclareMathOperator{\ndiv}{\not|}
\DeclareMathOperator{\contra}{\Rightarrow\mskip-\thinmuskip\Leftarrow}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\renewcommand{\P}[1]{\mathbb{P}(#1)}

\DeclareMathOperator{\vowel}{vowel}
\DeclareMathOperator{\consonant}{consonant}
\DeclareMathOperator{\isprime}{prime}
\DeclareMathOperator{\equals}{equals}
\DeclareMathOperator{\divides}{divides}

% classname
\newcommand\examNumber{gLogic}
\newcommand\semester{Spring 2024}
\newcommand\className{Foundations of Computer Science}
\newcommand\classNumber{CIS~300}
\newcommand\classFullName{\classNumber~\className}
\renewcommand{\dateseparator}{-}
\yyyymmdddate

% /classname

\pagestyle{headandfoot}
\firstpageheader{\classFullName\\\semester}{\examNumber\\~}{\today\\~}
\runningheader{\examNumber}{}{\today}


\title{\examNumber}


\newenvironment{showExample}[1]{
  \begingroup
  \renewcommand{\solutiontitle}{\noindent\textbf{Example:}\enspace}
  \printanswers
  \begin{solution}[#1]
  }{
  \end{solution}
  \endgroup
}

\begin{document}

\section*{Introduction}
Students will work in groups using propositional logic, truth tables,
and logic operations.

\section*{Assignment Goals}
\begin{itemize}
\item Prerequisite Knowledge
  \begin{itemize}
  \item Know what a \emph{proposition} and a \emph{predicate} are.
  \item Knowledge of \emph{truth tables}
  \end{itemize}
\item Learning Outcomes
  \begin{itemize}
  \item Show logical equivalence by showing two columns of a truth table
    are the same.
  \item Prove deMorgan's Law and distributive rule for logic operations.
  \end{itemize}
\end{itemize}

\section*{Procedure}

\textbf{Get out paper.} The group will turn in \emph{one}
document. Place all the names of group members attending atop the
page.

\noindent
\textbf{Copy each question before the answer.} This makes the answer
sheet a worthwhile study guide w/o the worksheet. The answers written
down should be \emph{discussed} by the group and represent the
\emph{consensus} of the group. Sometimes a \emph{picture}, a
\emph{graph}, or something similar is the most appropriate way to
answer a question.

\noindent
\textbf{Assign Roles.} Students should take roles they
have not held recently (or, perhaps, ever):

\begin{description}
\item[Manager] Move discussion forward.
\item[Reflector] Monitor that everyone gets heard and is caught
  up. (This is a \textbf{group} obligation, really.)
\item[Recorder] Writes the report.
\end{description}

\noindent
\textbf{Answer these questions.}

\begin{questions}
\question{} Expand $\sum\limits_{j=10}^{14}j \mod 6$.
\question{} Given simple propositions $a$ and $b$, explain, in English,
  the difference between $a \land b$ and $a \lor b$? When is each
  \emph{compound} proposition true? When false?

\question{} We have been practicing \emph{propositional algebra}.
  \begin{parts}
  \part{}What is the difference between a \textbf{simple} proposition
    and a \textbf{compound} proposition in a propositional logic statement?
  \part{}List the \emph{variables} in the propositional logic statement $(f
    \land w) \lxor \lnot (t \limplies m)$.
  \part{}What do the variables in a propositional algebraic statement,
    such as that above, stand for?
  \part{}List the \emph{operators} in the logic statement above.
  \part{}Describe, in English, what each of the operators in the above
    statement \emph{means}.
  \end{parts}

\question{} In propositional algebra:
  \begin{parts}
  \part{}List all of the \emph{unary} operators that we know and
    explain their meaning.
  \part{}List all of the \emph{binary} operators that we know and
    explain their meaning.
  \end{parts}

\question{} Set aside some space for a wide truth table.

  In one truth table, show the truth value of $\lnot(z \land k)$, $(z
  \lor k)$, $\lnot z \land \lnot k$, $(z \land k)$, $\lnot z \lor \lnot k$, $\lnot(z
  \lor k)$, $\lnot z \lor k$, and $z \lor \lnot k$.

\question{} Looking at the solution to the previous question, which of
  the compound propositions are \emph{logically equivalent}? How do
  you know?

\question{} Which of the compound propositions in the table above are
  logically equivalent to $z \limplies k$?

\question{} In English: what is the difference between $a \lxor b$ and
  $a \lor b$?

\question{} Dr. Ladd claims that \emph{divides}, $\ddiv$, is a
  \emph{predicate}. Do you agree with him? What is the retturn type
  (or result type, if you prefer) does $k | t$ have?

\question{} Given the \emph{predicate} $gt(a, b) ::= a > b$ ($gt$ is
  for ``greater than''). $gt$ determines if one integer parameter, $a$, is
  greater than it other integer parameter, $b$.
\begin{parts}
\part{}What is $gt(9, 7)$? $gt(-5, -178)$? $gt(1, 2)$? $gt(2^5,3^4)$?
\part{}How many \emph{parameters} does the function $gt$ take?
\part{}What is the \textbf{type} of each of the parameters (in order
  from left to right)?
\part{}Is $g(x, 17)$ a \emph{proposition}? Explain your answer.
\end{parts}
\end{questions}
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
