Skip to content

TS: the Small-Step Semantics chapter#101

Open
mwhicks1 wants to merge 17 commits into
mainfrom
mwh-slang-smallstep
Open

TS: the Small-Step Semantics chapter#101
mwhicks1 wants to merge 17 commits into
mainfrom
mwh-slang-smallstep

Conversation

@mwhicks1

@mwhicks1 mwhicks1 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Adds the Small-Step Semantics chapter to the Type Systems volume, built on the Slang chapter.

Contents

  • Core small-step operational semantics on a toy arithmetic language (Tm): determinism, values, strong progress, normal forms, multi-step reduction, and big-step/small-step equivalence.
  • The small-step treatment applied to the richer Slang arithmetic and boolean expressions (AStep/BStep), with new astep_deterministic/bstep_deterministic exercises (compact <;>-driven proofs).
  • A nondeterministic-evaluation variant (ANStep, ⟶n) standing in for Concurrent Imp, plus a small-step stack machine (compiler_is_correct).
  • The boolean toy language / Combined / normalize-tactic sections were cut as redundant now that the chapter builds on Slang (which already provides arithmetic and boolean expressions); the "stuck terms motivate types" lesson lands in the Types chapter instead.
  • Adopts the Exercise levels, gradeTheorem, canonical dev urgencies, quizSolution #97 markup: canonical dev-note urgencies, :::gradeTheorem, and :::quizSolution.

This chapter no longer depends on full Imp, so Concurrent Imp and the Imp-based stack machine are not there. Changed to nondeterministic Slang and a stack machine on Slang, instead.

Not handled here: Using notation fully (e.g., in the definition of the inductive relation), and formatting width (things are up to 100 columns, which present badly in the HTML).

mwhicks1 and others added 7 commits July 18, 2026 09:06
Slang is the simple expression language (Aexp/Bexp with big-step evaluation
and the optimize0plus optimization), extracted from HL/Imp's opening and shared
as the common foundation for the HL and TS paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The chapter's opening (~810 lines: variable-free Aexp/Bexp, evaluation,
optimization, and evaluation-as-a-relation) duplicated the new Slang chapter.
Remove it and add a short bridge telling the reader to read Slang first, then
resume here with variables and commands.

- Delete the # Arithmetic and Boolean Expressions / # Optimizing Booleans /
  # Evaluation as a Relation sections (Warmup, AevalRDivision, AevalRExtended).
- No import of TS.Slang: nothing here uses it in code, and importing would make
  HL depend on a TS-volume module, against the independent-paths goal.
- Reference Slang in prose (plain text; a live cross-book link isn't supported
  across separate books yet).
- Redirect the two Warmup back-references to Slang.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts:
#	HL/Imp.lean
- Promote dev-note urgencies/authors to directive args (SOONER ->
  BeforeNextRelease, LATER -> PotentialImprovement; mwhicks1/chenson2018 ->
  author strings).
- GRADE_THEOREM blocks -> :::gradeTheorem (GRADE_MANUAL stays :::grade).
- Add :::quizSolution answer blocks to the two quizzes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Small-step operational semantics (toy Tm language, typed arithmetic build-up,
and the Slang-based arithmetic/boolean small-step + stack machine).  Builds on
the Slang chapter.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Cut the boolean toy language (Temp4/Temp5), the Combined arith+bool language,
  and the normalize-tactic section: redundant now that the chapter builds on
  Slang (which already has arithmetic and boolean expressions).  The Combined
  language's stuck-terms lesson is picked up in the Types chapter.
- Rename the Slang small-step section to 'Small-Step Slang' and move
  Nondeterministic Evaluation after Boolean Expressions.
- Add astep_deterministic / bstep_deterministic exercises, proved as compact
  <;>-driven tactic chains with a single uniform closer.
- Use Unicode operators (¬, ∧, −, ×) in the boolean/arithmetic inference rules.
- Resolve in-file TODOs; drop stale dev/port-status notes; prose + formatting.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Dev-note urgencies/authors -> directive args (SOONER/LATER/TODO ->
  BeforeNextRelease/PotentialImprovement/NOW; mwhicks1/MRC -> author strings);
  the bare 'Additional Exercises' TODO -> :::dev NOW.
- GRADE_THEOREM -> :::gradeTheorem (GRADE_MANUAL stays :::grade).
- :::quizSolution for all 8 quizzes (5 converted from :::instructors answers,
  3 bare quizzes given computed answers).
- compiler_is_correct: (level := Advanced) (Rocq EX3A).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mwhicks1
mwhicks1 requested a review from a team as a code owner July 18, 2026 18:19
@mwhicks1
mwhicks1 force-pushed the mwh-slang-smallstep branch from eb59592 to b4ab6d6 Compare July 18, 2026 18:27
Benjamin Pierce and others added 10 commits July 20, 2026 19:49
- Replace <> / <= / ! / && with ≠ / ≤ / ¬ / ∧ in the imp_bexp grammar,
  macro_rules, and boolean delaborator
- Update examples and the #check expected-output annotation to match
- Strip trailing whitespace across prose and dev-note lines
- Use * rather than × in the arithmetic BNF for consistency
berberman left a GitHub comment about not using induction principles directly,
and preferring the fun_induction tactic. I asked Claude to help me update the
proof to do that, and then adjusted the text accordingly, leaving a note
that we should either update Automation to add this tactic, or introduce it
here.
Base automatically changed from mwh-slang to main July 20, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant