├── .gitattributes ├── LINKS.org ├── code ├── lecture01.v ├── lecture02.v ├── lecture03.v ├── lecture04.v ├── lecture05.v ├── lecture06.v ├── lecture07.v ├── lecture08.v ├── lecture09.v ├── lecture10.v ├── lecture11.v ├── lecture12.v ├── lecture14.v ├── sumarray.c └── sumarray.v ├── homework ├── hw01.v ├── hw02.v ├── hw03.v ├── hw04.v ├── hw05.v ├── hw06.v ├── hw07.v ├── hw08.v └── hw09.v ├── seminars ├── seminar02.v ├── seminar03.v ├── seminar04.v ├── seminar05.v ├── seminar06.v ├── seminar07.v ├── seminar08.v ├── seminar09.v └── seminar10.v └── slides ├── images ├── deepspec.png ├── fscq-bug.png ├── homeo.jpg ├── scilla-coq.jpg └── xmonad.png ├── lecture01.html ├── lecture01.org ├── lecture06.html ├── lecture06.org ├── lecture13.html ├── lecture13.org ├── modifications.css └── reveal.js ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── Gruntfile.js ├── LICENSE ├── README.md ├── bower.json ├── css ├── print │ ├── paper.css │ └── pdf.css ├── reveal.css ├── reveal.scss └── theme │ ├── README.md │ ├── beige.css │ ├── black.css │ ├── blood.css │ ├── league.css │ ├── moon.css │ ├── night.css │ ├── serif.css │ ├── simple.css │ ├── sky.css │ ├── solarized.css │ ├── source │ ├── beige.scss │ ├── black.scss │ ├── blood.scss │ ├── league.scss │ ├── moon.scss │ ├── night.scss │ ├── serif.scss │ ├── simple.scss │ ├── sky.scss │ ├── solarized.scss │ └── white.scss │ ├── template │ ├── mixins.scss │ ├── settings.scss │ └── theme.scss │ └── white.css ├── demo.html ├── index.html ├── js └── reveal.js ├── lib ├── css │ └── zenburn.css ├── font │ ├── league-gothic │ │ ├── LICENSE │ │ ├── league-gothic.css │ │ ├── league-gothic.eot │ │ ├── league-gothic.ttf │ │ └── league-gothic.woff │ └── source-sans-pro │ │ ├── LICENSE │ │ ├── source-sans-pro-italic.eot │ │ ├── source-sans-pro-italic.ttf │ │ ├── source-sans-pro-italic.woff │ │ ├── source-sans-pro-regular.eot │ │ ├── source-sans-pro-regular.ttf │ │ ├── source-sans-pro-regular.woff │ │ ├── source-sans-pro-semibold.eot │ │ ├── source-sans-pro-semibold.ttf │ │ ├── source-sans-pro-semibold.woff │ │ ├── source-sans-pro-semibolditalic.eot │ │ ├── source-sans-pro-semibolditalic.ttf │ │ ├── source-sans-pro-semibolditalic.woff │ │ └── source-sans-pro.css └── js │ ├── classList.js │ ├── head.min.js │ └── html5shiv.js ├── package.json ├── plugin ├── highlight │ └── highlight.js ├── markdown │ ├── example.html │ ├── example.md │ ├── markdown.js │ └── marked.js ├── math │ └── math.js ├── multiplex │ ├── client.js │ ├── index.js │ ├── master.js │ └── package.json ├── notes-server │ ├── client.js │ ├── index.js │ └── notes.html ├── notes │ ├── notes.html │ └── notes.js ├── print-pdf │ └── print-pdf.js ├── search │ └── search.js └── zoom-js │ └── zoom.js └── test ├── examples ├── assets │ ├── image1.png │ └── image2.png ├── barebones.html ├── embedded-media.html ├── math.html ├── slide-backgrounds.html └── slide-transitions.html ├── qunit-2.5.0.css ├── qunit-2.5.0.js ├── simple.md ├── test-markdown-element-attributes.html ├── test-markdown-element-attributes.js ├── test-markdown-external.html ├── test-markdown-external.js ├── test-markdown-options.html ├── test-markdown-options.js ├── test-markdown-slide-attributes.html ├── test-markdown-slide-attributes.js ├── test-markdown.html ├── test-markdown.js ├── test-pdf.html ├── test-pdf.js ├── test.html └── test.js /.gitattributes: -------------------------------------------------------------------------------- 1 | slides/reveal.js/* linguist-vendored 2 | -------------------------------------------------------------------------------- /LINKS.org: -------------------------------------------------------------------------------- 1 | * Useful links 2 | ** [[https://edu.tinkoff.ru/course/19/program][Course page at edu.tinkoff.ru (in Russian)]] 3 | ** [[https://www.youtube.com/playlist?list=PLQ-XJe6nVU5BwX1gV80aDhwW0Jt3tipIY][Video lectures (in Russian)]] 4 | ** How to install Coq and Mathcomp 5 | - https://github.com/coq/coq/wiki#coq-installation 6 | - https://github.com/math-comp/math-comp/blob/master/INSTALL.md 7 | ** IDE-like editors 8 | - [[https://github.com/coq-community/vscoq][VsCoq (Visual Studio Code based)]] 9 | - CoqIDE (see Coq's installation instructions) 10 | - [[https://github.com/ProofGeneral/PG][Proof General (Emacs based)]] 11 | ** Documentation 12 | - [[https://coq.inria.fr/distrib/current/refman/][The Coq Reference Manual]] 13 | ** SSReflect/Mathcomp-related 14 | - [[https://github.com/math-comp/math-comp/wiki/tutorials][Books, lecture notes, cheatsheets, tutorials, reference manual, videos of talks]] 15 | - [[https://github.com/math-comp/math-comp/blob/master/CONTRIBUTING.md][Code Style Guide]] 16 | - [[https://github.com/math-comp/math-comp/wiki/Search][Search: tips, tricks, and gotchas]] 17 | - Advanced use of =rewrite= tactic: [[https://hal.inria.fr/hal-00652286v1/document][A Language of Patterns for Subterm Selection]] - G. Gonthier, E. Tassi 18 | ** Background reading 19 | - [[http://www.cs.cmu.edu/~fp/courses/15317-f08/][Constructive Logic (lecture notes) by F. Pfenning(2008)]] 20 | - [[https://www.cs.cmu.edu/~cmartens/if/dem.html][The Devil of the Excluded Middle]] 21 | ** Exercises 22 | - [[https://coq-math-problems.github.io][Coq Math Problems: Interesting, challenging, or fun math problems formalized in Coq]] 23 | - [[https://homes.cs.washington.edu/~jrw12/InductionExercises.html][Exercises on Generalizing the Induction Hypothesis by J.R. Wilcox]] 24 | -------------------------------------------------------------------------------- /code/lecture01.v: -------------------------------------------------------------------------------- 1 | (** Use some very basic facilities of mathcomp library *) 2 | From mathcomp Require Import ssreflect. 3 | 4 | Module My. 5 | (** We introduce these definitions inside a new module 6 | to avoid name clashes with the standard library later *) 7 | 8 | Inductive bool : Type := 9 | | true 10 | | false. 11 | 12 | Check true : bool. 13 | Check true. 14 | 15 | (** Definitions (not part of Coq's type theory, by the way, it's 16 | a meta-linguistic feature) *) 17 | Definition idb := fun b : bool => b. 18 | 19 | Check (fun b : bool => b). 20 | Check idb. 21 | 22 | (** Pattern-matching *) 23 | Definition negb (b : bool) := 24 | match b with 25 | | true => false 26 | | false => true 27 | end. 28 | 29 | Compute idb true. 30 | Compute idb false. 31 | 32 | Compute negb true. 33 | Compute negb false. 34 | 35 | Variable c : bool. 36 | 37 | Compute idb c. 38 | 39 | Compute negb c. 40 | 41 | Definition andb (b c : bool) : bool := 42 | match b with 43 | | true => c 44 | | false => false 45 | end. 46 | 47 | (** Symbolic computations *) 48 | Compute andb c true. 49 | Compute andb c false. 50 | Compute andb false c. 51 | 52 | 53 | 54 | 55 | (** Peano numbers -- the first truly inductive type *) 56 | Inductive nat : Type := 57 | | S of nat 58 | | O. 59 | Print nat. 60 | 61 | Check O. 62 | Check S. 63 | Check (S O). 64 | Check S (S O). 65 | Check S (S (S O)). 66 | 67 | (** Incrementing function *) 68 | Definition inc := S. 69 | (** [Definition inc (n : nat) := S n.] is the same definition, 70 | only eta-expanded *) 71 | 72 | (** 73 | eta-expansion is baked into Coq's notion of definitional equality, i.e 74 | (fun x => f x) and f are definitionally equal 75 | but 76 | extensionally equal functions are not necessarily equal, i.e. 77 | (forall x, f x = g x -> f = g) 78 | does not have to hold. 79 | *) 80 | Print inc. 81 | 82 | Compute inc (S (S O)). 83 | 84 | 85 | Definition inc2 (n : nat) := S (S n). 86 | Compute inc2 (S (S O)). 87 | 88 | (** predecessor function *) 89 | Definition pred (n : nat) : nat := 90 | match n with 91 | | S n' => n' 92 | | O => O (* truncation! Coq's functions are total *) 93 | end. 94 | 95 | (** 96 | Some options to go about implementing [pred] function: 97 | 98 | pred : nat -> nat (* way to go *) 99 | pred : nat -> option nat 100 | pred : forall (n : nat), (n <> 0) -> nat 101 | 102 | *) 103 | 104 | (** Addition of natural numbers *) 105 | 106 | (** [{struct n}] means structural recursion on parameter [n]. 107 | Coq can infer the [struct] annotation in this case. *) 108 | 109 | Fixpoint addn (n m : nat) {struct n} : nat := 110 | match n with 111 | | S n' => S (addn n' m) 112 | | O => m 113 | end. 114 | 115 | Compute addn (S (S O)) (S (S O)). (* 2 + 2 is 4 *) 116 | 117 | (** Alternative implementation by recursion on the second parameter *) 118 | Fixpoint addn' (n m : nat) : nat := 119 | match m with 120 | | S m' => S (addn' n m') 121 | | O => n 122 | end. 123 | 124 | Print addn'. 125 | 126 | Fixpoint muln (n m : nat) : nat := 127 | match n with 128 | | S n' => addn m (muln n' m) 129 | | O => O 130 | end. 131 | 132 | Compute muln (S (S (S O))) (S (S O)). (* 3 * 2 is 6 *) 133 | Compute muln (S (S O)) O. (* 2 * 0 is 0 *) 134 | 135 | Definition square (n : nat) : nat := muln n n. 136 | 137 | Definition two := (S (S O)). 138 | Definition apply2 (f : nat -> nat) (n : nat) := 139 | f (f n). 140 | Eval hnf in (apply2 (apply2 square) two). 141 | (** Various reduction strategies: 142 | - Eval cbn in ... call-by-name 143 | - Eval lazy in ... call-by-need 144 | - Eval cbv in ... call-by-value 145 | - Eval compute in ... call-by-value (cbv's synonym) 146 | - Eval vm_compute in ... call-by-value using a bytecode virtual machine 147 | [Compute] is synonym for [Eval vm_compute in] 148 | - Eval native_compute in ... compile to OCaml and evaluate 149 | *) 150 | 151 | End My. 152 | 153 | (** After closing a module, the identifiers defined in it 154 | get prefixed with the module's name *) 155 | Check My.apply2. 156 | 157 | From mathcomp Require Import ssrfun ssrbool ssrnat. 158 | 159 | (** Some interactive queries *) 160 | About nat. 161 | About S. 162 | 163 | Locate ".+1". (* Notation "n .+1" := (S n). *) 164 | 165 | 166 | (** Apply [n] times a function [f] on natural numbers to 167 | an input [x] *) 168 | Definition applyn (f : nat -> nat) := 169 | fix rec (n : nat) (x : nat) := 170 | if n is n'.+1 then rec n' (f x) 171 | else x. 172 | 173 | (* a test *) 174 | Compute applyn S 5 42. 175 | 176 | (** An alternative implementation whose behavior is 177 | different when we evaluate it symbolically *) 178 | Definition applyn' := 179 | fix rec (f : nat -> nat) (n : nat) (x : nat) := 180 | if n is n'.+1 then rec f n' (f x) 181 | else x. 182 | 183 | 184 | Axiom fun_ext : 185 | forall (A B : Type) (f g : A -> B), 186 | (forall x, f x = g x) -> f = g. 187 | 188 | (** A way of defining [applyn] using Coq's section mechanism *) 189 | Section Applyn. 190 | 191 | Variable f : nat -> nat. 192 | 193 | Fixpoint applyn'' (n : nat) (x : nat) : nat := 194 | if n is n'.+1 then applyn'' n' (f x) 195 | else x. 196 | 197 | Variable n : nat. 198 | Compute applyn'' (S n) 0. 199 | 200 | Print applyn''. 201 | 202 | End Applyn. 203 | 204 | Print applyn''. (* compare the output to the one inside the above section *) 205 | 206 | (** A proposition which can never be constructed (in the empty context *) 207 | Inductive False : Prop := 208 | . (* no constructors! *) 209 | 210 | Print False. 211 | 212 | (** Let's illustrate why "in the empty context" is important *) 213 | Check (fun f : False => f (* here we construct a value of type 214 | [False], but the context is not empty, 215 | since the function parameter becomes 216 | part of context here *) 217 | ). 218 | (** Since it's impossible to construct a value of an empty type, 219 | it's impossible to call a function of type 220 | False -> SomeType *) 221 | (** ... provided we are talking about empty contexts again: *) 222 | Check (fun g : False => 223 | (fun f : False => f) g (* call [fun f : False => f] 224 | with [g] as the argument *) 225 | ). 226 | 227 | (** This is why Coq does not allow non-terminating functions *) 228 | Fail Fixpoint loop (n : nat) : False := 229 | loop n. 230 | (* loop : n -> False *) 231 | 232 | (** If this was allowed, we could construct a value of an empty type 233 | in the empty context like so: *) 234 | Fail Check (loop O : False). 235 | 236 | (** And this would preclude Coq from being a logic *) 237 | 238 | (** To be continued... *) 239 | -------------------------------------------------------------------------------- /code/sumarray.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | unsigned sumarray(unsigned a[], int n) { 4 | int i; unsigned s; 5 | i=0; 6 | s=0; 7 | while (i true 16 | | true, false => true 17 | | false, true => true 18 | | false, false => false 19 | end. 20 | 21 | (** Note: the above translates into nested pattern-matching, check this *) 22 | 23 | 24 | (** 1d. Define [addb_my] function implementing exclusive boolean disjunction. 25 | {The name [addb] comes from the fact this operation behaves like addition modulo 2} 26 | If you are already familiar with proofs in Coq, think of a prover friendly 27 | definition, if you are not -- experiment with how different implementations 28 | behave under symbolic execution. *) 29 | 30 | 31 | (*** Exercise 2 *) 32 | 33 | (** 2a. Implement power function of two arguments [x] and [n], 34 | raising [x] to the power of [n] *) 35 | 36 | 37 | (*** Exercise 3 *) 38 | 39 | (** 3a. Implement division on unary natural numbers *) 40 | 41 | Fixpoint divn_my (n m : nat) : nat. Abort. 42 | 43 | (* Unit tests: *) 44 | Compute divn_my 0 0. (* = 0 *) 45 | Compute divn_my 1 0. (* = 0 *) 46 | Compute divn_my 0 3. (* = 0 *) 47 | Compute divn_my 1 3. (* = 0 *) 48 | Compute divn_my 2 3. (* = 0 *) 49 | Compute divn_my 3 3. (* = 1 *) 50 | Compute divn_my 8 3. (* = 2 *) 51 | Compute divn_my 42 1. (* = 42 *) 52 | Compute divn_my 42 2. (* = 21 *) 53 | Compute divn_my 42 3. (* = 14 *) 54 | Compute divn_my 42 4. (* = 10 *) 55 | 56 | 57 | (** 3b. Provide several unit tests using [Compute] vernacular command *) 58 | 59 | 60 | (*** Exercise 4 *) 61 | 62 | (** Use the [applyn] function defined during the lecture 63 | (or better its Mathcomp sibling called [iter]) define 64 | 65 | 4a. addition on natural numbers 66 | 67 | 4b. multiplication on natural numbers 68 | 69 | Important: don't use recursion, i.e. no [Fixpoint] / [fix] should be in your solution. 70 | *) 71 | 72 | (** Here is out definition of [applyn]: *) 73 | Definition applyn (f : nat -> nat) := 74 | fix rec (n : nat) (x : nat) := 75 | if n is n'.+1 then rec n' (f x) 76 | else x. 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /homework/hw02.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | Section IntLogic. 7 | 8 | Variables A B C : Prop. 9 | 10 | Lemma notTrue_iff_False : (~ True) <-> False. 11 | Proof. 12 | (* step-wise solutiton *) 13 | split. 14 | - by apply. 15 | move=> f _. apply: f. 16 | 17 | Restart. 18 | 19 | (* idiomatic solution *) 20 | by []. 21 | Qed. 22 | 23 | 24 | Lemma dne_False : ~ ~ False -> False. 25 | Proof. 26 | move=> nnF; apply: nnF; apply. 27 | 28 | Restart. 29 | 30 | (* let's golf it a bit, just for fun *) 31 | exact: (@^~ id). 32 | 33 | Restart. 34 | (* and then a bit more *) 35 | exact. 36 | 37 | Qed. 38 | 39 | Lemma dne_True : ~ ~ True -> True. 40 | Proof. 41 | move=> _. exact: I. 42 | 43 | Restart. 44 | 45 | by []. 46 | Qed. 47 | 48 | Lemma weak_peirce : ((((A -> B) -> A) -> A) -> B) -> B. 49 | Proof. 50 | move=> H. 51 | apply: (H). 52 | apply. 53 | move=> p. 54 | apply: H. 55 | move=> _. 56 | exact: p. 57 | 58 | Restart. 59 | 60 | move=> abaab; apply: (abaab); apply=> a. 61 | by apply: abaab. 62 | Qed. 63 | 64 | Lemma imp_trans : (A -> B) -> (B -> C) -> (A -> C). 65 | Proof. 66 | move=> pq qr p. 67 | apply: qr. 68 | apply: pq. 69 | exact: p. 70 | 71 | Restart. 72 | 73 | by move=> pq qr /pq/qr. 74 | Qed. 75 | 76 | 77 | End IntLogic. 78 | 79 | 80 | (** Let's familiarize ourselves with some lemmas from [ssrbool] module. 81 | The proofs are very easy, so the lemma statements are more important here. 82 | *) 83 | Section BooleanLogic. 84 | 85 | Variables (A B : Type) (x : A) (f : A -> B) (a b : bool) (vT vF : A). 86 | 87 | Lemma negbNE : ~~ ~~ b -> b. 88 | Proof. by case: b. Qed. 89 | 90 | (** Figure out what [involutive] and [injective] mean 91 | using Coq's interactive queries. Prove the lemmas. 92 | Hint: to unfold a definition in the goal use [rewrite /definition] command. 93 | *) 94 | Lemma negbK : involutive negb. 95 | Proof. 96 | (* A step-by-step solution *) 97 | rewrite /involutive. 98 | rewrite /cancel. 99 | case. 100 | - done. 101 | done. 102 | 103 | Restart. 104 | 105 | (* An idiomatic solution *) 106 | by case. 107 | Qed. 108 | 109 | Lemma negb_inj : injective negb. 110 | Proof. 111 | (* A step-by-step solution *) 112 | rewrite /injective. 113 | case. 114 | - case. 115 | + done. 116 | done. 117 | case. 118 | - done. 119 | done. 120 | 121 | Restart. 122 | 123 | (* An idiomatic solution is based on the fact that each involutive function is 124 | injective *) 125 | apply: inv_inj. 126 | apply: negbK. 127 | 128 | Restart. 129 | 130 | (* or in one go: *) 131 | 132 | exact: inv_inj negbK. 133 | Qed. 134 | 135 | Lemma ifT : b -> (if b then vT else vF) = vT. 136 | Proof. 137 | (* step-by-step *) 138 | Set Printing Coercions. 139 | rewrite /is_true. 140 | Unset Printing Coercions. 141 | move=> ->. 142 | done. 143 | 144 | Restart. 145 | 146 | (* SSReflect can see under coercions (definitions) and use [b] with 147 | implicit coercion [is_true] as equation directly *) 148 | by move=> ->. 149 | 150 | Restart. 151 | 152 | (* another option would be to use case analysis on [b] like so: *) 153 | by case: b. 154 | Qed. 155 | 156 | Lemma ifF : b = false -> (if b then vT else vF) = vF. 157 | Proof. by move=> ->. Qed. 158 | 159 | Lemma if_same : (if b then vT else vT) = vT. 160 | Proof. 161 | case: b. 162 | - by []. 163 | by []. 164 | 165 | Restart. 166 | 167 | by case: b. 168 | (* It's important to understand why just [by [].] wouldn't work here. 169 | We have to do case analysis on [b] if we want the to reduce the [if]-expression *) 170 | Qed. 171 | 172 | Lemma if_neg : (if ~~ b then vT else vF) = if b then vF else vT. 173 | Proof. by case: b. Qed. 174 | 175 | Lemma fun_if : f (if b then vT else vF) = if b then f vT else f vF. 176 | Proof. by case: b. Qed. 177 | 178 | Lemma if_arg (fT fF : A -> B) : 179 | (if b then fT else fF) x = if b then fT x else fF x. 180 | Proof. by case: b. Qed. 181 | 182 | Lemma andbK : a && b || a = a. 183 | Proof. 184 | (* (almost) step-wise solutiton *) 185 | case: a. 186 | - by case: b. 187 | by []. 188 | 189 | Restart. 190 | 191 | (* idiomatic solution *) 192 | by case: a; case: b. (* case analyze on [a] and then for each of the two new 193 | subgoals do case analysis on [b] *) 194 | Qed. 195 | 196 | (** Find out what [left_id], [right_id] mean 197 | using Coq's interactive queries. Prove the lemmas. 198 | *) 199 | Lemma addFb : left_id false addb. (* [addb] means XOR (eXclusive OR operation) *) 200 | Proof. 201 | rewrite /left_id. 202 | by case. 203 | 204 | Restart. 205 | 206 | (* idiomatic solution: don't have to unfold definitions, [case] will do it for us *) 207 | by case. 208 | Qed. 209 | 210 | Lemma addbF : right_id false addb. 211 | Proof. by case. Qed. 212 | 213 | Lemma addbC : commutative addb. 214 | Proof. 215 | case. 216 | - by case. 217 | by case. 218 | 219 | Restart. 220 | 221 | (* idiomatic solution: *) 222 | by do 2 case. (* case-analyze on the head of the "goal stack" two times in a row *) 223 | Qed. 224 | 225 | Lemma addbA : associative addb. 226 | Proof. 227 | case. 228 | - case. 229 | + by case. 230 | by case. 231 | case. 232 | - by case. 233 | by case. 234 | 235 | Restart. 236 | 237 | by do 3 case. 238 | Qed. 239 | 240 | 241 | (** Formulate analogous laws (left/right identity, commutativity, associativity) 242 | for boolean AND and OR and prove those. 243 | Find the names of corresponding lemmas in the standard library using 244 | [Search] command. For instance: [Search _ andb left_id.] 245 | Have you noticed the naming patterns? 246 | *) 247 | 248 | Lemma andFb : left_id true andb. 249 | Proof. by case. Qed. 250 | 251 | Lemma andbF : right_id true andb. 252 | Proof. by case. Qed. 253 | 254 | Lemma andbC : commutative andb. 255 | Proof. by do 2 case. Qed. 256 | 257 | Lemma andbA : associative andb. 258 | Proof. by do 3 case. Qed. 259 | 260 | Lemma orFb : left_id false orb. 261 | Proof. by case. Qed. 262 | 263 | Lemma orbF : right_id false orb. 264 | Proof. by case. Qed. 265 | 266 | Lemma orbC : commutative orb. 267 | Proof. by do 2 case. Qed. 268 | 269 | Lemma orbA : associative orb. 270 | Proof. by do 3 case. Qed. 271 | 272 | End BooleanLogic. 273 | 274 | 275 | 276 | Section NaturalNumbers. 277 | (** Figure out what [cancel], [succn], [predn] mean 278 | using Coq's interactive queries. Prove the lemmas. 279 | *) 280 | Lemma succnK : cancel succn predn. 281 | Proof. 282 | rewrite /cancel. 283 | move=> n. 284 | by []. 285 | 286 | Restart. 287 | by []. 288 | Qed. 289 | 290 | Lemma add0n : left_id 0 addn. 291 | Proof. 292 | rewrite /left_id. 293 | move=> n. 294 | by []. 295 | 296 | Restart. 297 | by []. 298 | Qed. 299 | 300 | Lemma addSn m n : m.+1 + n = (m + n).+1. 301 | Proof. by []. Qed. 302 | 303 | Lemma add1n n : 1 + n = n.+1. 304 | Proof. by []. Qed. 305 | 306 | Lemma add2n m : 2 + m = m.+2. 307 | Proof. by []. Qed. 308 | 309 | Lemma subn0 : right_id 0 subn. 310 | Proof. 311 | rewrite /right_id. 312 | move=> n. 313 | Fail by []. 314 | case: n. 315 | - by []. 316 | move=> n. 317 | by []. 318 | 319 | Restart. 320 | by case. 321 | Qed. 322 | 323 | End NaturalNumbers. 324 | -------------------------------------------------------------------------------- /homework/hw04.v: -------------------------------------------------------------------------------- 1 | (** 2 | Exercises on Generalizing the Induction Hypothesis 3 | https://homes.cs.washington.edu/~jrw12/InductionExercises.html 4 | by James Wilcox (2017) 5 | 6 | Adapted to SSReflect syntax and Mathcomp library. 7 | *) 8 | 9 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq. 10 | Set Implicit Arguments. 11 | Unset Strict Implicit. 12 | Unset Printing Implicit Defensive. 13 | 14 | Fixpoint sum (l : seq nat) : nat := 15 | if l is (x :: xs) then x + sum xs 16 | else 0. 17 | 18 | Fixpoint sum_iter' (l : seq nat) (acc : nat) : nat := 19 | if l is (x :: xs) then sum_iter' xs (x + acc) 20 | else acc. 21 | 22 | Definition sum_iter (l : seq nat) : nat := 23 | sum_iter' l 0. 24 | 25 | Lemma sum_iter'_correct l x0 : 26 | sum_iter' l x0 = x0 + sum l. 27 | Proof. 28 | elim: l x0 => [|x l IHl /=] x0; first by rewrite addn0. 29 | by rewrite IHl addnCA addnA. 30 | Qed. 31 | 32 | Theorem sum_iter_correct l : 33 | sum_iter l = sum l. 34 | Proof. exact: sum_iter'_correct. Qed. 35 | 36 | 37 | (** Continuation-passing style 38 | https://en.wikipedia.org/wiki/Continuation-passing_style 39 | *) 40 | Fixpoint sum_cont' {A} (l : seq nat) (k : nat -> A) : A := 41 | if l is (x :: xs) then sum_cont' xs (fun ans => k (x + ans)) 42 | else k 0. 43 | 44 | Definition sum_cont (l : seq nat) : nat := 45 | sum_cont' l (fun x => x). 46 | 47 | Lemma sum_cont'_correct A l (k : nat -> A) : 48 | sum_cont' l k = k (sum l). 49 | Proof. by elim: l k => //= x l IHl k; rewrite IHl. Qed. 50 | 51 | Theorem sum_cont_correct l : 52 | sum_cont l = sum l. 53 | Proof. exact: sum_cont'_correct. Qed. 54 | 55 | 56 | Fixpoint rev_rec {A : Type} (xs : seq A) : seq A := 57 | if xs is (x::xs') then 58 | rev_rec xs' ++ [:: x] 59 | else xs. 60 | 61 | Lemma rev_correct A (l1 l2 : seq A) : 62 | catrev l1 l2 = rev_rec l1 ++ l2. 63 | Proof. 64 | elim: l1 l2 => //= x l1 IHl1 l2. 65 | by rewrite IHl1 -catA. 66 | Qed. 67 | 68 | Theorem rev_iter_correct A (l : seq A) : 69 | rev l = rev_rec l. 70 | Proof. by rewrite /rev rev_correct cats0. Qed. 71 | 72 | 73 | Fixpoint map_iter' {A B} 74 | (f : A -> B) (l : seq A) (acc : seq B) : seq B := 75 | if l is (x :: l') then map_iter' f l' (f x :: acc) 76 | else rev acc. 77 | 78 | Definition map_iter {A B} (f : A -> B) l := map_iter' f l [::]. 79 | 80 | Lemma map_iter'_correct A B (f : A -> B) l1 l2 : 81 | map_iter' f l1 l2 = rev l2 ++ (map f l1). 82 | Proof. 83 | elim: l1 l2 => [|x1 l1 IHl1 /=] l2; first by rewrite cats0. 84 | by rewrite IHl1 rev_cons -cats1 -catA. 85 | Qed. 86 | 87 | Theorem map_iter_correct A B (f : A -> B) l : 88 | map_iter f l = map f l. 89 | Proof. exact: map_iter'_correct. Qed. 90 | 91 | 92 | Inductive expr : Type := 93 | | Const of nat 94 | | Plus of expr & expr. 95 | 96 | Fixpoint eval_expr (e : expr) : nat := 97 | match e with 98 | | Const n => n 99 | | Plus e1 e2 => eval_expr e1 + eval_expr e2 100 | end. 101 | 102 | Fixpoint eval_expr_iter' (e : expr) (acc : nat) : nat := 103 | match e with 104 | | Const n => n + acc 105 | | Plus e1 e2 => eval_expr_iter' e2 (eval_expr_iter' e1 acc) 106 | end. 107 | 108 | Definition eval_expr_iter e := eval_expr_iter' e 0. 109 | 110 | Lemma eval_expr_iter'_correct e acc : 111 | eval_expr_iter' e acc = acc + eval_expr e. 112 | Proof. 113 | elim: e acc=> [n | e1 IH1 e2 IH2 /=] acc; first by rewrite addnC. 114 | by rewrite IH1 IH2 addnA. 115 | Qed. 116 | 117 | Theorem eval_expr_iter_correct e : 118 | eval_expr_iter e = eval_expr e. 119 | Proof. exact: eval_expr_iter'_correct. Qed. 120 | 121 | 122 | Fixpoint eval_expr_cont' {A} (e : expr) (k : nat -> A) : A := 123 | match e with 124 | | Const n => k n 125 | | Plus e1 e2 => eval_expr_cont' e2 (fun n2 => 126 | eval_expr_cont' e1 (fun n1 => k (n1 + n2))) 127 | end. 128 | 129 | Definition eval_expr_cont (e : expr) : nat := 130 | eval_expr_cont' e (fun n => n). 131 | 132 | Lemma eval_expr_cont'_correct A e (k : nat -> A) : 133 | eval_expr_cont' e k = k (eval_expr e). 134 | Proof. 135 | elim: e k=> //= e1 IH1 e2 IH2 k. 136 | by rewrite IH2 IH1. 137 | Qed. 138 | 139 | Theorem eval_expr_cont_correct e : 140 | eval_expr_cont e = eval_expr e. 141 | Proof. exact: eval_expr_cont'_correct. Qed. 142 | 143 | 144 | Inductive instr := Push (n : nat) | Add. 145 | 146 | Definition prog := seq instr. 147 | 148 | Definition stack := seq nat. 149 | 150 | Fixpoint run (p : prog) (s : stack) : stack := 151 | if p is (i :: p') then 152 | let s' := 153 | match i with 154 | | Push n => n :: s 155 | | Add => if s is (a1 :: a2 :: s') then a2 + a1 :: s' 156 | else s 157 | end 158 | in 159 | run p' s' 160 | else s. 161 | 162 | Compute run [:: Push 2; Push 3; Add] [::]. 163 | 164 | Fixpoint compile (e : expr) : prog := 165 | match e with 166 | | Const n => [:: Push n] 167 | | Plus e1 e2 => compile e1 ++ compile e2 ++ [:: Add] 168 | end. 169 | 170 | Lemma run_append p1 p2 s : 171 | run (p1 ++ p2) s = run p2 (run p1 s). 172 | Proof. 173 | elim: p1 s => //=. 174 | Qed. 175 | 176 | Lemma compile_correct_generalized e s : 177 | run (compile e) s = (eval_expr e) :: s. 178 | Proof. 179 | elim: e s => //= e1 IH1 e2 IH2 s. 180 | by rewrite !run_append IH1 IH2. 181 | Qed. 182 | 183 | Theorem compile_correct e : 184 | run (compile e) [::] = [:: eval_expr e]. 185 | Proof. exact: compile_correct_generalized. Qed. 186 | 187 | -------------------------------------------------------------------------------- /homework/hw05.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | 7 | Section BooleanReflection. 8 | 9 | (** A spec for boolean equality *) 10 | Variant eq_xor_neq (T : eqType) (x y : T) : bool -> bool -> Set := 11 | | EqNotNeq of x = y : eq_xor_neq x y true true 12 | | NeqNotEq of x != y : eq_xor_neq x y false false. 13 | 14 | Lemma eqVneq (T : eqType) (x y : T) : 15 | eq_xor_neq x y (y == x) (x == y). 16 | Proof. by rewrite eq_sym; case: (altP eqP); constructor. Qed. 17 | 18 | (* Use eqVneq to prove the following lemma. 19 | Hint: use [case: eqVneq] *) 20 | Lemma eqVneq_example (T : eqType) (w x y z : T) : 21 | w == x -> z == y -> 22 | (x == w) /\ (y == z) /\ (z == y). 23 | Proof. by case: eqVneq; case: eqVneq. Qed. 24 | 25 | Lemma andX (a b : bool) : reflect (a * b) (a && b). 26 | Proof. by case: a; case: b; constructor=> //; case. Qed. 27 | 28 | Arguments andX {a b}. 29 | 30 | (** Solve the following lemma using [andX] lemma 31 | and [rewrite] tactic *) 32 | Lemma andX_example a b : 33 | a && b -> b && a && a && b. 34 | Proof. by move=> ab; rewrite !(andX ab). Qed. 35 | 36 | (* one can rewrite with andX *) 37 | 38 | End BooleanReflection. 39 | 40 | 41 | 42 | 43 | Section RecursionSchemes. 44 | 45 | Lemma foldr_fusion {A B C} (f : A -> B -> B) (v : B) 46 | (g : A -> C -> C) (w : C) (h : C -> B) : 47 | h w = v -> 48 | (forall x y, h (g x y) = f x (h y)) -> 49 | (h \o foldr g w) =1 foldr f v. 50 | Proof. 51 | move=> h_acc h_gf. 52 | elim => //= x xs IHxs; by rewrite h_gf IHxs. 53 | Qed. 54 | 55 | Definition flip {A B C} (f : A -> B -> C) := fun x y => f y x. 56 | 57 | Lemma foldl_via_foldr A B (f : B -> A -> B) : 58 | flip (foldr (fun x rec => rec \o (flip f x)) id) =2 foldl f. 59 | Proof. by rewrite /flip; move=> v xs; elim: xs v=> /=. Qed. 60 | 61 | 62 | Lemma foldl_via_foldr2 {A B} (f : B -> A -> B) v : 63 | (foldr (flip f) v) \o rev =1 foldl f v. 64 | Proof. 65 | move=> xs; elim: xs v => //= x xs IH v. 66 | by rewrite -cat1s rev_cat foldr_cat /= IH. 67 | Qed. 68 | 69 | 70 | (* Let's generalize left and right folds over lists. 71 | We do that by factoring out the recursive call. 72 | So, instead of the combining function of type 73 | A -> B -> B we use 74 | A -> B -> (B -> B) -> B, 75 | where (B -> B) represents the recursive calls. 76 | See a couple of lemmas below explaining how it works. 77 | *) 78 | Definition foldk {A B : Type} (f : A -> B -> (B -> B) -> B) := 79 | fix rec (acc : B) (xs : list A) := 80 | if xs is x :: xs' then 81 | f x acc (fun acc2 => rec acc2 xs') 82 | else acc. 83 | (* The "k" suffix suggests "continuation" here *) 84 | 85 | Lemma foldr_via_foldk A B (f : A -> B -> B) : 86 | foldk (fun a b k => f a (k b)) =2 foldr f. 87 | Proof. by move=> acc; elim=> //= x xs ->. Qed. 88 | 89 | Lemma foldl_via_foldk A B (f : B -> A -> B) : 90 | foldk (fun a b k => k (f b a)) =2 foldl f. 91 | Proof. by []. Qed. 92 | 93 | End RecursionSchemes. 94 | 95 | 96 | 97 | Section IntLogic. 98 | 99 | (* Prove that having a general fixed-point combinator in Coq 100 | would be incosistent *) 101 | Definition FIX := forall A : Type, (A -> A) -> A. 102 | 103 | Lemma not_fix : 104 | FIX -> False. 105 | Proof. 106 | by move/(_ False id). 107 | 108 | Restart. 109 | 110 | exact. 111 | Qed. 112 | 113 | End IntLogic. 114 | 115 | 116 | -------------------------------------------------------------------------------- /homework/hw06.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | 7 | (** Implement an instance of equality type for the [seq] datatype *) 8 | 9 | 10 | 11 | (** Take apart the following proof: *) 12 | Lemma size_eq0 (T : eqType) (s : seq T) : 13 | (size s == 0) = (s == [::]). 14 | Proof. exact: (sameP nilP eqP). Qed. 15 | 16 | 17 | 18 | Lemma filter_all T (a : pred T) s : 19 | all a (filter a s). 20 | Admitted. 21 | 22 | Lemma filter_id T (a : pred T) s : 23 | filter a (filter a s) = filter a s. 24 | Admitted. 25 | 26 | Lemma all_count T (a : pred T) s : 27 | all a s = (count a s == size s). 28 | Admitted. 29 | 30 | Lemma all_predI T (a1 a2 : pred T) s : 31 | all (predI a1 a2) s = all a1 s && all a2 s. 32 | Admitted. 33 | 34 | Lemma allP (T : eqType) {a : pred T} {s : seq T} : 35 | reflect {in s, forall x, a x} (all a s). 36 | (* Hint 1: *) 37 | (* rewrite /prop_in1. *) 38 | 39 | (* Hint 2a and 2b: *) 40 | (* Check erefl : 1 \in [:: 3; 2; 1; 0] = true. *) 41 | (* Check erefl : 42 \in [:: 3; 2; 1; 0] = false. *) 42 | Admitted. 43 | 44 | Lemma sub_find T (a1 a2 : pred T) s : 45 | subpred a1 a2 -> 46 | find a2 s <= find a1 s. 47 | Admitted. 48 | 49 | Lemma take_nseq T n m (x : T) : take n (nseq m x) = nseq (minn n m) x. 50 | Admitted. 51 | 52 | Lemma rev_nseq A n (x : A) : rev (nseq n x) = nseq n x. 53 | Admitted. 54 | 55 | (* Hint: use mapP *) 56 | Lemma mem_map (T1 T2 : eqType) (f : T1 -> T2) x s : 57 | injective f -> 58 | (f x \in map f s) = (x \in s). 59 | Admitted. 60 | 61 | (* Double induction principle *) 62 | Lemma seq_ind2 {S T} (P : seq S -> seq T -> Type) : 63 | P [::] [::] -> 64 | (forall x y s t, size s = size t -> P s t -> P (x :: s) (y :: t)) -> 65 | forall s t, size s = size t -> P s t. 66 | Admitted. 67 | 68 | (* Hint: use seq_ind2 to prove the following *) 69 | Lemma rev_zip S T (s : seq S) (t : seq T) : 70 | size s = size t -> rev (zip s t) = zip (rev s) (rev t). 71 | Admitted. 72 | 73 | Lemma last_ind T (P : seq T -> Prop) : 74 | P [::] -> (forall s x, P s -> P (rcons s x)) -> forall s, P s. 75 | Admitted. 76 | 77 | (* Hint: use last_ind to prove the following *) 78 | Lemma nth_rev T (x0 : T) n (s : seq T) : 79 | n < size s -> nth x0 (rev s) n = nth x0 s (size s - n.+1). 80 | Admitted. 81 | 82 | 83 | -------------------------------------------------------------------------------- /homework/hw07.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | 7 | (** Properties of arbitrary binary relations (not necessarily decidable) *) 8 | (** A functional or deterministic relation *) 9 | Definition functional {X : Type} (R : X -> X -> Prop) : Prop := 10 | forall (s s1 s2 : X), R s s1 -> R s s2 -> s1 = s2. 11 | 12 | Lemma func1 : 13 | functional (fun x y => x.*2 == y). 14 | Admitted. 15 | 16 | Lemma func2 : 17 | ~ functional (fun x y => (x.*2 == y) || ((x, y) == (0,1))). 18 | Admitted. 19 | 20 | 21 | (** Define a notation such that {In C, functional R} restricts the domain of the relation like so: 22 | 23 | forall (s s1 s2 : X), C s -> R s s1 -> R s s2 -> s1 = s2 24 | 25 | And prove the following lemma: 26 | *) 27 | (* Notation "{ 'In' C , P }" := *) 28 | (* (...) (at level 0). *) 29 | 30 | Lemma func3 : 31 | {In (fun n => 0 < n), functional (fun x y => (x.*2 == y) || ((x, y) == (0,1)))}. 32 | Admitted. 33 | 34 | 35 | (* prove without using [case] or [elim] tactics *) 36 | Lemma Peirce p q : ((p ==> q) ==> p) ==> p. 37 | Admitted. 38 | 39 | 40 | (* prove without using [case] or [elim] tactics *) 41 | Lemma addb_neq12 p q : ~~ p = q -> p (+) q. 42 | Admitted. 43 | 44 | 45 | Lemma div_fact_plus1 m p : 1 < p -> p %| m `! + 1 -> m < p. 46 | Admitted. 47 | 48 | 49 | (* Prove [8x = 6y + 1] has no solutions in [nat] *) 50 | Lemma no_solution x y : 51 | 8*x != 6*y + 1. 52 | Admitted. 53 | 54 | 55 | 56 | Lemma iota_add m n1 n2 : 57 | iota m (n1 + n2) = iota m n1 ++ iota (m + n1) n2. 58 | Admitted. 59 | 60 | Definition mysum m n F := (foldr (fun i a => F i + a) 0 (iota m (n - m))). 61 | 62 | (* "big" operator *) 63 | Notation "\mysum_ ( m <= i < n ) F" := (mysum m n (fun i => F)) 64 | (at level 41, F at level 41, i, m, n at level 50, 65 | format "'[' \mysum_ ( m <= i < n ) '/ ' F ']'"). 66 | 67 | Lemma mysum_recl m n F : 68 | m <= n -> 69 | \mysum_(m <= i < n.+1) F i = \mysum_(m <= i < n) F i + F n. 70 | Admitted. 71 | 72 | Lemma sum_odds n : 73 | \mysum_(0 <= i < n) (2 * i + 1) = n ^ 2. 74 | Admitted. 75 | 76 | 77 | -------------------------------------------------------------------------------- /homework/hw08.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice fintype tuple. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | 7 | Lemma enum_example m (r : rel 'I_m) f v (x : nat) : 8 | (forall j, r v j -> f v j > 0) -> 9 | x \in [seq f v j | j <- enum 'I_m & r v j] -> 10 | 0 < x. 11 | Proof. 12 | Admitted. 13 | 14 | 15 | 16 | Section TriFinType. 17 | (** Define [finType] structure for the following datatype *) 18 | (** 19 | Hints: 20 | 1. To build a [finType] structure you need to build all of its parent structures, 21 | i.e. [eqType], [choiceType], [countType]. 22 | 2. An easy way to solve this is to use [CanChoiceMixin], [CanCountMixin], and [CanFinMixin] constructors. 23 | 3. The above hint requires mapping [tri] into an already existsing isomorphic [finType], e.g. [ordinal]. 24 | 4. The [ordinal] type from above is ['I_3] 25 | 26 | *) 27 | (** CanFinMixin *) 28 | Inductive tri : predArgType := (* [predArgType] is necessary to make [_ \in _] notation work, see below *) 29 | | Yes | No | Maybe. 30 | 31 | 32 | (** Your definitions here *) 33 | 34 | 35 | (** This should work now: *) 36 | Check (Yes != No) && (No \in tri) && (#| tri | == 3). 37 | End TriFinType. 38 | 39 | 40 | 41 | Section RecordFinType. 42 | 43 | Variables A B C : finType. 44 | 45 | (** Define [finType] structure for the following datatype *) 46 | Record record : predArgType := Mk_record { 47 | field_A : A; 48 | field_B : B; 49 | field_C : C 50 | }. 51 | 52 | (** This should work now: *) 53 | Variable test : record. 54 | Check (test == test) && (test \in record) && (#| record | == #| record |). 55 | 56 | End RecordFinType. 57 | 58 | 59 | 60 | Section DBranch. 61 | 62 | Variable ft : finType. 63 | 64 | (** Consider a sequence over a finite type with the restriction that all the sequence elements are unique *) 65 | Structure dbranch : predArgType := 66 | {branch :> seq ft; 67 | buniq : uniq branch}. 68 | 69 | (** * Define [finType] structure for [dbranch] *) 70 | 71 | 72 | (** Hints: 73 | 1. One way of building a [finType] structure is to embed the new construction 74 | into a (possibly bigger) finite type. 75 | 2. [sigT] is like [sig], but allows the second projection to live in [Type], not in [Prop]. 76 | 3. Build an embedding of [dbranch] into {k : 'I_#|ft|.+1 & k.-tuple ft} 77 | and its partial inverse, i.e. 78 | 79 | Definition tag_of_dbranch d : {k : 'I_#|ft|.+1 & k.-tuple ft} := ... 80 | Definition dbranch_of_tag (t : {k : 'I_#|ft|.+1 & k.-tuple ft}) : option dbranch := ... 81 | 82 | 4. [PcanFinMixin] is very useful in this setting. 83 | *) 84 | 85 | (** Your definitions here *) 86 | 87 | (** This should work now: *) 88 | Variable test : dbranch. 89 | Check (test == test) && (test \in dbranch) && (#| dbranch | == #| dbranch |). 90 | 91 | End DBranch. 92 | 93 | 94 | 95 | (** Bonus exercises: 96 | There is a library to reduce boilerplate while building instances of basic MathComp classes 97 | for inductive data types: https://github.com/arthuraa/deriving. 98 | Install it (it's available from extra-dev opam repository) an use it to solve some of the above exercise. 99 | *) 100 | 101 | -------------------------------------------------------------------------------- /homework/hw09.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice fintype tuple. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | 7 | Lemma bij_card_eq (T T' : finType) (f : T -> T') : 8 | bijective f -> #|T| = #|T'|. 9 | Proof. 10 | Admitted. 11 | 12 | 13 | Section bool_irrelevance. 14 | 15 | Implicit Types b c : bool. 16 | 17 | (** Let's define a projection function which projects any two 18 | proofs into one canonical proof: *) 19 | Definition proj {b c} (pf : b = c) : b = c := 20 | if b =P c is ReflectT pf' 21 | then pf' (* the canonical proof *) 22 | else pf. (* this is an impossible case, we could have used [False_rect] here *) 23 | 24 | (** A key property of [proj] function *) 25 | Lemma proj_constant {b c} : 26 | forall (pf1 pf2 : b = c), proj pf1 = proj pf2. 27 | Proof. 28 | Admitted. 29 | 30 | (** Another key property of [proj]: it's invertible! 31 | (although we only need injectivity) *) 32 | 33 | Definition join b c d (pf : b = c) : b = d -> c = d := 34 | etrans (esym pf). 35 | 36 | Definition proj_inv {b c} (pf : b = c) : b = c := 37 | join (proj (erefl b)) pf. 38 | 39 | Lemma trans_sym_eq b c : 40 | forall pf : b = c, join pf pf = erefl c. 41 | Proof. 42 | Admitted. 43 | 44 | Lemma proj_cancL b c : 45 | cancel (@proj b c) (@proj_inv b c). 46 | Proof. 47 | Admitted. 48 | 49 | Theorem bool_irrelevance b c : 50 | forall (pf1 pf2 : b = c), pf1 = pf2. 51 | Proof. 52 | Admitted. 53 | 54 | 55 | 56 | (** Now let's put [bool_irrelevance] to work *) 57 | Lemma UIP_refl b : 58 | forall (pf : b = b), pf = erefl b. 59 | Proof. 60 | Admitted. 61 | 62 | 63 | (** The Altenkirch-Streicher K axiom for booleans. 64 | See also https://ncatlab.org/nlab/show/axiom+K+%28type+theory%29 65 | *) 66 | Lemma Streicher_K b (P : b = b -> Prop) : 67 | P (erefl b) -> forall pf : b = b, P pf. 68 | Proof. 69 | Admitted. 70 | 71 | End bool_irrelevance. 72 | -------------------------------------------------------------------------------- /seminars/seminar02.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | (** Some basic functions *) 7 | 8 | Definition const {A B} (a : A) := 9 | fun _ : B => a. 10 | 11 | Definition flip {A B C} (f : A -> B -> C) : B -> A -> C := 12 | fun b a => f a b. 13 | 14 | Arguments const {A B} a _ /. 15 | Arguments flip {A B C} f b a /. 16 | 17 | 18 | (* move to logic_exercises *) 19 | Section IntLogic. 20 | 21 | Variables A B C D : Prop. 22 | 23 | Lemma axiomK : 24 | A -> B -> A. 25 | Proof. exact: const. Qed. 26 | 27 | 28 | (* note: flip is more general *) 29 | Lemma contraposition : 30 | (A -> ~ B) -> (B -> ~ A). 31 | Proof. exact: flip. Qed. 32 | 33 | 34 | Lemma p_imp_np_iff_np : (A -> ~A) <-> ~A. 35 | Proof. 36 | (* a step-by-step solution *) 37 | split. 38 | - rewrite /not. move=> a_na. move=> a. exact: (a_na a a). 39 | move=> na _. exact: na. 40 | 41 | Restart. 42 | (* a more idiomatic solution *) 43 | by split=> // a_na a; apply: a_na. 44 | (** 45 | Explanation: the proof of the last branch of the step-by-step proof 46 | is trivial, so it can be handled with [//]. 47 | This leaves us with just the first subgoal. 48 | [move=> a_na. move=> a.] can be merged into [move=> a_na a.] 49 | which itself can be melded into the preceeding [split] tactic. 50 | 51 | The [tac1; tac2] construction allows us to apply [tac2] tactic 52 | to all the subgoals we are left with after applying [tac1] tactic. 53 | *) 54 | Qed. 55 | 56 | 57 | (* We can generalize the previous lemma into *) 58 | Lemma p_p_q_iff_p_q : 59 | (A -> A -> B) <-> (A -> B). 60 | Proof. by split=> // a_na a; apply: a_na. Qed. 61 | 62 | 63 | Lemma p_is_not_equal_not_p : 64 | ~ (A <-> ~ A). 65 | Proof. 66 | (** The "defective" form of [move] tactic brings the goal to 67 | the head normal form (hnf). 68 | Defective here means "not combined with anything else". 69 | *) 70 | move. 71 | (** Amounts to "unfold all definitions" in this case. 72 | The goal after applying [compute] tactic can be 73 | easier to understand, but this really depends on 74 | how much experience you have with unfolding those 75 | definitions mentally. 76 | *) 77 | compute. 78 | (** Now that we have conjunction as the top of the goal stack, 79 | we can have access to the individual conjuncts. 80 | *) 81 | case. move=> aaf af_a. 82 | (** Parentheses around a hypothesis let us reuse it later, 83 | had we omitted those, we would have it erased from the context. 84 | *) 85 | apply: (aaf). 86 | - apply: af_a. move=> a. exact: (aaf a a). 87 | apply: af_a. move=> a. exact: (aaf a a). (* duplication! *) 88 | 89 | Restart. 90 | 91 | (** A refactored version of the above proof *) 92 | case=> aaf af_a. 93 | (** We use [have ident : statement by tactic] form to prove [A] beforehand 94 | and call it [a] in the context. 95 | *) 96 | have a: A by apply: af_a=> a; apply: aaf. 97 | by apply: aaf. 98 | Qed. 99 | 100 | 101 | Lemma not_not_lem : 102 | ~ ~ (A \/ ~ A). 103 | Proof. 104 | move=> not_lem. 105 | apply: (not_lem). 106 | right. 107 | move=> a. 108 | apply: not_lem. 109 | left. 110 | exact: a. 111 | 112 | Restart. 113 | 114 | (** a shorter version *) 115 | move=> not_lem; apply: (not_lem); right=> a. 116 | by apply: not_lem; left. 117 | Qed. 118 | 119 | Lemma constructiveDNE : 120 | ~ ~ ~ A -> ~ A. 121 | Proof. 122 | move=> nnna. 123 | move=> a. 124 | apply: nnna. 125 | move=> na. 126 | apply: na. 127 | exact: a. 128 | 129 | Restart. 130 | 131 | (** A shorter version *) 132 | by move=> nnna a; apply: nnna. 133 | Qed. 134 | 135 | End IntLogic. 136 | 137 | 138 | 139 | 140 | (* Boolean logic (decidable fragment enjoys classical laws) *) 141 | 142 | Section BooleanLogic. 143 | 144 | Lemma LEM_decidable a : 145 | a || ~~ a. 146 | Proof. 147 | by case: a. 148 | (** the rest of the proof is by computation *) 149 | Qed. 150 | 151 | Lemma disj_implb a b : 152 | a || (a ==> b). 153 | Proof. 154 | by case: a. 155 | (** Here we only need to case analyse on [a]. 156 | Make sure you understand why. 157 | (Hint: look at the definitions and see if knowing the form 158 | of [b] is really needed here) 159 | *) 160 | Qed. 161 | 162 | Lemma iff_is_if_and_only_if a b : 163 | (a ==> b) && (b ==> a) = (a == b). 164 | Proof. by case: a; case: b. Qed. 165 | 166 | Lemma implb_trans : transitive implb. 167 | Proof. 168 | rewrite /transitive. move=> b a c. case: a. 169 | - move=> /=. (* simplify goal *) 170 | (* The head of the goal is an (implicit) equation [b = true]. 171 | How to check it? *) 172 | move->. (* rewrite with the head of the goal stack *) 173 | move=> /=. 174 | by []. 175 | by []. 176 | 177 | Restart. 178 | 179 | (** A more idiomatic version *) 180 | by move=> b [] c //= ->. 181 | 182 | (** Explanation: 183 | 184 | [by move=> b [] c //= ->] 185 | ^ ^ 186 | | | 187 | | solve trivial goals (//) and simplify (/=) combined 188 | | 189 | inplace case analysis ([case: a]) 190 | *) 191 | Qed. 192 | 193 | Lemma triple_compb (f : bool -> bool) : 194 | f \o f \o f =1 f. 195 | Proof. 196 | by case=> /=; case Et: (f true); case Ef: (f false); rewrite ?Ef ?Et. 197 | Qed. 198 | 199 | 200 | 201 | (* negb \o odd means "even" *) 202 | Lemma even_add : 203 | {morph (negb \o odd) : x y / x + y >-> x == y}. 204 | Proof. 205 | move=> x y /=. 206 | by rewrite odd_add negb_add eqb_negLR negbK. 207 | Qed. 208 | 209 | End BooleanLogic. 210 | 211 | 212 | (* some properties of functional composition *) 213 | 214 | Section eq_comp. 215 | Variables A B C D : Type. 216 | 217 | Lemma compA (f : A -> B) (g : B -> C) (h : C -> D) : 218 | h \o g \o f = h \o (g \o f). 219 | Proof. by []. Qed. 220 | 221 | Lemma eq_compl (f g : A -> B) (h : B -> C) : 222 | f =1 g -> h \o f =1 h \o g. 223 | Proof. by move=> eq_fg; apply: eq_comp. Qed. 224 | 225 | Lemma eq_compr (f g : B -> C) (h : A -> B) : 226 | f =1 g -> f \o h =1 g \o h. 227 | Proof. by move=> eq_fg; apply: eq_comp. Qed. 228 | 229 | Lemma eq_idl (g1 g2 : A -> B) (f : B -> B) : 230 | f =1 id -> f \o g1 =1 f \o g2 -> g1 =1 g2. 231 | Proof. 232 | move=> f_id g12f a. 233 | move: (g12f a). move=> /=. 234 | rewrite f_id. rewrite f_id. 235 | done. 236 | 237 | Restart. 238 | 239 | (* idiomatic solution *) 240 | by move=> f_id g12f a; move: (g12f a)=> /=; rewrite !f_id. 241 | Qed. 242 | 243 | Lemma eq_idr (f1 f2 : A -> B) (g : A -> A) : 244 | g =1 id -> f1 \o g =1 f2 \o g -> f1 =1 f2. 245 | Proof. 246 | by move=> g_id f12g a; move: (f12g a)=> /=; rewrite g_id. 247 | Qed. 248 | 249 | End eq_comp. 250 | 251 | 252 | 253 | -------------------------------------------------------------------------------- /seminars/seminar03.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | 7 | Section IntLogic. 8 | 9 | (* Frobenius rule: existential quantifiers and conjunctions commute *) 10 | Lemma frobenius A (P : A -> Prop) Q : 11 | (exists x, Q /\ P x) <-> Q /\ (exists x, P x). 12 | Proof. 13 | split. 14 | - case. move=> x. case. move=> q px. split. 15 | + exact: q. 16 | exists x. exact: px. 17 | case. move=> q. case. move=> x px. exists x. split. 18 | - exact: q. 19 | exact: px. 20 | 21 | Restart. 22 | 23 | (* idiomatic solution *) 24 | split. 25 | - by case=> x [q px]; split=> //; exists x. 26 | by case=> [q [x px]]; exists x. 27 | Qed. 28 | 29 | Lemma exist_conj_commute A (P Q : A -> Prop) : 30 | (exists x, P x /\ Q x) -> 31 | (exists x, P x) /\ (exists x, Q x). 32 | Proof. by case=> [x [px qx]]; split; exists x. Qed. 33 | 34 | (* Elegant solution by Vasiliy Yorkin *) 35 | Lemma conj_exist_does_not_commute : 36 | ~ (forall A (P Q : A -> Prop), 37 | (exists x, P x) /\ (exists x, Q x) -> 38 | (exists x, P x /\ Q x)). 39 | Proof. 40 | move/(_ bool id not); case=> [|x [] //]. 41 | by split; [exists true | exists false]. 42 | Qed. 43 | 44 | (* helper lemma *) 45 | Lemma curry_dep A (P : A -> Prop) Q : 46 | ((exists x, P x) -> Q) -> (forall x, P x -> Q). 47 | Proof. move=> f x px. exact: (f (ex_intro _ x px)). Qed. 48 | 49 | Definition not_forall_exists := 50 | forall A (P : A -> Prop), 51 | ~ (forall x, ~ P x) -> (exists x, P x). 52 | 53 | (* Double negation elimination *) 54 | Definition DNE := forall (P : Prop), ~ ~ P -> P. 55 | 56 | Lemma not_for_all_is_exists_iff_dne : 57 | not_forall_exists <-> DNE. 58 | Proof. 59 | rewrite /not_forall_exists /DNE; split=> [nfe | dne]. 60 | - move=> P nnP. move: (nfe True (fun _ => P)). 61 | by case/(_ (fun t_notP => nnP (t_notP I))). 62 | by move=> A P nAll; apply: dne=> /curry_dep/nAll. 63 | Qed. 64 | 65 | End IntLogic. 66 | 67 | 68 | 69 | Section BooleanLogic. 70 | 71 | (** [==] is decidable equality operation for types with dec. eq. 72 | In case of booleans it means [if and only if]. *) 73 | Fixpoint mostowski_equiv (a : bool) (n : nat) := 74 | if n is n'.+1 then mostowski_equiv a n' == a 75 | else a. 76 | 77 | (* ((a == a ...) == a) == a *) 78 | 79 | Lemma mostowski_equiv_even_odd a n : 80 | mostowski_equiv a n = a || odd n. 81 | Proof. 82 | by elim: n=> [|n /= ->]; case: a=> //; rewrite eqbF_neg. 83 | Qed. 84 | 85 | End BooleanLogic. 86 | 87 | 88 | Section Arithmetics. 89 | 90 | Lemma addnCB m n : m + (n - m) = m - n + n. 91 | Proof. 92 | (* a step-wise solution *) 93 | Search _ (?m + (?n - ?m)). 94 | rewrite -maxnE. 95 | rewrite maxnC. (* we already know the "C" suffix stands for "commutative" *) 96 | rewrite maxnE. 97 | rewrite addnC. 98 | done. 99 | 100 | Restart. 101 | (* idiomatic solution *) 102 | by rewrite -maxnE maxnC maxnE addnC. 103 | Qed. 104 | 105 | Lemma addnBC m n : n - m + m = m - n + n. 106 | Proof. by rewrite addnC addnCB. Qed. 107 | 108 | Lemma addnBC' : commutative (fun m n => m - n + n). 109 | Proof. by move=> m n; apply: addnBC. Qed. 110 | 111 | 112 | Lemma example_for_rewrite_patterns m n : 113 | m * n + m * n + m * n + n * m 114 | = 115 | m * n + m * n + m * n + n * m. 116 | Proof. 117 | (* 118 | Parenthesized goal: 119 | X 120 | /--------------\ 121 | ((m * n + m * n) + m * n) + n * m 122 | = 123 | ((m * n + m * n) + m * n) + n * m 124 | \___________/ 125 | X 126 | *) 127 | rewrite [in X in X + _ + _]mulnC. 128 | done. 129 | Abort. 130 | 131 | Lemma subn_sqr m n : m ^ 2 - n ^ 2 = (m - n) * (m + n). 132 | Proof. 133 | by rewrite mulnBl !mulnDr addnC mulnC subnDl. 134 | Qed. 135 | 136 | Lemma leq_sub_add n m p : n - m <= n + p. 137 | Proof. by rewrite leq_subLR addnCA leq_addr. Qed. 138 | 139 | (* prove by induction *) 140 | Lemma odd_exp m n : odd (m ^ n) = (n == 0) || odd m. 141 | Proof. 142 | elim: n=> //= n IHn. 143 | Search _ (_ ^ _.+1 = _ * _) in ssrnat. 144 | rewrite expnS. 145 | Search _ (odd (_ * _)). 146 | rewrite odd_mul. 147 | rewrite IHn. 148 | Search _ (?b && (_ || ?b)). 149 | rewrite orKb. 150 | done. 151 | 152 | Restart. 153 | 154 | (* idiomatic solution: *) 155 | by elim: n=> //= n IHn; rewrite expnS odd_mul IHn orKb. 156 | Qed. 157 | 158 | End Arithmetics. 159 | 160 | 161 | 162 | Section Misc. 163 | (** Exlpain why the following statement is unprovable *) 164 | 165 | Definition const {A B} : A -> B -> A := fun a _ => a. 166 | (* [/] means "allow simplification after all the arguments before the slash symbol are supplied" *) 167 | Arguments const {A B} a b /. 168 | 169 | Lemma const_eq A B (x y : A) : 170 | @const A B x = const y -> x = y. 171 | Proof. 172 | (** Explanation: 173 | If we had an inhabitant of type [B], i.e. some [b : B], 174 | we could apply [const x] and [const y] to [b], getting 175 | [x = y] after redusing the beta-redexes as follows: *) 176 | 177 | have b: B by admit. (* assume we can construct [b] of type [B] *) 178 | 179 | by move=> /(congr1 (@^~ b)). 180 | (** [@^~ b] stands for (fun f => f b), i.e. application at [f]. 181 | 182 | move/(congr1 (@^~ b)) 183 | 184 | turns an equality between two functions [f1] and [f2], i.e. [f1 = f2], 185 | into the following equality [f1 b = f2 b] *) 186 | 187 | (** Now, the problem here is that [B] is an arbitrary type, so 188 | it might be empty meaning we would never come up with a proof for the admitted goal. *) 189 | Abort. 190 | 191 | 192 | (** Yet another explanation of the above unprovability fact 193 | It is known that Coq's theory is compatible with the axiom of functional extensionality. 194 | This means that is we assume that axiom, then proving [const_eq] must not 195 | lead to a contradition. 196 | Let's show this is not the case here. 197 | *) 198 | 199 | Axiom fext : forall A (B : A -> Type) (f1 f2 : forall x, B x), 200 | (forall x, f1 x = f2 x) -> f1 = f2. 201 | 202 | Lemma not_const_eq : ~ (forall A B (x y : A), 203 | @const A B x = const y -> x = y). 204 | Proof. 205 | move=> /(_ bool Empty_set false true) H. 206 | apply/notF/H. 207 | by apply: fext. 208 | Qed. 209 | 210 | End Misc. 211 | -------------------------------------------------------------------------------- /seminars/seminar04.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | 7 | From Coq Require Import Omega. 8 | 9 | Section InductionExercises. 10 | 11 | Fixpoint triple (n : nat) : nat := 12 | if n is n'.+1 then (triple n').+3 13 | else n. 14 | 15 | Lemma triple_mul3 n : 16 | triple n = 3 * n. 17 | Proof. 18 | by elim: n=> //= n ->; rewrite mulnS. 19 | Qed. 20 | 21 | Lemma double_inj m n : 22 | m + m = n + n -> m = n. 23 | Proof. 24 | elim: m n=> [| m IHm] [|n]=> //. 25 | by rewrite !addnS !addSn => [[]] /IHm->. 26 | Qed. 27 | 28 | 29 | (** Write a tail-recursive variation of the [addn] function 30 | (let's call it [addn_iter]). 31 | See https://en.wikipedia.org/wiki/Tail_call 32 | *) 33 | Fixpoint add_iter (n m : nat) {struct n}: nat := 34 | if n is n'.+1 then add_iter n' m.+1 35 | else m. 36 | 37 | Lemma add_iter_correct n m : 38 | add_iter n m = n + m. 39 | Proof. 40 | elim: n=> //= n IHn. 41 | (* Cannot apply IHn here because it expects the second argument to be [m], and not [m.+1] 42 | Anyways, lets try and massage the goal to rewrite with [IHn] from right to left. 43 | *) 44 | rewrite addSn. 45 | rewrite -IHn. 46 | Fail done. (* Convince yourself that we are stuck *) 47 | 48 | Restart. 49 | (* To proceeded we needed the induction hypothesis to be general in its second argument. 50 | To do that we need to generalize our goal before applying induction. 51 | *) 52 | move: m. 53 | elim: n. 54 | - move=> m. move=> /=. done. 55 | move=> n IHn m. 56 | move=> /=. 57 | rewrite IHn. rewrite addnS. done. (* and now we are properly done *) 58 | 59 | Restart. 60 | 61 | (* Idiomatic solution: *) 62 | by elim: n m=> //= n IHn m; rewrite IHn addnS. 63 | Qed. 64 | 65 | Fixpoint fib (n : nat) : nat := 66 | if n is (n''.+1 as n').+1 then fib n'' + fib n' 67 | else n. 68 | Arguments fib n : simpl nomatch. 69 | 70 | Lemma leq_add1l p m n : 71 | m <= n -> m <= p + n. 72 | Proof. by move/(leq_add (leq0n _)); apply. Qed. 73 | 74 | Lemma fib_monotone m n : 75 | m <= n -> fib m <= fib n. 76 | Proof. 77 | elim: n=> [|[|n] IHn]; first by case: m. 78 | - by case: {IHn}m=> [|[]]. 79 | rewrite /= leq_eqVlt => /orP[/eqP->// | /IHn]. 80 | by apply: leq_add1l. 81 | Qed. 82 | 83 | Lemma fib_add_succ m n : 84 | fib (m + n).+1 = fib m.+1 * fib n.+1 + fib m * fib n. 85 | Proof. 86 | elim: m n=> [|m IHm] n; first by rewrite mul1n addn0. 87 | rewrite addSnnS IHm /=. 88 | by rewrite mulnDl mulnDr addnAC -addnA addnC. 89 | Qed. 90 | 91 | End InductionExercises. 92 | 93 | 94 | 95 | (* Thanks to Mike Potanin for pointing me to this example *) 96 | (* https://en.wikipedia.org/wiki/Eckmann–Hilton_argument *) 97 | 98 | Section EckmannHilton. 99 | 100 | Context {X : Type}. 101 | Variables f1 f2 : X -> X -> X. 102 | 103 | Variable e1 : X. 104 | Hypothesis U1 : left_id e1 f1 * right_id e1 f1. 105 | 106 | Variables e2 : X. 107 | Hypothesis U2 : left_id e2 f2 * right_id e2 f2. 108 | 109 | Hypothesis I : interchange f1 f2. 110 | 111 | Lemma units_same : 112 | e1 = e2. 113 | Proof. by move: (I e1 e2 e2 e1); rewrite !(U1, U2). Qed. 114 | 115 | Lemma operations_equal : 116 | f1 =2 f2. 117 | Proof. by move=> a b; move: (I a e1 e1 b); rewrite !U1 units_same !U2. Qed. 118 | 119 | Lemma I1 : interchange f1 f1. 120 | Proof. by move=> a b c d; move: (I a b c d); rewrite -!operations_equal. Qed. 121 | 122 | Lemma operations_comm : 123 | commutative f1. 124 | Proof. by move=> a b; move: (I1 e1 a b e1); rewrite !U1. Qed. 125 | 126 | Lemma operations_assoc : 127 | associative f1. 128 | Proof. by move=> a b c; move: (I1 a e1 b c); rewrite !U1. Qed. 129 | 130 | End EckmannHilton. 131 | -------------------------------------------------------------------------------- /seminars/seminar05.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | 7 | 8 | Section LeftPad. 9 | 10 | (** 11 | What is "leftpad"? 12 | 13 | Leftpad is a function that takes a character, a length, and a string, and pads the string to that length. 14 | It pads it by adding the character to the left. 15 | 16 | Compute leftpad 0 5 [:: 1; 2; 3]. (* = [:: 0; 0; 1; 2; 3] *) 17 | Compute leftpad 0 2 [:: 1; 2; 3]. (* = [:: 1; 2; 3] *) 18 | *) 19 | 20 | 21 | (* [def] is the default value, i.e. type T is not empty *) 22 | Variables (T : Type) (def : T). 23 | 24 | (** Define the leftpad function, modeling strings as sequences of elements of type [T] *) 25 | 26 | Definition leftpad (c : T) (n : nat) (s : seq T) : seq T := 27 | ncons (n - size s) c s. 28 | 29 | (** The following properties of the leftpad function *) 30 | 31 | Lemma length_max_spec c n s : 32 | size (leftpad c n s) = maxn n (size s). 33 | Proof. by rewrite size_ncons addnC maxnC maxnE. Qed. 34 | 35 | (** Local alias for the [nth] function returning the n-th element of the input sequence *) 36 | Local Notation nth := (nth def). 37 | 38 | Lemma prefix_spec c n s : 39 | forall i, i < n - size s -> nth (leftpad c n s) i = c. 40 | Proof. by move=> i; rewrite nth_ncons => ->. Qed. 41 | 42 | Lemma suffix_spec c n s : 43 | forall i, i < size s -> nth (leftpad c n s) (n - size s + i) = nth s i. 44 | Proof. by move=> i _; rewrite nth_ncons addKn ifN // -ltnNge leq_addr. Qed. 45 | 46 | End LeftPad. 47 | 48 | 49 | 50 | Section MoreInductionExercises. 51 | 52 | (** Implement a recursive function performing integer division by 2 *) 53 | Fixpoint div2 (n : nat) : nat := 54 | if n is n''.+2 then (div2 n'').+1 55 | else n.-1. 56 | 57 | (* You might want to uncomment the following: *) 58 | Arguments div2 : simpl nomatch. 59 | 60 | Lemma nat_ind2' (P : nat -> Prop) : 61 | P 0 -> 62 | P 1 -> 63 | (forall n, P n -> P n.+2) -> 64 | forall n, P n. 65 | Proof. 66 | move=> p0 p1 Istep n; suffices: P n /\ P n.+1 by case. 67 | by elim: n=> // n [/Istep]. 68 | Qed. 69 | 70 | Lemma div2_le n : div2 n <= n. 71 | Proof. 72 | by elim/nat_ind2': n => //= n /leqW IHn; rewrite ltnS. 73 | Qed. 74 | 75 | Lemma div2_correct n : 76 | div2 n = n./2. 77 | Proof. by elim/nat_ind2': n=> //= n ->. Qed. 78 | 79 | 80 | 81 | (** Strong induction principle *) 82 | Lemma lt_wf_ind (P : nat -> Prop) : 83 | (forall m, (forall k : nat, (k < m) -> P k) -> P m) -> 84 | forall n, P n. 85 | Proof. 86 | move=> step n. 87 | (* complete induction *) 88 | elim: n {-2}n (leqnn n) => [[_|//] | n IHn k le_kSn]; first by apply: step. 89 | apply: step => j /leq_trans - /(_ _ le_kSn); rewrite ltnS. 90 | exact: IHn. 91 | Qed. 92 | 93 | 94 | Fixpoint divn_my (n m : nat) {struct n} : nat := 95 | if m is m'.+1 then 96 | if n - m' is d.+1 then 97 | (divn_my d m).+1 98 | else 0 99 | else 0. 100 | 101 | Lemma divn_my_correct2 n m : 102 | divn_my n m = divn n m. 103 | Proof. 104 | (* complete induction *) 105 | elim: n {-2}n (leqnn n) m => [|n IHn]; first by case=> // _; case. 106 | case=> [_ [] // | n' le_n'Sn [//| m /=]]. 107 | case eq_sub: (n'.+1 - m) => [|d]; first by rewrite divn_small // -subn_eq0 subSS eq_sub. 108 | move: (congr1 predn eq_sub)=> /= <-; rewrite subSKn. 109 | rewrite IHn ?(leq_trans (leq_subr m n')) //. 110 | rewrite -[in RHS](@subnK m.+1 n'.+1) -1?subn_gt0 ?eq_sub //. 111 | by rewrite addnC -{2}(mul1n m.+1) divnMDl. 112 | Qed. 113 | 114 | 115 | Fixpoint fib (n : nat) : nat := 116 | if n is (n''.+1 as n').+1 then fib n'' + fib n' 117 | else n. 118 | Arguments fib n : simpl nomatch. 119 | 120 | (* proved in seminar 04, repeating the proofs here to bypass project management in Coq *) 121 | Lemma fib_add_succ m n : 122 | fib (m + n).+1 = fib m.+1 * fib n.+1 + fib m * fib n. 123 | Proof. 124 | elim: m n=> [|m IHm] n; first by rewrite mul1n addn0. 125 | rewrite addSnnS IHm /=. 126 | by rewrite mulnDl mulnDr addnAC -addnA addnC. 127 | Qed. 128 | 129 | (* proved in seminar 04 *) 130 | Lemma leq_add1l p m n : 131 | m <= n -> m <= p + n. 132 | Proof. by move/(leq_add (leq0n _)); apply. Qed. 133 | 134 | (* proved in seminar 04 *) 135 | Lemma fib_monotone m n : 136 | m <= n -> fib m <= fib n. 137 | Proof. 138 | elim: n=> [|[|n] IHn]; first by case: m. 139 | - by case: {IHn}m=> [|[]]. 140 | rewrite /= leq_eqVlt => /orP[/eqP->// | /IHn]. 141 | by apply: leq_add1l. 142 | Qed. 143 | 144 | From Coq Require Import Psatz. (* to use [lia] tactic *) 145 | 146 | Lemma fib3 n : 147 | fib (3*n).+1 = (fib n.+1)^3 + 3 * fib n.+1 * (fib n)^2 - (fib n)^3. 148 | Proof. 149 | rewrite ![in LHS]mulSnr mul0n add0n !fib_add_succ mulnDl !mulnn -expnSr. 150 | rewrite -addnBA; last by rewrite -(mul1n (_ ^ 3)) -mulnA leq_mul ?expnS ?leq_mul ?fib_monotone. 151 | case: n=> // n; rewrite addSn fib_add_succ /=. 152 | (* optional step, it's here just to clarify the form of the goal for the human *) 153 | move: (fib n) (fib n.+1) => x y. 154 | (* massage the goal so the [lia] tactic is able to finish it off *) 155 | rewrite !expnS !expn0 !muln1 -!plusE -!multE -!minusE; lia. 156 | Qed. 157 | 158 | End MoreInductionExercises. 159 | 160 | -------------------------------------------------------------------------------- /seminars/seminar06.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq. 2 | 3 | Set Implicit Arguments. 4 | Unset Strict Implicit. 5 | Unset Printing Implicit Defensive. 6 | 7 | 8 | Section EqType. 9 | 10 | Lemma eq_sym (T : eqType) (x y : T) : 11 | (x == y) = (y == x). 12 | Proof. 13 | Admitted. 14 | (* ^ Hint: use apply/view1/view2 mechanism *) 15 | 16 | 17 | (** Define equality type for the following datatype *) 18 | Inductive tri := 19 | | Yes | No | Maybe. 20 | (** This should not fail! *) 21 | Fail Check (1, Yes) == (1, Maybe). 22 | 23 | 24 | (** Define equality type for the [Empty_set] datatype *) 25 | (** This should not fail! *) 26 | Fail Check fun v : Empty_set => (1, v) == (1, v). 27 | 28 | 29 | Lemma predU1P (T : eqType) (x y : T) (b : bool) : 30 | reflect (x = y \/ b) ((x == y) || b). 31 | Proof. 32 | Admitted. 33 | 34 | 35 | Variables (A B : eqType) (f : A -> B) (g : B -> A). 36 | 37 | Lemma inj_eq : injective f -> forall x y, (f x == f y) = (x == y). 38 | Proof. 39 | Admitted. 40 | 41 | 42 | Lemma can_eq : cancel f g -> forall x y, (f x == f y) = (x == y). 43 | Proof. 44 | Admitted. 45 | 46 | 47 | Lemma eqn_add2l p m n : (p + m == p + n) = (m == n). 48 | Proof. 49 | Admitted. 50 | 51 | 52 | Lemma expn_eq0 m e : (m ^ e == 0) = (m == 0) && (e > 0). 53 | Proof. 54 | Admitted. 55 | 56 | 57 | Lemma seq_last_notin (s : seq A) x : 58 | last x s \notin s = (s == [::]). 59 | Proof. 60 | Admitted. 61 | 62 | End EqType. 63 | 64 | -------------------------------------------------------------------------------- /seminars/seminar07.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | (** Projection using phantoms. 7 | Implement [swap'] definition and [swap] notation 8 | so that the following works: *) 9 | 10 | (** Strictly no pattern-matching! *) 11 | 12 | (* Definition swap' := . *) 13 | (* Notation swap p := (...). *) 14 | (** Usage: *) 15 | Fail Eval hnf in swap (true || false, 41 + 1). 16 | (** 17 | = (41 + 1, true || false) 18 | *) 19 | 20 | 21 | 22 | (** Design a unification tool so that the following 23 | typechecks iff X and Y can be unified *) 24 | 25 | (* Notation "[unify X 'with' Y ]" := *) 26 | (* (...). *) 27 | 28 | (** Usage: *) 29 | (* Check [unify 1 with 0 + 1]. *) 30 | (* Check [unify 1 with 1 + 0]. *) 31 | (* Check (fun n : nat => [unify 0 + n with n]). *) 32 | (* Fail Check (fun n : nat => [unify n + 0 with n]). (** this should fail *) *) 33 | 34 | 35 | Section LHS. 36 | (** Design a tool for extracting the left-hand side expression 37 | from a term proving an equation *) 38 | (* Notation "[LHS 'of' proof_of_equation ]" := *) 39 | (* (). *) 40 | 41 | Variable prf_eq : true && false = false. 42 | (* Eval cbv zeta in [LHS of prf_eq]. *) 43 | (** The desired result = true && false *) 44 | 45 | End LHS. 46 | 47 | -------------------------------------------------------------------------------- /seminars/seminar08.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | 7 | (** * Odd and even numbers *) 8 | 9 | 10 | Structure odd_nat := Odd { 11 | oval :> nat; 12 | oprop : odd oval 13 | }. 14 | 15 | (** Prove the main property of [odd_nat] *) 16 | Lemma oddP (n : odd_nat) : odd n. 17 | Admitted. 18 | 19 | Structure even_nat := Even { 20 | eval :> nat; 21 | eprop : ~~ (odd eval) 22 | }. 23 | 24 | (* Prove the main property of [even_nat] *) 25 | Lemma evenP (n : even_nat) : ~~ (odd n). 26 | Admitted. 27 | 28 | 29 | (** ** Part 1: Arithmetics *) 30 | 31 | 32 | (** The objective is to make it work: knowing that 33 | [n] is [odd] Coq should infer that [n * 3] 34 | is also [odd], and that [6] is even *) 35 | Example test_odd (n : odd_nat) : ~~ (odd 6) && odd (n * 3). 36 | Proof. Fail by rewrite oddP evenP. Abort. 37 | 38 | (* Let's start by telling Coq that 0 is even *) 39 | Canonical even_0 : even_nat := @Even 0 isT. 40 | 41 | Lemma oddS n : ~~ (odd n) -> odd n.+1. 42 | Admitted. 43 | 44 | Lemma evenS n : (odd n) -> ~~ (odd n.+1). 45 | Admitted. 46 | 47 | (** Here we teach Coq that if [m] is even, 48 | then [m.+1] is [odd] *) 49 | (* 50 | Canonical odd_even (m : even_nat) : odd_nat := 51 | ... 52 | *) 53 | 54 | (** Implement the dual, teach Coq that if [m] 55 | is [odd] then [m.+1] is [even] *) 56 | (* 57 | Canonical even_odd (m : odd_nat) : even_nat := 58 | ... 59 | *) 60 | 61 | (** Now let's deal with multiplication *) 62 | Lemma odd_mulP (n m : odd_nat) : odd (n * m). 63 | Admitted. 64 | 65 | (** Teach Coq that [*] preserves being [odd] *) 66 | (* 67 | Canonical oddmul_Odd (n m : odd_nat) : odd_nat := 68 | ... 69 | *) 70 | 71 | (* It should work now! *) 72 | Example test_odd (n : odd_nat) : 73 | ~~ (odd 6) && odd (n * 3). 74 | Proof. by rewrite oddP evenP. Qed. 75 | 76 | 77 | (** ** Part 2: Equality *) 78 | 79 | (** We can't use [==] on [odd] natural numbers because 80 | [odd_nat] is not an [eqType] *) 81 | Fail Check forall n : odd_nat, n == n. 82 | 83 | (** Use the [subType] machinery in order 84 | to teach Coq that [odd_nat] is an [eqType] *) 85 | (* 86 | Canonical odd_subType := 87 | Definition odd_eqMixin := 88 | Canonical odd_eqType := 89 | *) 90 | 91 | (* This should work now *) 92 | Check forall n : odd_nat, n == n. 93 | Lemma odd_nat_eq_refl (n : odd_nat) : 94 | Proof. by rewrite eq_refl. Qed. 95 | 96 | (** Now deal with [even_nat] *) 97 | Fail Check forall (m : even_nat), m == m. 98 | 99 | Check forall (m : even_nat), m == m. 100 | 101 | Lemma odd_nat_eq_refl (n : even_nat) : 102 | Proof. by rewrite eq_refl. Qed. 103 | 104 | -------------------------------------------------------------------------------- /seminars/seminar09.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | (** * Totality and termination *) 7 | 8 | (** Define Ackermann's function without using 9 | the nested [fix] trick. 10 | Try several different approaches 11 | *) 12 | 13 | 14 | (** Implement the [interleave] function using 15 | [Fix_F_2] combinator *) 16 | (** 17 | Definition interleave_fix {A} (xs ys : seq A) : seq A := 18 | Fix_F_2 ... 19 | *) 20 | 21 | 22 | (** Define a list sorting function using merge sort algorithm. *) 23 | 24 | 25 | 26 | 27 | (** * Cast and John Major Equality via cast *) 28 | 29 | From Coq Require Import Eqdep. 30 | 31 | Section Cast. 32 | Variable (T : Type) (interp : T -> Type). 33 | 34 | Definition cast A B (pf : A = B) (v : interp B) : interp A := 35 | ecast _ _ (esym pf) v. 36 | 37 | (** Hint: you need to use [Streicher_K] axiom from [Eqdep] module *) 38 | Lemma eqc A (pf : A = A) (v : interp A) : cast pf v = v. 39 | Proof. 40 | Admitted. 41 | 42 | (** Heterogeneous equality via [cast] *) 43 | Definition jmeq A B (v : interp A) (w : interp B) := 44 | exists pf, v = cast pf w. 45 | 46 | Lemma jmrefl A (v : interp A) : jmeq v v. 47 | Proof. 48 | Admitted. 49 | 50 | Lemma jm_sym A B (v : interp A) (w : interp B) : jmeq v w -> jmeq w v. 51 | Proof. 52 | Admitted. 53 | 54 | Lemma jm_trans A B C (u : interp A) (v : interp B) (w : interp C) : 55 | jmeq u v -> jmeq v w -> jmeq u w. 56 | Proof. 57 | Admitted. 58 | 59 | Lemma jmE A (v w : interp A) : jmeq v w <-> v = w. 60 | Proof. 61 | Admitted. 62 | 63 | Lemma castE A B (pf1 pf2 : A = B) (v1 v2 : interp B) : 64 | v1 = v2 <-> cast pf1 v1 = cast pf2 v2. 65 | Proof. 66 | Admitted. 67 | 68 | End Cast. 69 | -------------------------------------------------------------------------------- /seminars/seminar10.v: -------------------------------------------------------------------------------- 1 | From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path. 2 | Set Implicit Arguments. 3 | Unset Strict Implicit. 4 | Unset Printing Implicit Defensive. 5 | 6 | 7 | Section LectureExercise. 8 | 9 | Variable T : eqType. 10 | Variable leT : rel T. 11 | Implicit Types x y z : T. 12 | Implicit Types s t u : seq T. 13 | 14 | (** Insert an element [e] into a sorted list [s] *) 15 | Fixpoint insert e s : seq T := 16 | if s is x :: s' then 17 | if leT e x then e :: s 18 | else x :: (insert e s') 19 | else [:: e]. 20 | 21 | (** Sort input list [s] *) 22 | Fixpoint sort s : seq T := 23 | if s is x :: s' then 24 | insert x (sort s') 25 | else [::]. 26 | 27 | Lemma sorted_cons e s : 28 | sorted leT (e :: s) -> sorted leT s. 29 | Proof. 30 | Admitted. 31 | 32 | 33 | (** Refactor the proof in the lecture 10 into an idiomatic one *) 34 | Lemma insert_path z e s : 35 | leT z e -> 36 | path leT z s -> 37 | path leT z (insert e s). 38 | Proof. 39 | Admitted. 40 | 41 | 42 | Lemma sort_sorted s : 43 | sorted leT (sort s). 44 | Proof. 45 | Admitted. 46 | 47 | Lemma count_insert p e s : 48 | count p (insert leT e s) = p e + count p s. 49 | Proof. 50 | Admitted. 51 | 52 | End LectureExercise. 53 | 54 | 55 | Section Stability. 56 | Variables (T : eqType) (leT leT' : rel T). 57 | Implicit Types s : seq T. 58 | 59 | (** Hint: you are free to assume [transitivity] of [leT] / [leT'] should 60 | you need that. E.g. 61 | Hypothesis leT_tr : transitive leT. 62 | *) 63 | 64 | Lemma sort_stable s : 65 | sorted leT' s -> 66 | sorted 67 | [rel x y | leT x y && (leT y x ==> leT' x y)] 68 | (sort leT s). 69 | Proof. 70 | Admitted. 71 | 72 | End Stability. 73 | -------------------------------------------------------------------------------- /slides/images/deepspec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/images/deepspec.png -------------------------------------------------------------------------------- /slides/images/fscq-bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/images/fscq-bug.png -------------------------------------------------------------------------------- /slides/images/homeo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/images/homeo.jpg -------------------------------------------------------------------------------- /slides/images/scilla-coq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/images/scilla-coq.jpg -------------------------------------------------------------------------------- /slides/images/xmonad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/images/xmonad.png -------------------------------------------------------------------------------- /slides/modifications.css: -------------------------------------------------------------------------------- 1 | .reveal .title { 2 | font-size: 2.75em; 3 | } 4 | 5 | .reveal .author { 6 | font-size: 1.5em; 7 | } 8 | 9 | .reveal .date { 10 | font-size: 1.2em; 11 | } 12 | 13 | .reveal pre { 14 | font-size: 0.75em; 15 | } 16 | 17 | .reveal ol, 18 | .reveal dl, 19 | .reveal ul { 20 | display: block; 21 | text-align: left; 22 | margin: 0 0 0 1em; } 23 | 24 | .reveal p { 25 | text-align: left; 26 | } 27 | -------------------------------------------------------------------------------- /slides/reveal.js/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.iml 3 | *.iws 4 | *.eml 5 | out/ 6 | .DS_Store 7 | .svn 8 | log/*.log 9 | tmp/** 10 | node_modules/ 11 | package-lock.json 12 | .sass-cache 13 | css/reveal.min.css 14 | js/reveal.min.js 15 | -------------------------------------------------------------------------------- /slides/reveal.js/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 4 4 | after_script: 5 | - npm run build -- retire 6 | -------------------------------------------------------------------------------- /slides/reveal.js/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | Please keep the [issue tracker](http://github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**. 4 | 5 | 6 | ### Personal Support 7 | If you have personal support or setup questions the best place to ask those are [StackOverflow](http://stackoverflow.com/questions/tagged/reveal.js). 8 | 9 | 10 | ### Bug Reports 11 | When reporting a bug make sure to include information about which browser and operating system you are on as well as the necessary steps to reproduce the issue. If possible please include a link to a sample presentation where the bug can be tested. 12 | 13 | 14 | ### Pull Requests 15 | - Should follow the coding style of the file you work in, most importantly: 16 | - Tabs to indent 17 | - Single-quoted strings 18 | - Should be made towards the **dev branch** 19 | - Should be submitted from a feature/topic branch (not your master) 20 | 21 | 22 | ### Plugins 23 | Please do not submit plugins as pull requests. They should be maintained in their own separate repository. More information here: https://github.com/hakimel/reveal.js/wiki/Plugin-Guidelines 24 | -------------------------------------------------------------------------------- /slides/reveal.js/Gruntfile.js: -------------------------------------------------------------------------------- 1 | /* global module:false */ 2 | module.exports = function(grunt) { 3 | var port = grunt.option('port') || 8000; 4 | var root = grunt.option('root') || '.'; 5 | 6 | if (!Array.isArray(root)) root = [root]; 7 | 8 | // Project configuration 9 | grunt.initConfig({ 10 | pkg: grunt.file.readJSON('package.json'), 11 | meta: { 12 | banner: 13 | '/*!\n' + 14 | ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + 15 | ' * http://revealjs.com\n' + 16 | ' * MIT licensed\n' + 17 | ' *\n' + 18 | ' * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n' + 19 | ' */' 20 | }, 21 | 22 | qunit: { 23 | files: [ 'test/*.html' ] 24 | }, 25 | 26 | uglify: { 27 | options: { 28 | banner: '<%= meta.banner %>\n', 29 | ie8: true 30 | }, 31 | build: { 32 | src: 'js/reveal.js', 33 | dest: 'js/reveal.min.js' 34 | } 35 | }, 36 | 37 | sass: { 38 | core: { 39 | src: 'css/reveal.scss', 40 | dest: 'css/reveal.css' 41 | }, 42 | themes: { 43 | expand: true, 44 | cwd: 'css/theme/source', 45 | src: ['*.sass', '*.scss'], 46 | dest: 'css/theme', 47 | ext: '.css' 48 | } 49 | }, 50 | 51 | autoprefixer: { 52 | core: { 53 | src: 'css/reveal.css' 54 | } 55 | }, 56 | 57 | cssmin: { 58 | options: { 59 | compatibility: 'ie9' 60 | }, 61 | compress: { 62 | src: 'css/reveal.css', 63 | dest: 'css/reveal.min.css' 64 | } 65 | }, 66 | 67 | jshint: { 68 | options: { 69 | curly: false, 70 | eqeqeq: true, 71 | immed: true, 72 | esnext: true, 73 | latedef: 'nofunc', 74 | newcap: true, 75 | noarg: true, 76 | sub: true, 77 | undef: true, 78 | eqnull: true, 79 | browser: true, 80 | expr: true, 81 | loopfunc: true, 82 | globals: { 83 | head: false, 84 | module: false, 85 | console: false, 86 | unescape: false, 87 | define: false, 88 | exports: false 89 | } 90 | }, 91 | files: [ 'Gruntfile.js', 'js/reveal.js' ] 92 | }, 93 | 94 | connect: { 95 | server: { 96 | options: { 97 | port: port, 98 | base: root, 99 | livereload: true, 100 | open: true, 101 | useAvailablePort: true 102 | } 103 | } 104 | }, 105 | 106 | zip: { 107 | bundle: { 108 | src: [ 109 | 'index.html', 110 | 'css/**', 111 | 'js/**', 112 | 'lib/**', 113 | 'images/**', 114 | 'plugin/**', 115 | '**.md' 116 | ], 117 | dest: 'reveal-js-presentation.zip' 118 | } 119 | }, 120 | 121 | watch: { 122 | js: { 123 | files: [ 'Gruntfile.js', 'js/reveal.js' ], 124 | tasks: 'js' 125 | }, 126 | theme: { 127 | files: [ 128 | 'css/theme/source/*.sass', 129 | 'css/theme/source/*.scss', 130 | 'css/theme/template/*.sass', 131 | 'css/theme/template/*.scss' 132 | ], 133 | tasks: 'css-themes' 134 | }, 135 | css: { 136 | files: [ 'css/reveal.scss' ], 137 | tasks: 'css-core' 138 | }, 139 | html: { 140 | files: root.map(path => path + '/*.html') 141 | }, 142 | markdown: { 143 | files: root.map(path => path + '/*.md') 144 | }, 145 | options: { 146 | livereload: true 147 | } 148 | }, 149 | 150 | retire: { 151 | js: [ 'js/reveal.js', 'lib/js/*.js', 'plugin/**/*.js' ], 152 | node: [ '.' ] 153 | } 154 | 155 | }); 156 | 157 | // Dependencies 158 | grunt.loadNpmTasks( 'grunt-contrib-connect' ); 159 | grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); 160 | grunt.loadNpmTasks( 'grunt-contrib-jshint' ); 161 | grunt.loadNpmTasks( 'grunt-contrib-qunit' ); 162 | grunt.loadNpmTasks( 'grunt-contrib-uglify' ); 163 | grunt.loadNpmTasks( 'grunt-contrib-watch' ); 164 | grunt.loadNpmTasks( 'grunt-autoprefixer' ); 165 | grunt.loadNpmTasks( 'grunt-retire' ); 166 | grunt.loadNpmTasks( 'grunt-sass' ); 167 | grunt.loadNpmTasks( 'grunt-zip' ); 168 | 169 | // Default task 170 | grunt.registerTask( 'default', [ 'css', 'js' ] ); 171 | 172 | // JS task 173 | grunt.registerTask( 'js', [ 'jshint', 'uglify', 'qunit' ] ); 174 | 175 | // Theme CSS 176 | grunt.registerTask( 'css-themes', [ 'sass:themes' ] ); 177 | 178 | // Core framework CSS 179 | grunt.registerTask( 'css-core', [ 'sass:core', 'autoprefixer', 'cssmin' ] ); 180 | 181 | // All CSS 182 | grunt.registerTask( 'css', [ 'sass', 'autoprefixer', 'cssmin' ] ); 183 | 184 | // Package presentation to archive 185 | grunt.registerTask( 'package', [ 'default', 'zip' ] ); 186 | 187 | // Serve presentation locally 188 | grunt.registerTask( 'serve', [ 'connect', 'watch' ] ); 189 | 190 | // Run tests 191 | grunt.registerTask( 'test', [ 'jshint', 'qunit' ] ); 192 | 193 | }; 194 | -------------------------------------------------------------------------------- /slides/reveal.js/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2018 Hakim El Hattab, http://hakim.se, and reveal.js contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /slides/reveal.js/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reveal.js", 3 | "version": "3.7.0", 4 | "main": [ 5 | "js/reveal.js", 6 | "css/reveal.css" 7 | ], 8 | "homepage": "http://revealjs.com", 9 | "license": "MIT", 10 | "description": "The HTML Presentation Framework", 11 | "authors": [ 12 | "Hakim El Hattab " 13 | ], 14 | "dependencies": { 15 | "headjs": "~1.0.3" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/hakimel/reveal.js.git" 20 | }, 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test" 26 | ] 27 | } -------------------------------------------------------------------------------- /slides/reveal.js/css/print/paper.css: -------------------------------------------------------------------------------- 1 | /* Default Print Stylesheet Template 2 | by Rob Glazebrook of CSSnewbie.com 3 | Last Updated: June 4, 2008 4 | 5 | Feel free (nay, compelled) to edit, append, and 6 | manipulate this file as you see fit. */ 7 | 8 | 9 | @media print { 10 | 11 | /* SECTION 1: Set default width, margin, float, and 12 | background. This prevents elements from extending 13 | beyond the edge of the printed page, and prevents 14 | unnecessary background images from printing */ 15 | html { 16 | background: #fff; 17 | width: auto; 18 | height: auto; 19 | overflow: visible; 20 | } 21 | body { 22 | background: #fff; 23 | font-size: 20pt; 24 | width: auto; 25 | height: auto; 26 | border: 0; 27 | margin: 0 5%; 28 | padding: 0; 29 | overflow: visible; 30 | float: none !important; 31 | } 32 | 33 | /* SECTION 2: Remove any elements not needed in print. 34 | This would include navigation, ads, sidebars, etc. */ 35 | .nestedarrow, 36 | .controls, 37 | .fork-reveal, 38 | .share-reveal, 39 | .state-background, 40 | .reveal .progress, 41 | .reveal .backgrounds, 42 | .reveal .slide-number { 43 | display: none !important; 44 | } 45 | 46 | /* SECTION 3: Set body font face, size, and color. 47 | Consider using a serif font for readability. */ 48 | body, p, td, li, div { 49 | font-size: 20pt!important; 50 | font-family: Georgia, "Times New Roman", Times, serif !important; 51 | color: #000; 52 | } 53 | 54 | /* SECTION 4: Set heading font face, sizes, and color. 55 | Differentiate your headings from your body text. 56 | Perhaps use a large sans-serif for distinction. */ 57 | h1,h2,h3,h4,h5,h6 { 58 | color: #000!important; 59 | height: auto; 60 | line-height: normal; 61 | font-family: Georgia, "Times New Roman", Times, serif !important; 62 | text-shadow: 0 0 0 #000 !important; 63 | text-align: left; 64 | letter-spacing: normal; 65 | } 66 | /* Need to reduce the size of the fonts for printing */ 67 | h1 { font-size: 28pt !important; } 68 | h2 { font-size: 24pt !important; } 69 | h3 { font-size: 22pt !important; } 70 | h4 { font-size: 22pt !important; font-variant: small-caps; } 71 | h5 { font-size: 21pt !important; } 72 | h6 { font-size: 20pt !important; font-style: italic; } 73 | 74 | /* SECTION 5: Make hyperlinks more usable. 75 | Ensure links are underlined, and consider appending 76 | the URL to the end of the link for usability. */ 77 | a:link, 78 | a:visited { 79 | color: #000 !important; 80 | font-weight: bold; 81 | text-decoration: underline; 82 | } 83 | /* 84 | .reveal a:link:after, 85 | .reveal a:visited:after { 86 | content: " (" attr(href) ") "; 87 | color: #222 !important; 88 | font-size: 90%; 89 | } 90 | */ 91 | 92 | 93 | /* SECTION 6: more reveal.js specific additions by @skypanther */ 94 | ul, ol, div, p { 95 | visibility: visible; 96 | position: static; 97 | width: auto; 98 | height: auto; 99 | display: block; 100 | overflow: visible; 101 | margin: 0; 102 | text-align: left !important; 103 | } 104 | .reveal pre, 105 | .reveal table { 106 | margin-left: 0; 107 | margin-right: 0; 108 | } 109 | .reveal pre code { 110 | padding: 20px; 111 | border: 1px solid #ddd; 112 | } 113 | .reveal blockquote { 114 | margin: 20px 0; 115 | } 116 | .reveal .slides { 117 | position: static !important; 118 | width: auto !important; 119 | height: auto !important; 120 | 121 | left: 0 !important; 122 | top: 0 !important; 123 | margin-left: 0 !important; 124 | margin-top: 0 !important; 125 | padding: 0 !important; 126 | zoom: 1 !important; 127 | 128 | overflow: visible !important; 129 | display: block !important; 130 | 131 | text-align: left !important; 132 | -webkit-perspective: none; 133 | -moz-perspective: none; 134 | -ms-perspective: none; 135 | perspective: none; 136 | 137 | -webkit-perspective-origin: 50% 50%; 138 | -moz-perspective-origin: 50% 50%; 139 | -ms-perspective-origin: 50% 50%; 140 | perspective-origin: 50% 50%; 141 | } 142 | .reveal .slides section { 143 | visibility: visible !important; 144 | position: static !important; 145 | width: auto !important; 146 | height: auto !important; 147 | display: block !important; 148 | overflow: visible !important; 149 | 150 | left: 0 !important; 151 | top: 0 !important; 152 | margin-left: 0 !important; 153 | margin-top: 0 !important; 154 | padding: 60px 20px !important; 155 | z-index: auto !important; 156 | 157 | opacity: 1 !important; 158 | 159 | page-break-after: always !important; 160 | 161 | -webkit-transform-style: flat !important; 162 | -moz-transform-style: flat !important; 163 | -ms-transform-style: flat !important; 164 | transform-style: flat !important; 165 | 166 | -webkit-transform: none !important; 167 | -moz-transform: none !important; 168 | -ms-transform: none !important; 169 | transform: none !important; 170 | 171 | -webkit-transition: none !important; 172 | -moz-transition: none !important; 173 | -ms-transition: none !important; 174 | transition: none !important; 175 | } 176 | .reveal .slides section.stack { 177 | padding: 0 !important; 178 | } 179 | .reveal section:last-of-type { 180 | page-break-after: avoid !important; 181 | } 182 | .reveal section .fragment { 183 | opacity: 1 !important; 184 | visibility: visible !important; 185 | 186 | -webkit-transform: none !important; 187 | -moz-transform: none !important; 188 | -ms-transform: none !important; 189 | transform: none !important; 190 | } 191 | .reveal section img { 192 | display: block; 193 | margin: 15px 0px; 194 | background: rgba(255,255,255,1); 195 | border: 1px solid #666; 196 | box-shadow: none; 197 | } 198 | 199 | .reveal section small { 200 | font-size: 0.8em; 201 | } 202 | 203 | } 204 | -------------------------------------------------------------------------------- /slides/reveal.js/css/print/pdf.css: -------------------------------------------------------------------------------- 1 | /** 2 | * This stylesheet is used to print reveal.js 3 | * presentations to PDF. 4 | * 5 | * https://github.com/hakimel/reveal.js#pdf-export 6 | */ 7 | 8 | * { 9 | -webkit-print-color-adjust: exact; 10 | } 11 | 12 | body { 13 | margin: 0 auto !important; 14 | border: 0; 15 | padding: 0; 16 | float: none !important; 17 | overflow: visible; 18 | } 19 | 20 | html { 21 | width: 100%; 22 | height: 100%; 23 | overflow: visible; 24 | } 25 | 26 | /* Remove any elements not needed in print. */ 27 | .nestedarrow, 28 | .reveal .controls, 29 | .reveal .progress, 30 | .reveal .playback, 31 | .reveal.overview, 32 | .fork-reveal, 33 | .share-reveal, 34 | .state-background { 35 | display: none !important; 36 | } 37 | 38 | h1, h2, h3, h4, h5, h6 { 39 | text-shadow: 0 0 0 #000 !important; 40 | } 41 | 42 | .reveal pre code { 43 | overflow: hidden !important; 44 | font-family: Courier, 'Courier New', monospace !important; 45 | } 46 | 47 | ul, ol, div, p { 48 | visibility: visible; 49 | position: static; 50 | width: auto; 51 | height: auto; 52 | display: block; 53 | overflow: visible; 54 | margin: auto; 55 | } 56 | .reveal { 57 | width: auto !important; 58 | height: auto !important; 59 | overflow: hidden !important; 60 | } 61 | .reveal .slides { 62 | position: static; 63 | width: 100% !important; 64 | height: auto !important; 65 | zoom: 1 !important; 66 | 67 | left: auto; 68 | top: auto; 69 | margin: 0 !important; 70 | padding: 0 !important; 71 | 72 | overflow: visible; 73 | display: block; 74 | 75 | perspective: none; 76 | perspective-origin: 50% 50%; 77 | } 78 | 79 | .reveal .slides .pdf-page { 80 | position: relative; 81 | overflow: hidden; 82 | z-index: 1; 83 | 84 | page-break-after: always; 85 | } 86 | 87 | .reveal .slides section { 88 | visibility: visible !important; 89 | display: block !important; 90 | position: absolute !important; 91 | 92 | margin: 0 !important; 93 | padding: 0 !important; 94 | box-sizing: border-box !important; 95 | min-height: 1px; 96 | 97 | opacity: 1 !important; 98 | 99 | transform-style: flat !important; 100 | transform: none !important; 101 | } 102 | 103 | .reveal section.stack { 104 | position: relative !important; 105 | margin: 0 !important; 106 | padding: 0 !important; 107 | page-break-after: avoid !important; 108 | height: auto !important; 109 | min-height: auto !important; 110 | } 111 | 112 | .reveal img { 113 | box-shadow: none; 114 | } 115 | 116 | .reveal .roll { 117 | overflow: visible; 118 | line-height: 1em; 119 | } 120 | 121 | /* Slide backgrounds are placed inside of their slide when exporting to PDF */ 122 | .reveal .slide-background { 123 | display: block !important; 124 | position: absolute; 125 | top: 0; 126 | left: 0; 127 | width: 100%; 128 | height: 100%; 129 | z-index: auto !important; 130 | } 131 | 132 | /* Display slide speaker notes when 'showNotes' is enabled */ 133 | .reveal.show-notes { 134 | max-width: none; 135 | max-height: none; 136 | } 137 | .reveal .speaker-notes-pdf { 138 | display: block; 139 | width: 100%; 140 | height: auto; 141 | max-height: none; 142 | top: auto; 143 | right: auto; 144 | bottom: auto; 145 | left: auto; 146 | z-index: 100; 147 | } 148 | 149 | /* Layout option which makes notes appear on a separate page */ 150 | .reveal .speaker-notes-pdf[data-layout="separate-page"] { 151 | position: relative; 152 | color: inherit; 153 | background-color: transparent; 154 | padding: 20px; 155 | page-break-after: always; 156 | border: 0; 157 | } 158 | 159 | /* Display slide numbers when 'slideNumber' is enabled */ 160 | .reveal .slide-number-pdf { 161 | display: block; 162 | position: absolute; 163 | font-size: 14px; 164 | } 165 | -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/README.md: -------------------------------------------------------------------------------- 1 | ## Dependencies 2 | 3 | Themes are written using Sass to keep things modular and reduce the need for repeated selectors across files. Make sure that you have the reveal.js development environment including the Grunt dependencies installed before proceeding: https://github.com/hakimel/reveal.js#full-setup 4 | 5 | ## Creating a Theme 6 | 7 | To create your own theme, start by duplicating a ```.scss``` file in [/css/theme/source](https://github.com/hakimel/reveal.js/blob/master/css/theme/source). It will be automatically compiled by Grunt from Sass to CSS (see the [Gruntfile](https://github.com/hakimel/reveal.js/blob/master/Gruntfile.js)) when you run `npm run build -- css-themes`. 8 | 9 | Each theme file does four things in the following order: 10 | 11 | 1. **Include [/css/theme/template/mixins.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/mixins.scss)** 12 | Shared utility functions. 13 | 14 | 2. **Include [/css/theme/template/settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss)** 15 | Declares a set of custom variables that the template file (step 4) expects. Can be overridden in step 3. 16 | 17 | 3. **Override** 18 | This is where you override the default theme. Either by specifying variables (see [settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss) for reference) or by adding any selectors and styles you please. 19 | 20 | 4. **Include [/css/theme/template/theme.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/theme.scss)** 21 | The template theme file which will generate final CSS output based on the currently defined variables. 22 | -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/moon.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Solarized Dark theme for reveal.js. 3 | * Author: Achim Staebler 4 | */ 5 | @import url(../../lib/font/league-gothic/league-gothic.css); 6 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 7 | /** 8 | * Solarized colors by Ethan Schoonover 9 | */ 10 | html * { 11 | color-profile: sRGB; 12 | rendering-intent: auto; } 13 | 14 | /********************************************* 15 | * GLOBAL STYLES 16 | *********************************************/ 17 | body { 18 | background: #002b36; 19 | background-color: #002b36; } 20 | 21 | .reveal { 22 | font-family: "Lato", sans-serif; 23 | font-size: 40px; 24 | font-weight: normal; 25 | color: #93a1a1; } 26 | 27 | ::selection { 28 | color: #fff; 29 | background: #d33682; 30 | text-shadow: none; } 31 | 32 | ::-moz-selection { 33 | color: #fff; 34 | background: #d33682; 35 | text-shadow: none; } 36 | 37 | .reveal .slides section, 38 | .reveal .slides section > section { 39 | line-height: 1.3; 40 | font-weight: inherit; } 41 | 42 | /********************************************* 43 | * HEADERS 44 | *********************************************/ 45 | .reveal h1, 46 | .reveal h2, 47 | .reveal h3, 48 | .reveal h4, 49 | .reveal h5, 50 | .reveal h6 { 51 | margin: 0 0 20px 0; 52 | color: #eee8d5; 53 | font-family: "League Gothic", Impact, sans-serif; 54 | font-weight: normal; 55 | line-height: 1.2; 56 | letter-spacing: normal; 57 | text-transform: uppercase; 58 | text-shadow: none; 59 | word-wrap: break-word; } 60 | 61 | .reveal h1 { 62 | font-size: 3.77em; } 63 | 64 | .reveal h2 { 65 | font-size: 2.11em; } 66 | 67 | .reveal h3 { 68 | font-size: 1.55em; } 69 | 70 | .reveal h4 { 71 | font-size: 1em; } 72 | 73 | .reveal h1 { 74 | text-shadow: none; } 75 | 76 | /********************************************* 77 | * OTHER 78 | *********************************************/ 79 | .reveal p { 80 | margin: 20px 0; 81 | line-height: 1.3; } 82 | 83 | /* Ensure certain elements are never larger than the slide itself */ 84 | .reveal img, 85 | .reveal video, 86 | .reveal iframe { 87 | max-width: 95%; 88 | max-height: 95%; } 89 | 90 | .reveal strong, 91 | .reveal b { 92 | font-weight: bold; } 93 | 94 | .reveal em { 95 | font-style: italic; } 96 | 97 | .reveal ol, 98 | .reveal dl, 99 | .reveal ul { 100 | display: inline-block; 101 | text-align: left; 102 | margin: 0 0 0 1em; } 103 | 104 | .reveal ol { 105 | list-style-type: decimal; } 106 | 107 | .reveal ul { 108 | list-style-type: disc; } 109 | 110 | .reveal ul ul { 111 | list-style-type: square; } 112 | 113 | .reveal ul ul ul { 114 | list-style-type: circle; } 115 | 116 | .reveal ul ul, 117 | .reveal ul ol, 118 | .reveal ol ol, 119 | .reveal ol ul { 120 | display: block; 121 | margin-left: 40px; } 122 | 123 | .reveal dt { 124 | font-weight: bold; } 125 | 126 | .reveal dd { 127 | margin-left: 40px; } 128 | 129 | .reveal blockquote { 130 | display: block; 131 | position: relative; 132 | width: 70%; 133 | margin: 20px auto; 134 | padding: 5px; 135 | font-style: italic; 136 | background: rgba(255, 255, 255, 0.05); 137 | box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } 138 | 139 | .reveal blockquote p:first-child, 140 | .reveal blockquote p:last-child { 141 | display: inline-block; } 142 | 143 | .reveal q { 144 | font-style: italic; } 145 | 146 | .reveal pre { 147 | display: block; 148 | position: relative; 149 | width: 90%; 150 | margin: 20px auto; 151 | text-align: left; 152 | font-size: 0.55em; 153 | font-family: monospace; 154 | line-height: 1.2em; 155 | word-wrap: break-word; 156 | box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); } 157 | 158 | .reveal code { 159 | font-family: monospace; 160 | text-transform: none; } 161 | 162 | .reveal pre code { 163 | display: block; 164 | padding: 5px; 165 | overflow: auto; 166 | max-height: 400px; 167 | word-wrap: normal; } 168 | 169 | .reveal table { 170 | margin: auto; 171 | border-collapse: collapse; 172 | border-spacing: 0; } 173 | 174 | .reveal table th { 175 | font-weight: bold; } 176 | 177 | .reveal table th, 178 | .reveal table td { 179 | text-align: left; 180 | padding: 0.2em 0.5em 0.2em 0.5em; 181 | border-bottom: 1px solid; } 182 | 183 | .reveal table th[align="center"], 184 | .reveal table td[align="center"] { 185 | text-align: center; } 186 | 187 | .reveal table th[align="right"], 188 | .reveal table td[align="right"] { 189 | text-align: right; } 190 | 191 | .reveal table tbody tr:last-child th, 192 | .reveal table tbody tr:last-child td { 193 | border-bottom: none; } 194 | 195 | .reveal sup { 196 | vertical-align: super; 197 | font-size: smaller; } 198 | 199 | .reveal sub { 200 | vertical-align: sub; 201 | font-size: smaller; } 202 | 203 | .reveal small { 204 | display: inline-block; 205 | font-size: 0.6em; 206 | line-height: 1.2em; 207 | vertical-align: top; } 208 | 209 | .reveal small * { 210 | vertical-align: top; } 211 | 212 | /********************************************* 213 | * LINKS 214 | *********************************************/ 215 | .reveal a { 216 | color: #268bd2; 217 | text-decoration: none; 218 | -webkit-transition: color .15s ease; 219 | -moz-transition: color .15s ease; 220 | transition: color .15s ease; } 221 | 222 | .reveal a:hover { 223 | color: #78b9e6; 224 | text-shadow: none; 225 | border: none; } 226 | 227 | .reveal .roll span:after { 228 | color: #fff; 229 | background: #1a6091; } 230 | 231 | /********************************************* 232 | * IMAGES 233 | *********************************************/ 234 | .reveal section img { 235 | margin: 15px 0px; 236 | background: rgba(255, 255, 255, 0.12); 237 | border: 4px solid #93a1a1; 238 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } 239 | 240 | .reveal section img.plain { 241 | border: 0; 242 | box-shadow: none; } 243 | 244 | .reveal a img { 245 | -webkit-transition: all .15s linear; 246 | -moz-transition: all .15s linear; 247 | transition: all .15s linear; } 248 | 249 | .reveal a:hover img { 250 | background: rgba(255, 255, 255, 0.2); 251 | border-color: #268bd2; 252 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 253 | 254 | /********************************************* 255 | * NAVIGATION CONTROLS 256 | *********************************************/ 257 | .reveal .controls { 258 | color: #268bd2; } 259 | 260 | /********************************************* 261 | * PROGRESS BAR 262 | *********************************************/ 263 | .reveal .progress { 264 | background: rgba(0, 0, 0, 0.2); 265 | color: #268bd2; } 266 | 267 | .reveal .progress span { 268 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 269 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 270 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 271 | 272 | /********************************************* 273 | * PRINT BACKGROUND 274 | *********************************************/ 275 | @media print { 276 | .backgrounds { 277 | background-color: #002b36; } } 278 | -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/night.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Black theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | @import url(https://fonts.googleapis.com/css?family=Montserrat:700); 7 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic); 8 | /********************************************* 9 | * GLOBAL STYLES 10 | *********************************************/ 11 | body { 12 | background: #111; 13 | background-color: #111; } 14 | 15 | .reveal { 16 | font-family: "Open Sans", sans-serif; 17 | font-size: 40px; 18 | font-weight: normal; 19 | color: #eee; } 20 | 21 | ::selection { 22 | color: #fff; 23 | background: #e7ad52; 24 | text-shadow: none; } 25 | 26 | ::-moz-selection { 27 | color: #fff; 28 | background: #e7ad52; 29 | text-shadow: none; } 30 | 31 | .reveal .slides section, 32 | .reveal .slides section > section { 33 | line-height: 1.3; 34 | font-weight: inherit; } 35 | 36 | /********************************************* 37 | * HEADERS 38 | *********************************************/ 39 | .reveal h1, 40 | .reveal h2, 41 | .reveal h3, 42 | .reveal h4, 43 | .reveal h5, 44 | .reveal h6 { 45 | margin: 0 0 20px 0; 46 | color: #eee; 47 | font-family: "Montserrat", Impact, sans-serif; 48 | font-weight: normal; 49 | line-height: 1.2; 50 | letter-spacing: -0.03em; 51 | text-transform: none; 52 | text-shadow: none; 53 | word-wrap: break-word; } 54 | 55 | .reveal h1 { 56 | font-size: 3.77em; } 57 | 58 | .reveal h2 { 59 | font-size: 2.11em; } 60 | 61 | .reveal h3 { 62 | font-size: 1.55em; } 63 | 64 | .reveal h4 { 65 | font-size: 1em; } 66 | 67 | .reveal h1 { 68 | text-shadow: none; } 69 | 70 | /********************************************* 71 | * OTHER 72 | *********************************************/ 73 | .reveal p { 74 | margin: 20px 0; 75 | line-height: 1.3; } 76 | 77 | /* Ensure certain elements are never larger than the slide itself */ 78 | .reveal img, 79 | .reveal video, 80 | .reveal iframe { 81 | max-width: 95%; 82 | max-height: 95%; } 83 | 84 | .reveal strong, 85 | .reveal b { 86 | font-weight: bold; } 87 | 88 | .reveal em { 89 | font-style: italic; } 90 | 91 | .reveal ol, 92 | .reveal dl, 93 | .reveal ul { 94 | display: inline-block; 95 | text-align: left; 96 | margin: 0 0 0 1em; } 97 | 98 | .reveal ol { 99 | list-style-type: decimal; } 100 | 101 | .reveal ul { 102 | list-style-type: disc; } 103 | 104 | .reveal ul ul { 105 | list-style-type: square; } 106 | 107 | .reveal ul ul ul { 108 | list-style-type: circle; } 109 | 110 | .reveal ul ul, 111 | .reveal ul ol, 112 | .reveal ol ol, 113 | .reveal ol ul { 114 | display: block; 115 | margin-left: 40px; } 116 | 117 | .reveal dt { 118 | font-weight: bold; } 119 | 120 | .reveal dd { 121 | margin-left: 40px; } 122 | 123 | .reveal blockquote { 124 | display: block; 125 | position: relative; 126 | width: 70%; 127 | margin: 20px auto; 128 | padding: 5px; 129 | font-style: italic; 130 | background: rgba(255, 255, 255, 0.05); 131 | box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } 132 | 133 | .reveal blockquote p:first-child, 134 | .reveal blockquote p:last-child { 135 | display: inline-block; } 136 | 137 | .reveal q { 138 | font-style: italic; } 139 | 140 | .reveal pre { 141 | display: block; 142 | position: relative; 143 | width: 90%; 144 | margin: 20px auto; 145 | text-align: left; 146 | font-size: 0.55em; 147 | font-family: monospace; 148 | line-height: 1.2em; 149 | word-wrap: break-word; 150 | box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); } 151 | 152 | .reveal code { 153 | font-family: monospace; 154 | text-transform: none; } 155 | 156 | .reveal pre code { 157 | display: block; 158 | padding: 5px; 159 | overflow: auto; 160 | max-height: 400px; 161 | word-wrap: normal; } 162 | 163 | .reveal table { 164 | margin: auto; 165 | border-collapse: collapse; 166 | border-spacing: 0; } 167 | 168 | .reveal table th { 169 | font-weight: bold; } 170 | 171 | .reveal table th, 172 | .reveal table td { 173 | text-align: left; 174 | padding: 0.2em 0.5em 0.2em 0.5em; 175 | border-bottom: 1px solid; } 176 | 177 | .reveal table th[align="center"], 178 | .reveal table td[align="center"] { 179 | text-align: center; } 180 | 181 | .reveal table th[align="right"], 182 | .reveal table td[align="right"] { 183 | text-align: right; } 184 | 185 | .reveal table tbody tr:last-child th, 186 | .reveal table tbody tr:last-child td { 187 | border-bottom: none; } 188 | 189 | .reveal sup { 190 | vertical-align: super; 191 | font-size: smaller; } 192 | 193 | .reveal sub { 194 | vertical-align: sub; 195 | font-size: smaller; } 196 | 197 | .reveal small { 198 | display: inline-block; 199 | font-size: 0.6em; 200 | line-height: 1.2em; 201 | vertical-align: top; } 202 | 203 | .reveal small * { 204 | vertical-align: top; } 205 | 206 | /********************************************* 207 | * LINKS 208 | *********************************************/ 209 | .reveal a { 210 | color: #e7ad52; 211 | text-decoration: none; 212 | -webkit-transition: color .15s ease; 213 | -moz-transition: color .15s ease; 214 | transition: color .15s ease; } 215 | 216 | .reveal a:hover { 217 | color: #f3d7ac; 218 | text-shadow: none; 219 | border: none; } 220 | 221 | .reveal .roll span:after { 222 | color: #fff; 223 | background: #d08a1d; } 224 | 225 | /********************************************* 226 | * IMAGES 227 | *********************************************/ 228 | .reveal section img { 229 | margin: 15px 0px; 230 | background: rgba(255, 255, 255, 0.12); 231 | border: 4px solid #eee; 232 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } 233 | 234 | .reveal section img.plain { 235 | border: 0; 236 | box-shadow: none; } 237 | 238 | .reveal a img { 239 | -webkit-transition: all .15s linear; 240 | -moz-transition: all .15s linear; 241 | transition: all .15s linear; } 242 | 243 | .reveal a:hover img { 244 | background: rgba(255, 255, 255, 0.2); 245 | border-color: #e7ad52; 246 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 247 | 248 | /********************************************* 249 | * NAVIGATION CONTROLS 250 | *********************************************/ 251 | .reveal .controls { 252 | color: #e7ad52; } 253 | 254 | /********************************************* 255 | * PROGRESS BAR 256 | *********************************************/ 257 | .reveal .progress { 258 | background: rgba(0, 0, 0, 0.2); 259 | color: #e7ad52; } 260 | 261 | .reveal .progress span { 262 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 263 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 264 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 265 | 266 | /********************************************* 267 | * PRINT BACKGROUND 268 | *********************************************/ 269 | @media print { 270 | .backgrounds { 271 | background-color: #111; } } 272 | -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/serif.css: -------------------------------------------------------------------------------- 1 | /** 2 | * A simple theme for reveal.js presentations, similar 3 | * to the default theme. The accent color is brown. 4 | * 5 | * This theme is Copyright (C) 2012-2013 Owen Versteeg, http://owenversteeg.com - it is MIT licensed. 6 | */ 7 | .reveal a { 8 | line-height: 1.3em; } 9 | 10 | /********************************************* 11 | * GLOBAL STYLES 12 | *********************************************/ 13 | body { 14 | background: #F0F1EB; 15 | background-color: #F0F1EB; } 16 | 17 | .reveal { 18 | font-family: "Palatino Linotype", "Book Antiqua", Palatino, FreeSerif, serif; 19 | font-size: 40px; 20 | font-weight: normal; 21 | color: #000; } 22 | 23 | ::selection { 24 | color: #fff; 25 | background: #26351C; 26 | text-shadow: none; } 27 | 28 | ::-moz-selection { 29 | color: #fff; 30 | background: #26351C; 31 | text-shadow: none; } 32 | 33 | .reveal .slides section, 34 | .reveal .slides section > section { 35 | line-height: 1.3; 36 | font-weight: inherit; } 37 | 38 | /********************************************* 39 | * HEADERS 40 | *********************************************/ 41 | .reveal h1, 42 | .reveal h2, 43 | .reveal h3, 44 | .reveal h4, 45 | .reveal h5, 46 | .reveal h6 { 47 | margin: 0 0 20px 0; 48 | color: #383D3D; 49 | font-family: "Palatino Linotype", "Book Antiqua", Palatino, FreeSerif, serif; 50 | font-weight: normal; 51 | line-height: 1.2; 52 | letter-spacing: normal; 53 | text-transform: none; 54 | text-shadow: none; 55 | word-wrap: break-word; } 56 | 57 | .reveal h1 { 58 | font-size: 3.77em; } 59 | 60 | .reveal h2 { 61 | font-size: 2.11em; } 62 | 63 | .reveal h3 { 64 | font-size: 1.55em; } 65 | 66 | .reveal h4 { 67 | font-size: 1em; } 68 | 69 | .reveal h1 { 70 | text-shadow: none; } 71 | 72 | /********************************************* 73 | * OTHER 74 | *********************************************/ 75 | .reveal p { 76 | margin: 20px 0; 77 | line-height: 1.3; } 78 | 79 | /* Ensure certain elements are never larger than the slide itself */ 80 | .reveal img, 81 | .reveal video, 82 | .reveal iframe { 83 | max-width: 95%; 84 | max-height: 95%; } 85 | 86 | .reveal strong, 87 | .reveal b { 88 | font-weight: bold; } 89 | 90 | .reveal em { 91 | font-style: italic; } 92 | 93 | .reveal ol, 94 | .reveal dl, 95 | .reveal ul { 96 | display: inline-block; 97 | text-align: left; 98 | margin: 0 0 0 1em; } 99 | 100 | .reveal ol { 101 | list-style-type: decimal; } 102 | 103 | .reveal ul { 104 | list-style-type: disc; } 105 | 106 | .reveal ul ul { 107 | list-style-type: square; } 108 | 109 | .reveal ul ul ul { 110 | list-style-type: circle; } 111 | 112 | .reveal ul ul, 113 | .reveal ul ol, 114 | .reveal ol ol, 115 | .reveal ol ul { 116 | display: block; 117 | margin-left: 40px; } 118 | 119 | .reveal dt { 120 | font-weight: bold; } 121 | 122 | .reveal dd { 123 | margin-left: 40px; } 124 | 125 | .reveal blockquote { 126 | display: block; 127 | position: relative; 128 | width: 70%; 129 | margin: 20px auto; 130 | padding: 5px; 131 | font-style: italic; 132 | background: rgba(255, 255, 255, 0.05); 133 | box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } 134 | 135 | .reveal blockquote p:first-child, 136 | .reveal blockquote p:last-child { 137 | display: inline-block; } 138 | 139 | .reveal q { 140 | font-style: italic; } 141 | 142 | .reveal pre { 143 | display: block; 144 | position: relative; 145 | width: 90%; 146 | margin: 20px auto; 147 | text-align: left; 148 | font-size: 0.55em; 149 | font-family: monospace; 150 | line-height: 1.2em; 151 | word-wrap: break-word; 152 | box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); } 153 | 154 | .reveal code { 155 | font-family: monospace; 156 | text-transform: none; } 157 | 158 | .reveal pre code { 159 | display: block; 160 | padding: 5px; 161 | overflow: auto; 162 | max-height: 400px; 163 | word-wrap: normal; } 164 | 165 | .reveal table { 166 | margin: auto; 167 | border-collapse: collapse; 168 | border-spacing: 0; } 169 | 170 | .reveal table th { 171 | font-weight: bold; } 172 | 173 | .reveal table th, 174 | .reveal table td { 175 | text-align: left; 176 | padding: 0.2em 0.5em 0.2em 0.5em; 177 | border-bottom: 1px solid; } 178 | 179 | .reveal table th[align="center"], 180 | .reveal table td[align="center"] { 181 | text-align: center; } 182 | 183 | .reveal table th[align="right"], 184 | .reveal table td[align="right"] { 185 | text-align: right; } 186 | 187 | .reveal table tbody tr:last-child th, 188 | .reveal table tbody tr:last-child td { 189 | border-bottom: none; } 190 | 191 | .reveal sup { 192 | vertical-align: super; 193 | font-size: smaller; } 194 | 195 | .reveal sub { 196 | vertical-align: sub; 197 | font-size: smaller; } 198 | 199 | .reveal small { 200 | display: inline-block; 201 | font-size: 0.6em; 202 | line-height: 1.2em; 203 | vertical-align: top; } 204 | 205 | .reveal small * { 206 | vertical-align: top; } 207 | 208 | /********************************************* 209 | * LINKS 210 | *********************************************/ 211 | .reveal a { 212 | color: #51483D; 213 | text-decoration: none; 214 | -webkit-transition: color .15s ease; 215 | -moz-transition: color .15s ease; 216 | transition: color .15s ease; } 217 | 218 | .reveal a:hover { 219 | color: #8b7c69; 220 | text-shadow: none; 221 | border: none; } 222 | 223 | .reveal .roll span:after { 224 | color: #fff; 225 | background: #25211c; } 226 | 227 | /********************************************* 228 | * IMAGES 229 | *********************************************/ 230 | .reveal section img { 231 | margin: 15px 0px; 232 | background: rgba(255, 255, 255, 0.12); 233 | border: 4px solid #000; 234 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } 235 | 236 | .reveal section img.plain { 237 | border: 0; 238 | box-shadow: none; } 239 | 240 | .reveal a img { 241 | -webkit-transition: all .15s linear; 242 | -moz-transition: all .15s linear; 243 | transition: all .15s linear; } 244 | 245 | .reveal a:hover img { 246 | background: rgba(255, 255, 255, 0.2); 247 | border-color: #51483D; 248 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 249 | 250 | /********************************************* 251 | * NAVIGATION CONTROLS 252 | *********************************************/ 253 | .reveal .controls { 254 | color: #51483D; } 255 | 256 | /********************************************* 257 | * PROGRESS BAR 258 | *********************************************/ 259 | .reveal .progress { 260 | background: rgba(0, 0, 0, 0.2); 261 | color: #51483D; } 262 | 263 | .reveal .progress span { 264 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 265 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 266 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 267 | 268 | /********************************************* 269 | * PRINT BACKGROUND 270 | *********************************************/ 271 | @media print { 272 | .backgrounds { 273 | background-color: #F0F1EB; } } 274 | -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/solarized.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Solarized Light theme for reveal.js. 3 | * Author: Achim Staebler 4 | */ 5 | @import url(../../lib/font/league-gothic/league-gothic.css); 6 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 7 | /** 8 | * Solarized colors by Ethan Schoonover 9 | */ 10 | html * { 11 | color-profile: sRGB; 12 | rendering-intent: auto; } 13 | 14 | /********************************************* 15 | * GLOBAL STYLES 16 | *********************************************/ 17 | body { 18 | background: #fdf6e3; 19 | background-color: #fdf6e3; } 20 | 21 | .reveal { 22 | font-family: "Lato", sans-serif; 23 | font-size: 40px; 24 | font-weight: normal; 25 | color: #657b83; } 26 | 27 | ::selection { 28 | color: #fff; 29 | background: #d33682; 30 | text-shadow: none; } 31 | 32 | ::-moz-selection { 33 | color: #fff; 34 | background: #d33682; 35 | text-shadow: none; } 36 | 37 | .reveal .slides section, 38 | .reveal .slides section > section { 39 | line-height: 1.3; 40 | font-weight: inherit; } 41 | 42 | /********************************************* 43 | * HEADERS 44 | *********************************************/ 45 | .reveal h1, 46 | .reveal h2, 47 | .reveal h3, 48 | .reveal h4, 49 | .reveal h5, 50 | .reveal h6 { 51 | margin: 0 0 20px 0; 52 | color: #586e75; 53 | font-family: "League Gothic", Impact, sans-serif; 54 | font-weight: normal; 55 | line-height: 1.2; 56 | letter-spacing: normal; 57 | text-transform: uppercase; 58 | text-shadow: none; 59 | word-wrap: break-word; } 60 | 61 | .reveal h1 { 62 | font-size: 3.77em; } 63 | 64 | .reveal h2 { 65 | font-size: 2.11em; } 66 | 67 | .reveal h3 { 68 | font-size: 1.55em; } 69 | 70 | .reveal h4 { 71 | font-size: 1em; } 72 | 73 | .reveal h1 { 74 | text-shadow: none; } 75 | 76 | /********************************************* 77 | * OTHER 78 | *********************************************/ 79 | .reveal p { 80 | margin: 20px 0; 81 | line-height: 1.3; } 82 | 83 | /* Ensure certain elements are never larger than the slide itself */ 84 | .reveal img, 85 | .reveal video, 86 | .reveal iframe { 87 | max-width: 95%; 88 | max-height: 95%; } 89 | 90 | .reveal strong, 91 | .reveal b { 92 | font-weight: bold; } 93 | 94 | .reveal em { 95 | font-style: italic; } 96 | 97 | .reveal ol, 98 | .reveal dl, 99 | .reveal ul { 100 | display: inline-block; 101 | text-align: left; 102 | margin: 0 0 0 1em; } 103 | 104 | .reveal ol { 105 | list-style-type: decimal; } 106 | 107 | .reveal ul { 108 | list-style-type: disc; } 109 | 110 | .reveal ul ul { 111 | list-style-type: square; } 112 | 113 | .reveal ul ul ul { 114 | list-style-type: circle; } 115 | 116 | .reveal ul ul, 117 | .reveal ul ol, 118 | .reveal ol ol, 119 | .reveal ol ul { 120 | display: block; 121 | margin-left: 40px; } 122 | 123 | .reveal dt { 124 | font-weight: bold; } 125 | 126 | .reveal dd { 127 | margin-left: 40px; } 128 | 129 | .reveal blockquote { 130 | display: block; 131 | position: relative; 132 | width: 70%; 133 | margin: 20px auto; 134 | padding: 5px; 135 | font-style: italic; 136 | background: rgba(255, 255, 255, 0.05); 137 | box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } 138 | 139 | .reveal blockquote p:first-child, 140 | .reveal blockquote p:last-child { 141 | display: inline-block; } 142 | 143 | .reveal q { 144 | font-style: italic; } 145 | 146 | .reveal pre { 147 | display: block; 148 | position: relative; 149 | width: 90%; 150 | margin: 20px auto; 151 | text-align: left; 152 | font-size: 0.55em; 153 | font-family: monospace; 154 | line-height: 1.2em; 155 | word-wrap: break-word; 156 | box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); } 157 | 158 | .reveal code { 159 | font-family: monospace; 160 | text-transform: none; } 161 | 162 | .reveal pre code { 163 | display: block; 164 | padding: 5px; 165 | overflow: auto; 166 | max-height: 400px; 167 | word-wrap: normal; } 168 | 169 | .reveal table { 170 | margin: auto; 171 | border-collapse: collapse; 172 | border-spacing: 0; } 173 | 174 | .reveal table th { 175 | font-weight: bold; } 176 | 177 | .reveal table th, 178 | .reveal table td { 179 | text-align: left; 180 | padding: 0.2em 0.5em 0.2em 0.5em; 181 | border-bottom: 1px solid; } 182 | 183 | .reveal table th[align="center"], 184 | .reveal table td[align="center"] { 185 | text-align: center; } 186 | 187 | .reveal table th[align="right"], 188 | .reveal table td[align="right"] { 189 | text-align: right; } 190 | 191 | .reveal table tbody tr:last-child th, 192 | .reveal table tbody tr:last-child td { 193 | border-bottom: none; } 194 | 195 | .reveal sup { 196 | vertical-align: super; 197 | font-size: smaller; } 198 | 199 | .reveal sub { 200 | vertical-align: sub; 201 | font-size: smaller; } 202 | 203 | .reveal small { 204 | display: inline-block; 205 | font-size: 0.6em; 206 | line-height: 1.2em; 207 | vertical-align: top; } 208 | 209 | .reveal small * { 210 | vertical-align: top; } 211 | 212 | /********************************************* 213 | * LINKS 214 | *********************************************/ 215 | .reveal a { 216 | color: #268bd2; 217 | text-decoration: none; 218 | -webkit-transition: color .15s ease; 219 | -moz-transition: color .15s ease; 220 | transition: color .15s ease; } 221 | 222 | .reveal a:hover { 223 | color: #78b9e6; 224 | text-shadow: none; 225 | border: none; } 226 | 227 | .reveal .roll span:after { 228 | color: #fff; 229 | background: #1a6091; } 230 | 231 | /********************************************* 232 | * IMAGES 233 | *********************************************/ 234 | .reveal section img { 235 | margin: 15px 0px; 236 | background: rgba(255, 255, 255, 0.12); 237 | border: 4px solid #657b83; 238 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } 239 | 240 | .reveal section img.plain { 241 | border: 0; 242 | box-shadow: none; } 243 | 244 | .reveal a img { 245 | -webkit-transition: all .15s linear; 246 | -moz-transition: all .15s linear; 247 | transition: all .15s linear; } 248 | 249 | .reveal a:hover img { 250 | background: rgba(255, 255, 255, 0.2); 251 | border-color: #268bd2; 252 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 253 | 254 | /********************************************* 255 | * NAVIGATION CONTROLS 256 | *********************************************/ 257 | .reveal .controls { 258 | color: #268bd2; } 259 | 260 | /********************************************* 261 | * PROGRESS BAR 262 | *********************************************/ 263 | .reveal .progress { 264 | background: rgba(0, 0, 0, 0.2); 265 | color: #268bd2; } 266 | 267 | .reveal .progress span { 268 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 269 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 270 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 271 | 272 | /********************************************* 273 | * PRINT BACKGROUND 274 | *********************************************/ 275 | @media print { 276 | .backgrounds { 277 | background-color: #fdf6e3; } } 278 | -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/source/beige.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Beige theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | 15 | // Include theme-specific fonts 16 | @import url(../../lib/font/league-gothic/league-gothic.css); 17 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 18 | 19 | 20 | // Override theme settings (see ../template/settings.scss) 21 | $mainColor: #333; 22 | $headingColor: #333; 23 | $headingTextShadow: none; 24 | $backgroundColor: #f7f3de; 25 | $linkColor: #8b743d; 26 | $linkColorHover: lighten( $linkColor, 20% ); 27 | $selectionBackgroundColor: rgba(79, 64, 28, 0.99); 28 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); 29 | 30 | // Background generator 31 | @mixin bodyBackground() { 32 | @include radial-gradient( rgba(247,242,211,1), rgba(255,255,255,1) ); 33 | } 34 | 35 | 36 | 37 | // Theme template ------------------------------ 38 | @import "../template/theme"; 39 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/source/black.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Black theme for reveal.js. This is the opposite of the 'white' theme. 3 | * 4 | * By Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/source-sans-pro/source-sans-pro.css); 16 | 17 | 18 | // Override theme settings (see ../template/settings.scss) 19 | $backgroundColor: #222; 20 | 21 | $mainColor: #fff; 22 | $headingColor: #fff; 23 | 24 | $mainFontSize: 42px; 25 | $mainFont: 'Source Sans Pro', Helvetica, sans-serif; 26 | $headingFont: 'Source Sans Pro', Helvetica, sans-serif; 27 | $headingTextShadow: none; 28 | $headingLetterSpacing: normal; 29 | $headingTextTransform: uppercase; 30 | $headingFontWeight: 600; 31 | $linkColor: #42affa; 32 | $linkColorHover: lighten( $linkColor, 15% ); 33 | $selectionBackgroundColor: lighten( $linkColor, 25% ); 34 | 35 | $heading1Size: 2.5em; 36 | $heading2Size: 1.6em; 37 | $heading3Size: 1.3em; 38 | $heading4Size: 1.0em; 39 | 40 | section.has-light-background { 41 | &, h1, h2, h3, h4, h5, h6 { 42 | color: #222; 43 | } 44 | } 45 | 46 | 47 | // Theme template ------------------------------ 48 | @import "../template/theme"; 49 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/source/blood.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Blood theme for reveal.js 3 | * Author: Walther http://github.com/Walther 4 | * 5 | * Designed to be used with highlight.js theme 6 | * "monokai_sublime.css" available from 7 | * https://github.com/isagalaev/highlight.js/ 8 | * 9 | * For other themes, change $codeBackground accordingly. 10 | * 11 | */ 12 | 13 | // Default mixins and settings ----------------- 14 | @import "../template/mixins"; 15 | @import "../template/settings"; 16 | // --------------------------------------------- 17 | 18 | // Include theme-specific fonts 19 | 20 | @import url(https://fonts.googleapis.com/css?family=Ubuntu:300,700,300italic,700italic); 21 | 22 | // Colors used in the theme 23 | $blood: #a23; 24 | $coal: #222; 25 | $codeBackground: #23241f; 26 | 27 | $backgroundColor: $coal; 28 | 29 | // Main text 30 | $mainFont: Ubuntu, 'sans-serif'; 31 | $mainColor: #eee; 32 | 33 | // Headings 34 | $headingFont: Ubuntu, 'sans-serif'; 35 | $headingTextShadow: 2px 2px 2px $coal; 36 | 37 | // h1 shadow, borrowed humbly from 38 | // (c) Default theme by Hakim El Hattab 39 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); 40 | 41 | // Links 42 | $linkColor: $blood; 43 | $linkColorHover: lighten( $linkColor, 20% ); 44 | 45 | // Text selection 46 | $selectionBackgroundColor: $blood; 47 | $selectionColor: #fff; 48 | 49 | 50 | // Theme template ------------------------------ 51 | @import "../template/theme"; 52 | // --------------------------------------------- 53 | 54 | // some overrides after theme template import 55 | 56 | .reveal p { 57 | font-weight: 300; 58 | text-shadow: 1px 1px $coal; 59 | } 60 | 61 | .reveal h1, 62 | .reveal h2, 63 | .reveal h3, 64 | .reveal h4, 65 | .reveal h5, 66 | .reveal h6 { 67 | font-weight: 700; 68 | } 69 | 70 | .reveal p code { 71 | background-color: $codeBackground; 72 | display: inline-block; 73 | border-radius: 7px; 74 | } 75 | 76 | .reveal small code { 77 | vertical-align: baseline; 78 | } -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/source/league.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * League theme for reveal.js. 3 | * 4 | * This was the default theme pre-3.0.0. 5 | * 6 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | 9 | 10 | // Default mixins and settings ----------------- 11 | @import "../template/mixins"; 12 | @import "../template/settings"; 13 | // --------------------------------------------- 14 | 15 | 16 | 17 | // Include theme-specific fonts 18 | @import url(../../lib/font/league-gothic/league-gothic.css); 19 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 20 | 21 | // Override theme settings (see ../template/settings.scss) 22 | $headingTextShadow: 0px 0px 6px rgba(0,0,0,0.2); 23 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); 24 | 25 | // Background generator 26 | @mixin bodyBackground() { 27 | @include radial-gradient( rgba(28,30,32,1), rgba(85,90,95,1) ); 28 | } 29 | 30 | 31 | 32 | // Theme template ------------------------------ 33 | @import "../template/theme"; 34 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/source/moon.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Solarized Dark theme for reveal.js. 3 | * Author: Achim Staebler 4 | */ 5 | 6 | 7 | // Default mixins and settings ----------------- 8 | @import "../template/mixins"; 9 | @import "../template/settings"; 10 | // --------------------------------------------- 11 | 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/league-gothic/league-gothic.css); 16 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 17 | 18 | /** 19 | * Solarized colors by Ethan Schoonover 20 | */ 21 | html * { 22 | color-profile: sRGB; 23 | rendering-intent: auto; 24 | } 25 | 26 | // Solarized colors 27 | $base03: #002b36; 28 | $base02: #073642; 29 | $base01: #586e75; 30 | $base00: #657b83; 31 | $base0: #839496; 32 | $base1: #93a1a1; 33 | $base2: #eee8d5; 34 | $base3: #fdf6e3; 35 | $yellow: #b58900; 36 | $orange: #cb4b16; 37 | $red: #dc322f; 38 | $magenta: #d33682; 39 | $violet: #6c71c4; 40 | $blue: #268bd2; 41 | $cyan: #2aa198; 42 | $green: #859900; 43 | 44 | // Override theme settings (see ../template/settings.scss) 45 | $mainColor: $base1; 46 | $headingColor: $base2; 47 | $headingTextShadow: none; 48 | $backgroundColor: $base03; 49 | $linkColor: $blue; 50 | $linkColorHover: lighten( $linkColor, 20% ); 51 | $selectionBackgroundColor: $magenta; 52 | 53 | 54 | 55 | // Theme template ------------------------------ 56 | @import "../template/theme"; 57 | // --------------------------------------------- 58 | -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/source/night.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Black theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(https://fonts.googleapis.com/css?family=Montserrat:700); 16 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic); 17 | 18 | 19 | // Override theme settings (see ../template/settings.scss) 20 | $backgroundColor: #111; 21 | 22 | $mainFont: 'Open Sans', sans-serif; 23 | $linkColor: #e7ad52; 24 | $linkColorHover: lighten( $linkColor, 20% ); 25 | $headingFont: 'Montserrat', Impact, sans-serif; 26 | $headingTextShadow: none; 27 | $headingLetterSpacing: -0.03em; 28 | $headingTextTransform: none; 29 | $selectionBackgroundColor: #e7ad52; 30 | 31 | 32 | // Theme template ------------------------------ 33 | @import "../template/theme"; 34 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/source/serif.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * A simple theme for reveal.js presentations, similar 3 | * to the default theme. The accent color is brown. 4 | * 5 | * This theme is Copyright (C) 2012-2013 Owen Versteeg, http://owenversteeg.com - it is MIT licensed. 6 | */ 7 | 8 | 9 | // Default mixins and settings ----------------- 10 | @import "../template/mixins"; 11 | @import "../template/settings"; 12 | // --------------------------------------------- 13 | 14 | 15 | 16 | // Override theme settings (see ../template/settings.scss) 17 | $mainFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; 18 | $mainColor: #000; 19 | $headingFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; 20 | $headingColor: #383D3D; 21 | $headingTextShadow: none; 22 | $headingTextTransform: none; 23 | $backgroundColor: #F0F1EB; 24 | $linkColor: #51483D; 25 | $linkColorHover: lighten( $linkColor, 20% ); 26 | $selectionBackgroundColor: #26351C; 27 | 28 | .reveal a { 29 | line-height: 1.3em; 30 | } 31 | 32 | 33 | // Theme template ------------------------------ 34 | @import "../template/theme"; 35 | // --------------------------------------------- 36 | -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/source/simple.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * A simple theme for reveal.js presentations, similar 3 | * to the default theme. The accent color is darkblue. 4 | * 5 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. 6 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | 9 | 10 | // Default mixins and settings ----------------- 11 | @import "../template/mixins"; 12 | @import "../template/settings"; 13 | // --------------------------------------------- 14 | 15 | 16 | 17 | // Include theme-specific fonts 18 | @import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700); 19 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 20 | 21 | 22 | // Override theme settings (see ../template/settings.scss) 23 | $mainFont: 'Lato', sans-serif; 24 | $mainColor: #000; 25 | $headingFont: 'News Cycle', Impact, sans-serif; 26 | $headingColor: #000; 27 | $headingTextShadow: none; 28 | $headingTextTransform: none; 29 | $backgroundColor: #fff; 30 | $linkColor: #00008B; 31 | $linkColorHover: lighten( $linkColor, 20% ); 32 | $selectionBackgroundColor: rgba(0, 0, 0, 0.99); 33 | 34 | section.has-dark-background { 35 | &, h1, h2, h3, h4, h5, h6 { 36 | color: #fff; 37 | } 38 | } 39 | 40 | 41 | // Theme template ------------------------------ 42 | @import "../template/theme"; 43 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/source/sky.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Sky theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | 15 | // Include theme-specific fonts 16 | @import url(https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic); 17 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700); 18 | 19 | 20 | // Override theme settings (see ../template/settings.scss) 21 | $mainFont: 'Open Sans', sans-serif; 22 | $mainColor: #333; 23 | $headingFont: 'Quicksand', sans-serif; 24 | $headingColor: #333; 25 | $headingLetterSpacing: -0.08em; 26 | $headingTextShadow: none; 27 | $backgroundColor: #f7fbfc; 28 | $linkColor: #3b759e; 29 | $linkColorHover: lighten( $linkColor, 20% ); 30 | $selectionBackgroundColor: #134674; 31 | 32 | // Fix links so they are not cut off 33 | .reveal a { 34 | line-height: 1.3em; 35 | } 36 | 37 | // Background generator 38 | @mixin bodyBackground() { 39 | @include radial-gradient( #add9e4, #f7fbfc ); 40 | } 41 | 42 | 43 | 44 | // Theme template ------------------------------ 45 | @import "../template/theme"; 46 | // --------------------------------------------- 47 | -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/source/solarized.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Solarized Light theme for reveal.js. 3 | * Author: Achim Staebler 4 | */ 5 | 6 | 7 | // Default mixins and settings ----------------- 8 | @import "../template/mixins"; 9 | @import "../template/settings"; 10 | // --------------------------------------------- 11 | 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/league-gothic/league-gothic.css); 16 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 17 | 18 | 19 | /** 20 | * Solarized colors by Ethan Schoonover 21 | */ 22 | html * { 23 | color-profile: sRGB; 24 | rendering-intent: auto; 25 | } 26 | 27 | // Solarized colors 28 | $base03: #002b36; 29 | $base02: #073642; 30 | $base01: #586e75; 31 | $base00: #657b83; 32 | $base0: #839496; 33 | $base1: #93a1a1; 34 | $base2: #eee8d5; 35 | $base3: #fdf6e3; 36 | $yellow: #b58900; 37 | $orange: #cb4b16; 38 | $red: #dc322f; 39 | $magenta: #d33682; 40 | $violet: #6c71c4; 41 | $blue: #268bd2; 42 | $cyan: #2aa198; 43 | $green: #859900; 44 | 45 | // Override theme settings (see ../template/settings.scss) 46 | $mainColor: $base00; 47 | $headingColor: $base01; 48 | $headingTextShadow: none; 49 | $backgroundColor: $base3; 50 | $linkColor: $blue; 51 | $linkColorHover: lighten( $linkColor, 20% ); 52 | $selectionBackgroundColor: $magenta; 53 | 54 | // Background generator 55 | // @mixin bodyBackground() { 56 | // @include radial-gradient( rgba($base3,1), rgba(lighten($base3, 20%),1) ); 57 | // } 58 | 59 | 60 | 61 | // Theme template ------------------------------ 62 | @import "../template/theme"; 63 | // --------------------------------------------- 64 | -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/source/white.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * White theme for reveal.js. This is the opposite of the 'black' theme. 3 | * 4 | * By Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/source-sans-pro/source-sans-pro.css); 16 | 17 | 18 | // Override theme settings (see ../template/settings.scss) 19 | $backgroundColor: #fff; 20 | 21 | $mainColor: #222; 22 | $headingColor: #222; 23 | 24 | $mainFontSize: 42px; 25 | $mainFont: 'Source Sans Pro', Helvetica, sans-serif; 26 | $headingFont: 'Source Sans Pro', Helvetica, sans-serif; 27 | $headingTextShadow: none; 28 | $headingLetterSpacing: normal; 29 | $headingTextTransform: uppercase; 30 | $headingFontWeight: 600; 31 | $linkColor: #2a76dd; 32 | $linkColorHover: lighten( $linkColor, 15% ); 33 | $selectionBackgroundColor: lighten( $linkColor, 25% ); 34 | 35 | $heading1Size: 2.5em; 36 | $heading2Size: 1.6em; 37 | $heading3Size: 1.3em; 38 | $heading4Size: 1.0em; 39 | 40 | section.has-dark-background { 41 | &, h1, h2, h3, h4, h5, h6 { 42 | color: #fff; 43 | } 44 | } 45 | 46 | 47 | // Theme template ------------------------------ 48 | @import "../template/theme"; 49 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/template/mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin vertical-gradient( $top, $bottom ) { 2 | background: $top; 3 | background: -moz-linear-gradient( top, $top 0%, $bottom 100% ); 4 | background: -webkit-gradient( linear, left top, left bottom, color-stop(0%,$top), color-stop(100%,$bottom) ); 5 | background: -webkit-linear-gradient( top, $top 0%, $bottom 100% ); 6 | background: -o-linear-gradient( top, $top 0%, $bottom 100% ); 7 | background: -ms-linear-gradient( top, $top 0%, $bottom 100% ); 8 | background: linear-gradient( top, $top 0%, $bottom 100% ); 9 | } 10 | 11 | @mixin horizontal-gradient( $top, $bottom ) { 12 | background: $top; 13 | background: -moz-linear-gradient( left, $top 0%, $bottom 100% ); 14 | background: -webkit-gradient( linear, left top, right top, color-stop(0%,$top), color-stop(100%,$bottom) ); 15 | background: -webkit-linear-gradient( left, $top 0%, $bottom 100% ); 16 | background: -o-linear-gradient( left, $top 0%, $bottom 100% ); 17 | background: -ms-linear-gradient( left, $top 0%, $bottom 100% ); 18 | background: linear-gradient( left, $top 0%, $bottom 100% ); 19 | } 20 | 21 | @mixin radial-gradient( $outer, $inner, $type: circle ) { 22 | background: $outer; 23 | background: -moz-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 24 | background: -webkit-gradient( radial, center center, 0px, center center, 100%, color-stop(0%,$inner), color-stop(100%,$outer) ); 25 | background: -webkit-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 26 | background: -o-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 27 | background: -ms-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 28 | background: radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 29 | } -------------------------------------------------------------------------------- /slides/reveal.js/css/theme/template/settings.scss: -------------------------------------------------------------------------------- 1 | // Base settings for all themes that can optionally be 2 | // overridden by the super-theme 3 | 4 | // Background of the presentation 5 | $backgroundColor: #2b2b2b; 6 | 7 | // Primary/body text 8 | $mainFont: 'Lato', sans-serif; 9 | $mainFontSize: 40px; 10 | $mainColor: #eee; 11 | 12 | // Vertical spacing between blocks of text 13 | $blockMargin: 20px; 14 | 15 | // Headings 16 | $headingMargin: 0 0 $blockMargin 0; 17 | $headingFont: 'League Gothic', Impact, sans-serif; 18 | $headingColor: #eee; 19 | $headingLineHeight: 1.2; 20 | $headingLetterSpacing: normal; 21 | $headingTextTransform: uppercase; 22 | $headingTextShadow: none; 23 | $headingFontWeight: normal; 24 | $heading1TextShadow: $headingTextShadow; 25 | 26 | $heading1Size: 3.77em; 27 | $heading2Size: 2.11em; 28 | $heading3Size: 1.55em; 29 | $heading4Size: 1.00em; 30 | 31 | // Links and actions 32 | $linkColor: #13DAEC; 33 | $linkColorHover: lighten( $linkColor, 20% ); 34 | 35 | // Text selection 36 | $selectionBackgroundColor: #FF5E99; 37 | $selectionColor: #fff; 38 | 39 | // Generates the presentation background, can be overridden 40 | // to return a background image or gradient 41 | @mixin bodyBackground() { 42 | background: $backgroundColor; 43 | } -------------------------------------------------------------------------------- /slides/reveal.js/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 23 | 24 | 25 |
26 |
27 |
Slide 1
28 |
Slide 2
29 |
30 |
31 | 32 | 33 | 34 | 35 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /slides/reveal.js/lib/css/zenburn.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov 4 | based on dark.css by Ivan Sagalaev 5 | 6 | */ 7 | 8 | .hljs { 9 | display: block; 10 | overflow-x: auto; 11 | padding: 0.5em; 12 | background: #3f3f3f; 13 | color: #dcdcdc; 14 | } 15 | 16 | .hljs-keyword, 17 | .hljs-selector-tag, 18 | .hljs-tag { 19 | color: #e3ceab; 20 | } 21 | 22 | .hljs-template-tag { 23 | color: #dcdcdc; 24 | } 25 | 26 | .hljs-number { 27 | color: #8cd0d3; 28 | } 29 | 30 | .hljs-variable, 31 | .hljs-template-variable, 32 | .hljs-attribute { 33 | color: #efdcbc; 34 | } 35 | 36 | .hljs-literal { 37 | color: #efefaf; 38 | } 39 | 40 | .hljs-subst { 41 | color: #8f8f8f; 42 | } 43 | 44 | .hljs-title, 45 | .hljs-name, 46 | .hljs-selector-id, 47 | .hljs-selector-class, 48 | .hljs-section, 49 | .hljs-type { 50 | color: #efef8f; 51 | } 52 | 53 | .hljs-symbol, 54 | .hljs-bullet, 55 | .hljs-link { 56 | color: #dca3a3; 57 | } 58 | 59 | .hljs-deletion, 60 | .hljs-string, 61 | .hljs-built_in, 62 | .hljs-builtin-name { 63 | color: #cc9393; 64 | } 65 | 66 | .hljs-addition, 67 | .hljs-comment, 68 | .hljs-quote, 69 | .hljs-meta { 70 | color: #7f9f7f; 71 | } 72 | 73 | 74 | .hljs-emphasis { 75 | font-style: italic; 76 | } 77 | 78 | .hljs-strong { 79 | font-weight: bold; 80 | } 81 | -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/league-gothic/LICENSE: -------------------------------------------------------------------------------- 1 | SIL Open Font License (OFL) 2 | http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL 3 | -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/league-gothic/league-gothic.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'League Gothic'; 3 | src: url('league-gothic.eot'); 4 | src: url('league-gothic.eot?#iefix') format('embedded-opentype'), 5 | url('league-gothic.woff') format('woff'), 6 | url('league-gothic.ttf') format('truetype'); 7 | 8 | font-weight: normal; 9 | font-style: normal; 10 | } -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/league-gothic/league-gothic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/league-gothic/league-gothic.eot -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/league-gothic/league-gothic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/league-gothic/league-gothic.ttf -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/league-gothic/league-gothic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/league-gothic/league-gothic.woff -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/LICENSE: -------------------------------------------------------------------------------- 1 | SIL Open Font License 2 | 3 | Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. 4 | 5 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 6 | This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL 7 | 8 | —————————————————————————————- 9 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 10 | —————————————————————————————- 11 | 12 | PREAMBLE 13 | The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. 14 | 15 | The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. 16 | 17 | DEFINITIONS 18 | “Font Software” refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 19 | 20 | “Reserved Font Name” refers to any names specified as such after the copyright statement(s). 21 | 22 | “Original Version” refers to the collection of Font Software components as distributed by the Copyright Holder(s). 23 | 24 | “Modified Version” refers to any derivative made by adding to, deleting, or substituting—in part or in whole—any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 25 | 26 | “Author” refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. 27 | 28 | PERMISSION & CONDITIONS 29 | Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 30 | 31 | 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 32 | 33 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 34 | 35 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 36 | 37 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 38 | 39 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 40 | 41 | TERMINATION 42 | This license becomes null and void if any of the above conditions are not met. 43 | 44 | DISCLAIMER 45 | THE FONT SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff -------------------------------------------------------------------------------- /slides/reveal.js/lib/font/source-sans-pro/source-sans-pro.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Source Sans Pro'; 3 | src: url('source-sans-pro-regular.eot'); 4 | src: url('source-sans-pro-regular.eot?#iefix') format('embedded-opentype'), 5 | url('source-sans-pro-regular.woff') format('woff'), 6 | url('source-sans-pro-regular.ttf') format('truetype'); 7 | font-weight: normal; 8 | font-style: normal; 9 | } 10 | 11 | @font-face { 12 | font-family: 'Source Sans Pro'; 13 | src: url('source-sans-pro-italic.eot'); 14 | src: url('source-sans-pro-italic.eot?#iefix') format('embedded-opentype'), 15 | url('source-sans-pro-italic.woff') format('woff'), 16 | url('source-sans-pro-italic.ttf') format('truetype'); 17 | font-weight: normal; 18 | font-style: italic; 19 | } 20 | 21 | @font-face { 22 | font-family: 'Source Sans Pro'; 23 | src: url('source-sans-pro-semibold.eot'); 24 | src: url('source-sans-pro-semibold.eot?#iefix') format('embedded-opentype'), 25 | url('source-sans-pro-semibold.woff') format('woff'), 26 | url('source-sans-pro-semibold.ttf') format('truetype'); 27 | font-weight: 600; 28 | font-style: normal; 29 | } 30 | 31 | @font-face { 32 | font-family: 'Source Sans Pro'; 33 | src: url('source-sans-pro-semibolditalic.eot'); 34 | src: url('source-sans-pro-semibolditalic.eot?#iefix') format('embedded-opentype'), 35 | url('source-sans-pro-semibolditalic.woff') format('woff'), 36 | url('source-sans-pro-semibolditalic.ttf') format('truetype'); 37 | font-weight: 600; 38 | font-style: italic; 39 | } -------------------------------------------------------------------------------- /slides/reveal.js/lib/js/classList.js: -------------------------------------------------------------------------------- 1 | /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/ 2 | if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(j){var a="classList",f="prototype",m=(j.HTMLElement||j.Element)[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p=4.0.0" 24 | }, 25 | "devDependencies": { 26 | "express": "^4.16.2", 27 | "grunt": "^1.0.1", 28 | "grunt-autoprefixer": "^3.0.4", 29 | "grunt-cli": "^1.2.0", 30 | "grunt-contrib-connect": "^1.0.2", 31 | "grunt-contrib-cssmin": "^2.2.1", 32 | "grunt-contrib-jshint": "^1.1.0", 33 | "grunt-contrib-qunit": "^2.0.0", 34 | "grunt-contrib-uglify": "^3.3.0", 35 | "grunt-contrib-watch": "^1.0.0", 36 | "grunt-sass": "^2.0.0", 37 | "grunt-retire": "^1.0.7", 38 | "grunt-zip": "~0.17.1", 39 | "mustache": "^2.3.0", 40 | "socket.io": "^1.7.3" 41 | }, 42 | "license": "MIT" 43 | } 44 | -------------------------------------------------------------------------------- /slides/reveal.js/plugin/markdown/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Markdown Demo 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 |
23 | 24 | 25 |
26 | 36 |
37 | 38 | 39 |
40 | 54 |
55 | 56 | 57 |
58 | 69 |
70 | 71 | 72 |
73 | 77 |
78 | 79 | 80 |
81 | 86 |
87 | 88 | 89 |
90 | 100 |
101 | 102 | 103 |
104 | 107 |
108 | 109 |
110 |
111 | 112 | 113 | 114 | 115 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /slides/reveal.js/plugin/markdown/example.md: -------------------------------------------------------------------------------- 1 | # Markdown Demo 2 | 3 | 4 | 5 | ## External 1.1 6 | 7 | Content 1.1 8 | 9 | Note: This will only appear in the speaker notes window. 10 | 11 | 12 | ## External 1.2 13 | 14 | Content 1.2 15 | 16 | 17 | 18 | ## External 2 19 | 20 | Content 2.1 21 | 22 | 23 | 24 | ## External 3.1 25 | 26 | Content 3.1 27 | 28 | 29 | ## External 3.2 30 | 31 | Content 3.2 32 | 33 | 34 | ## External 3.3 35 | 36 | ![External Image](https://s3.amazonaws.com/static.slid.es/logo/v2/slides-symbol-512x512.png) 37 | -------------------------------------------------------------------------------- /slides/reveal.js/plugin/math/math.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A plugin which enables rendering of math equations inside 3 | * of reveal.js slides. Essentially a thin wrapper for MathJax. 4 | * 5 | * @author Hakim El Hattab 6 | */ 7 | var RevealMath = window.RevealMath || (function(){ 8 | 9 | var options = Reveal.getConfig().math || {}; 10 | options.mathjax = options.mathjax || 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js'; 11 | options.config = options.config || 'TeX-AMS_HTML-full'; 12 | options.tex2jax = options.tex2jax || { 13 | inlineMath: [['$','$'],['\\(','\\)']] , 14 | skipTags: ['script','noscript','style','textarea','pre'] }; 15 | 16 | loadScript( options.mathjax + '?config=' + options.config, function() { 17 | 18 | MathJax.Hub.Config({ 19 | messageStyle: 'none', 20 | tex2jax: options.tex2jax, 21 | skipStartupTypeset: true 22 | }); 23 | 24 | // Typeset followed by an immediate reveal.js layout since 25 | // the typesetting process could affect slide height 26 | MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub ] ); 27 | MathJax.Hub.Queue( Reveal.layout ); 28 | 29 | // Reprocess equations in slides when they turn visible 30 | Reveal.addEventListener( 'slidechanged', function( event ) { 31 | 32 | MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub, event.currentSlide ] ); 33 | 34 | } ); 35 | 36 | } ); 37 | 38 | function loadScript( url, callback ) { 39 | 40 | var head = document.querySelector( 'head' ); 41 | var script = document.createElement( 'script' ); 42 | script.type = 'text/javascript'; 43 | script.src = url; 44 | 45 | // Wrapper for callback to make sure it only fires once 46 | var finish = function() { 47 | if( typeof callback === 'function' ) { 48 | callback.call(); 49 | callback = null; 50 | } 51 | } 52 | 53 | script.onload = finish; 54 | 55 | // IE 56 | script.onreadystatechange = function() { 57 | if ( this.readyState === 'loaded' ) { 58 | finish(); 59 | } 60 | } 61 | 62 | // Normal browsers 63 | head.appendChild( script ); 64 | 65 | } 66 | 67 | })(); 68 | -------------------------------------------------------------------------------- /slides/reveal.js/plugin/multiplex/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var multiplex = Reveal.getConfig().multiplex; 3 | var socketId = multiplex.id; 4 | var socket = io.connect(multiplex.url); 5 | 6 | socket.on(multiplex.id, function(data) { 7 | // ignore data from sockets that aren't ours 8 | if (data.socketId !== socketId) { return; } 9 | if( window.location.host === 'localhost:1947' ) return; 10 | 11 | Reveal.setState(data.state); 12 | }); 13 | }()); 14 | -------------------------------------------------------------------------------- /slides/reveal.js/plugin/multiplex/index.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var express = require('express'); 3 | var fs = require('fs'); 4 | var io = require('socket.io'); 5 | var crypto = require('crypto'); 6 | 7 | var app = express(); 8 | var staticDir = express.static; 9 | var server = http.createServer(app); 10 | 11 | io = io(server); 12 | 13 | var opts = { 14 | port: process.env.PORT || 1948, 15 | baseDir : __dirname + '/../../' 16 | }; 17 | 18 | io.on( 'connection', function( socket ) { 19 | socket.on('multiplex-statechanged', function(data) { 20 | if (typeof data.secret == 'undefined' || data.secret == null || data.secret === '') return; 21 | if (createHash(data.secret) === data.socketId) { 22 | data.secret = null; 23 | socket.broadcast.emit(data.socketId, data); 24 | }; 25 | }); 26 | }); 27 | 28 | [ 'css', 'js', 'plugin', 'lib' ].forEach(function(dir) { 29 | app.use('/' + dir, staticDir(opts.baseDir + dir)); 30 | }); 31 | 32 | app.get("/", function(req, res) { 33 | res.writeHead(200, {'Content-Type': 'text/html'}); 34 | 35 | var stream = fs.createReadStream(opts.baseDir + '/index.html'); 36 | stream.on('error', function( error ) { 37 | res.write('

reveal.js multiplex server.

Generate token'); 38 | res.end(); 39 | }); 40 | stream.on('readable', function() { 41 | stream.pipe(res); 42 | }); 43 | }); 44 | 45 | app.get("/token", function(req,res) { 46 | var ts = new Date().getTime(); 47 | var rand = Math.floor(Math.random()*9999999); 48 | var secret = ts.toString() + rand.toString(); 49 | res.send({secret: secret, socketId: createHash(secret)}); 50 | }); 51 | 52 | var createHash = function(secret) { 53 | var cipher = crypto.createCipher('blowfish', secret); 54 | return(cipher.final('hex')); 55 | }; 56 | 57 | // Actually listen 58 | server.listen( opts.port || null ); 59 | 60 | var brown = '\033[33m', 61 | green = '\033[32m', 62 | reset = '\033[0m'; 63 | 64 | console.log( brown + "reveal.js:" + reset + " Multiplex running on port " + green + opts.port + reset ); -------------------------------------------------------------------------------- /slides/reveal.js/plugin/multiplex/master.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 3 | // Don't emit events from inside of notes windows 4 | if ( window.location.search.match( /receiver/gi ) ) { return; } 5 | 6 | var multiplex = Reveal.getConfig().multiplex; 7 | 8 | var socket = io.connect( multiplex.url ); 9 | 10 | function post() { 11 | 12 | var messageData = { 13 | state: Reveal.getState(), 14 | secret: multiplex.secret, 15 | socketId: multiplex.id 16 | }; 17 | 18 | socket.emit( 'multiplex-statechanged', messageData ); 19 | 20 | }; 21 | 22 | // post once the page is loaded, so the client follows also on "open URL". 23 | window.addEventListener( 'load', post ); 24 | 25 | // Monitor events that trigger a change in state 26 | Reveal.addEventListener( 'slidechanged', post ); 27 | Reveal.addEventListener( 'fragmentshown', post ); 28 | Reveal.addEventListener( 'fragmenthidden', post ); 29 | Reveal.addEventListener( 'overviewhidden', post ); 30 | Reveal.addEventListener( 'overviewshown', post ); 31 | Reveal.addEventListener( 'paused', post ); 32 | Reveal.addEventListener( 'resumed', post ); 33 | 34 | }()); 35 | -------------------------------------------------------------------------------- /slides/reveal.js/plugin/multiplex/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reveal-js-multiplex", 3 | "version": "1.0.0", 4 | "description": "reveal.js multiplex server", 5 | "homepage": "http://revealjs.com", 6 | "scripts": { 7 | "start": "node index.js" 8 | }, 9 | "engines": { 10 | "node": "~4.1.1" 11 | }, 12 | "dependencies": { 13 | "express": "~4.13.3", 14 | "grunt-cli": "~0.1.13", 15 | "mustache": "~2.2.1", 16 | "socket.io": "~1.3.7" 17 | }, 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /slides/reveal.js/plugin/notes-server/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 3 | // don't emit events from inside the previews themselves 4 | if( window.location.search.match( /receiver/gi ) ) { return; } 5 | 6 | var socket = io.connect( window.location.origin ), 7 | socketId = Math.random().toString().slice( 2 ); 8 | 9 | console.log( 'View slide notes at ' + window.location.origin + '/notes/' + socketId ); 10 | 11 | window.open( window.location.origin + '/notes/' + socketId, 'notes-' + socketId ); 12 | 13 | /** 14 | * Posts the current slide data to the notes window 15 | */ 16 | function post() { 17 | 18 | var slideElement = Reveal.getCurrentSlide(), 19 | notesElement = slideElement.querySelector( 'aside.notes' ); 20 | 21 | var messageData = { 22 | notes: '', 23 | markdown: false, 24 | socketId: socketId, 25 | state: Reveal.getState() 26 | }; 27 | 28 | // Look for notes defined in a slide attribute 29 | if( slideElement.hasAttribute( 'data-notes' ) ) { 30 | messageData.notes = slideElement.getAttribute( 'data-notes' ); 31 | } 32 | 33 | // Look for notes defined in an aside element 34 | if( notesElement ) { 35 | messageData.notes = notesElement.innerHTML; 36 | messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string'; 37 | } 38 | 39 | socket.emit( 'statechanged', messageData ); 40 | 41 | } 42 | 43 | // When a new notes window connects, post our current state 44 | socket.on( 'new-subscriber', function( data ) { 45 | post(); 46 | } ); 47 | 48 | // When the state changes from inside of the speaker view 49 | socket.on( 'statechanged-speaker', function( data ) { 50 | Reveal.setState( data.state ); 51 | } ); 52 | 53 | // Monitor events that trigger a change in state 54 | Reveal.addEventListener( 'slidechanged', post ); 55 | Reveal.addEventListener( 'fragmentshown', post ); 56 | Reveal.addEventListener( 'fragmenthidden', post ); 57 | Reveal.addEventListener( 'overviewhidden', post ); 58 | Reveal.addEventListener( 'overviewshown', post ); 59 | Reveal.addEventListener( 'paused', post ); 60 | Reveal.addEventListener( 'resumed', post ); 61 | 62 | // Post the initial state 63 | post(); 64 | 65 | }()); 66 | -------------------------------------------------------------------------------- /slides/reveal.js/plugin/notes-server/index.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var express = require('express'); 3 | var fs = require('fs'); 4 | var io = require('socket.io'); 5 | var Mustache = require('mustache'); 6 | 7 | var app = express(); 8 | var staticDir = express.static; 9 | var server = http.createServer(app); 10 | 11 | io = io(server); 12 | 13 | var opts = { 14 | port : 1947, 15 | baseDir : __dirname + '/../../' 16 | }; 17 | 18 | io.on( 'connection', function( socket ) { 19 | 20 | socket.on( 'new-subscriber', function( data ) { 21 | socket.broadcast.emit( 'new-subscriber', data ); 22 | }); 23 | 24 | socket.on( 'statechanged', function( data ) { 25 | delete data.state.overview; 26 | socket.broadcast.emit( 'statechanged', data ); 27 | }); 28 | 29 | socket.on( 'statechanged-speaker', function( data ) { 30 | delete data.state.overview; 31 | socket.broadcast.emit( 'statechanged-speaker', data ); 32 | }); 33 | 34 | }); 35 | 36 | [ 'css', 'js', 'images', 'plugin', 'lib' ].forEach( function( dir ) { 37 | app.use( '/' + dir, staticDir( opts.baseDir + dir ) ); 38 | }); 39 | 40 | app.get('/', function( req, res ) { 41 | 42 | res.writeHead( 200, { 'Content-Type': 'text/html' } ); 43 | fs.createReadStream( opts.baseDir + '/index.html' ).pipe( res ); 44 | 45 | }); 46 | 47 | app.get( '/notes/:socketId', function( req, res ) { 48 | 49 | fs.readFile( opts.baseDir + 'plugin/notes-server/notes.html', function( err, data ) { 50 | res.send( Mustache.to_html( data.toString(), { 51 | socketId : req.params.socketId 52 | })); 53 | }); 54 | 55 | }); 56 | 57 | // Actually listen 58 | server.listen( opts.port || null ); 59 | 60 | var brown = '\033[33m', 61 | green = '\033[32m', 62 | reset = '\033[0m'; 63 | 64 | var slidesLocation = 'http://localhost' + ( opts.port ? ( ':' + opts.port ) : '' ); 65 | 66 | console.log( brown + 'reveal.js - Speaker Notes' + reset ); 67 | console.log( '1. Open the slides at ' + green + slidesLocation + reset ); 68 | console.log( '2. Click on the link in your JS console to go to the notes page' ); 69 | console.log( '3. Advance through your slides and your notes will advance automatically' ); 70 | -------------------------------------------------------------------------------- /slides/reveal.js/plugin/notes/notes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Handles opening of and synchronization with the reveal.js 3 | * notes window. 4 | * 5 | * Handshake process: 6 | * 1. This window posts 'connect' to notes window 7 | * - Includes URL of presentation to show 8 | * 2. Notes window responds with 'connected' when it is available 9 | * 3. This window proceeds to send the current presentation state 10 | * to the notes window 11 | */ 12 | var RevealNotes = (function() { 13 | 14 | function openNotes( notesFilePath ) { 15 | 16 | if( !notesFilePath ) { 17 | var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path 18 | jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path 19 | notesFilePath = jsFileLocation + 'notes.html'; 20 | } 21 | 22 | var notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' ); 23 | 24 | if( !notesPopup ) { 25 | alert( 'Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.' ); 26 | return; 27 | } 28 | 29 | // Allow popup window access to Reveal API 30 | notesPopup.Reveal = window.Reveal; 31 | 32 | /** 33 | * Connect to the notes window through a postmessage handshake. 34 | * Using postmessage enables us to work in situations where the 35 | * origins differ, such as a presentation being opened from the 36 | * file system. 37 | */ 38 | function connect() { 39 | // Keep trying to connect until we get a 'connected' message back 40 | var connectInterval = setInterval( function() { 41 | notesPopup.postMessage( JSON.stringify( { 42 | namespace: 'reveal-notes', 43 | type: 'connect', 44 | url: window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search, 45 | state: Reveal.getState() 46 | } ), '*' ); 47 | }, 500 ); 48 | 49 | window.addEventListener( 'message', function( event ) { 50 | var data = JSON.parse( event.data ); 51 | if( data && data.namespace === 'reveal-notes' && data.type === 'connected' ) { 52 | clearInterval( connectInterval ); 53 | onConnected(); 54 | } 55 | } ); 56 | } 57 | 58 | /** 59 | * Posts the current slide data to the notes window 60 | */ 61 | function post( event ) { 62 | 63 | var slideElement = Reveal.getCurrentSlide(), 64 | notesElement = slideElement.querySelector( 'aside.notes' ), 65 | fragmentElement = slideElement.querySelector( '.current-fragment' ); 66 | 67 | var messageData = { 68 | namespace: 'reveal-notes', 69 | type: 'state', 70 | notes: '', 71 | markdown: false, 72 | whitespace: 'normal', 73 | state: Reveal.getState() 74 | }; 75 | 76 | // Look for notes defined in a slide attribute 77 | if( slideElement.hasAttribute( 'data-notes' ) ) { 78 | messageData.notes = slideElement.getAttribute( 'data-notes' ); 79 | messageData.whitespace = 'pre-wrap'; 80 | } 81 | 82 | // Look for notes defined in a fragment 83 | if( fragmentElement ) { 84 | var fragmentNotes = fragmentElement.querySelector( 'aside.notes' ); 85 | if( fragmentNotes ) { 86 | notesElement = fragmentNotes; 87 | } 88 | else if( fragmentElement.hasAttribute( 'data-notes' ) ) { 89 | messageData.notes = fragmentElement.getAttribute( 'data-notes' ); 90 | messageData.whitespace = 'pre-wrap'; 91 | 92 | // In case there are slide notes 93 | notesElement = null; 94 | } 95 | } 96 | 97 | // Look for notes defined in an aside element 98 | if( notesElement ) { 99 | messageData.notes = notesElement.innerHTML; 100 | messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string'; 101 | } 102 | 103 | notesPopup.postMessage( JSON.stringify( messageData ), '*' ); 104 | 105 | } 106 | 107 | /** 108 | * Called once we have established a connection to the notes 109 | * window. 110 | */ 111 | function onConnected() { 112 | 113 | // Monitor events that trigger a change in state 114 | Reveal.addEventListener( 'slidechanged', post ); 115 | Reveal.addEventListener( 'fragmentshown', post ); 116 | Reveal.addEventListener( 'fragmenthidden', post ); 117 | Reveal.addEventListener( 'overviewhidden', post ); 118 | Reveal.addEventListener( 'overviewshown', post ); 119 | Reveal.addEventListener( 'paused', post ); 120 | Reveal.addEventListener( 'resumed', post ); 121 | 122 | // Post the initial state 123 | post(); 124 | 125 | } 126 | 127 | connect(); 128 | 129 | } 130 | 131 | if( !/receiver/i.test( window.location.search ) ) { 132 | 133 | // If the there's a 'notes' query set, open directly 134 | if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { 135 | openNotes(); 136 | } 137 | 138 | // Open the notes when the 's' key is hit 139 | Reveal.addKeyBinding({keyCode: 83, key: 'S', description: 'Speaker notes view'}, function() { 140 | openNotes(); 141 | } ); 142 | 143 | } 144 | 145 | return { open: openNotes }; 146 | 147 | })(); 148 | -------------------------------------------------------------------------------- /slides/reveal.js/plugin/print-pdf/print-pdf.js: -------------------------------------------------------------------------------- 1 | /** 2 | * phantomjs script for printing presentations to PDF. 3 | * 4 | * Example: 5 | * phantomjs print-pdf.js "http://revealjs.com?print-pdf" reveal-demo.pdf 6 | * 7 | * @author Manuel Bieh (https://github.com/manuelbieh) 8 | * @author Hakim El Hattab (https://github.com/hakimel) 9 | * @author Manuel Riezebosch (https://github.com/riezebosch) 10 | */ 11 | 12 | // html2pdf.js 13 | var system = require( 'system' ); 14 | 15 | var probePage = new WebPage(); 16 | var printPage = new WebPage(); 17 | 18 | var inputFile = system.args[1] || 'index.html?print-pdf'; 19 | var outputFile = system.args[2] || 'slides.pdf'; 20 | 21 | if( outputFile.match( /\.pdf$/gi ) === null ) { 22 | outputFile += '.pdf'; 23 | } 24 | 25 | console.log( 'Export PDF: Reading reveal.js config [1/4]' ); 26 | 27 | probePage.open( inputFile, function( status ) { 28 | 29 | console.log( 'Export PDF: Preparing print layout [2/4]' ); 30 | 31 | var config = probePage.evaluate( function() { 32 | return Reveal.getConfig(); 33 | } ); 34 | 35 | if( config ) { 36 | 37 | printPage.paperSize = { 38 | width: Math.floor( config.width * ( 1 + config.margin ) ), 39 | height: Math.floor( config.height * ( 1 + config.margin ) ), 40 | border: 0 41 | }; 42 | 43 | printPage.open( inputFile, function( status ) { 44 | console.log( 'Export PDF: Preparing pdf [3/4]') 45 | printPage.evaluate( function() { 46 | Reveal.isReady() ? window.callPhantom() : Reveal.addEventListener( 'pdf-ready', window.callPhantom ); 47 | } ); 48 | } ); 49 | 50 | printPage.onCallback = function( data ) { 51 | // For some reason we need to "jump the queue" for syntax highlighting to work. 52 | // See: http://stackoverflow.com/a/3580132/129269 53 | setTimeout( function() { 54 | console.log( 'Export PDF: Writing file [4/4]' ); 55 | printPage.render( outputFile ); 56 | console.log( 'Export PDF: Finished successfully!' ); 57 | phantom.exit(); 58 | }, 0 ); 59 | }; 60 | } 61 | else { 62 | 63 | console.log( 'Export PDF: Unable to read reveal.js config. Make sure the input address points to a reveal.js page.' ); 64 | phantom.exit( 1 ); 65 | 66 | } 67 | } ); 68 | -------------------------------------------------------------------------------- /slides/reveal.js/test/examples/assets/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/test/examples/assets/image1.png -------------------------------------------------------------------------------- /slides/reveal.js/test/examples/assets/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anton-trunov/coq-lecture-notes/e012addae82da6d8d03f6e789e43f35140dcdfea/slides/reveal.js/test/examples/assets/image2.png -------------------------------------------------------------------------------- /slides/reveal.js/test/examples/barebones.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Barebones 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 | 18 |
19 |

Barebones Presentation

20 |

This example contains the bare minimum includes and markup required to run a reveal.js presentation.

21 |
22 | 23 |
24 |

No Theme

25 |

There's no theme included, so it will fall back on browser defaults.

26 |
27 | 28 |
29 | 30 |
31 | 32 | 33 | 34 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /slides/reveal.js/test/examples/embedded-media.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Embedded Media 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 |
22 |

Embedded Media Test

23 |
24 | 25 |
26 | 27 |
28 | 29 |
30 |

Empty Slide

31 |
32 | 33 |
34 | 35 |
36 | 37 | 38 | 39 | 40 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /slides/reveal.js/test/examples/math.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Math Plugin 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 |
22 |

reveal.js Math Plugin

23 |

A thin wrapper for MathJax

24 |
25 | 26 |
27 |

The Lorenz Equations

28 | 29 | \[\begin{aligned} 30 | \dot{x} & = \sigma(y-x) \\ 31 | \dot{y} & = \rho x - y - xz \\ 32 | \dot{z} & = -\beta z + xy 33 | \end{aligned} \] 34 |
35 | 36 |
37 |

The Cauchy-Schwarz Inequality

38 | 39 | 42 |
43 | 44 |
45 |

A Cross Product Formula

46 | 47 | \[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} 48 | \mathbf{i} & \mathbf{j} & \mathbf{k} \\ 49 | \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ 50 | \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 51 | \end{vmatrix} \] 52 |
53 | 54 |
55 |

The probability of getting \(k\) heads when flipping \(n\) coins is

56 | 57 | \[P(E) = {n \choose k} p^k (1-p)^{ n-k} \] 58 |
59 | 60 |
61 |

An Identity of Ramanujan

62 | 63 | \[ \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 64 | 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} 65 | {1+\frac{e^{-8\pi}} {1+\ldots} } } } \] 66 |
67 | 68 |
69 |

A Rogers-Ramanujan Identity

70 | 71 | \[ 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = 72 | \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}\] 73 |
74 | 75 |
76 |

