diff --git a/site/dune b/site/dune index 13fc698..550c914 100644 --- a/site/dune +++ b/site/dune @@ -31,7 +31,7 @@ (target new_book.html) (deps README.md) (action - (system "pandoc -s %{deps} -o %{target} --metadata title='Curious OCaml'"))) + (system "pandoc -s %{deps} -o %{target} --katex --metadata title='Curious OCaml'"))) (rule (alias old_lectures_as_book) @@ -40,4 +40,4 @@ (deps old_lectures_as_book.md) (action (system - "pandoc -s %{deps} -o %{target} --metadata title='Functional Programming Course'"))) + "pandoc -s %{deps} -o %{target} --katex --metadata title='Functional Programming Course'"))) diff --git a/site/new_book.html b/site/new_book.html index 8c54aa4..15c68ec 100644 --- a/site/new_book.html +++ b/site/new_book.html @@ -152,8 +152,25 @@ div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} - .display.math{display: block; text-align: center; margin: 0.5rem auto;} + + +
How can we define them? Think in terms of derivation trees:
-$$
+
\frac{
\frac{\frac{\,}{\text{a premise}} \; \frac{\,}{\text{another
premise}}}{\frac{\,}{\text{some fact}}} \;
\frac{\frac{\,}{\text{a premise}} \; \frac{\,}{\text{another
premise}}}{\frac{\,}{\text{another fact}}}}
{\text{final conclusion}}
-$$
To define the connectives, we provide rules for using them: for -example, a rule $\frac{a \; b}{c}$ +example, a rule \frac{a \; b}{c} matches parts of the tree that have two premises, represented by -variables a and b, and have any conclusion, -represented by variable c.
+variables a and b, and have any conclusion, represented by +variable c.Introduction rules say how to produce a connective. Elimination rules diff --git a/site/old_lectures_as_book.html b/site/old_lectures_as_book.html index 4b16799..7831a69 100644 --- a/site/old_lectures_as_book.html +++ b/site/old_lectures_as_book.html @@ -215,8 +215,25 @@ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ - .display.math{display: block; text-align: center; margin: 0.5rem auto;} + + +
How can we define them?Think in terms of derivation trees:
-$$ \frac{\begin{array}{ll}
+ \frac{\begin{array}{ll}
\frac{\begin{array}{ll}
\frac{\,}{\text{a premise}} & \frac{\,}{\text{another
premise}}
\end{array}}{\text{some fact}} & \frac{\frac{\,}{\text{this we
have by
default}}}{\text{another fact}}
- \end{array}}{\text{final conclusion}} $$
Define by providing rules for using the connectives: for example, a -rule $\frac{\begin{array}{ll} a & b -\end{array}}{c}$ matches parts of the tree that have two -premises, represented by variables a and b, and have any conclusion, -represented by variable c.
+rule \frac{\begin{array}{ll} a & b +\end{array}}{c} matches parts of the tree that have two premises, +represented by variables a and b, and have any conclusion, represented by +variable c.Try to use only the connective you define in its definition.# 2 Rules for Logical Connectives
Introduction rules say how to produce a connective.
@@ -389,25 +405,24 @@Notations
-$$ {{{\frac{\,}{a} \tiny{x}} \atop
+ {{{\frac{\,}{a} \tiny{x}} \atop
{\text{\textbar}}} \atop {b}} \text{, \ \ or \ \ }
{{{\frac{\,}{a} \tiny{x}} \atop {\text{\textbar}}} \atop {c}}
-$$ match any subtree that derives b (or c) and can use a (by assumption $\frac{\,}{a} \tiny{x}$) although otherwise
-a might not be warranted. For
+
match any subtree that derives b (or +c) and can use a (by assumption \frac{\,}{a} \tiny{x}) although otherwise +a might not be warranted. For example:
-$$
+
\frac{\frac{\frac{\frac{\frac{\,}{\text{sunny}} \small{x}}{\text{go
outdoor}}}{\text{playing}}}{\text{happy}}}{\text{sunny} \rightarrow
- \text{happy}} \small{\text{ using } x} $$
Such assumption can only be used in the matched subtree! But it can be used several times, e.g. if someone’s mood is more difficult to influence:
-$$ \frac{\frac{\begin{array}{ll}
+ \frac{\frac{\begin{array}{ll}
\frac{\frac{\frac{\,}{\text{sunny}} \small{x}}{\text{go
outdoor}}}{\text{playing}} & \frac{\begin{array}{ll}
\frac{\,}{\text{sunny}} \small{x} &
@@ -415,17 +430,17 @@ 1 In the Beginning there was
\small{x}}{\text{go outdoor}}
\end{array}}{\text{nice view}}
\end{array}}{\text{happy}}}{\text{sunny} \rightarrow \text{happy}}
- \small{\text{ using } x} $$
Elimination rule for disjunction
+ \small{\text{ using } x}
How can we use the fact that it is sunny∨cloudy (but not rainy)?
-$$ \frac{\begin{array}{rrl} +class="math inline">\veecloudy (but not rainy)?
+\frac{\begin{array}{rrl} \frac{\,}{\text{sunny} \vee \text{cloudy}} \tiny{\text{ forecast}} & \frac{\frac{\,}{\text{sunny}} \tiny{x}}{\text{no-umbrella}} & \frac{\frac{\,}{\text{cloudy}} \tiny{y}}{\text{no-umbrella}} \end{array}}{\text{no-umbrella}} \small{\text{ using } x, y} -$$
+We know that it will be sunny or cloudy, by watching weather forecast. If it will be sunny, we won’t need an umbrella. If it will be cloudy, we won’t need an umbrella. Therefore, won’t need an umbrella.We @@ -433,15 +448,15 @@
$$ x $$
-So we get any p for any -natural number n, provided we -can get it for 0, and using it for -x we can derive it for the -successor x + 1, where x is a unique variable (we cannot -substitute for it some particular number, because we write “using x” on the side).# 3 Logos was -Programmed in OCaml
+So we get any p for any natural +number n, provided we can get it for +0, and using it for x we can derive it for the successor x + 1, where x is a unique variable (we cannot substitute +for it some particular number, because we write “using x” on the side).# 3 Logos was Programmed in +OCaml