"EECS 1012")
": TA in Fall 2017"))))
+(define se212-f19-page
+ (static-page
+ "SE 212 Material"
+ "se212-f19/index.html"
+ `((h1 "Material from SE 212 tutorials")
+ (p "This page contains slides and other material from "
+ ,(aa "SE 212 tutorials"
+ "https://www.student.cs.uwaterloo.ca/~se212/times.html")
+ " held by me in Fall 2019. "
+ (del "If you have any questions, concerns, or suggestions "
+ "about the presented material, please email me at "
+ "bandali@uwaterloo.ca or come see me during my "
+ ,(aa "Friday office hours"
+ "https://www.student.cs.uwaterloo.ca/~se212/personnel.html")
+ "."))
+ (ul
+ (li "Tutorial 1:"
+ (ul
+ (li ,(aa "TUT 101 slides" "se212-t01-101.pdf"))
+ (li ,(aa "TUT 102 slides" "se212-t01-102.pdf"))
+ (li ,(aa "Org beamer sources" "se212-t01.org"))))
+ (li "Tutorial 2:"
+ (ul
+ (li ,(aa "Homework 2 q04d solution"
+ "se212-h02q04d-soln.grg"))))
+ (li "Tutorial 3: —")
+ (li "Tutorial 4: —")
+ (li "Tutorial 5:"
+ (ul
+ (li ,(aa "Slides" "se212-t05.pdf"))
+ (li ,(aa "Org beamer sources" "se212-t05.org"))))
+ (li "Tutorial 6: —")
+ (li "Tutorial 7: worked through questions 1–5 of Homework 7")
+ (li "Tutorial 8: —")
+ (li "Tutorial 9: —")
+ (li "Tutorial 10: worked through questions 1–10 of "
+ "Homework 10")))))
+
(site #:title "Amin Bandali"
;; TODO: uncomment after new haunt release
;; #:scheme my-scheme
contact-page
cv-page
license-page
+ se212-f19-page
(static-directory "static" "")))
+++ /dev/null
-<!doctype html>
-<html lang="en">
- <head>
- <meta charset="utf-8" />
- <meta name=viewport content="width=device-width, initial-scale=1" />
- <title>SE 212 Material | Amin Bandali</title>
- <link rel="stylesheet" href="/style.css" />
- </head>
- <body>
- <nav><a href="/">bandali.eu.org</a> / se212-f19</nav>
- <main>
- <h1>Material from SE 212 tutorials</h1>
- <p>
- This page contains slides and other material from
- <a href="https://www.student.cs.uwaterloo.ca/~se212/times.html">SE
- 212 tutorials</a> held by me in Fall 2019.
-
- If you have any questions, concerns, or suggestions about the
- presented material, please email me at bandali@uwaterloo.ca or
- come see me during my
- <a href="https://www.student.cs.uwaterloo.ca/~se212/personnel.html">Friday
- office hours</a>.
- </p>
-
- <ul>
- <li>Tutorial 1:
- <ul>
- <li>
- <a href="se212-t01-101.pdf">TUT 101 slides</a>
- </li>
- <li>
- <a href="se212-t01-102.pdf">TUT 102 slides</a>
- </li>
- <li><a href="se212-t01.org">Org beamer sources</a></li>
- </ul>
- <li>Tutorial 2:
- <ul>
- <li><a href="se212-h02q04d-soln.grg">Homework 2 q04d solution</a>
- </li>
- </ul>
- </li>
- <li>Tutorial 3: —</li>
- <li>Tutorial 4: —</li>
- <li>Tutorial 5:
- <ul>
- <li><a href="se212-t05.pdf">Slides</a></li>
- <li><a href="se212-t05.org">Org beamer sources</a></li>
- </ul>
- </li>
- <li>Tutorial 6: —</li>
- <li>Tutorial 7: worked through questions 1–5 of Homework 7.</li>
- </ul>
- </main>
- <footer>
- <p>
- Copyright © 2019 Amin Bandali.
- See <a href="/license.html">license.html</a> for license
- conditions. Please copy and share.
- </p>
- </footer>
- </body>
-</html>
+++ /dev/null
-#u abandali
-#a h02
-
-#q q04d
-
-p <=> q, p & q <=> (p | q)
-
-#check TP
-
-p <=> q <-> p & q <=> (p | q)
-
- 1) p & q <=> (p | q)
- 2) (p & q => p | q) & (p | q => p & q) by equiv
- 3) (!(p & q) | p | q) & (!(p | q) | p & q) by impl * 2
- 4) (!p | !q | p | q) & (!(p | q) | p & q) by dm
- 5) (true | !q | q) & (!(p | q) | p & q) by lem
- 6) true & (!(p | q) | p & q) by simp1
- 7) !(p | q) | p & q by simp1
- 8) !p & !q | p & q by dm
- 9) (!p & !q | p) & (!p & !q | q) by distr
-10) (!p | p) & (!q | p) & (!p | q) & (!q | q) by distr * 2
-11) true & (!q | p) & (!p | q) & true by lem * 2
-12) (!q | p) & (!p | q) by simp1 * 2
-13) (q => p) & (p => q) by impl * 2
-14) p <=> q by equiv
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-<!-- 2019-09-18 Wed 23:12 -->
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<meta name="viewport" content="width=device-width, initial-scale=1" />
-<title>Propositional Logic</title>
-<meta name="generator" content="Org mode" />
-<meta name="author" content="Amin Bandali" />
-<style type="text/css">
- <!--/*--><![CDATA[/*><!--*/
- .title { text-align: center;
- margin-bottom: .2em; }
- .subtitle { text-align: center;
- font-size: medium;
- font-weight: bold;
- margin-top:0; }
- .todo { font-family: monospace; color: red; }
- .done { font-family: monospace; color: green; }
- .priority { font-family: monospace; color: orange; }
- .tag { background-color: #eee; font-family: monospace;
- padding: 2px; font-size: 80%; font-weight: normal; }
- .timestamp { color: #bebebe; }
- .timestamp-kwd { color: #5f9ea0; }
- .org-right { margin-left: auto; margin-right: 0px; text-align: right; }
- .org-left { margin-left: 0px; margin-right: auto; text-align: left; }
- .org-center { margin-left: auto; margin-right: auto; text-align: center; }
- .underline { text-decoration: underline; }
- #postamble p, #preamble p { font-size: 90%; margin: .2em; }
- p.verse { margin-left: 3%; }
- pre {
- border: 1px solid #ccc;
- box-shadow: 3px 3px 3px #eee;
- padding: 8pt;
- font-family: monospace;
- overflow: auto;
- margin: 1.2em;
- }
- pre.src {
- position: relative;
- overflow: visible;
- padding-top: 1.2em;
- }
- pre.src:before {
- display: none;
- position: absolute;
- background-color: white;
- top: -10px;
- right: 10px;
- padding: 3px;
- border: 1px solid black;
- }
- pre.src:hover:before { display: inline;}
- /* Languages per Org manual */
- pre.src-asymptote:before { content: 'Asymptote'; }
- pre.src-awk:before { content: 'Awk'; }
- pre.src-C:before { content: 'C'; }
- /* pre.src-C++ doesn't work in CSS */
- pre.src-clojure:before { content: 'Clojure'; }
- pre.src-css:before { content: 'CSS'; }
- pre.src-D:before { content: 'D'; }
- pre.src-ditaa:before { content: 'ditaa'; }
- pre.src-dot:before { content: 'Graphviz'; }
- pre.src-calc:before { content: 'Emacs Calc'; }
- pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
- pre.src-fortran:before { content: 'Fortran'; }
- pre.src-gnuplot:before { content: 'gnuplot'; }
- pre.src-haskell:before { content: 'Haskell'; }
- pre.src-hledger:before { content: 'hledger'; }
- pre.src-java:before { content: 'Java'; }
- pre.src-js:before { content: 'Javascript'; }
- pre.src-latex:before { content: 'LaTeX'; }
- pre.src-ledger:before { content: 'Ledger'; }
- pre.src-lisp:before { content: 'Lisp'; }
- pre.src-lilypond:before { content: 'Lilypond'; }
- pre.src-lua:before { content: 'Lua'; }
- pre.src-matlab:before { content: 'MATLAB'; }
- pre.src-mscgen:before { content: 'Mscgen'; }
- pre.src-ocaml:before { content: 'Objective Caml'; }
- pre.src-octave:before { content: 'Octave'; }
- pre.src-org:before { content: 'Org mode'; }
- pre.src-oz:before { content: 'OZ'; }
- pre.src-plantuml:before { content: 'Plantuml'; }
- pre.src-processing:before { content: 'Processing.js'; }
- pre.src-python:before { content: 'Python'; }
- pre.src-R:before { content: 'R'; }
- pre.src-ruby:before { content: 'Ruby'; }
- pre.src-sass:before { content: 'Sass'; }
- pre.src-scheme:before { content: 'Scheme'; }
- pre.src-screen:before { content: 'Gnu Screen'; }
- pre.src-sed:before { content: 'Sed'; }
- pre.src-sh:before { content: 'shell'; }
- pre.src-sql:before { content: 'SQL'; }
- pre.src-sqlite:before { content: 'SQLite'; }
- /* additional languages in org.el's org-babel-load-languages alist */
- pre.src-forth:before { content: 'Forth'; }
- pre.src-io:before { content: 'IO'; }
- pre.src-J:before { content: 'J'; }
- pre.src-makefile:before { content: 'Makefile'; }
- pre.src-maxima:before { content: 'Maxima'; }
- pre.src-perl:before { content: 'Perl'; }
- pre.src-picolisp:before { content: 'Pico Lisp'; }
- pre.src-scala:before { content: 'Scala'; }
- pre.src-shell:before { content: 'Shell Script'; }
- pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
- /* additional language identifiers per "defun org-babel-execute"
- in ob-*.el */
- pre.src-cpp:before { content: 'C++'; }
- pre.src-abc:before { content: 'ABC'; }
- pre.src-coq:before { content: 'Coq'; }
- pre.src-groovy:before { content: 'Groovy'; }
- /* additional language identifiers from org-babel-shell-names in
- ob-shell.el: ob-shell is the only babel language using a lambda to put
- the execution function name together. */
- pre.src-bash:before { content: 'bash'; }
- pre.src-csh:before { content: 'csh'; }
- pre.src-ash:before { content: 'ash'; }
- pre.src-dash:before { content: 'dash'; }
- pre.src-ksh:before { content: 'ksh'; }
- pre.src-mksh:before { content: 'mksh'; }
- pre.src-posh:before { content: 'posh'; }
- /* Additional Emacs modes also supported by the LaTeX listings package */
- pre.src-ada:before { content: 'Ada'; }
- pre.src-asm:before { content: 'Assembler'; }
- pre.src-caml:before { content: 'Caml'; }
- pre.src-delphi:before { content: 'Delphi'; }
- pre.src-html:before { content: 'HTML'; }
- pre.src-idl:before { content: 'IDL'; }
- pre.src-mercury:before { content: 'Mercury'; }
- pre.src-metapost:before { content: 'MetaPost'; }
- pre.src-modula-2:before { content: 'Modula-2'; }
- pre.src-pascal:before { content: 'Pascal'; }
- pre.src-ps:before { content: 'PostScript'; }
- pre.src-prolog:before { content: 'Prolog'; }
- pre.src-simula:before { content: 'Simula'; }
- pre.src-tcl:before { content: 'tcl'; }
- pre.src-tex:before { content: 'TeX'; }
- pre.src-plain-tex:before { content: 'Plain TeX'; }
- pre.src-verilog:before { content: 'Verilog'; }
- pre.src-vhdl:before { content: 'VHDL'; }
- pre.src-xml:before { content: 'XML'; }
- pre.src-nxml:before { content: 'XML'; }
- /* add a generic configuration mode; LaTeX export needs an additional
- (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
- pre.src-conf:before { content: 'Configuration File'; }
-
- table { border-collapse:collapse; }
- caption.t-above { caption-side: top; }
- caption.t-bottom { caption-side: bottom; }
- td, th { vertical-align:top; }
- th.org-right { text-align: center; }
- th.org-left { text-align: center; }
- th.org-center { text-align: center; }
- td.org-right { text-align: right; }
- td.org-left { text-align: left; }
- td.org-center { text-align: center; }
- dt { font-weight: bold; }
- .footpara { display: inline; }
- .footdef { margin-bottom: 1em; }
- .figure { padding: 1em; }
- .figure p { text-align: center; }
- .equation-container {
- display: table;
- text-align: center;
- width: 100%;
- }
- .equation {
- vertical-align: middle;
- }
- .equation-label {
- display: table-cell;
- text-align: right;
- vertical-align: middle;
- }
- .inlinetask {
- padding: 10px;
- border: 2px solid gray;
- margin: 10px;
- background: #ffffcc;
- }
- #org-div-home-and-up
- { text-align: right; font-size: 70%; white-space: nowrap; }
- textarea { overflow-x: auto; }
- .linenr { font-size: smaller }
- .code-highlighted { background-color: #ffff00; }
- .org-info-js_info-navigation { border-style: none; }
- #org-info-js_console-label
- { font-size: 10px; font-weight: bold; white-space: nowrap; }
- .org-info-js_search-highlight
- { background-color: #ffff00; color: #000000; font-weight: bold; }
- .org-svg { width: 90%; }
- /*]]>*/-->
-</style>
-<script type="text/javascript">
-/*
-@licstart The following is the entire license notice for the
-JavaScript code in this tag.
-
-Copyright (C) 2012-2019 Free Software Foundation, Inc.
-
-The JavaScript code in this tag is free software: you can
-redistribute it and/or modify it under the terms of the GNU
-General Public License (GNU GPL) as published by the Free Software
-Foundation, either version 3 of the License, or (at your option)
-any later version. The code is distributed WITHOUT ANY WARRANTY;
-without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
-
-As additional permission under GNU GPL version 3 section 7, you
-may distribute non-source (e.g., minimized or compacted) forms of
-that code without the copy of the GNU GPL normally required by
-section 4, provided you include this license notice and a URL
-through which recipients can access the Corresponding Source.
-
-
-@licend The above is the entire license notice
-for the JavaScript code in this tag.
-*/
-<!--/*--><![CDATA[/*><!--*/
- function CodeHighlightOn(elem, id)
- {
- var target = document.getElementById(id);
- if(null != target) {
- elem.cacheClassElem = elem.className;
- elem.cacheClassTarget = target.className;
- target.className = "code-highlighted";
- elem.className = "code-highlighted";
- }
- }
- function CodeHighlightOff(elem, id)
- {
- var target = document.getElementById(id);
- if(elem.cacheClassElem)
- elem.className = elem.cacheClassElem;
- if(elem.cacheClassTarget)
- target.className = elem.cacheClassTarget;
- }
-/*]]>*///-->
-</script>
-</head>
-<body>
-<div id="content">
-<h1 class="title">Propositional Logic
-<br />
-<span class="subtitle">(SE 212 TUT 102)</span>
-</h1>
-
-<div id="outline-container-org3ca277c" class="outline-2">
-<h2 id="org3ca277c"><span class="section-number-2">1</span> Are you at the right place?</h2>
-<div class="outline-text-2" id="text-1">
-<p>
-We’re in MC 4040, for SE 212 TUT 102 (03:30-04:20W)
-</p>
-</div>
-</div>
-
-<div id="outline-container-orgc50c656" class="outline-2">
-<h2 id="orgc50c656"><span class="section-number-2">2</span> </h2>
-<div class="outline-text-2" id="text-2">
-<div class="org-center">
-<p>
-George
-</p>
-</div>
-</div>
-</div>
-
-<div id="outline-container-orgc4929c6" class="outline-2">
-<h2 id="orgc4929c6"><span class="section-number-2">3</span> </h2>
-<div class="outline-text-2" id="text-3">
-
-<div class="figure">
-<p><img src="./george.png" alt="george.png" />
-</p>
-</div>
-
-<p>
-<a href="https://www.student.cs.uwaterloo.ca/~se212/george/ask-george/">https://www.student.cs.uwaterloo.ca/~se212/george/ask-george/</a>
-</p>
-</div>
-</div>
-
-<div id="outline-container-org67896df" class="outline-2">
-<h2 id="org67896df"><span class="section-number-2">4</span> Tool support</h2>
-<div class="outline-text-2" id="text-4">
-<p>
-Over the years, students have developed a number of tools for using
-George and/or editing <code>.grg</code> files, such as plugins for Vim and Atom.
-</p>
-
-<p>
-Check them out at
-</p>
-
-<div class="org-center">
-<p>
-Course website → George User Manual → Contributions
-</p>
-</div>
-</div>
-</div>
-
-<div id="outline-container-org88ee3fd" class="outline-2">
-<h2 id="org88ee3fd"><span class="section-number-2">5</span> George mode for Emacs (new!)</h2>
-<div class="outline-text-2" id="text-5">
-<ul class="org-ul">
-<li>Syntax highlighting + a number of convenience functions</li>
-<li>Grab it from <a href="https://git.sr.ht/~bandali/george-mode">https://git.sr.ht/~bandali/george-mode</a> <br />
-(soon on Contributions page)</li>
-</ul>
-</div>
-</div>
-
-<div id="outline-container-org0ba02d1" class="outline-2">
-<h2 id="org0ba02d1"><span class="section-number-2">6</span> <code>a00q01.grg</code> (demo)</h2>
-<div class="outline-text-2" id="text-6">
-<p>
-Walk through answering <code>a00q01.grg</code> and submitting on MarkUs
-</p>
-</div>
-</div>
-
-<div id="outline-container-orgb863070" class="outline-2">
-<h2 id="orgb863070"><span class="section-number-2">7</span> Homework 1</h2>
-<div class="outline-text-2" id="text-7">
-<ul class="org-ul">
-<li>Let’s do a couple of questions from Homework 1</li>
-<li>Now you try the rest, let me know if you have any questions</li>
-</ul>
-</div>
-</div>
-</div>
-<div id="postamble" class="status">
-<p class="date">Date: Wed Sep 11, 2019</p>
-<p class="author">Author: Amin Bandali</p>
-<p class="email">Email: <a href="mailto:bandali@uwaterloo.ca">bandali@uwaterloo.ca</a></p>
-<p class="date">Created: 2019-09-18 Wed 23:12</p>
-<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
-</div>
-</body>
-</html>
+++ /dev/null
-#+macro: topic Propositional Logic
-
-#+macro: room MC 4040
-#+macro: sec1 SE 212 TUT 101
-#+macro: sec2 SE 212 TUT 102
-#+macro: time1 02:30-03:20W
-#+macro: time2 03:30-04:20W
-
-#+macro: sec {{{sec2}}}
-#+macro: sectime {{{time2}}}
-
-#+title: {{{topic}}}
-#+subtitle: ({{{sec}}})
-#+author: Amin Bandali
-#+email: bandali@uwaterloo.ca
-#+date: Wed Sep 11, 2019
-#+language: en
-#+options: email:t num:t toc:nil \n:nil ::t |:t ^:t -:t f:t *:t <:t
-#+options: tex:t d:nil todo:t pri:nil tags:not-in-toc
-#+select_tags: export
-#+exclude_tags: noexport
-#+startup: beamer
-#+latex_class: beamer
-# #+latex_class_options: [bigger]
-#+latex_header: \setbeamercovered{transparent}
-#+latex: \setbeamertemplate{itemize items}[circle]
-#+beamer_color_theme: beaver
-
-* Are you at the right place?
-
-We’re in {{{room}}}, for {{{sec}}} ({{{sectime}}})
-
-*
-
-#+latex: \definecolor{darkred}{rgb}{0.8,0,0}
-#+latex: {\Large \color{darkred}
-#+begin_center
-George
-#+end_center
-#+latex: }
-
-*
-
-#+latex: \vspace{-2.5em}
-file:./george.png
-
-#+latex: {\footnotesize
-https://www.student.cs.uwaterloo.ca/~se212/george/ask-george/
-#+latex: }
-
-* Tool support
-
-Over the years, students have developed a number of tools for using
-George and/or editing =.grg= files, such as plugins for Vim and Atom.
-
-Check them out at
-
-#+begin_center
-Course website → George User Manual → Contributions
-#+end_center
-
-* George mode for Emacs (new!)
-
-- Syntax highlighting + a number of convenience functions
-- Grab it from https://git.sr.ht/~bandali/george-mode \\
- (soon on Contributions page)
-
-* =a00q01.grg= (demo)
-
-Walk through answering =a00q01.grg= and submitting on MarkUs
-
-* Homework 1
-:PROPERTIES:
-:BEAMER_act: [<+->]
-:END:
-
-- Let’s do a couple of questions from Homework 1
-- Now you try the rest, let me know if you have any questions
+++ /dev/null
-#+title: Predicate Logic
-#+subtitle: (SE 212 Tutorial 5)
-#+author: Amin Bandali
-#+email: bandali@uwaterloo.ca
-#+date: Wed Oct 9, 2019
-#+language: en
-#+options: email:t num:t toc:nil \n:nil ::t |:t ^:t -:t f:t *:t <:t
-#+options: tex:t d:nil todo:t pri:nil tags:not-in-toc
-#+select_tags: export
-#+exclude_tags: noexport
-#+startup: beamer
-#+latex_class: beamer
-# #+latex_class_options: [bigger]
-#+latex_header: \setbeamercovered{transparent}
-#+latex: \setbeamertemplate{itemize items}[circle]
-#+beamer_color_theme: beaver
-
-* Today’s plan
-:PROPERTIES:
-:BEAMER_act: [<+->]
-:END:
-
-- do some semantics questions from homework 4
-- do some ND questions from homework 5
-
-* =h04q05=
-
-Provide a counterexample to show that the following argument is not
-valid and demonstrate that your answer is correct.
-
-#+begin_example
-forall y : M . exists x : N . p(g(x), y)
-|=
-exists z : M . p(z, z)
-#+end_example
-
-* =h04q05= \small{(cont’d)}
-
-#+begin_example
-Domain:
- M = {m1, m2}
- N = {n1, n2}
-
-Mapping:
- Syntax | Meaning
- --------------------------
- g(.) | G(n1) := m1
- | G(n2) := m2
- --------------------------
- p(., .) | P(m1, m1) := F
- | P(m1, m2) := T
- | P(m2, m1) := T
- | P(m2, m2) := F
-#+end_example
-
-* =h04q05= \small{(cont’d)}
-
-#+begin_example
-Premise:
- [forall y : M . exists x : N . p(g(x), y)]
- = [exists x: N. p(g(x), ^m1)] AND
- [exists x: N . p(g(x), ^m2)]
- = (P(G(n1), m1) OR P(G(n2), m1)) AND
- (P(G(n1), m2) OR P(G(n2), m2))
- = (P(m1, m1) OR P(m2, m1)) AND
- (P(m1, m2) OR P(m2, m2))
- = (F OR T) AND (T OR F)
- = T
-#+end_example
-
-* =h04q05= \small{(cont’d)}
-
-#+begin_example
-Conclusion:
- [exists z: M . p(z, z)]
- = P(m1, m1) OR P(m2, m2)
- = F OR F
- = F
-#+end_example
-
-* =h04q06=
-
-Express the following sentences in predicate logic. Use types in your
-formalization. Is the set of formulas consistent? Demonstrate that
-your answer is correct using the semantics of predicate logic.
-
-#+begin_example
-All programmer like some computers.
-Some programmers use MAC.
-Therefore, some people who like some computers use MAC.
-#+end_example
-
-* =h04q06= \small{(cont’d)}
-
-All programmer like some computers.\\
-Some programmers use MAC.\\
-Therefore, some people who like some computers use MAC.
-
-#+begin_example
-Formalization:
- programmer(x) means x is a programmer
- usesmac(x) means x uses MAC
- likes(x, y) means x likes y
-
-forall x: Person . programmer(x) =>
- exists y: Computer . likes(x, y),
-exists x: Person . programmer(x) & usesmac(x)
-|-
-exists x: Person .
- (exists y: Computer . likes(x, y) & usesmac(x))
-#+end_example
-
-* =h04q06= \small{(cont’d)}
-
-These sentences are /consistent/. Here is an interpretation in which
-all the formulas are T:
-
-#+begin_example
-Domain:
- People = {John}
- Computer = {MacPro}
-
-Mapping:
- Syntax | Meaning
- -------------------------------------------
- programmer(.) | programmer(John) = T
- likes(.,.) | likes(John, MacPro) = T
- usesmac(.) | usesmac(John) = T
-#+end_example
-
-* =h04q06= \small{(cont’d)}
-
-#+begin_example
-formula 1:
- [forall x: Person . programmer(x) =>
- exists y: Computer . likes(x, y)]
- = [programmer(^John) =>
- exists y: Computer . likes(^John, y)]]
- = programmer(John) IMP likes(John, MacPro)
- = T IMP T
- = T
-
-formula 2:
- [exists x: Person . programmer(x) & usesmac(x)]
- = programmer(John) AND usesmac(John)
- = T AND T
- = T
-#+end_example
-
-* =h04q06= \small{(cont’d)}
-
-#+begin_example
-formula 3:
- [exists x: Person . (exists y: Computer .
- likes(x, y) & usesmac(x))]
- = [exists y: Computer .
- likes(^John, y) & usesmac(^John)]
- = likes(John, MacPro) AND usesmac(John)
- = T AND T
- = T
-#+end_example
-
-* =h05q01a=
-
-If the following arguments are valid, use natural deduction AND
-semantic tableaux to prove them; otherwise, provide a counterexample.
-
-#+begin_example
-forall x . s(x) | t(x),
-forall x . s(x) => t(x) & k(c, x),
-forall x . t(x) => m(x)
-|-
-m(c)
-where c is a constant
-#+end_example
-
-* =h05q01a= \small{(cont’d)}
-
-#+begin_example
-#check ND
-forall x . s(x) | t(x),
-forall x . s(x) => t(x) & k(c, x),
-forall x . t(x) => m(x)
-|-
-m(c)
-#+end_example
-
-* =h05q01a= \small{(cont’d)}
-
-#+begin_example
-1) forall x . s(x) | t(x) premise
-2) forall x . s(x) => t(x) & k(c, x) premise
-3) forall x . t(x) => m(x) premise
-4) s(c) | t(c) by forall_e on 1
-5) s(c) => t(c) & k(c, c) by forall_e on 2
-6) t(c) => m(c) by forall_e on 3
-7) case s(c) {
- 8) t(c) & k(c, c) by imp_e on 5, 7
- 9) t(c) by and_e on 8
- 10) m(c) by imp_e on 6, 9
-}
-11) case t(c) {
- 12) m(c) by imp_e on 6, 11
-}
-13) m(c) by cases on 4, 7-10, 11-12
-#+end_example
-
-* =h05q01b=
-
-Is this formula a tautology?
-
-#+begin_example
-|- (exists x . p(x)) => forall y . p(y)
-#+end_example
-
-* =h05q01b= \small{(cont’d)}
-
-No, this formula is not a tautology. Interpretation:
-
-#+begin_example
-1) Domain = {a, b}
-
-2) Mapping:
- Syntax | Meaning
- ----------------------
- p(.) | P(a) = T
- | P(b) = F
-
-Conclusion:
- [(exists x. p(x)) => forall y. p(y)]
-= (P(a) OR P(b)) IMP (P(a) AND P(b))
-= (T OR F) IMP (T AND F)
-= T IMP F
-= F
-#+end_example
-
-* =h05q01d=
-
-Is this argument valid?
-
-#+begin_example
-forall x . p(x) | q(x),
-forall x . !p(x)
-|-
-forall x . q(x)
-#+end_example
-
-* =h05q01d= \small{(cont’d)}
-
-#+begin_example
-#check ND
-
-forall x . p(x) | q(x), forall x . !p(x) |- forall x . q(x)
-
-1) forall x . p(x) | q(x) premise
-2) forall x . !p(x) premise
-3) for every xg {
- 4) p(xg) | q(xg) by forall_e on 1
- 5) case p(xg) {
- 6) !p(xg) by forall_e on 2
- 7) q(xg) by not_e on 5, 6
- }
- 8) case q(xg) {}
- 9) q(xg) by cases on 4, 5-7, 8-8
-}
-10) forall x. q(x) by forall_i on 3-9
-#+end_example
-
-* Announcements
-
-- no tutorial next week (Oct 16) (reading week)
-- no tutorial the week after (Oct 23) (midterm marking)
--- /dev/null
+#u abandali
+#a h02
+
+#q q04d
+
+p <=> q, p & q <=> (p | q)
+
+#check TP
+
+p <=> q <-> p & q <=> (p | q)
+
+ 1) p & q <=> (p | q)
+ 2) (p & q => p | q) & (p | q => p & q) by equiv
+ 3) (!(p & q) | p | q) & (!(p | q) | p & q) by impl * 2
+ 4) (!p | !q | p | q) & (!(p | q) | p & q) by dm
+ 5) (true | !q | q) & (!(p | q) | p & q) by lem
+ 6) true & (!(p | q) | p & q) by simp1
+ 7) !(p | q) | p & q by simp1
+ 8) !p & !q | p & q by dm
+ 9) (!p & !q | p) & (!p & !q | q) by distr
+10) (!p | p) & (!q | p) & (!p | q) & (!q | q) by distr * 2
+11) true & (!q | p) & (!p | q) & true by lem * 2
+12) (!q | p) & (!p | q) by simp1 * 2
+13) (q => p) & (p => q) by impl * 2
+14) p <=> q by equiv
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<!-- 2019-09-18 Wed 23:12 -->
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Propositional Logic</title>
+<meta name="generator" content="Org mode" />
+<meta name="author" content="Amin Bandali" />
+<style type="text/css">
+ <!--/*--><![CDATA[/*><!--*/
+ .title { text-align: center;
+ margin-bottom: .2em; }
+ .subtitle { text-align: center;
+ font-size: medium;
+ font-weight: bold;
+ margin-top:0; }
+ .todo { font-family: monospace; color: red; }
+ .done { font-family: monospace; color: green; }
+ .priority { font-family: monospace; color: orange; }
+ .tag { background-color: #eee; font-family: monospace;
+ padding: 2px; font-size: 80%; font-weight: normal; }
+ .timestamp { color: #bebebe; }
+ .timestamp-kwd { color: #5f9ea0; }
+ .org-right { margin-left: auto; margin-right: 0px; text-align: right; }
+ .org-left { margin-left: 0px; margin-right: auto; text-align: left; }
+ .org-center { margin-left: auto; margin-right: auto; text-align: center; }
+ .underline { text-decoration: underline; }
+ #postamble p, #preamble p { font-size: 90%; margin: .2em; }
+ p.verse { margin-left: 3%; }
+ pre {
+ border: 1px solid #ccc;
+ box-shadow: 3px 3px 3px #eee;
+ padding: 8pt;
+ font-family: monospace;
+ overflow: auto;
+ margin: 1.2em;
+ }
+ pre.src {
+ position: relative;
+ overflow: visible;
+ padding-top: 1.2em;
+ }
+ pre.src:before {
+ display: none;
+ position: absolute;
+ background-color: white;
+ top: -10px;
+ right: 10px;
+ padding: 3px;
+ border: 1px solid black;
+ }
+ pre.src:hover:before { display: inline;}
+ /* Languages per Org manual */
+ pre.src-asymptote:before { content: 'Asymptote'; }
+ pre.src-awk:before { content: 'Awk'; }
+ pre.src-C:before { content: 'C'; }
+ /* pre.src-C++ doesn't work in CSS */
+ pre.src-clojure:before { content: 'Clojure'; }
+ pre.src-css:before { content: 'CSS'; }
+ pre.src-D:before { content: 'D'; }
+ pre.src-ditaa:before { content: 'ditaa'; }
+ pre.src-dot:before { content: 'Graphviz'; }
+ pre.src-calc:before { content: 'Emacs Calc'; }
+ pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
+ pre.src-fortran:before { content: 'Fortran'; }
+ pre.src-gnuplot:before { content: 'gnuplot'; }
+ pre.src-haskell:before { content: 'Haskell'; }
+ pre.src-hledger:before { content: 'hledger'; }
+ pre.src-java:before { content: 'Java'; }
+ pre.src-js:before { content: 'Javascript'; }
+ pre.src-latex:before { content: 'LaTeX'; }
+ pre.src-ledger:before { content: 'Ledger'; }
+ pre.src-lisp:before { content: 'Lisp'; }
+ pre.src-lilypond:before { content: 'Lilypond'; }
+ pre.src-lua:before { content: 'Lua'; }
+ pre.src-matlab:before { content: 'MATLAB'; }
+ pre.src-mscgen:before { content: 'Mscgen'; }
+ pre.src-ocaml:before { content: 'Objective Caml'; }
+ pre.src-octave:before { content: 'Octave'; }
+ pre.src-org:before { content: 'Org mode'; }
+ pre.src-oz:before { content: 'OZ'; }
+ pre.src-plantuml:before { content: 'Plantuml'; }
+ pre.src-processing:before { content: 'Processing.js'; }
+ pre.src-python:before { content: 'Python'; }
+ pre.src-R:before { content: 'R'; }
+ pre.src-ruby:before { content: 'Ruby'; }
+ pre.src-sass:before { content: 'Sass'; }
+ pre.src-scheme:before { content: 'Scheme'; }
+ pre.src-screen:before { content: 'Gnu Screen'; }
+ pre.src-sed:before { content: 'Sed'; }
+ pre.src-sh:before { content: 'shell'; }
+ pre.src-sql:before { content: 'SQL'; }
+ pre.src-sqlite:before { content: 'SQLite'; }
+ /* additional languages in org.el's org-babel-load-languages alist */
+ pre.src-forth:before { content: 'Forth'; }
+ pre.src-io:before { content: 'IO'; }
+ pre.src-J:before { content: 'J'; }
+ pre.src-makefile:before { content: 'Makefile'; }
+ pre.src-maxima:before { content: 'Maxima'; }
+ pre.src-perl:before { content: 'Perl'; }
+ pre.src-picolisp:before { content: 'Pico Lisp'; }
+ pre.src-scala:before { content: 'Scala'; }
+ pre.src-shell:before { content: 'Shell Script'; }
+ pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
+ /* additional language identifiers per "defun org-babel-execute"
+ in ob-*.el */
+ pre.src-cpp:before { content: 'C++'; }
+ pre.src-abc:before { content: 'ABC'; }
+ pre.src-coq:before { content: 'Coq'; }
+ pre.src-groovy:before { content: 'Groovy'; }
+ /* additional language identifiers from org-babel-shell-names in
+ ob-shell.el: ob-shell is the only babel language using a lambda to put
+ the execution function name together. */
+ pre.src-bash:before { content: 'bash'; }
+ pre.src-csh:before { content: 'csh'; }
+ pre.src-ash:before { content: 'ash'; }
+ pre.src-dash:before { content: 'dash'; }
+ pre.src-ksh:before { content: 'ksh'; }
+ pre.src-mksh:before { content: 'mksh'; }
+ pre.src-posh:before { content: 'posh'; }
+ /* Additional Emacs modes also supported by the LaTeX listings package */
+ pre.src-ada:before { content: 'Ada'; }
+ pre.src-asm:before { content: 'Assembler'; }
+ pre.src-caml:before { content: 'Caml'; }
+ pre.src-delphi:before { content: 'Delphi'; }
+ pre.src-html:before { content: 'HTML'; }
+ pre.src-idl:before { content: 'IDL'; }
+ pre.src-mercury:before { content: 'Mercury'; }
+ pre.src-metapost:before { content: 'MetaPost'; }
+ pre.src-modula-2:before { content: 'Modula-2'; }
+ pre.src-pascal:before { content: 'Pascal'; }
+ pre.src-ps:before { content: 'PostScript'; }
+ pre.src-prolog:before { content: 'Prolog'; }
+ pre.src-simula:before { content: 'Simula'; }
+ pre.src-tcl:before { content: 'tcl'; }
+ pre.src-tex:before { content: 'TeX'; }
+ pre.src-plain-tex:before { content: 'Plain TeX'; }
+ pre.src-verilog:before { content: 'Verilog'; }
+ pre.src-vhdl:before { content: 'VHDL'; }
+ pre.src-xml:before { content: 'XML'; }
+ pre.src-nxml:before { content: 'XML'; }
+ /* add a generic configuration mode; LaTeX export needs an additional
+ (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
+ pre.src-conf:before { content: 'Configuration File'; }
+
+ table { border-collapse:collapse; }
+ caption.t-above { caption-side: top; }
+ caption.t-bottom { caption-side: bottom; }
+ td, th { vertical-align:top; }
+ th.org-right { text-align: center; }
+ th.org-left { text-align: center; }
+ th.org-center { text-align: center; }
+ td.org-right { text-align: right; }
+ td.org-left { text-align: left; }
+ td.org-center { text-align: center; }
+ dt { font-weight: bold; }
+ .footpara { display: inline; }
+ .footdef { margin-bottom: 1em; }
+ .figure { padding: 1em; }
+ .figure p { text-align: center; }
+ .equation-container {
+ display: table;
+ text-align: center;
+ width: 100%;
+ }
+ .equation {
+ vertical-align: middle;
+ }
+ .equation-label {
+ display: table-cell;
+ text-align: right;
+ vertical-align: middle;
+ }
+ .inlinetask {
+ padding: 10px;
+ border: 2px solid gray;
+ margin: 10px;
+ background: #ffffcc;
+ }
+ #org-div-home-and-up
+ { text-align: right; font-size: 70%; white-space: nowrap; }
+ textarea { overflow-x: auto; }
+ .linenr { font-size: smaller }
+ .code-highlighted { background-color: #ffff00; }
+ .org-info-js_info-navigation { border-style: none; }
+ #org-info-js_console-label
+ { font-size: 10px; font-weight: bold; white-space: nowrap; }
+ .org-info-js_search-highlight
+ { background-color: #ffff00; color: #000000; font-weight: bold; }
+ .org-svg { width: 90%; }
+ /*]]>*/-->
+</style>
+<script type="text/javascript">
+/*
+@licstart The following is the entire license notice for the
+JavaScript code in this tag.
+
+Copyright (C) 2012-2019 Free Software Foundation, Inc.
+
+The JavaScript code in this tag is free software: you can
+redistribute it and/or modify it under the terms of the GNU
+General Public License (GNU GPL) as published by the Free Software
+Foundation, either version 3 of the License, or (at your option)
+any later version. The code is distributed WITHOUT ANY WARRANTY;
+without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
+
+As additional permission under GNU GPL version 3 section 7, you
+may distribute non-source (e.g., minimized or compacted) forms of
+that code without the copy of the GNU GPL normally required by
+section 4, provided you include this license notice and a URL
+through which recipients can access the Corresponding Source.
+
+
+@licend The above is the entire license notice
+for the JavaScript code in this tag.
+*/
+<!--/*--><![CDATA[/*><!--*/
+ function CodeHighlightOn(elem, id)
+ {
+ var target = document.getElementById(id);
+ if(null != target) {
+ elem.cacheClassElem = elem.className;
+ elem.cacheClassTarget = target.className;
+ target.className = "code-highlighted";
+ elem.className = "code-highlighted";
+ }
+ }
+ function CodeHighlightOff(elem, id)
+ {
+ var target = document.getElementById(id);
+ if(elem.cacheClassElem)
+ elem.className = elem.cacheClassElem;
+ if(elem.cacheClassTarget)
+ target.className = elem.cacheClassTarget;
+ }
+/*]]>*///-->
+</script>
+</head>
+<body>
+<div id="content">
+<h1 class="title">Propositional Logic
+<br />
+<span class="subtitle">(SE 212 TUT 102)</span>
+</h1>
+
+<div id="outline-container-org3ca277c" class="outline-2">
+<h2 id="org3ca277c"><span class="section-number-2">1</span> Are you at the right place?</h2>
+<div class="outline-text-2" id="text-1">
+<p>
+We’re in MC 4040, for SE 212 TUT 102 (03:30-04:20W)
+</p>
+</div>
+</div>
+
+<div id="outline-container-orgc50c656" class="outline-2">
+<h2 id="orgc50c656"><span class="section-number-2">2</span> </h2>
+<div class="outline-text-2" id="text-2">
+<div class="org-center">
+<p>
+George
+</p>
+</div>
+</div>
+</div>
+
+<div id="outline-container-orgc4929c6" class="outline-2">
+<h2 id="orgc4929c6"><span class="section-number-2">3</span> </h2>
+<div class="outline-text-2" id="text-3">
+
+<div class="figure">
+<p><img src="./george.png" alt="george.png" />
+</p>
+</div>
+
+<p>
+<a href="https://www.student.cs.uwaterloo.ca/~se212/george/ask-george/">https://www.student.cs.uwaterloo.ca/~se212/george/ask-george/</a>
+</p>
+</div>
+</div>
+
+<div id="outline-container-org67896df" class="outline-2">
+<h2 id="org67896df"><span class="section-number-2">4</span> Tool support</h2>
+<div class="outline-text-2" id="text-4">
+<p>
+Over the years, students have developed a number of tools for using
+George and/or editing <code>.grg</code> files, such as plugins for Vim and Atom.
+</p>
+
+<p>
+Check them out at
+</p>
+
+<div class="org-center">
+<p>
+Course website → George User Manual → Contributions
+</p>
+</div>
+</div>
+</div>
+
+<div id="outline-container-org88ee3fd" class="outline-2">
+<h2 id="org88ee3fd"><span class="section-number-2">5</span> George mode for Emacs (new!)</h2>
+<div class="outline-text-2" id="text-5">
+<ul class="org-ul">
+<li>Syntax highlighting + a number of convenience functions</li>
+<li>Grab it from <a href="https://git.sr.ht/~bandali/george-mode">https://git.sr.ht/~bandali/george-mode</a> <br />
+(soon on Contributions page)</li>
+</ul>
+</div>
+</div>
+
+<div id="outline-container-org0ba02d1" class="outline-2">
+<h2 id="org0ba02d1"><span class="section-number-2">6</span> <code>a00q01.grg</code> (demo)</h2>
+<div class="outline-text-2" id="text-6">
+<p>
+Walk through answering <code>a00q01.grg</code> and submitting on MarkUs
+</p>
+</div>
+</div>
+
+<div id="outline-container-orgb863070" class="outline-2">
+<h2 id="orgb863070"><span class="section-number-2">7</span> Homework 1</h2>
+<div class="outline-text-2" id="text-7">
+<ul class="org-ul">
+<li>Let’s do a couple of questions from Homework 1</li>
+<li>Now you try the rest, let me know if you have any questions</li>
+</ul>
+</div>
+</div>
+</div>
+<div id="postamble" class="status">
+<p class="date">Date: Wed Sep 11, 2019</p>
+<p class="author">Author: Amin Bandali</p>
+<p class="email">Email: <a href="mailto:bandali@uwaterloo.ca">bandali@uwaterloo.ca</a></p>
+<p class="date">Created: 2019-09-18 Wed 23:12</p>
+<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
+</div>
+</body>
+</html>
--- /dev/null
+#+macro: topic Propositional Logic
+
+#+macro: room MC 4040
+#+macro: sec1 SE 212 TUT 101
+#+macro: sec2 SE 212 TUT 102
+#+macro: time1 02:30-03:20W
+#+macro: time2 03:30-04:20W
+
+#+macro: sec {{{sec2}}}
+#+macro: sectime {{{time2}}}
+
+#+title: {{{topic}}}
+#+subtitle: ({{{sec}}})
+#+author: Amin Bandali
+#+email: bandali@uwaterloo.ca
+#+date: Wed Sep 11, 2019
+#+language: en
+#+options: email:t num:t toc:nil \n:nil ::t |:t ^:t -:t f:t *:t <:t
+#+options: tex:t d:nil todo:t pri:nil tags:not-in-toc
+#+select_tags: export
+#+exclude_tags: noexport
+#+startup: beamer
+#+latex_class: beamer
+# #+latex_class_options: [bigger]
+#+latex_header: \setbeamercovered{transparent}
+#+latex: \setbeamertemplate{itemize items}[circle]
+#+beamer_color_theme: beaver
+
+* Are you at the right place?
+
+We’re in {{{room}}}, for {{{sec}}} ({{{sectime}}})
+
+*
+
+#+latex: \definecolor{darkred}{rgb}{0.8,0,0}
+#+latex: {\Large \color{darkred}
+#+begin_center
+George
+#+end_center
+#+latex: }
+
+*
+
+#+latex: \vspace{-2.5em}
+file:./george.png
+
+#+latex: {\footnotesize
+https://www.student.cs.uwaterloo.ca/~se212/george/ask-george/
+#+latex: }
+
+* Tool support
+
+Over the years, students have developed a number of tools for using
+George and/or editing =.grg= files, such as plugins for Vim and Atom.
+
+Check them out at
+
+#+begin_center
+Course website → George User Manual → Contributions
+#+end_center
+
+* George mode for Emacs (new!)
+
+- Syntax highlighting + a number of convenience functions
+- Grab it from https://git.sr.ht/~bandali/george-mode \\
+ (soon on Contributions page)
+
+* =a00q01.grg= (demo)
+
+Walk through answering =a00q01.grg= and submitting on MarkUs
+
+* Homework 1
+:PROPERTIES:
+:BEAMER_act: [<+->]
+:END:
+
+- Let’s do a couple of questions from Homework 1
+- Now you try the rest, let me know if you have any questions
--- /dev/null
+#+title: Predicate Logic
+#+subtitle: (SE 212 Tutorial 5)
+#+author: Amin Bandali
+#+email: bandali@uwaterloo.ca
+#+date: Wed Oct 9, 2019
+#+language: en
+#+options: email:t num:t toc:nil \n:nil ::t |:t ^:t -:t f:t *:t <:t
+#+options: tex:t d:nil todo:t pri:nil tags:not-in-toc
+#+select_tags: export
+#+exclude_tags: noexport
+#+startup: beamer
+#+latex_class: beamer
+# #+latex_class_options: [bigger]
+#+latex_header: \setbeamercovered{transparent}
+#+latex: \setbeamertemplate{itemize items}[circle]
+#+beamer_color_theme: beaver
+
+* Today’s plan
+:PROPERTIES:
+:BEAMER_act: [<+->]
+:END:
+
+- do some semantics questions from homework 4
+- do some ND questions from homework 5
+
+* =h04q05=
+
+Provide a counterexample to show that the following argument is not
+valid and demonstrate that your answer is correct.
+
+#+begin_example
+forall y : M . exists x : N . p(g(x), y)
+|=
+exists z : M . p(z, z)
+#+end_example
+
+* =h04q05= \small{(cont’d)}
+
+#+begin_example
+Domain:
+ M = {m1, m2}
+ N = {n1, n2}
+
+Mapping:
+ Syntax | Meaning
+ --------------------------
+ g(.) | G(n1) := m1
+ | G(n2) := m2
+ --------------------------
+ p(., .) | P(m1, m1) := F
+ | P(m1, m2) := T
+ | P(m2, m1) := T
+ | P(m2, m2) := F
+#+end_example
+
+* =h04q05= \small{(cont’d)}
+
+#+begin_example
+Premise:
+ [forall y : M . exists x : N . p(g(x), y)]
+ = [exists x: N. p(g(x), ^m1)] AND
+ [exists x: N . p(g(x), ^m2)]
+ = (P(G(n1), m1) OR P(G(n2), m1)) AND
+ (P(G(n1), m2) OR P(G(n2), m2))
+ = (P(m1, m1) OR P(m2, m1)) AND
+ (P(m1, m2) OR P(m2, m2))
+ = (F OR T) AND (T OR F)
+ = T
+#+end_example
+
+* =h04q05= \small{(cont’d)}
+
+#+begin_example
+Conclusion:
+ [exists z: M . p(z, z)]
+ = P(m1, m1) OR P(m2, m2)
+ = F OR F
+ = F
+#+end_example
+
+* =h04q06=
+
+Express the following sentences in predicate logic. Use types in your
+formalization. Is the set of formulas consistent? Demonstrate that
+your answer is correct using the semantics of predicate logic.
+
+#+begin_example
+All programmer like some computers.
+Some programmers use MAC.
+Therefore, some people who like some computers use MAC.
+#+end_example
+
+* =h04q06= \small{(cont’d)}
+
+All programmer like some computers.\\
+Some programmers use MAC.\\
+Therefore, some people who like some computers use MAC.
+
+#+begin_example
+Formalization:
+ programmer(x) means x is a programmer
+ usesmac(x) means x uses MAC
+ likes(x, y) means x likes y
+
+forall x: Person . programmer(x) =>
+ exists y: Computer . likes(x, y),
+exists x: Person . programmer(x) & usesmac(x)
+|-
+exists x: Person .
+ (exists y: Computer . likes(x, y) & usesmac(x))
+#+end_example
+
+* =h04q06= \small{(cont’d)}
+
+These sentences are /consistent/. Here is an interpretation in which
+all the formulas are T:
+
+#+begin_example
+Domain:
+ People = {John}
+ Computer = {MacPro}
+
+Mapping:
+ Syntax | Meaning
+ -------------------------------------------
+ programmer(.) | programmer(John) = T
+ likes(.,.) | likes(John, MacPro) = T
+ usesmac(.) | usesmac(John) = T
+#+end_example
+
+* =h04q06= \small{(cont’d)}
+
+#+begin_example
+formula 1:
+ [forall x: Person . programmer(x) =>
+ exists y: Computer . likes(x, y)]
+ = [programmer(^John) =>
+ exists y: Computer . likes(^John, y)]]
+ = programmer(John) IMP likes(John, MacPro)
+ = T IMP T
+ = T
+
+formula 2:
+ [exists x: Person . programmer(x) & usesmac(x)]
+ = programmer(John) AND usesmac(John)
+ = T AND T
+ = T
+#+end_example
+
+* =h04q06= \small{(cont’d)}
+
+#+begin_example
+formula 3:
+ [exists x: Person . (exists y: Computer .
+ likes(x, y) & usesmac(x))]
+ = [exists y: Computer .
+ likes(^John, y) & usesmac(^John)]
+ = likes(John, MacPro) AND usesmac(John)
+ = T AND T
+ = T
+#+end_example
+
+* =h05q01a=
+
+If the following arguments are valid, use natural deduction AND
+semantic tableaux to prove them; otherwise, provide a counterexample.
+
+#+begin_example
+forall x . s(x) | t(x),
+forall x . s(x) => t(x) & k(c, x),
+forall x . t(x) => m(x)
+|-
+m(c)
+where c is a constant
+#+end_example
+
+* =h05q01a= \small{(cont’d)}
+
+#+begin_example
+#check ND
+forall x . s(x) | t(x),
+forall x . s(x) => t(x) & k(c, x),
+forall x . t(x) => m(x)
+|-
+m(c)
+#+end_example
+
+* =h05q01a= \small{(cont’d)}
+
+#+begin_example
+1) forall x . s(x) | t(x) premise
+2) forall x . s(x) => t(x) & k(c, x) premise
+3) forall x . t(x) => m(x) premise
+4) s(c) | t(c) by forall_e on 1
+5) s(c) => t(c) & k(c, c) by forall_e on 2
+6) t(c) => m(c) by forall_e on 3
+7) case s(c) {
+ 8) t(c) & k(c, c) by imp_e on 5, 7
+ 9) t(c) by and_e on 8
+ 10) m(c) by imp_e on 6, 9
+}
+11) case t(c) {
+ 12) m(c) by imp_e on 6, 11
+}
+13) m(c) by cases on 4, 7-10, 11-12
+#+end_example
+
+* =h05q01b=
+
+Is this formula a tautology?
+
+#+begin_example
+|- (exists x . p(x)) => forall y . p(y)
+#+end_example
+
+* =h05q01b= \small{(cont’d)}
+
+No, this formula is not a tautology. Interpretation:
+
+#+begin_example
+1) Domain = {a, b}
+
+2) Mapping:
+ Syntax | Meaning
+ ----------------------
+ p(.) | P(a) = T
+ | P(b) = F
+
+Conclusion:
+ [(exists x. p(x)) => forall y. p(y)]
+= (P(a) OR P(b)) IMP (P(a) AND P(b))
+= (T OR F) IMP (T AND F)
+= T IMP F
+= F
+#+end_example
+
+* =h05q01d=
+
+Is this argument valid?
+
+#+begin_example
+forall x . p(x) | q(x),
+forall x . !p(x)
+|-
+forall x . q(x)
+#+end_example
+
+* =h05q01d= \small{(cont’d)}
+
+#+begin_example
+#check ND
+
+forall x . p(x) | q(x), forall x . !p(x) |- forall x . q(x)
+
+1) forall x . p(x) | q(x) premise
+2) forall x . !p(x) premise
+3) for every xg {
+ 4) p(xg) | q(xg) by forall_e on 1
+ 5) case p(xg) {
+ 6) !p(xg) by forall_e on 2
+ 7) q(xg) by not_e on 5, 6
+ }
+ 8) case q(xg) {}
+ 9) q(xg) by cases on 4, 5-7, 8-8
+}
+10) forall x. q(x) by forall_i on 3-9
+#+end_example
+
+* Announcements
+
+- no tutorial next week (Oct 16) (reading week)
+- no tutorial the week after (Oct 23) (midterm marking)