Lesson map
Lesson 07. Map, example, EX053.
flowchart TD
T["today = 2026-10-01"] --> D["Subtract last release"]
D --> G{"Is the day count greater than 730?"}
G -->|Yes| U["Append the UNMAINTAINED note"]
G -->|No| S["No age note"]
The threshold is a strict greater-than. The print shows the day count, not the threshold.
Logical drawing
event-calendar last release 2022-05-09
2026-10-01 minus that date = 1606 days
1606 > 730, so the note is appended
730 itself would not pass the test, and no row has that age
Learning outcomes
After this chapter, you should be able to:
- Reconstruct 1606 as one date subtraction.
- State the predicate as
days > 730. - Refuse a note that prints the threshold as if the script had.
7.1 The clock is fixed, and equality at 730 does not flag.
today is date(2026, 10, 1). It is not the clock of the machine that happens to run the file, and it is not read from a log. For each tuple the script computes (today - last).days. event-calendar's last release is date(2022, 5, 9). That subtraction is 1606. The test is > 730, so 1606 appends UNMAINTAINED (1606 days since release). The number inside the note is the subtraction. The number 730 is only in the source.
Equality is the excluded edge. An age that lands on 1 October 2024 measures 730 and stays silent. The previous civil day, 30 September 2024, measures 731 and would add the clause. Neither civil day is a stored tuple. Calling 730 "about two years" is an approximation beside the source. The predicate itself does not measure calendar anniversaries, leap-day labels, or a maintainer's promise.
The other three ages are real subtractions and are not printed, because each fails > 730. donate-form was released on 2 August 2026, which is 60 days. photo-gallery was released on 20 June 2026, which is 103 days. newsletter was released on 1 September 2026, which is 30 days. Those three figures may be labelled as arithmetic next to the source. They must not be written into the four output lines.
Lesson table; scroll horizontally to read all columns →
| Last release | Days before 2026-10-01 | days > 730 |
Row |
|---|---|---|---|
| 2022-05-09 | 1606 | yes | event-calendar, printed |
| 2026-08-02 | 60 | no | donate-form, not printed |
| 2026-06-20 | 103 | no | photo-gallery, not printed |
| 2026-09-01 | 30 | no | newsletter, not printed |
| 2024-10-01 | 730 | no | no such tuple |
| 2024-09-30 | 731 | yes | no such tuple |
7.2 Worked example
Lesson table; scroll horizontally to read all columns →
| Claim about the age test | Arithmetic | Decision |
|---|---|---|
| event-calendar prints 1606 | date(2026, 10, 1) - date(2022, 5, 9) |
Keep |
| 730 is the cut in the source | The note does not contain 730 | Keep as source, not as output |
| "A 730-day component would be flagged." | The operator is >, so 730 fails |
Refuse |
| "The script printed 60, 103, and 30." | Those ages fail the test and stay off the page | Refuse |
Synthetic case. The review date is a constant in the lab, not a timestamp copied from the host.
Errors and limits
Do not replace the printed 1606 with the hidden threshold or with an age the output omitted.
Apply
- EX053 — One subtraction. The calendar line says 1606 days. A classmate adds the threshold 730 to the output, says a component aged exactly 730 days would be flagged, and writes 60, 103, and 30 onto the other lines. Which figures does the script print, and what does the comparison require?
Show marking criteria
Rubric: 3 = only 1606 is printed; it is the subtraction from 2026-10-01 to 2022-05-09; the test isdays > 730; 730, 60, 103, and 30 stay off the output;; 2 = 1606 stays the printed age and 730 is not printed;; 1 = one figure;; 0 = none.