|
1 | 1 | # Prolog Module 1 |
2 | 2 |
|
3 | | -## trace.pl |
| 3 | +An introductory guide to Prolog programming with practical examples and video tutorials. This module covers the fundamentals of Prolog including facts, rules, variables, arithmetic operations, and debugging techniques. |
4 | 4 |
|
5 | | -[VIDEO](https://youtu.be/360AHAy8U-E) (2:54) - an example of debugging a query using `trace` |
| 5 | +--- |
6 | 6 |
|
7 | | -## factsandrules.pl |
| 7 | +## Files Overview |
| 8 | + |
| 9 | +### trace.pl |
| 10 | + |
| 11 | +This file demonstrates how to use Prolog's `trace` feature to debug queries step-by-step. |
| 12 | + |
| 13 | +[VIDEO](https://youtu.be/360AHAy8U-E) (2:54) - An example of debugging a query using `trace` |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +### factsandrules.pl |
| 18 | + |
| 19 | +Introduction to Prolog facts (base knowledge) and rules (logical deductions). This example uses a Star Wars family tree to demonstrate: |
| 20 | + |
| 21 | +- Defining facts (father, mother relationships) |
| 22 | +- Creating rules (parent, child relationships) |
| 23 | +- Using rules to derive new knowledge from existing facts |
8 | 24 |
|
9 | 25 | [VIDEO](https://youtu.be/zRxNrK4kS5A) (5:49) - Introduction to Prolog, facts & rules |
10 | 26 |
|
11 | | -## workingwithnumbers.pl |
| 27 | +--- |
| 28 | + |
| 29 | +### variables.pl |
| 30 | + |
| 31 | +Example of working with variables in Prolog, including: |
| 32 | + |
| 33 | +- Variable assignment and unification |
| 34 | +- Singleton variables and their use cases |
| 35 | +- Querying with variables to find multiple solutions |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +### workingwithnumbers.pl |
| 40 | + |
| 41 | +Master working with numbers in Prolog: |
| 42 | + |
| 43 | +- Arithmetic operations |
| 44 | +- Converting between temperature scales (Fahrenheit to Celsius) |
| 45 | +- Using the `is` operator for arithmetic calculations |
| 46 | +- Comparing numeric values with relational operators |
| 47 | +- Writing rules that perform calculations and logical comparisons |
12 | 48 |
|
13 | 49 | [VIDEO](https://youtu.be/BtyKhoVooBM) (10:28) - Examples of working with numbers |
14 | 50 |
|
15 | | -## moreexamples.pl |
| 51 | +--- |
| 52 | + |
| 53 | +### moreexamples.pl |
| 54 | + |
| 55 | +This file contains more complex examples building on the fundamentals, including advanced rule definitions and multi-step logical reasoning. |
| 56 | + |
| 57 | +[VIDEO](https://youtu.be/fjw5nif64X8) (17:14) - More complex Prolog examples |
| 58 | + |
| 59 | +(Note: The `same_temp/2` rule shown at the start of the video is not included in this file) |
16 | 60 |
|
17 | | -[VIDEO](https://youtu.be/fjw5nif64X8) (17:14) - (note that the same_temp/2 rule that is shown own screen at the start of the video is not included in this file) |
| 61 | +--- |
18 | 62 |
|
19 | | -## otherexamples.pl |
| 63 | +### otherexamples.pl |
20 | 64 |
|
21 | | -I use this file to store small examples for short videos |
| 65 | +A collection of smaller examples created for brief demonstrations. |
22 | 66 |
|
23 | | -[VIDEO](https://youtu.be/CFuBfQwtscE) (2:12) - Explaination of why some queries return both true and false |
| 67 | +[VIDEO](https://youtu.be/CFuBfQwtscE) (2:12) - Explanation of why some queries return both true and false |
0 commit comments