Softanza
StartFrançais
Softanza
The book · Chapter 13 · The proof of each chapter

The gap question

This chapter has 6 cells and writes 10 promises. In each of its four editions its cells were run in one fresh process on 2026-10-08 20:15: English, 6 cells ran, 10 promises kept; Français, 6 cells ran, 10 promises kept; العربية, 6 cells ran, 10 promises kept; Hausa, 6 cells ran, 10 promises kept. The four editions make the same promises, cell for cell. No edition stores any output.

The guard

The course's guard is course_narrated.ring(opens in a new tab): it runs every chapter in all four languages, compares the promises from one edition to the next, and has every exercise prove itself on its wrong and right answers. This page asked the same questions of the same objects, in one process inside the library, at commit 0e72e2e2c. To prove this chapter alone, from your copy of the repository:

cd libraries/stzlib/base/test/education
# run course_narrated with the repository's runtime, for this chapter:
#   course_narrated the-gap-question

run on 2026-10-08 20:15 inside the library at commit 4a184e6f0, in 246.4 s for the whole book · The four editions of the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

The reader stores no output, by the course's own law; this page is the record of a run, made for it.

The cells, run

Cell 1 · 1. Declare a goal

Softanza
oRest = new stzKnowledgeGraph("restaurant")
oRest.Know("margherita", "dish").Know("tiramisu", "dish")
oRest.AddConversationQ("setup").SetGoal(StzGoalQ().RequireEach("dish", "contains"))
? len( oRest.GapsIn("setup") )
#--> 2
Output of this run
2

ran: the promise is kept · in all four editions

This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

Cell 2 · 2. Softanza asks, and says why

Softanza
aQ = oRest.AskInXT("setup")
? aQ[:question]
#--> What does 'margherita' have for 'contains'?  (why: every dish needs 'contains')
Output of this run
What does 'margherita' have for 'contains'?  (why: every dish needs 'contains')

ran: the promise is kept · in all four editions

This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

Cell 3 · 3. You answer in words, and the world grows

Softanza
aV = oRest.ReplyIn("setup", "tomato and mozzarella")
? @@( aV[:admitted] )
#--> [ "tomato", "mozzarella" ]
? @@( oRest.Query([ "margherita", "contains", "?o" ]) )
#--> [ "tomato", "mozzarella" ]
? len( oRest.GapsIn("setup") )
#--> 1
Output of this run
[ "tomato", "mozzarella" ]
[ "tomato", "mozzarella" ]
1

ran: the promise is kept · in all four editions

This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

Cell 4 · 4. The next question offers what it already knows

Softanza
aQ2 = oRest.AskInXT("setup")
? aQ2[:question]
#--> Which 'contains' does 'tiramisu' have? (1) tomato  (2) mozzarella -- or answer freely.  (why: every dish needs 'contains')
Output of this run
Which 'contains' does 'tiramisu' have? (1) tomato  (2) mozzarella -- or answer freely.  (why: every dish needs 'contains')

ran: the promise is kept · in all four editions

This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

Cell 5 · 5. Ask the library what it calls the thing you mean

Softanza
oDoc = StzSelfDocQ("stzList")
? oDoc.HowTo("remove duplicates")
#--> Q([...]).RemoveDuplicates()   -- composed by grammar (remove duplicates)
? oDoc.HasMethod("DuplicatesRemoved")
#--> TRUE
Output of this run
Q([...]).RemoveDuplicates()   -- composed by grammar (remove duplicates)
1

ran: the promise is kept · in all four editions

This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

Cell 6 · 6. Explain a method, and refuse an unknown one

Softanza
? StzLeft( oDoc.ExplainMethod("DuplicatesRemoved"), 20 )
#--> DuplicatesRemoved --
? oDoc.ExplainMethod("NoSuchThing")
#--> No method 'NoSuchThing' in stzList.
Output of this run
DuplicatesRemoved --
No method 'NoSuchThing' in stzList.

ran: the promise is kept · in all four editions

This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

The exercises

Every exercise proves itself: its wrong answers are refused and its right answers accepted.

ex-13-01 · Exercise 13.1 · Close one gap

2 of 2 wrong answers refused, 2 of 2 right answers accepted

01-never-answers.ring refused · 02-prints-the-question.ring refused · 01-answer-in-words.ring accepted · 02-answer-with-a-list.ring accepted

The exercise's folder(opens in a new tab)

ex-13-02 · Exercise 13.2 · Ask the library

2 of 2 wrong answers refused, 2 of 2 right answers accepted

01-another-intent.ring refused · 02-explains-instead.ring refused · 01-howto.ring accepted · 02-howto-on-an-object.ring accepted

The exercise's folder(opens in a new tab)