Skip to content

Commit

Permalink
Add a few videos.
Browse files Browse the repository at this point in the history
The videos are work in progress and may be replaced by newer versions
at any time. Hence, if possible, please use the stable links to refer
to these videos, since they will always point to the latest version.

For example, to link to the Sudoku video, please use:

    https://www.metalevel.at/prolog/videos/sudoku

This will automatically redirect to the latest version. See also #3.
  • Loading branch information
triska committed Mar 16, 2019
1 parent 20db9f2 commit 3542ee4
Show file tree
Hide file tree
Showing 21 changed files with 124 additions and 0 deletions.
9 changes: 9 additions & 0 deletions prolog/clpfd.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@
Prolog programs also reason about integers.

<br><br>

<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="videos/integers"><img src="videos/t_integers.png" alt="Integers"></a>
</td>
</tr>
</table>

<center><h2 id="constraint">Constraints</h2></center>

Generally, an <i>n</i>-ary <b>constraint</b> is a <i>relation</i>
Expand Down
37 changes: 37 additions & 0 deletions prolog/concepts.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
and <tt>X=Y</tt> instead of <tt>+(a,b)</tt> and <tt>=(X,Y)</tt>,
respectively.

<br><br>
<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="videos/operators"><img src="videos/t_operators.png" alt="Operators"></a>
</td>
</tr>
</table>

<center><h2 id="program">Programs</h2></center>

A Prolog <b>program</b> is a set of <i>predicates</i>.
Expand Down Expand Up @@ -63,6 +72,16 @@

<br><br>

<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="videos/predicates"><img src="videos/t_predicates.png" alt="Predicates"></a>
</td>
</tr>
</table>

<br><br>

A predicate is defined by a collection of <i>clauses</i>.

<br><br>
Expand All @@ -74,6 +93,15 @@
the whole predicate is&nbsp;true.
</div>

<br><br>
<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="videos/clauses"><img src="videos/t_clauses.png" alt="Clauses, Rules and Facts"></a>
</td>
</tr>
</table>

<center><h3 id="rule">Rules</h3></center>

A Prolog <b>rule</b> has the form:
Expand Down Expand Up @@ -338,6 +366,15 @@
We can implement <tt>hailstone/2</tt> more efficiently
with&nbsp;<a href="metapredicates#if_3"><tt>if_/3</tt></a>.

<br><br>
<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="videos/collatz"><img src="videos/t_collatz.png" alt="Collatz Conjecture"></a>
</td>
</tr>
</table>

<br><br><br>
<b><a href="/prolog">More about Prolog</a></b>

Expand Down
21 changes: 21 additions & 0 deletions prolog/data.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@
to&nbsp;<a href="optimization#tree">trees</a>. There is a
<a href="sorting#order">standard&nbsp;order</a> on&nbsp;terms.

<br><br>

<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="videos/terms"><img src="videos/t_terms.png" alt="Terms"></a>
</td>
</tr>
</table>


<center><h2 id="list">Lists</h2></center>

Prolog <b>lists</b> are a special case of <a href="#term"><i>terms</i></a>.
Expand Down Expand Up @@ -144,6 +155,16 @@
<a href="dcg">DCG notation</a> is frequently used for
describing&nbsp;lists.

<br><br>

<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="videos/lists"><img src="videos/t_lists.png" alt="Lists"></a>
</td>
</tr>
</table>

<center><h2 id="pair">Pairs</h2></center>

By convention, the functor <tt>(-)/2</tt> is often used to denote
Expand Down
9 changes: 9 additions & 0 deletions prolog/facets.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ <h2 id="logic"><center>Prolog is a logic programming language</center></h2>

A <a href="purity">pure</a> Prolog program consists of a set
of <a href="https://en.wikipedia.org/wiki/Horn_clause">Horn&nbsp;clauses</a>.

<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="videos/horn_clauses"><img src="videos/t_horn_clauses.png" alt="Horn Clauses"></a>
</td>
</tr>
</table>

Its execution can be regarded as a special case
of <i>resolution</i>, which is an algorithm that is rooted in
formal&nbsp;logic. Logically, when Prolog answers a query, it
Expand Down
10 changes: 10 additions & 0 deletions prolog/metapredicates.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
Prolog predicates that take <i>predicates</i> as arguments are
called <b>higher-order predicates</b>, or <b>meta-predicates</b>.

<br><br>

<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="videos/metapredicates"><img src="videos/t_metapredicates.png" alt="Meta-Predicates"></a>
</td>
</tr>
</table>

<center><h2 id="call"><tt>call/N</tt></h2></center>

The <tt>call/N</tt> family
Expand Down
10 changes: 10 additions & 0 deletions prolog/optimization.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@

<br><br>

<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="videos/map_colouring"><img src="videos/t_map_colouring.png" alt="Map Colouring"></a>
</td>
</tr>
</table>

<br><br>

We can easily map this task to a combinatorial task
over <i>integers</i>, by using one logical variable for each
region, and one integer for each&nbsp;colour.
Expand Down
9 changes: 9 additions & 0 deletions prolog/puzzles.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
Raymond&nbsp;Smullyan's <i>What Is the Name of This&nbsp;Book?</i>
and Maurice&nbsp;Kraitchik's <i>Mathematical&nbsp;Recreations</i>.

<br><br>
<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="videos/knights_and_knaves"><img src="videos/t_knights_and_knaves.png" alt="Knights and Knaves"></a>
</td>
</tr>
</table>

<br><br>

<div class="example">
Expand Down
Binary file added prolog/videos/t_clauses.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prolog/videos/t_collatz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prolog/videos/t_horn_clauses.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prolog/videos/t_integers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prolog/videos/t_knights_and_knaves.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prolog/videos/t_lists.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prolog/videos/t_map_colouring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prolog/videos/t_metapredicates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prolog/videos/t_operators.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prolog/videos/t_predicates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prolog/videos/t_sudoku.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prolog/videos/t_terms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions queens/queens.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ <h1>Solving N-queens with Prolog</h1>

The task is to place N queens on an N&times;N chessboard in such a
way that none of the queens is under attack.

<br><br>
<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="/prolog/videos/n_queens"><img src="/prolog/videos/t_n_queens.png" alt="N-Queens"></a>
</td>
</tr>
</table>

<br><br>

<h2><center>Prolog Solution</center></h2>
Expand Down
9 changes: 9 additions & 0 deletions sudoku/sudoku.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ <h2><center>Prolog solution</center></h2>
solving <a href="/prolog/optimization">combinatorial</a>
tasks like&nbsp;<i>Sudoku</i>.

<br><br>
<table>
<tr>
<td><i>Video</i>:</td>
<td><a href="/prolog/videos/sudoku"><img src="/prolog/videos/t_sudoku.png" alt="Sudoku"></a>
</td>
</tr>
</table>

<br><br>

For example, using <a href="/prolog/clpfd">constraints</a>, a
Expand Down

0 comments on commit 3542ee4

Please sign in to comment.