Maxwell’s Equations

77 | 78 | \[ \begin{aligned} 79 | \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ 80 | \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ 81 | \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} 82 | \] 83 |
84 | 85 |
86 |
87 |

The Lorenz Equations

88 | 89 |
90 | \[\begin{aligned} 91 | \dot{x} & = \sigma(y-x) \\ 92 | \dot{y} & = \rho x - y - xz \\ 93 | \dot{z} & = -\beta z + xy 94 | \end{aligned} \] 95 |
96 |
97 | 98 |
99 |

The Cauchy-Schwarz Inequality

100 | 101 |
102 | \[ \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \] 103 |
104 |
105 | 106 |
107 |

A Cross Product Formula

108 | 109 |
110 | \[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} 111 | \mathbf{i} & \mathbf{j} & \mathbf{k} \\ 112 | \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ 113 | \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 114 | \end{vmatrix} \] 115 |
116 |
117 | 118 |
119 |

The probability of getting \(k\) heads when flipping \(n\) coins is

120 | 121 |
122 | \[P(E) = {n \choose k} p^k (1-p)^{ n-k} \] 123 |
124 |
125 | 126 |
127 |

An Identity of Ramanujan

128 | 129 |
130 | \[ \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 131 | 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} 132 | {1+\frac{e^{-8\pi}} {1+\ldots} } } } \] 133 |
134 |
135 | 136 |
137 |

A Rogers-Ramanujan Identity

138 | 139 |
140 | \[ 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = 141 | \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}\] 142 |
143 |
144 | 145 |
146 |

Maxwell’s Equations

147 | 148 |
149 | \[ \begin{aligned} 150 | \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ 151 | \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ 152 | \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} 153 | \] 154 |
155 |
156 |
157 | 158 |
159 | 160 |
161 | 162 | 163 | 164 | 165 | 183 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /slides/reveal.js/test/examples/slide-backgrounds.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Slide Backgrounds 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 |
32 |

data-background: #00ffff

33 |
34 | 35 |
36 |

data-background: #bb00bb

37 |
38 | 39 |
40 |

data-background: lightblue

41 |
42 | 43 |
44 |
45 |

data-background: #ff0000

46 |
47 |
48 |

data-background: rgba(0, 0, 0, 0.2)

49 |
50 |
51 |

data-background: salmon

52 |
53 |
54 | 55 |
56 |
57 |

Background applied to stack

58 |
59 |
60 |

Background applied to stack

61 |
62 |
63 |

Background applied to slide inside of stack

64 |
65 |
66 | 67 |
68 |

Background image

69 |
70 | 71 |
72 |
73 |

Background image

74 |
75 |
76 |

Background image

77 |
78 |
79 | 80 |
81 |

