You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CSwFP.yaml still marks 14 CSwFP exercises as TODO, and scripts/check-cswfp.py lists them as "exercises still to decide". For each one, decide whether it becomes an exercise in CSwL (and where), is absorbed, or is dropped, and record the outcome in CSwFP.yaml.
2.13 (p. 26): the higher-order function λfλx ↦ f (f x); was twice, no longer in the book
4.5 (p. 68): a grammar for strings that also generates the empty string
5.30 (p. 110): transitive closures of the relations of Exercise 2.7
5.31 (p. 110): reflexive transitive closures of the same relations
5.32 (p. 115): filter the facts of a knowledge base that mention a given entity
6.5 (p. 141): an equivalent formula using only 0, s, ∗, +, <; goes with 6.5 to Logic/FOL
6.6 (p. 146): what formula3 expresses when R is interpreted as <; goes with 6.5 to Logic/FOL
9.10 stays here for now (decided while porting CSwFP/9.6, where the exercise sits).
The exercise asks for a rule for complex determiners made of a determiner function and a numeral: less than n, more than n, at least n, at most n, exactly n. In the port it would mean a parser for numerals and a rule DET → DF NUM, so that e.g. prs "Less than 3 dwarfs smiled." has a parse.
What blocks it:
The lexicon (Parsing/Lexicon.lean) is a fixed definition, and prs is tied to it. To add entries, the reader would have to define an extended lexicon and a prs that uses it, and that needs a way to parameterize the parsers by the lexicon that does not exist yet.
The lexicon only has less_than and more_than as DF. preproc produces at_least and at_most, but they are not in the lexicon, and there is nothing for exactly or for numerals.
Exercise 9.13 (in 9.7) asks for the same rule with the parsers of 9.7, and has the same obstacle.
Exercise 9.10 is now complex-det, in Parsing/Categories.lean (#62).
The obstacle above was half real. The parsers of the rules never consult the lexicon; only prs did, through collectCats, which already took the lexicon as an argument. So prs is now parseWith lexicon parseSent, where parseWith takes the lexicon and the parser. The reader defines lexicon' (the missing DF entries at_least, at_most, exactly, and digit strings as NUM, in place of a parser for numerals), complexDetRule (DET → DF NUM), complexNpRule, and parseNP' := parseNP <|> complexNpRule, tested with parseWith lexicon' parseNP' and native_decide.
What stays open: the rules are fixed. sRule calls parseNP, and vpRule parses objects through parseNPsorPPs, so a whole sentence such as Less than 3 dwarfs smiled would need the chain of rules redefined or parameterized by the NP parser. The exercise is therefore scoped to the noun phrase. Exercise 9.13 asks for the same rule with the parsers of 9.7 and meets the same question.
Activity
arademaker commentedon Nov 18, 2026
9.10 stays here for now (decided while porting CSwFP/9.6, where the exercise sits).
The exercise asks for a rule for complex determiners made of a determiner function and a numeral: less than n, more than n, at least n, at most n, exactly n. In the port it would mean a parser for numerals and a rule
DET → DF NUM, so that e.g.prs "Less than 3 dwarfs smiled."has a parse.What blocks it:
Parsing/Lexicon.lean) is a fixed definition, andprsis tied to it. To add entries, the reader would have to define an extended lexicon and aprsthat uses it, and that needs a way to parameterize the parsers by the lexicon that does not exist yet.less_thanandmore_thanasDF.preprocproducesat_leastandat_most, but they are not in the lexicon, and there is nothing for exactly or for numerals.Exercise 9.13 (in 9.7) asks for the same rule with the parsers of 9.7, and has the same obstacle.
arademaker commentedon Nov 19, 2026
Exercise 9.10 is now
complex-det, inParsing/Categories.lean(#62).The obstacle above was half real. The parsers of the rules never consult the lexicon; only
prsdid, throughcollectCats, which already took the lexicon as an argument. Soprsis nowparseWith lexicon parseSent, whereparseWithtakes the lexicon and the parser. The reader defineslexicon'(the missingDFentriesat_least,at_most,exactly, and digit strings asNUM, in place of a parser for numerals),complexDetRule(DET → DF NUM),complexNpRule, andparseNP' := parseNP <|> complexNpRule, tested withparseWith lexicon' parseNP'andnative_decide.What stays open: the rules are fixed.
sRulecallsparseNP, andvpRuleparses objects throughparseNPsorPPs, so a whole sentence such as Less than 3 dwarfs smiled would need the chain of rules redefined or parameterized by theNPparser. The exercise is therefore scoped to the noun phrase. Exercise 9.13 asks for the same rule with the parsers of 9.7 and meets the same question.