Background image

82 |
data-background-size="100px" data-background-repeat="repeat" data-background-color="#111"
83 |
84 | 85 |
86 |

Same background twice (1/2)

87 |
88 |
89 |

Same background twice (2/2)

90 |
91 | 92 |
93 |

Video background

94 |
95 | 96 |
97 |

Iframe background

98 |
99 | 100 |
101 |
102 |

Same background twice vertical (1/2)

103 |
104 |
105 |

Same background twice vertical (2/2)

106 |
107 |
108 | 109 |
110 |

Same background from horizontal to vertical (1/3)

111 |
112 |
113 |
114 |

Same background from horizontal to vertical (2/3)

115 |
116 |
117 |

Same background from horizontal to vertical (3/3)

118 |
119 |
120 | 121 |
122 | 123 |
124 | 125 | 126 | 127 | 128 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /slides/reveal.js/test/examples/slide-transitions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Slide Transitions 8 | 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 |
26 | 27 |
28 | 29 |
30 |

Default

31 |
32 | 33 |
34 |

Default

35 |
36 | 37 |
38 |

data-transition: zoom

39 |
40 | 41 |
42 |

data-transition: zoom-in fade-out

43 |
44 | 45 |
46 |

Default

47 |
48 | 49 |
50 |

data-transition: convex

51 |
52 | 53 |
54 |

data-transition: convex-in concave-out

55 |
56 | 57 |
58 |
59 |

Default

60 |
61 |
62 |

data-transition: concave

63 |
64 |
65 |

data-transition: convex-in fade-out

66 |
67 |
68 |

Default

69 |
70 |
71 | 72 |
73 |

data-transition: none

74 |
75 | 76 |
77 |

Default

78 |
79 | 80 |
81 | 82 |
83 | 84 | 85 | 86 | 87 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /slides/reveal.js/test/simple.md: -------------------------------------------------------------------------------- 1 | ## Slide 1.1 2 | 3 | ```js 4 | var a = 1; 5 | ``` 6 | 7 | 8 | ## Slide 1.2 9 | 10 | 11 | 12 | ## Slide 2 13 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-markdown-element-attributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown Element Attributes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-markdown-element-attributes.js: -------------------------------------------------------------------------------- 1 | Reveal.addEventListener( 'ready', function() { 2 | 3 | QUnit.module( 'Markdown' ); 4 | 5 | QUnit.test( 'Vertical separator', function( assert ) { 6 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 4, 'found four slides' ); 7 | }); 8 | 9 | QUnit.test( 'Attributes on element header in vertical slides', function( assert ) { 10 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.fade-out' ).length, 1, 'found one vertical slide with class fragment.fade-out on header' ); 11 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.shrink' ).length, 1, 'found one vertical slide with class fragment.shrink on header' ); 12 | }); 13 | 14 | QUnit.test( 'Attributes on element paragraphs in vertical slides', function( assert ) { 15 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section p.fragment.grow' ).length, 2, 'found a vertical slide with two paragraphs with class fragment.grow' ); 16 | }); 17 | 18 | QUnit.test( 'Attributes on element list items in vertical slides', function( assert ) { 19 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section li.fragment.grow' ).length, 3, 'found a vertical slide with three list items with class fragment.grow' ); 20 | }); 21 | 22 | QUnit.test( 'Attributes on element paragraphs in horizontal slides', function( assert ) { 23 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-red' ).length, 4, 'found a horizontal slide with four paragraphs with class fragment.grow' ); 24 | }); 25 | 26 | QUnit.test( 'Attributes on element list items in horizontal slides', function( assert ) { 27 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section li.fragment.highlight-green' ).length, 5, 'found a horizontal slide with five list items with class fragment.roll-in' ); 28 | }); 29 | 30 | QUnit.test( 'Attributes on element image in horizontal slides', function( assert ) { 31 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section img.reveal.stretch' ).length, 1, 'found a horizontal slide with stretched image, class img.reveal.stretch' ); 32 | }); 33 | 34 | QUnit.test( 'Attributes on elements in vertical slides with default element attribute separator', function( assert ) { 35 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section h2.fragment.highlight-red' ).length, 2, 'found two h2 titles with fragment highlight-red in vertical slides with default element attribute separator' ); 36 | }); 37 | 38 | QUnit.test( 'Attributes on elements in single slides with default element attribute separator', function( assert ) { 39 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-blue' ).length, 3, 'found three elements with fragment highlight-blue in single slide with default element attribute separator' ); 40 | }); 41 | 42 | } ); 43 | 44 | Reveal.initialize(); 45 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-markdown-external.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-markdown-external.js: -------------------------------------------------------------------------------- 1 | Reveal.addEventListener( 'ready', function() { 2 | 3 | QUnit.module( 'Markdown' ); 4 | 5 | QUnit.test( 'Vertical separator', function( assert ) { 6 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' ); 7 | }); 8 | 9 | QUnit.test( 'Horizontal separator', function( assert ) { 10 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section' ).length, 2, 'found two slides' ); 11 | }); 12 | 13 | QUnit.test( 'Language highlighter', function( assert ) { 14 | assert.strictEqual( document.querySelectorAll( '.hljs-keyword' ).length, 1, 'got rendered highlight tag.' ); 15 | assert.strictEqual( document.querySelector( '.hljs-keyword' ).innerHTML, 'var', 'the same keyword: var.' ); 16 | }); 17 | 18 | } ); 19 | 20 | Reveal.initialize(); 21 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-markdown-options.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown Options 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-markdown-options.js: -------------------------------------------------------------------------------- 1 | Reveal.addEventListener( 'ready', function() { 2 | 3 | QUnit.module( 'Markdown' ); 4 | 5 | QUnit.test( 'Options are set', function( assert ) { 6 | assert.strictEqual( marked.defaults.smartypants, true ); 7 | }); 8 | 9 | QUnit.test( 'Smart quotes are activated', function( assert ) { 10 | var text = document.querySelector( '.reveal .slides>section>p' ).textContent; 11 | 12 | assert.strictEqual( /['"]/.test( text ), false ); 13 | assert.strictEqual( /[“”‘’]/.test( text ), true ); 14 | }); 15 | 16 | } ); 17 | 18 | Reveal.initialize({ 19 | dependencies: [ 20 | { src: '../plugin/markdown/marked.js' }, 21 | // Test loading JS files with query strings 22 | { src: '../plugin/markdown/markdown.js?query=string' }, 23 | ], 24 | markdown: { 25 | smartypants: true 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-markdown-slide-attributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown Attributes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-markdown-slide-attributes.js: -------------------------------------------------------------------------------- 1 | Reveal.addEventListener( 'ready', function() { 2 | 3 | QUnit.module( 'Markdown' ); 4 | 5 | QUnit.test( 'Vertical separator', function( assert ) { 6 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 6, 'found six vertical slides' ); 7 | }); 8 | 9 | QUnit.test( 'Id on slide', function( assert ) { 10 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section#slide2' ).length, 1, 'found one slide with id slide2' ); 11 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section a[href="#/slide2"]' ).length, 1, 'found one slide with a link to slide2' ); 12 | }); 13 | 14 | QUnit.test( 'data-background attributes', function( assert ) { 15 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A0C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' ); 16 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#ff0000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' ); 17 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C6916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' ); 18 | }); 19 | 20 | QUnit.test( 'data-transition attributes', function( assert ) { 21 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="zoom"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' ); 22 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="fade"]' ).length, 1, 'found one vertical slide with data-transition="fade"' ); 23 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="zoom"]' ).length, 1, 'found one slide with data-transition="zoom"' ); 24 | }); 25 | 26 | QUnit.test( 'data-background attributes with default separator', function( assert ) { 27 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A7C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' ); 28 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#f70000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' ); 29 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C7916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' ); 30 | }); 31 | 32 | QUnit.test( 'data-transition attributes with default separator', function( assert ) { 33 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="concave"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' ); 34 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="page"]' ).length, 1, 'found one vertical slide with data-transition="fade"' ); 35 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="concave"]' ).length, 1, 'found one slide with data-transition="zoom"' ); 36 | }); 37 | 38 | QUnit.test( 'data-transition attributes with inline content', function( assert ) { 39 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#ff0000"]' ).length, 3, 'found three horizontal slides with data-background="#ff0000"' ); 40 | }); 41 | 42 | } ); 43 | 44 | Reveal.initialize(); 45 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-markdown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-markdown.js: -------------------------------------------------------------------------------- 1 | Reveal.addEventListener( 'ready', function() { 2 | 3 | QUnit.module( 'Markdown' ); 4 | 5 | QUnit.test( 'Vertical separator', function( assert ) { 6 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' ); 7 | }); 8 | 9 | } ); 10 | 11 | Reveal.initialize(); 12 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-pdf.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test PDF exports 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 | 19 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test-pdf.js: -------------------------------------------------------------------------------- 1 | Reveal.addEventListener( 'ready', function() { 2 | 3 | // Only one test for now, we're mainly ensuring that there 4 | // are no execution errors when running PDF mode 5 | 6 | QUnit.test( 'Reveal.isReady', function( assert ) { 7 | assert.strictEqual( Reveal.isReady(), true, 'returns true' ); 8 | }); 9 | 10 | } ); 11 | 12 | Reveal.initialize({ pdf: true }); 13 | -------------------------------------------------------------------------------- /slides/reveal.js/test/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Tests 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | --------------------------------------------------------------------------------