{"families":[{"id":"source-text","name":"Source text","named":true,"part":0,"topics":["source-text-tokenization","character-classes"]},{"id":"lexical-tokens","name":"Lexical tokens","named":true,"part":0,"topics":["symbols-keywords","numeric-literals","string-literals"]},{"id":"terms","name":"Terms","named":true,"part":0,"topics":["pattern-matching","term-grammar","variables-scope"]},{"id":"attributes","name":"Attributes","named":true,"part":0,"topics":["term-annotations","attribute-syntax"]},{"id":"commands-scripts","name":"Commands and scripts","named":true,"part":0,"topics":["command-syntax-options","scripts-interaction","declarations-definitions"]},{"id":"sexpressions","name":"S-expressions","named":true,"part":0,"topics":["sexpressions-constants"]},{"id":"identifiers-sorts","name":"Identifiers and sorts","named":true,"part":0,"topics":["indexed-identifiers","sort-expressions"]}],"layer":"phrases","meaning":"Each tie is a pointer that landed. Whether the paper and the Lean say the same thing is a reading.","parts":[{"end_byte":19119,"name":"","start_byte":0}],"passages":[[23,60,["smtlib.document"],"front"]],"segments":[[145,935,[0]],[937,1554,[1]],[1556,1718,[2]],[1720,1836,[3]],[1838,1911,[4]],[1913,2083,[5]],[2085,2182,[6]],[2184,2270,[7]],[2272,2431,[8]],[2433,2543,[9]],[2545,2974,[10]],[2976,3392,[11]],[3394,3595,[12]],[3597,3806,[13]],[3808,4025,[14]],[4027,4088,[15]],[4090,4237,[16]],[4239,5199,[17]],[5201,5399,[18]],[5493,5756,[19]],[5758,5872,[20]],[5874,5993,[21]],[6085,6459,[22]],[6461,6509,[23]],[6511,6584,[24]],[6675,7084,[25]],[7086,7177,[26]],[7179,7256,[27]],[7342,7915,[28]],[7917,7988,[29]],[8087,9439,[30]],[9441,9526,[31]],[9528,9581,[32]],[9583,9635,[33]],[9637,9675,[34]],[9677,9747,[35]],[9749,9802,[36]],[9804,10158,[37]],[10261,10403,[38]],[10405,10621,[39]],[10623,10963,[40]],[10965,11217,[41]],[11219,12450,[42]],[12452,12765,[43]],[12767,12864,[44]],[12981,13114,[45]],[13214,13545,[46]],[13664,14865,[47]],[14867,14920,[48]],[14922,14976,[49]],[14978,15047,[50]],[15049,15161,[51]],[15163,15243,[52]],[15245,15332,[53]],[15334,16399,[54]],[16401,16436,[55]],[16438,16950,[56]],[16952,17077,[57]],[17079,17585,[58]],[17703,18046,[59]],[18048,18109,[60]],[18111,18197,[61]],[18199,18232,[62]],[18234,18288,[63]],[18290,18364,[64]],[18366,18419,[65]],[18421,18535,[66]],[18537,18613,[67]],[18615,18721,[68]],[18723,18807,[69]],[18809,18970,[70]],[18972,19013,[71]],[19015,19084,[72]]],"ties":[{"anchor":"sec-3.1","at":"b145-935","from_record":false,"lean":true,"lines":[47,49],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.SourceFile","origin":"ai","part":0,"phrase":"2-7-p023-02","plain":"ASCII-only source in 2.0 and unrestricted byte sequences from 2.5","record":null,"relation":"defines","role":"definition","rows":[{"end_line":49,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper requires Unicode source text in an 8-bit encoding; the formal definition accepts every byte sequence in version 2.7. It removes the older ASCII restriction but does not establish that the bytes encode Unicode text.","fidelity_source":"ai","line":47,"lines":[47,49],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.SourceFile","note":"","plain":"ASCII-only source in 2.0 and unrestricted byte sequences from 2.5","relation":"defines","annotation":"Section 3.1 specifies Unicode text in an 8-bit encoding. At version 2.7, `SourceFile` is `True` for every byte sequence, so Unicode validity is outside this predicate. The ASCII byte check is specific to version 2.0.","annotation_references":[{"start":0,"end":11,"key":"section:3.1"}]},{"end_line":42,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper introduces token streams and whitespace; the formal definition also requires explicit token delimiters and permits a final comment without a line break. These are additional parsing conventions, so this is not a literal transcription of the quoted rules.","fidelity_source":"ai","line":37,"lines":[37,42],"module":"BSmtLibSpec.Lexicon.Tokenization","name":"BSmtLibSpec.Lexicon.Tokenization.From","note":"","plain":"Tokenisation from a specified offset","relation":"defines","annotation":"The token stream in this passage is the output of the relation in `Tokenization.From`. A step splits off whitespace and one token, records its byte offset, leaves the token's source spelling intact, and continues on the rest. The rules require a delimiter after a non-parenthesis token and admit a final comment at end of input."},{"end_line":101,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition recognizes a semicolon followed by characters up to and including the first line feed or carriage return. This completes the comment rule whose sentence continues onto the next page.","fidelity_source":"ai","line":101,"lines":[101,101],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.comment","note":"","plain":"Semicolon comments stop at the first line break","relation":"defines","annotation":"The regular expression starts at `;` and consumes the first line feed or carriage return as part of the comment. The tokenization rules determine whether that semicolon starts a comment or occurs inside a string or quoted symbol."},{"end_line":67,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper speaks of Unicode characters from 128 onward; the formal definition recognizes individual bytes from 32 to 126 or 128 to 255. This models an encoded byte stream and does not validate its Unicode encoding.","fidelity_source":"ai","line":67,"lines":[67,67],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.printableChar","note":"","plain":"Printable byte codes 32–126 and 128–255","relation":"defines","annotation":"The printable character class in this paragraph corresponds to two byte ranges in Lean, $32$ through $126$ and $128$ through $255$. A UTF-8 character can span several bytes, and this regular expression matches one byte at a time."}],"tone":0,"topic":"source-text-tokenization"},{"anchor":"sec-3.1","at":"b937-1554","from_record":false,"lean":true,"lines":[49,50],"module":"BSmtLibSpec.Lexicon.Tokenization","name":"BSmtLibSpec.Lexicon.Tokenization","origin":"ai","part":0,"phrase":"2-7-p024-01","plain":"Splitting input into lexical tokens","record":null,"relation":"defines","role":"definition","rows":[{"end_line":50,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition starts tokenization at offset zero, treats whitespace as separators, and adds a delimiter requirement after non-parenthesis tokens. It also allows an unterminated final comment; the quotation does not specify these extra conventions.","fidelity_source":"ai","line":49,"lines":[49,50],"module":"BSmtLibSpec.Lexicon.Tokenization","name":"BSmtLibSpec.Lexicon.Tokenization","note":"","plain":"Splitting input into lexical tokens","relation":"defines","annotation":"`Tokenization` relates a complete input to its token list, starting at byte offset zero. Whitespace and comments are consumed between tokens and omitted from the resulting list. The relation requires delimiters after non-parenthesis tokens and permits a comment to finish at end of input."},{"end_line":42,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition tracks token positions while discarding separating whitespace. It additionally requires delimiters after non-parenthesis tokens and allows a comment to end at end of input, neither of which is stated in the quotation.","fidelity_source":"ai","line":37,"lines":[37,42],"module":"BSmtLibSpec.Lexicon.Tokenization","name":"BSmtLibSpec.Lexicon.Tokenization.From","note":"","plain":"Tokenisation from a specified offset","relation":"defines","annotation":"Each recursive step advances the offset by the lengths of both the whitespace and the token, then continues on the remaining bytes. A non-parenthesis token needs end of input, whitespace, a parenthesis or a semicolon immediately after it. The last step can consume a final comment without a newline."},{"end_line":332,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition assigns recognition rules to parentheses, numeric literals, strings, symbols, keywords, and reserved words. Simple and quoted symbols are represented separately; the keyword rule has the broader spelling discussed at the keyword passage.","fidelity_source":"ai","line":321,"lines":[321,332],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.categoryRegex","note":"","plain":"Regular expressions for token categories by version","relation":"defines","annotation":"The standard's list of token kinds becomes a case split in `categoryRegex`, with separate cases for simple and quoted symbols. The selected version determines the reserved words and simple-symbol rule, and version 2.0 uses its own string rule."},{"end_line":101,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition ends a semicolon comment at the first line feed or carriage return, matching the sentence continued here. Recognition of comments within the source is handled separately from recognition of string literals and quoted symbols.","fidelity_source":"ai","line":101,"lines":[101,101],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.comment","note":"","plain":"Semicolon comments stop at the first line break","relation":"defines","annotation":"The two line-breaking bytes named here are precisely the bytes excluded by `minus anyChar lineBreak` from the comment body. The final `lineBreak` consumes whichever of them comes first."},{"end_line":91,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition allows exactly character codes 10 and 13 as comment-ending line breaks, as stated in the paper.","fidelity_source":"ai","line":91,"lines":[91,91],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.lineBreak","note":"","plain":"Line feed or carriage return","relation":"defines","annotation":"`alt (code 10) (code 13)` matches one byte, a line feed or a carriage return. That byte ends the ordinary semicolon comment."},{"end_line":116,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition recognizes any concatenation of whitespace characters and line-terminated comments, including an empty concatenation. This supplies the separators described in the paper.","fidelity_source":"ai","line":116,"lines":[116,116],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.whitespace","note":"","plain":"Whitespace characters and complete comments","relation":"defines","annotation":"In `star (alt whiteSpaceChar comment)`, each repetition consumes either a white space byte or a complete line-terminated comment. Zero repetitions allow an empty separator, and the tokenization relation specifies when a delimiter is required."}],"tone":0,"topic":"source-text-tokenization"},{"anchor":"sec-3.1","at":"b1556-1718","from_record":false,"lean":true,"lines":[58,58],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.whiteSpaceChar","origin":"ai","part":0,"phrase":"2-7-p024-02","plain":"Tab, line feed, carriage return and space","record":null,"relation":"defines","role":"definition","rows":[{"end_line":58,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition recognizes exactly tab, line feed, carriage return, and space: character codes 9, 10, 13, and 32.","fidelity_source":"ai","line":58,"lines":[58,58],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.whiteSpaceChar","note":"","plain":"Tab, line feed, carriage return and space","relation":"defines","annotation":"The four alternatives in `altAll` are the decimal byte codes for tab, line feed, carriage return and space. A sequence of such bytes is handled by the separate `whitespace` expression."}],"tone":1,"topic":"character-classes"},{"anchor":"sec-3.1","at":"b1720-1836","from_record":false,"lean":true,"lines":[67,67],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.printableChar","origin":"ai","part":0,"phrase":"2-7-p024-03","plain":"Printable byte codes 32–126 and 128–255","record":null,"relation":"defines","role":"definition","rows":[{"end_line":67,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper allows characters from 128 onward without an upper bound; the formal definition works on bytes and ends that range at 255. It agrees with the byte range printed in Appendix B, but does not itself describe or validate Unicode code points.","fidelity_source":"ai","line":67,"lines":[67,67],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.printableChar","note":"","plain":"Printable byte codes 32–126 and 128–255","relation":"defines","annotation":"`printableChar` matches a byte in $32$ through $126$ or $128$ through $255$, leaving out $127$. Compare the explicit upper bound in Appendix B with “from 128 on” in this paragraph about characters.","annotation_references":[{"start":132,"end":142,"key":"appendix:b"}]}],"tone":1,"topic":"character-classes"},{"anchor":"sec-3.1","at":"b1838-1911","from_record":false,"lean":true,"lines":[74,74],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.digit","origin":"ai","part":0,"phrase":"2-7-p024-04","plain":"Decimal digit characters","record":null,"relation":"defines","role":"definition","rows":[{"end_line":74,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition recognizes exactly the ASCII digits 0 through 9, with codes 48 through 57.","fidelity_source":"ai","line":74,"lines":[74,74],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.digit","note":"","plain":"Decimal digit characters","relation":"defines","annotation":"`range 48 57` matches one ASCII byte, from `0` to `9` inclusive. The numeral and decimal rules use this single-byte class to build longer tokens."}],"tone":1,"topic":"character-classes"},{"anchor":"sec-3.1","at":"b1913-2083","from_record":false,"lean":true,"lines":[84,84],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.letter","origin":"ai","part":0,"phrase":"2-7-p024-05","plain":"Uppercase and lowercase ASCII letters","record":null,"relation":"defines","role":"definition","rows":[{"end_line":84,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition recognizes exactly the two ASCII letter ranges A through Z and a through z, with codes 65–90 and 97–122.","fidelity_source":"ai","line":84,"lines":[84,84],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.letter","note":"","plain":"Uppercase and lowercase ASCII letters","relation":"defines","annotation":"The two inclusive ranges in `letter` match one ASCII byte, either `A` through `Z` or `a` through `z`. The definition gives the literal alphabet used in simple symbols."}],"tone":1,"topic":"character-classes"},{"anchor":"sec-3.1","at":"b2085-2182","from_record":false,"lean":true,"lines":[132,132],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.numeral","origin":"ai","part":0,"phrase":"2-7-p024-06","plain":"Zero or a sequence of digits without a leading zero","record":null,"relation":"defines","role":"definition","rows":[{"end_line":132,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition allows 0 by itself or a nonempty sequence of decimal digits whose first digit is not 0. Leading zeros are excluded from longer numerals.","fidelity_source":"ai","line":132,"lines":[132,132],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.numeral","note":"","plain":"Zero or a sequence of digits without a leading zero","relation":"defines","annotation":"The first branch admits `0`. The second starts with all nonempty digit strings and subtracts those beginning with `0`, so `10` matches and `01` falls outside the rule. The result is a spelling rule for numeral tokens."}],"tone":3,"topic":"numeric-literals"},{"anchor":"sec-3.1","at":"b2184-2270","from_record":false,"lean":true,"lines":[139,139],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.decimal","origin":"ai","part":0,"phrase":"2-7-p024-07","plain":"Decimal literals have digits on both sides of the point","record":null,"relation":"defines","role":"definition","rows":[{"end_line":139,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition is a numeral, a decimal point, zero or more zeros, and another numeral. Thus there is at least one digit after the point, while zeros may begin the fractional part.","fidelity_source":"ai","line":139,"lines":[139,139],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.decimal","note":"","plain":"Decimal literals have digits on both sides of the point","relation":"defines","annotation":"The two occurrences of `numeral` enclose a literal point followed by `star (lit \"0\")`. The extra zero run makes `0.007` possible on the fractional side, and the final numeral ensures at least one digit follows the point."}],"tone":3,"topic":"numeric-literals"},{"anchor":"sec-3.1","at":"b2272-2431","from_record":false,"lean":true,"lines":[147,147],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.hexadecimal","origin":"ai","part":0,"phrase":"2-7-p024-08","plain":"Hexadecimal literals have a #x prefix and a nonempty digit string","record":null,"relation":"defines","role":"definition","rows":[{"end_line":147,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition requires the lowercase prefix #x followed by one or more digits or letters A–F or a–f. Only the hexadecimal digits are case-insensitive.","fidelity_source":"ai","line":147,"lines":[147,147],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.hexadecimal","note":"","plain":"Hexadecimal literals have a #x prefix and a nonempty digit string","relation":"defines","annotation":"The literal prefix is `#x`. The following `plus` requires at least one byte from the digit class or the two letter ranges `A` to `F` and `a` to `f`, as in `#x01Ab`."}],"tone":3,"topic":"numeric-literals"},{"anchor":"sec-3.1","at":"b2433-2543","from_record":false,"lean":true,"lines":[154,154],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.binary","origin":"ai","part":0,"phrase":"2-7-p024-10","plain":"Binary literals have a #b prefix and a nonempty digit string","record":null,"relation":"defines","role":"definition","rows":[{"end_line":154,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition requires the lowercase prefix #b followed by one or more characters, each either 0 or 1.","fidelity_source":"ai","line":154,"lines":[154,154],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.binary","note":"","plain":"Binary literals have a #b prefix and a nonempty digit string","relation":"defines","annotation":"After the literal `#b`, `plus (oneOf \"01\")` matches at least one binary digit. The rule admits the leading zeroes in the standard's example `#b001`."}],"tone":3,"topic":"numeric-literals"},{"anchor":"sec-3.1","at":"b2545-2974","from_record":false,"lean":true,"lines":[162,165],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.string","origin":"ai","part":0,"phrase":"2-7-p024-12","plain":"String literals use doubled quotation marks from version 2.5","record":null,"relation":"defines","role":"definition","rows":[{"end_line":165,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition implements the surrounding quotes and doubled-quote escape exactly, but its permitted contents are bytes rather than Unicode characters. The quoted character-set requirement therefore needs a separate encoding assumption.","fidelity_source":"ai","line":162,"lines":[162,165],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.string","note":"","plain":"String literals use doubled quotation marks from version 2.5","relation":"defines","annotation":"Between the two delimiter quotes, the repeated unit is either one permitted byte other than a quote or the pair `\"\"`. This is the version 2.7 spelling rule on bytes, with the printable byte class in place of a Unicode decoding step."},{"end_line":174,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition replaces each doubled quote in a literal’s contents by one quote and leaves other bytes unchanged. It defines the escape’s meaning; removing the surrounding delimiters is a separate step.","fidelity_source":"ai","line":172,"lines":[172,174],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.unescape","note":"","plain":"Decode doubled quotation marks","relation":"defines","annotation":"Once the outer quotes have been removed, `unescape` takes adjacent quote bytes two at a time and outputs one quote for each pair. Matching the complete quoted literal is the role of `string`."}],"tone":4,"topic":"string-literals"},{"anchor":"sec-3.1","at":"b2976-3392","from_record":false,"lean":true,"lines":[162,165],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.string","origin":"ai","part":0,"phrase":"2-7-p025-04","plain":"String literals use doubled quotation marks from version 2.5","record":null,"relation":"defines","role":"definition","rows":[{"end_line":165,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition gives only doubled quotes a special role inside a string literal. A backslash is an ordinary permitted character, so the backslash sequences mentioned in the paper are not lexical escapes.","fidelity_source":"ai","line":162,"lines":[162,165],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.string","note":"","plain":"String literals use doubled quotation marks from version 2.5","relation":"defines","annotation":"A backslash is in the printable byte class used by `string`. Thus `\\n` can appear as a backslash followed by `n` in the string interior, while an interior double quote must be written as `\"\"`."},{"end_line":174,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition collapses doubled quotes and makes no changes to backslash sequences. This matches the paper’s rule that such sequences retain their individual characters.","fidelity_source":"ai","line":172,"lines":[172,174],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.unescape","note":"","plain":"Decode doubled quotation marks","relation":"defines","annotation":"The recursive case for two quote bytes is the only replacement in `unescape`. Given `\\x0A` in the interior, it copies the backslash and the next three bytes in order."}],"tone":4,"topic":"string-literals"},{"anchor":"sec-3.1","at":"b3394-3595","from_record":false,"lean":true,"lines":[208,212],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.addedBasicReservedWords","origin":"ai","part":0,"phrase":"2-7-p025-05","plain":"New reserved words by version","record":null,"relation":"defines","role":"definition","rows":[{"end_line":212,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper introduces the complete basic set of reserved words; the formal definition lists only the words added by each version. For version 2.7 alone it returns lambda, so the earlier additions must be included to recover the full set.","fidelity_source":"ai","line":208,"lines":[208,212],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.addedBasicReservedWords","note":"","plain":"New reserved words by version","relation":"defines","annotation":"The list on this page is cumulative. In `addedBasicReservedWords` the version 2.7 case contains just `lambda`. `match`, the names for literal categories and the other grammar words come from earlier cases."},{"end_line":220,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition collects all basic reserved words introduced up to the selected version. At version 2.7 this includes the literal-category words, punctuation, and language words listed immediately after the quotation.","fidelity_source":"ai","line":219,"lines":[219,220],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.basicReservedWords","note":"","plain":"General reserved words by version","relation":"defines","annotation":"`version.upTo.flatMap addedBasicReservedWords` concatenates the basic words added in each supported version through the selected one. At 2.7 this puts `lambda` and `match` in the same list as earlier words such as `_` and `forall`."},{"end_line":251,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper describes reserved words as lexical tokens; the formal definition checks whether an already classified reserved word belongs to the selected version. It accepts other kinds of input without this check and does not define token recognition.","fidelity_source":"ai","line":249,"lines":[249,251],"module":"BSmtLibSpec.Parser.Traversal","name":"BSmtLibSpec.Parser.Traversal.Received.OfVersion","note":"","plain":"Reserved-word tokens must belong to the active version","relation":"defines","annotation":"This parser condition starts with an item already classified as a token or end of input. For a reserved token it tests the union of the version's basic reserved words and command names. All other items satisfy this particular condition."}],"tone":2,"topic":"symbols-keywords"},{"anchor":"sec-3.1","at":"b3597-3806","from_record":false,"lean":true,"lines":[230,238],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.addedCommandNames","origin":"ai","part":0,"phrase":"2-7-p025-08","plain":"New command names by version","record":null,"relation":"defines","role":"definition","rows":[{"end_line":238,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper includes every command name among the reserved words; the formal definition lists only the commands newly introduced in each version. Accumulating those lists is a separate operation.","fidelity_source":"ai","line":230,"lines":[230,238],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.addedCommandNames","note":"","plain":"New command names by version","relation":"defines","annotation":"The command names are grouped here by the version that introduced them. The 2.7 branch has `declare-sort-parameter` and `define-const`, while the `set-logic` and `set-option` named in the passage come from the 2.0 branch."},{"end_line":247,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition collects all command names introduced by version 2.7, including define-funs-rec. This matches the statement that every command name is reserved.","fidelity_source":"ai","line":246,"lines":[246,247],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.commandNames","note":"","plain":"Available command names by version","relation":"defines","annotation":"At version 2.7, the concatenation includes the commands added in 2.0, 2.5, 2.6 and 2.7. That is where `define-funs-rec`, which entered the grammar in 2.5, joins the current set of command names."},{"end_line":255,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition recognizes exactly a basic reserved word or a command name for the selected version. This matches the paper’s combined reserved-word category.","fidelity_source":"ai","line":254,"lines":[254,255],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.reserved","note":"","plain":"Matching a reserved word","relation":"defines","annotation":"`litOneOf` matches the complete spelling of a word from either `basicReservedWords` or `commandNames` for that version. This puts a command like `set-option` and a grammar word like `let` in the same lexical category."}],"tone":2,"topic":"symbols-keywords"},{"anchor":"sec-3.1","at":"b3808-4025","from_record":false,"lean":true,"lines":[271,273],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.simpleSymbol","origin":"ai","part":0,"phrase":"2-7-p025-09","plain":"Unquoted symbols exclude initial digits and reserved words","record":null,"relation":"defines","role":"definition","rows":[{"end_line":273,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition recognises nonempty sequences of ASCII letters, digits and exactly these punctuation characters, excluding an initial digit and reserved words. The two exclusions are stated in the next sentence, which has its own link.","fidelity_source":"ai","line":271,"lines":[271,273],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.simpleSymbol","note":"","plain":"Unquoted symbols exclude initial digits and reserved words","relation":"defines","annotation":"The inner `plus` combines letters, digits and the punctuation listed here into a nonempty candidate. The two subtractions apply the initial-digit and reserved-word exclusions in the continuation below."},{"end_line":262,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition is exactly the seventeen punctuation characters listed here, in the same order.","fidelity_source":"ai","line":262,"lines":[262,262],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.symbolPunctuation","note":"","plain":"Punctuation permitted in simple symbols","relation":"defines","annotation":"`oneOf` matches exactly one of the listed punctuation characters. The simple-symbol rule combines that class with letters and digits before checking the whole spelling."}],"tone":2,"topic":"symbols-keywords"},{"anchor":"sec-3.1","at":"b4027-4088","from_record":false,"lean":true,"lines":[271,273],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.simpleSymbol","origin":"ai","part":0,"phrase":"2-7-p025-11","plain":"Unquoted symbols exclude initial digits and reserved words","record":null,"relation":"defines","role":"definition","rows":[{"end_line":273,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition excludes an initial digit and excludes every reserved word of the selected version. These are exactly the two restrictions stated in this continuation of the simple-symbol definition.","fidelity_source":"ai","line":271,"lines":[271,273],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.simpleSymbol","note":"","plain":"Unquoted symbols exclude initial digits and reserved words","relation":"defines","annotation":"The nested `minus` expressions remove candidates that start with a digit and candidates whose whole spelling is reserved. For example, `x1` remains a simple symbol in 2.7, while `1x` and `let` are excluded by different subtractions."}],"tone":2,"topic":"symbols-keywords"},{"anchor":"sec-3.1","at":"b4090-4237","from_record":false,"lean":true,"lines":[281,282],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.quotedSymbol","origin":"ai","part":0,"phrase":"2-7-p025-14","plain":"Quoted symbols forbid interior bars and backslashes","record":null,"relation":"defines","role":"definition","rows":[{"end_line":282,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition uses enclosing vertical bars and excludes interior bars and backslashes, matching those restrictions. Its contents are bytes in the permitted ranges, however, so the paper’s Unicode character requirement is not established by this definition alone.","fidelity_source":"ai","line":281,"lines":[281,282],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.quotedSymbol","note":"","plain":"Quoted symbols forbid interior bars and backslashes","relation":"defines","annotation":"The two outer `lit \"|\"` expressions are the delimiters. The starred interior permits `||` and strings of printable or white space bytes, with interior bars and backslashes removed from the allowed byte class."}],"tone":2,"topic":"symbols-keywords"},{"anchor":"sec-3.1","at":"b4239-5199","from_record":false,"lean":true,"lines":[360,366],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.Token.content","origin":"ai","part":0,"phrase":"2-7-p026-03","plain":"Decoding the contents of tokens","record":null,"relation":"defines","role":"definition","rows":[{"end_line":366,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition removes the surrounding bars from a quoted symbol and leaves a simple symbol unchanged, without changing case. Thus abc and |abc| have identical name contents; restrictions on solver-generated names are a separate matter.","fidelity_source":"ai","line":360,"lines":[360,366],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.Token.content","note":"","plain":"Decoding the contents of tokens","relation":"defines","annotation":"The quoted-symbol case strips the bars, so `abc` and `|abc|` supply the same case-sensitive name bytes. When Lean builds syntax tokens from those bytes, it also records whether the source symbol was quoted."},{"end_line":282,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition recognizes the spelling of a quoted symbol; it does not state that quoted and unquoted names have the same identity or reserve names beginning with @ or a dot for solvers. Those are additional claims in the quotation.","fidelity_source":"ai","line":281,"lines":[281,282],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.quotedSymbol","note":"","plain":"Quoted symbols forbid interior bars and backslashes","relation":"defines","annotation":"This rule recognizes the bar-delimited spelling in examples such as `|abc|` and `|@abc|`. Name bytes are extracted separately, and the regex tests spelling alone."},{"end_line":273,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition recognizes permissible simple-symbol spellings. It does not identify quoted and unquoted names or enforce the quoted restriction that names beginning with @ or a dot belong to solvers.","fidelity_source":"ai","line":271,"lines":[271,273],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.simpleSymbol","note":"","plain":"Unquoted symbols exclude initial digits and reserved words","relation":"defines","annotation":"The lexical rule can match names beginning with `@` or `.`, including `@abc` and `.abc`. The restriction on who introduces those names concerns solver use, which is outside this spelling test."}],"tone":2,"topic":"symbols-keywords"},{"anchor":"sec-3.1","at":"b5201-5399","from_record":false,"lean":true,"lines":[294,294],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.keyword","origin":"ai","part":0,"phrase":"2-7-p026-04","plain":"Colon-prefixed attribute, option names","record":null,"relation":"defines","role":"definition","rows":[{"end_line":294,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper specifies a colon followed by a simple symbol; the formal definition also permits an initial digit or a reserved word after the colon, such as :56 or :let. This follows the older keyword rule and the paper’s own :56 example, rather than the displayed production literally.","fidelity_source":"ai","line":294,"lines":[294,294],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.keyword","note":"","plain":"Colon-prefixed attribute, option names","relation":"defines","annotation":"Lean uses the 2.0 rule in every supported version. After `:`, it accepts a nonempty sequence of letters, digits and symbol punctuation, so both the printed example `:56` and `:let` match despite the stricter simple-symbol production."}],"tone":2,"topic":"symbols-keywords"},{"anchor":"sec-3.2","at":"b5493-5756","from_record":false,"lean":true,"lines":[348,353],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SExpr.Valid","origin":"ai","part":0,"phrase":"2-7-p026-06","plain":"Reserved words in S-expressions from the 2021 revision of 2.6","record":null,"relation":"defines","role":"definition","rows":[{"end_line":353,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines atoms and parenthesized lists; the formal definition only restricts which reserved words may occur in an already represented S-expression. It supplies version conditions rather than the entire S-expression definition.","fidelity_source":"ai","line":348,"lines":[348,353],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SExpr.Valid","note":"","plain":"Reserved words in S-expressions from the 2021 revision of 2.6","relation":"defines","annotation":"Once an S-expression tree is given, `Valid` recurses through its lists to check reserved-word atoms. Each must belong to the selected version's reserved set, and reserved-word atoms are available from 2.6 onward."},{"end_line":60,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes an atom as one token and a list as parentheses around its members, allowing an empty list. This matches the quoted construction of S-expressions; it is not a theorem about every other syntactic category.","fidelity_source":"ai","line":55,"lines":[55,60],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SExpr.tokens","note":"","plain":"Writing an S-expression as tokens","relation":"defines","annotation":"An atom supplies one syntax token. For a list, Lean joins the members' token lists in order and adds the two parentheses, so an empty list supplies just `(` and `)`."}],"tone":13,"topic":"sexpressions-constants"},{"anchor":"sec-3.2","at":"b5758-5872","from_record":false,"lean":true,"lines":[39,44],"merged":[{"id":"2-7-p026-07","quote":"⟨spec\\_constant ⟩ ::= ⟨numeral ⟩ \\| ⟨decimal ⟩ \\| ⟨hexadecimal ⟩ \\| ⟨binary ⟩ \\| ⟨string ⟩","role":"definition","topic":"sexpressions-constants"},{"id":"2-7-p105-12","quote":"⟨spec\\_constant ⟩ ::= ⟨numeral ⟩ \\| ⟨decimal ⟩ \\| ⟨hexadecimal ⟩ \\| ⟨binary ⟩ \\| ⟨string ⟩","role":"definition","topic":"sexpressions-constants"}],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.SpecConstant","origin":"ai","part":0,"phrase":"2-7-p026-07","plain":"Numeral, decimal, hexadecimal, binary and string literals","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition distinguishes the same five special-constant alternatives: numeral, decimal, hexadecimal, binary, and string. Recognition of each literal’s spelling is supplied by the lexical rules.","phrase":"2-7-p026-07"},{"fidelity":"same","fidelity_note":"The formal definition distinguishes the same five special-constant alternatives: numeral, decimal, hexadecimal, binary, and string. Recognition of each literal’s spelling is supplied by the lexical rules.","phrase":"2-7-p105-12"}],"end_line":44,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition distinguishes the same five special-constant alternatives: numeral, decimal, hexadecimal, binary, and string. Recognition of each literal’s spelling is supplied by the lexical rules.","fidelity_source":"ai","line":39,"lines":[39,44],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.SpecConstant","note":"","plain":"Numeral, decimal, hexadecimal, binary and string literals","relation":"defines","annotation":"Each alternative has its own Lean constructor with a byte-sequence payload. In particular a numeral stores its digits, and a string stores its content. Their interpretation as terms is supplied by the relevant theory (see Remark 1 on special constants).","annotation_references":[{"start":222,"end":230,"key":"remark:1"}]},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition turns each of the five kinds of special constant into its corresponding single token. It preserves the alternatives listed in the production, with lexical spelling handled separately.","phrase":"2-7-p026-07"},{"fidelity":"same","fidelity_note":"The formal definition turns each of the five kinds of special constant into its corresponding single token. It preserves the alternatives listed in the production, with lexical spelling handled separately.","phrase":"2-7-p105-12"}],"end_line":45,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition turns each of the five kinds of special constant into its corresponding single token. It preserves the alternatives listed in the production, with lexical spelling handled separately.","fidelity_source":"ai","line":40,"lines":[40,45],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SpecConstant.token","note":"","plain":"Single token for a literal","relation":"defines","annotation":"Each constant constructor produces one syntax token of the corresponding kind and passes through its payload. For example, a hexadecimal constant passes its digit sequence, since the lexical-to-syntax conversion has already dropped `#x`."}],"tone":13,"topic":"sexpressions-constants"},{"anchor":"sec-3.2","at":"b5874-5993","from_record":false,"lean":true,"lines":[608,609],"merged":[{"id":"2-7-p026-08","quote":"⟨s\\_expr ⟩ ::= \\| ⟨spec\\_constant ⟩ \\| ⟨symbol ⟩ \\| ⟨reserved ⟩ \\| ⟨keyword ⟩ ( ⟨s\\_expr ⟩∗ )","role":"definition","topic":"sexpressions-constants"},{"id":"2-7-p105-13","quote":"⟨s\\_expr ⟩ ::= \\| ⟨spec\\_constant ⟩ \\| ⟨symbol ⟩ \\| ⟨reserved ⟩ \\| ⟨keyword ⟩ ( ⟨s\\_expr ⟩∗ )","role":"definition","topic":"sexpressions-constants"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Syntax.IsSExpr","origin":"ai","part":0,"phrase":"2-7-p026-08","plain":"Tokens of an S-expression valid in the current version","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"same","fidelity_note":"In version 2.7 the formal definition accepts a token sequence as an S-expression exactly when it writes a constant, symbol, reserved word, keyword or parenthesised list of S-expressions, every reserved word being one the version reserves. This matches the five alternatives; the spelling of each token is checked by the lexical rules.","phrase":"2-7-p026-08"},{"fidelity":"same","fidelity_note":"In version 2.7 the formal definition accepts a token sequence as an S-expression exactly when it writes a constant, symbol, reserved word, keyword or parenthesised list of S-expressions, every reserved word being one the version reserves. This matches the five alternatives; the spelling of each token is checked by the lexical rules.","phrase":"2-7-p105-13"}],"end_line":609,"exact_lines":false,"fidelity":"same","fidelity_note":"In version 2.7 the formal definition accepts a token sequence as an S-expression exactly when it writes a constant, symbol, reserved word, keyword or parenthesised list of S-expressions, every reserved word being one the version reserves. This matches the five alternatives; the spelling of each token is checked by the lexical rules.","fidelity_source":"ai","line":608,"lines":[608,609],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Syntax.IsSExpr","note":"","plain":"Tokens of an S-expression valid in the current version","relation":"defines","annotation":"For a given tree and token list, `IsSExpr` pairs two tests. The tree must satisfy the version rule and its emitted tokens must equal the supplied list. These tests apply to tokens after lexical recognition."},{"assessments":[{"fidelity":"different","fidelity_note":"The production lists five alternatives; the formal condition adds only that a reserved word, at any depth, is one the version reserves and occurs from version 2.6 on. It is a side condition on S-expressions already built, not the production itself.","phrase":"2-7-p026-08"},{"fidelity":"different","fidelity_note":"The production lists five alternatives; the formal condition adds only that a reserved word, at any depth, is one the version reserves and occurs from version 2.6 on. It is a side condition on S-expressions already built, not the production itself.","phrase":"2-7-p105-13"}],"end_line":353,"exact_lines":false,"fidelity":"different","fidelity_note":"The production lists five alternatives; the formal condition adds only that a reserved word, at any depth, is one the version reserves and occurs from version 2.6 on. It is a side condition on S-expressions already built, not the production itself.","fidelity_source":"ai","line":348,"lines":[348,353],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SExpr.Valid","note":"","plain":"Reserved words in S-expressions from the 2021 revision of 2.6","relation":"defines","annotation":"Of the four atom alternatives, only the reserved-word case has a further condition here. It checks that the version is at least 2.6 and that the word belongs to that version. The list case repeats the check at every depth."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition has exactly the five alternatives: constant, symbol, reserved word, keyword, and a list of S-expressions that may be empty, as the star allows. It stores spellings without checking them; the lexical rules check those.","phrase":"2-7-p026-08"},{"fidelity":"same","fidelity_note":"The formal definition has exactly the five alternatives: constant, symbol, reserved word, keyword, and a list of S-expressions that may be empty, as the star allows. It stores spellings without checking them; the lexical rules check those.","phrase":"2-7-p105-13"}],"end_line":56,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition has exactly the five alternatives: constant, symbol, reserved word, keyword, and a list of S-expressions that may be empty, as the star allows. It stores spellings without checking them; the lexical rules check those.","fidelity_source":"ai","line":51,"lines":[51,56],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.SExpr","note":"","plain":"Atoms and parenthesised expressions","relation":"defines","annotation":"The recursive `.list` constructor represents the parenthesized alternative, with zero members allowed by the production's star. The other four constructors represent the four kinds of atom individually."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition writes each atom as one token and a list as its S-expressions in order between parentheses, as the production reads. Which reserved words a version allows is checked by a separate condition.","phrase":"2-7-p026-08"},{"fidelity":"same","fidelity_note":"The formal definition writes each atom as one token and a list as its S-expressions in order between parentheses, as the production reads. Which reserved words a version allows is checked by a separate condition.","phrase":"2-7-p105-13"}],"end_line":60,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes each atom as one token and a list as its S-expressions in order between parentheses, as the production reads. Which reserved words a version allows is checked by a separate condition.","fidelity_source":"ai","line":55,"lines":[55,60],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SExpr.tokens","note":"","plain":"Writing an S-expression as tokens","relation":"defines","annotation":"Each atom branch produces a singleton list in its own token category. The `.list` branch concatenates the members' tokens inside parentheses, preserving the nesting of the displayed production."}],"tone":13,"topic":"sexpressions-constants"},{"anchor":"sec-3.3","at":"b6085-6459","from_record":false,"lean":true,"lines":[83,85],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Identifier.tokens","origin":"ai","part":0,"phrase":"2-7-p027-02","plain":"Writing simple and indexed identifiers","record":null,"relation":"defines","role":"definition","rows":[{"end_line":85,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes an unindexed name as its symbol and an indexed name as a parenthesized underscore, symbol, and nonempty list of indices. This matches the construction described in the paper.","fidelity_source":"ai","line":83,"lines":[83,85],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Identifier.tokens","note":"","plain":"Writing simple and indexed identifiers","relation":"defines","annotation":"For an identifier with indices, `Identifier.tokens` emits `(`, the reserved token `_`, the symbol, its index tokens in order, and `)`. A symbol with an empty index list is emitted on its own."},{"end_line":76,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes an index as either a numeral token or a symbol token, exactly the two index forms named in the paper.","fidelity_source":"ai","line":74,"lines":[74,76],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Index.tokens","note":"","plain":"Writing a numeral or symbol index","relation":"defines","annotation":"Each index contributes one token to the enclosing identifier. For example, the final component of `(_ BitVec 32)` is a numeral token with payload `32`."}],"tone":14,"topic":"indexed-identifiers"},{"anchor":"sec-3.3","at":"b6461-6509","from_record":false,"lean":true,"lines":[367,369],"merged":[{"id":"2-7-p027-03","quote":"⟨index ⟩ ::= ⟨numeral ⟩ \\| ⟨symbol ⟩","role":"definition","topic":"indexed-identifiers"},{"id":"2-7-p105-14","quote":"⟨index ⟩ ::= ⟨numeral ⟩ \\| ⟨symbol ⟩","role":"definition","topic":"indexed-identifiers"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Index.Valid","origin":"ai","part":0,"phrase":"2-7-p027-03","plain":"Numeral indices in every version and symbol indices from 2.5","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The paper defines the two index forms; the formal definition only says that symbolic indices require version 2.5 or later. At version 2.7 it imposes no further condition on either form.","phrase":"2-7-p027-03"},{"fidelity":"different","fidelity_note":"The paper defines the two index forms; the formal definition only says that symbolic indices require version 2.5 or later. At version 2.7 it imposes no further condition on either form.","phrase":"2-7-p105-14"}],"end_line":369,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines the two index forms; the formal definition only says that symbolic indices require version 2.5 or later. At version 2.7 it imposes no further condition on either form.","fidelity_source":"ai","line":367,"lines":[367,369],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Index.Valid","note":"","plain":"Numeral indices in every version and symbol indices from 2.5","relation":"defines","annotation":"Both alternatives satisfy `Index.Valid` in version 2.7. The version check is relevant to symbolic indices, which this implementation admits from 2.5 onward. The characters of a numeral or symbol are handled by the lexicon (see Section 3.1 for the spelling rules).","annotation_references":[{"start":227,"end":238,"key":"section:3.1"}]},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition has exactly the two index alternatives in the production: a numeral or a symbol. Their lexical spellings are handled separately.","phrase":"2-7-p027-03"},{"fidelity":"same","fidelity_note":"The formal definition has exactly the two index alternatives in the production: a numeral or a symbol. Their lexical spellings are handled separately.","phrase":"2-7-p105-14"}],"end_line":65,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition has exactly the two index alternatives in the production: a numeral or a symbol. Their lexical spellings are handled separately.","fidelity_source":"ai","line":63,"lines":[63,65],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.Index","note":"","plain":"Numerals or symbols as indices","relation":"defines","annotation":"The alternatives on either side of the bar are the two constructors of `Index`. A numeral index stores the digits, while a symbol index stores a `Symbol`, including its quoting flag."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition writes a numeral index as a numeral token and a symbol index as a symbol token, matching the production.","phrase":"2-7-p027-03"},{"fidelity":"same","fidelity_note":"The formal definition writes a numeral index as a numeral token and a symbol index as a symbol token, matching the production.","phrase":"2-7-p105-14"}],"end_line":76,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes a numeral index as a numeral token and a symbol index as a symbol token, matching the production.","fidelity_source":"ai","line":74,"lines":[74,76],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Index.tokens","note":"","plain":"Writing a numeral or symbol index","relation":"defines","annotation":"The two cases write one `.numeral` or one `.symbol` syntax token with the supplied payload. The underscore that introduces an indexed identifier belongs to the surrounding identifier, outside the index itself."}],"tone":14,"topic":"indexed-identifiers"},{"anchor":"sec-3.3","at":"b6511-6584","from_record":false,"lean":true,"lines":[376,377],"merged":[{"id":"2-7-p027-04","quote":"⟨identifier ⟩ ::= ⟨symbol ⟩ \\| ( \\_ ⟨symbol ⟩ ⟨index ⟩+ )","role":"definition","topic":"indexed-identifiers"},{"id":"2-7-p105-15","quote":"⟨identifier ⟩ ::= ⟨symbol ⟩ \\| ( \\_ ⟨symbol ⟩ ⟨index ⟩+ )","role":"definition","topic":"indexed-identifiers"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Identifier.Valid","origin":"ai","part":0,"phrase":"2-7-p027-04","plain":"Every index of an identifier must be valid","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The paper defines plain and indexed identifiers; the formal definition checks only that the supplied indices are available in the selected version. It does not define the underscore or parentheses in the production.","phrase":"2-7-p027-04"},{"fidelity":"different","fidelity_note":"The paper defines plain and indexed identifiers; the formal definition checks only that the supplied indices are available in the selected version. It does not define the underscore or parentheses in the production.","phrase":"2-7-p105-15"}],"end_line":377,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines plain and indexed identifiers; the formal definition checks only that the supplied indices are available in the selected version. It does not define the underscore or parentheses in the production.","fidelity_source":"ai","line":376,"lines":[376,377],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Identifier.Valid","note":"","plain":"Every index of an identifier must be valid","relation":"defines","annotation":"The test ranges over the identifier's list of indices and applies `Index.Valid` to each. For a plain symbol that list is empty, so the test is vacuous."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition stores a symbol together with a list of indices. An empty list represents the plain alternative, and a nonempty list represents the indexed alternative.","phrase":"2-7-p027-04"},{"fidelity":"same","fidelity_note":"The formal definition stores a symbol together with a list of indices. An empty list represents the plain alternative, and a nonempty list represents the indexed alternative.","phrase":"2-7-p105-15"}],"end_line":74,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition stores a symbol together with a list of indices. An empty list represents the plain alternative, and a nonempty list represents the indexed alternative.","fidelity_source":"ai","line":72,"lines":[72,74],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.Identifier","note":"","plain":"Symbol with optional indices","relation":"defines","annotation":"Both sides of the production use one Lean structure with a symbol and a list of indices. Empty indices encode the plain alternative and a populated list encodes the indexed alternative."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition writes the symbol alone when there are no indices, and otherwise writes the underscore, symbol, and indices inside parentheses. This enforces the production’s nonempty indexed form.","phrase":"2-7-p027-04"},{"fidelity":"same","fidelity_note":"The formal definition writes the symbol alone when there are no indices, and otherwise writes the underscore, symbol, and indices inside parentheses. This enforces the production’s nonempty indexed form.","phrase":"2-7-p105-15"}],"end_line":85,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes the symbol alone when there are no indices, and otherwise writes the underscore, symbol, and indices inside parentheses. This enforces the production’s nonempty indexed form.","fidelity_source":"ai","line":83,"lines":[83,85],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Identifier.tokens","note":"","plain":"Writing simple and indexed identifiers","relation":"defines","annotation":"The empty-list branch emits only the symbol. The other branch emits the parenthesized `_` form and concatenates one token per index, so the indexed spelling always contains at least one index."}],"tone":14,"topic":"indexed-identifiers"},{"anchor":"sec-3.4","at":"b6675-7084","from_record":false,"lean":true,"lines":[121,123],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Attribute.tokens","origin":"ai","part":0,"phrase":"2-7-p027-08","plain":"Writing a keyword and optional value","record":null,"relation":"defines","role":"definition","rows":[{"end_line":123,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes an attribute’s keyword followed by its value when one is present, and just the keyword otherwise. This matches the paper’s allowance of attributes with or without values.","fidelity_source":"ai","line":121,"lines":[121,123],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Attribute.tokens","note":"","plain":"Writing a keyword and optional value","relation":"defines","annotation":"A value of `none` yields the keyword alone. With `some value`, `Attribute.tokens` prepends the keyword to the tokens of that value. There is no additional wrapper for the attribute as a whole."},{"end_line":114,"exact_lines":false,"fidelity":"different","fidelity_note":"The prose describes attribute values as S-expressions other than keywords; the formal definition also excludes bare reserved words. It agrees with the narrower production immediately below the prose: a special constant, a symbol, or a parenthesized list.","fidelity_source":"ai","line":111,"lines":[111,114],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.AttributeValue.tokens","note":"","plain":"Writing an attribute's value","relation":"defines","annotation":"The branches correspond to the production below the paragraph. They emit a constant, a symbol, or a parenthesized list of S-expressions. A reserved word can appear inside the list if grammatically valid, while the listed branches have no bare reserved-word case."}],"tone":9,"topic":"attribute-syntax"},{"anchor":"sec-3.4","at":"b7086-7177","from_record":false,"lean":true,"lines":[401,403],"merged":[{"id":"2-7-p027-09","quote":"⟨attribute\\_value ⟩ ::= ⟨spec\\_constant ⟩ \\| ⟨symbol ⟩ \\| ( ⟨s\\_expr ⟩∗ )","role":"definition","topic":"attribute-syntax"},{"id":"2-7-p106-02","quote":"⟨attribute\\_value ⟩ ::= ⟨spec\\_constant ⟩ \\| ⟨symbol ⟩ \\| ( ⟨s\\_expr ⟩∗ )","role":"definition","topic":"attribute-syntax"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.AttributeValue.Valid","origin":"ai","part":0,"phrase":"2-7-p027-09","plain":"Every S-expression in an attribute list must be valid","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The production defines three forms of attribute value; the formal definition checks only the version conditions inside a list value. Special constants and symbols pass without any additional condition here.","phrase":"2-7-p027-09"},{"fidelity":"different","fidelity_note":"The production defines three forms of attribute value; the formal definition checks only the version conditions inside a list value. Special constants and symbols pass without any additional condition here.","phrase":"2-7-p106-02"}],"end_line":403,"exact_lines":false,"fidelity":"different","fidelity_note":"The production defines three forms of attribute value; the formal definition checks only the version conditions inside a list value. Special constants and symbols pass without any additional condition here.","fidelity_source":"ai","line":401,"lines":[401,403],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.AttributeValue.Valid","note":"","plain":"Every S-expression in an attribute list must be valid","relation":"defines","annotation":"Only a value in the list branch needs a further grammar check here. `SExpr.ValidAll` checks its members, including the version's restrictions on reserved-word atoms. The two atomic forms satisfy this predicate directly."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition gives the same three alternatives: a special constant, a symbol, or a possibly empty list of S-expressions. A bare keyword or reserved word is not an alternative.","phrase":"2-7-p027-09"},{"fidelity":"same","fidelity_note":"The formal definition gives the same three alternatives: a special constant, a symbol, or a possibly empty list of S-expressions. A bare keyword or reserved word is not an alternative.","phrase":"2-7-p106-02"}],"end_line":92,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition gives the same three alternatives: a special constant, a symbol, or a possibly empty list of S-expressions. A bare keyword or reserved word is not an alternative.","fidelity_source":"ai","line":89,"lines":[89,92],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.AttributeValue","note":"","plain":"Constants, symbols or S-expression lists","relation":"defines","annotation":"The type has one case for each alternative in the production. Its third case contains a list of S-expressions and permits an empty list, represented in the grammar as `()`."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition writes a constant or symbol as one token and a list between parentheses. These are precisely the three forms in the quoted production.","phrase":"2-7-p027-09"},{"fidelity":"same","fidelity_note":"The formal definition writes a constant or symbol as one token and a list between parentheses. These are precisely the three forms in the quoted production.","phrase":"2-7-p106-02"}],"end_line":114,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes a constant or symbol as one token and a list between parentheses. These are precisely the three forms in the quoted production.","fidelity_source":"ai","line":111,"lines":[111,114],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.AttributeValue.tokens","note":"","plain":"Writing an attribute's value","relation":"defines","annotation":"The constant and symbol branches each emit one token. The list branch emits the members' tokens inside parentheses, even for an empty list. The attribute keyword is emitted separately by `Attribute.tokens`."}],"tone":9,"topic":"attribute-syntax"},{"anchor":"sec-3.4","at":"b7179-7256","from_record":false,"lean":true,"lines":[618,620],"merged":[{"id":"2-7-p027-10","quote":"⟨attribute ⟩ ::= ⟨keyword ⟩ \\| ⟨keyword ⟩ ⟨attribute\\_value ⟩","role":"definition","topic":"attribute-syntax"},{"id":"2-7-p106-03","quote":"⟨attribute ⟩ ::= ⟨keyword ⟩ \\| ⟨keyword ⟩ ⟨attribute\\_value ⟩","role":"definition","topic":"attribute-syntax"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Syntax.IsAttribute","origin":"ai","part":0,"phrase":"2-7-p027-10","plain":"Tokens of an attribute valid in the current version","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition relates an attribute to a keyword token with an optional value, subject to the value’s grammar conditions. This matches the quoted token-level production; keyword spelling is handled by the lexicon.","phrase":"2-7-p027-10"},{"fidelity":"same","fidelity_note":"The formal definition relates an attribute to a keyword token with an optional value, subject to the value’s grammar conditions. This matches the quoted token-level production; keyword spelling is handled by the lexicon.","phrase":"2-7-p106-03"}],"end_line":620,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition relates an attribute to a keyword token with an optional value, subject to the value’s grammar conditions. This matches the quoted token-level production; keyword spelling is handled by the lexicon.","fidelity_source":"ai","line":618,"lines":[618,620],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Syntax.IsAttribute","note":"","plain":"Tokens of an attribute valid in the current version","relation":"defines","annotation":"For a supplied token list, `IsAttribute` requires an exact match with the attribute's tokens and grammatical validity of its optional value. The keyword's spelling belongs to the preceding lexical stage."},{"assessments":[{"fidelity":"different","fidelity_note":"The production specifies a keyword with an optional value; the formal definition only checks the value’s version conditions when a value exists. It does not itself describe the attribute’s token sequence.","phrase":"2-7-p027-10"},{"fidelity":"different","fidelity_note":"The production specifies a keyword with an optional value; the formal definition only checks the value’s version conditions when a value exists. It does not itself describe the attribute’s token sequence.","phrase":"2-7-p106-03"}],"end_line":412,"exact_lines":false,"fidelity":"different","fidelity_note":"The production specifies a keyword with an optional value; the formal definition only checks the value’s version conditions when a value exists. It does not itself describe the attribute’s token sequence.","fidelity_source":"ai","line":410,"lines":[410,412],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Attribute.Valid","note":"","plain":"An attribute’s value must be valid when present","relation":"defines","annotation":"The keyword-only branch is `True`. The branch with a value calls `AttributeValue.Valid` in the same version, leaving any restrictions tied to a particular attribute name to the context where it is used."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition consists of a keyword and an optional attribute value, matching the two alternatives in the production.","phrase":"2-7-p027-10"},{"fidelity":"same","fidelity_note":"The formal definition consists of a keyword and an optional attribute value, matching the two alternatives in the production.","phrase":"2-7-p106-03"}],"end_line":101,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition consists of a keyword and an optional attribute value, matching the two alternatives in the production.","fidelity_source":"ai","line":99,"lines":[99,101],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.Attribute","note":"","plain":"Keyword with an optional value","relation":"defines","annotation":"The structure stores the attribute name and an `Option AttributeValue`. The two alternatives in the production differ only in whether that option is `none` or `some value`."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition writes the keyword alone or followed by its value, exactly as in the quoted production.","phrase":"2-7-p027-10"},{"fidelity":"same","fidelity_note":"The formal definition writes the keyword alone or followed by its value, exactly as in the quoted production.","phrase":"2-7-p106-03"}],"end_line":123,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes the keyword alone or followed by its value, exactly as in the quoted production.","fidelity_source":"ai","line":121,"lines":[121,123],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Attribute.tokens","note":"","plain":"Writing a keyword and optional value","relation":"defines","annotation":"`Attribute.tokens` emits a keyword token first in both branches. When the option contains a value, its tokens immediately follow the keyword."}],"tone":9,"topic":"attribute-syntax"},{"anchor":"sec-3.5","at":"b7342-7915","from_record":false,"lean":true,"lines":[94,96],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Sort.tokens","origin":"ai","part":0,"phrase":"2-7-p028-02","plain":"Writing a sort as tokens","record":null,"relation":"defines","role":"definition","rows":[{"end_line":96,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper discusses sorts assigned to terms and the distinction between sort symbols and parameters; the formal definition only writes the syntax of a sort expression. It neither assigns sorts to terms nor distinguishes parameters from declared sort symbols.","fidelity_source":"ai","line":94,"lines":[94,96],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Sort.tokens","note":"","plain":"Writing a sort as tokens","relation":"defines","annotation":"In these grammar rules, a sort expression such as `Bool` is written as its identifier alone. An application such as `(Array Int Bool)` adds parentheses and writes the argument sorts in order. This operation starts from a given sort tree, so assigning a sort to a term is a separate question."}],"tone":15,"topic":"sort-expressions"},{"anchor":"sec-3.5","at":"b7917-7988","from_record":false,"lean":true,"lines":[627,628],"merged":[{"id":"2-7-p028-03","quote":"⟨sort ⟩ ::= ⟨identifier ⟩ \\| ( ⟨identifier ⟩ ⟨sort ⟩+ )","role":"definition","topic":"sort-expressions"},{"id":"2-7-p106-01","quote":"⟨sort ⟩ ::= ⟨identifier ⟩ \\| ( ⟨identifier ⟩ ⟨sort ⟩+ )","role":"definition","topic":"sort-expressions"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Syntax.IsSort","origin":"ai","part":0,"phrase":"2-7-p028-03","plain":"Tokens of a sort valid in the current version","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition relates a sort expression to either its identifier alone or an identifier applied to a nonempty list of sort expressions, subject to version conditions. This matches the concrete grammar; declaration arities are a separate requirement.","phrase":"2-7-p028-03"},{"fidelity":"same","fidelity_note":"The formal definition relates a sort expression to either its identifier alone or an identifier applied to a nonempty list of sort expressions, subject to version conditions. This matches the concrete grammar; declaration arities are a separate requirement.","phrase":"2-7-p106-01"}],"end_line":628,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition relates a sort expression to either its identifier alone or an identifier applied to a nonempty list of sort expressions, subject to version conditions. This matches the concrete grammar; declaration arities are a separate requirement.","fidelity_source":"ai","line":627,"lines":[627,628],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Syntax.IsSort","note":"","plain":"Tokens of a sort valid in the current version","relation":"defines","annotation":"A supplied token list represents a given sort tree when it equals `sort.tokens` and the tree satisfies `sort.Valid` for the selected version. This gives concrete syntax, with declared constructors and their arities coming from a signature."},{"assessments":[{"fidelity":"different","fidelity_note":"The production defines how sort expressions are written; the formal definition recursively checks version conditions in identifiers and arguments. It does not state the parenthesized form or check a declared sort symbol’s arity.","phrase":"2-7-p028-03"},{"fidelity":"different","fidelity_note":"The production defines how sort expressions are written; the formal definition recursively checks version conditions in identifiers and arguments. It does not state the parenthesized form or check a declared sort symbol’s arity.","phrase":"2-7-p106-01"}],"end_line":387,"exact_lines":false,"fidelity":"different","fidelity_note":"The production defines how sort expressions are written; the formal definition recursively checks version conditions in identifiers and arguments. It does not state the parenthesized form or check a declared sort symbol’s arity.","fidelity_source":"ai","line":386,"lines":[386,387],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Sort.Valid","note":"","plain":"A sort requires a valid identifier and valid arguments","relation":"defines","annotation":"For each sort node, `Valid` checks the identifier's indices and recursively checks the argument subtrees. The predicate has no signature parameter for checking declared arities (see Definition 1, Sorts).","annotation_references":[{"start":182,"end":194,"key":"definition:1"}]},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition builds a sort expression from an identifier and a list of sort arguments. The empty list represents the identifier alone, and a nonempty list represents application.","phrase":"2-7-p028-03"},{"fidelity":"same","fidelity_note":"The formal definition builds a sort expression from an identifier and a list of sort arguments. The empty list represents the identifier alone, and a nonempty list represents application.","phrase":"2-7-p106-01"}],"end_line":82,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition builds a sort expression from an identifier and a list of sort arguments. The empty list represents the identifier alone, and a nonempty list represents application.","fidelity_source":"ai","line":81,"lines":[81,82],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.Sort","note":"","plain":"Sort identifiers with sort arguments","relation":"defines","annotation":"The only constructor contains an identifier and a recursive list of sort arguments. The identifier alone in the first alternative is the case with an empty argument list."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition writes the identifier alone when it has no arguments, and otherwise places the identifier and its arguments inside parentheses. This matches both alternatives of the production.","phrase":"2-7-p028-03"},{"fidelity":"same","fidelity_note":"The formal definition writes the identifier alone when it has no arguments, and otherwise places the identifier and its arguments inside parentheses. This matches both alternatives of the production.","phrase":"2-7-p106-01"}],"end_line":96,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes the identifier alone when it has no arguments, and otherwise places the identifier and its arguments inside parentheses. This matches both alternatives of the production.","fidelity_source":"ai","line":94,"lines":[94,96],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Sort.tokens","note":"","plain":"Writing a sort as tokens","relation":"defines","annotation":"The branch for zero arguments writes the bare identifier. A populated argument list yields `(`, the identifier and each argument's tokens, then `)`, so the parenthesized form contains at least one argument."}],"tone":15,"topic":"sort-expressions"},{"anchor":"sec-3.6","at":"b8087-9439","from_record":false,"lean":true,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","origin":"ai","part":0,"phrase":"2-7-p030-01","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","record":null,"relation":"defines","role":"definition","rows":[{"end_line":473,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper describes variable scope, function ranks, and term forms; the formal definition enforces version availability and nonempty repetitions in the grammar. It does not determine which names are variables or whether a term has the required sort.","fidelity_source":"ai","line":457,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","note":"","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","relation":"defines","annotation":"In the application case, `Valid` requires at least one argument and checks the qualified identifier and each argument for grammatical validity. The predicate has no binder environment or function signature, so variables and function ranks are resolved outside this check (see Section 3.6.3 on well-sortedness).","annotation_references":[{"start":276,"end":289,"key":"section:3.6.3"}]},{"end_line":133,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes either a bare identifier or its sort-qualified form `(as f τ)`, matching the final clause. The function’s permitted result sorts come from its declaration.","fidelity_source":"ai","line":131,"lines":[131,133],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.QualIdentifier.tokens","note":"","plain":"Writing a sort-qualified identifier","relation":"defines","annotation":"For the passage's final form, the `.as` case emits `as`, the tokens of $f$ and the tokens of $\\tau$ between parentheses. The plain case emits the identifier's tokens alone."},{"end_line":195,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes the listed term forms as tokens. It does not resolve variable names, assign function ranks, or enforce the nonempty lists and scope conditions discussed in the quotation.","fidelity_source":"ai","line":174,"lines":[174,195],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.tokens","note":"","plain":"Writing a term as tokens","relation":"defines","annotation":"The term tree uses the same identifier branch for an identifier regardless of its role as a variable or a function symbol. `Term.tokens` emits the tokens of that branch directly. It uses distinct outer forms for applications, binders and annotations."}],"tone":6,"topic":"term-grammar"},{"anchor":"sec-3.6","at":"b9441-9526","from_record":false,"lean":true,"lines":[419,421],"merged":[{"id":"2-7-p030-02","quote":"⟨qual\\_identifier ⟩ ::= ⟨identifier ⟩ \\| ( as ⟨identifier ⟩ ⟨sort ⟩ )","role":"definition","topic":"term-grammar"},{"id":"2-7-p106-04","quote":"⟨qual\\_identifier ⟩ ::= ⟨identifier ⟩ \\| ( as ⟨identifier ⟩ ⟨sort ⟩ )","role":"definition","topic":"term-grammar"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.QualIdentifier.Valid","origin":"ai","part":0,"phrase":"2-7-p030-02","plain":"A valid identifier with a valid sort when present","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The paper defines the two spellings of a qualified identifier; the formal definition only checks version conditions in its identifier and optional sort. It does not compare the annotation with the function’s actual result sort.","phrase":"2-7-p030-02"},{"fidelity":"different","fidelity_note":"The paper defines the two spellings of a qualified identifier; the formal definition only checks version conditions in its identifier and optional sort. It does not compare the annotation with the function’s actual result sort.","phrase":"2-7-p106-04"}],"end_line":421,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines the two spellings of a qualified identifier; the formal definition only checks version conditions in its identifier and optional sort. It does not compare the annotation with the function’s actual result sort.","fidelity_source":"ai","line":419,"lines":[419,421],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.QualIdentifier.Valid","note":"","plain":"A valid identifier with a valid sort when present","relation":"defines","annotation":"`Valid` checks the identifier in both alternatives. In the `.as` branch it also checks the sort expression. Both checks are grammatical and use the selected version."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition distinguishes an ordinary identifier from an identifier annotated by a sort, exactly the two alternatives shown.","phrase":"2-7-p030-02"},{"fidelity":"same","fidelity_note":"The formal definition distinguishes an ordinary identifier from an identifier annotated by a sort, exactly the two alternatives shown.","phrase":"2-7-p106-04"}],"end_line":110,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition distinguishes an ordinary identifier from an identifier annotated by a sort, exactly the two alternatives shown.","fidelity_source":"ai","line":108,"lines":[108,110],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.QualIdentifier","note":"","plain":"Identifier with optional sort","relation":"defines","annotation":"The constructor `.plain` contains only an identifier. The constructor `.as` also contains the sort written after the identifier in the second alternative."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition writes an identifier alone or writes as, the identifier, and its sort inside parentheses, matching the production.","phrase":"2-7-p030-02"},{"fidelity":"same","fidelity_note":"The formal definition writes an identifier alone or writes as, the identifier, and its sort inside parentheses, matching the production.","phrase":"2-7-p106-04"}],"end_line":133,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes an identifier alone or writes as, the identifier, and its sort inside parentheses, matching the production.","fidelity_source":"ai","line":131,"lines":[131,133],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.QualIdentifier.tokens","note":"","plain":"Writing a sort-qualified identifier","relation":"defines","annotation":"The plain branch uses `Identifier.tokens`. The qualified branch uses `paren` to enclose the reserved word `as`, the identifier tokens and the sort tokens in that order."}],"tone":6,"topic":"term-grammar"},{"anchor":"sec-3.6","at":"b9528-9581","from_record":false,"lean":true,"lines":[481,483],"merged":[{"id":"2-7-p030-03","quote":"⟨var\\_binding ⟩ ::= ( ⟨symbol ⟩ ⟨term ⟩ )","role":"definition","topic":"variables-scope"},{"id":"2-7-p106-05","quote":"⟨var\\_binding ⟩ ::= ( ⟨symbol ⟩ ⟨term ⟩ )","role":"definition","topic":"variables-scope"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.ValidBindings","origin":"ai","part":0,"phrase":"2-7-p030-03","plain":"Every bound term in a let must be valid","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The paper defines one parenthesized symbol–term pair; the formal definition checks the component terms in an entire list of such pairs, including an empty list. It is a condition on repeated bindings, not the single-pair production.","phrase":"2-7-p030-03"},{"fidelity":"different","fidelity_note":"The paper defines one parenthesized symbol–term pair; the formal definition checks the component terms in an entire list of such pairs, including an empty list. It is a condition on repeated bindings, not the single-pair production.","phrase":"2-7-p106-05"}],"end_line":483,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines one parenthesized symbol–term pair; the formal definition checks the component terms in an entire list of such pairs, including an empty list. It is a condition on repeated bindings, not the single-pair production.","fidelity_source":"ai","line":481,"lines":[481,483],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.ValidBindings","note":"","plain":"Every bound term in a let must be valid","relation":"defines","annotation":"The production describes one binding, which Lean stores as a symbol–term pair. The list helper checks the term in every pair and succeeds on an empty list. The enclosing `let` rule requires a nonempty list."},{"assessments":[{"fidelity":"different","fidelity_note":"The paper gives one symbol–term pair; the formal definition concatenates the parenthesized pairs for a whole list. A one-element list gives the displayed form, but the declaration’s scope is the repetition used by let.","phrase":"2-7-p030-03"},{"fidelity":"different","fidelity_note":"The paper gives one symbol–term pair; the formal definition concatenates the parenthesized pairs for a whole list. A one-element list gives the displayed form, but the declaration’s scope is the repetition used by let.","phrase":"2-7-p106-05"}],"end_line":209,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper gives one symbol–term pair; the formal definition concatenates the parenthesized pairs for a whole list. A one-element list gives the displayed form, but the declaration’s scope is the repetition used by let.","fidelity_source":"ai","line":207,"lines":[207,209],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.bindingTokens","note":"","plain":"Writing variable definitions in let","relation":"defines","annotation":"For each pair, `bindingTokens` surrounds the symbol and the defining term with parentheses. It concatenates those pairs, and the enclosing `let` branch adds the parentheses around the whole list."}],"tone":7,"topic":"variables-scope"},{"anchor":"sec-3.6","at":"b9583-9635","from_record":false,"lean":true,"lines":[428,429],"merged":[{"id":"2-7-p030-04","quote":"⟨sorted\\_var ⟩ ::= ( ⟨symbol ⟩ ⟨sort ⟩ )","role":"definition","topic":"variables-scope"},{"id":"2-7-p106-06","quote":"⟨sorted\\_var ⟩ ::= ( ⟨symbol ⟩ ⟨sort ⟩ )","role":"definition","topic":"variables-scope"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SortedVar.Valid","origin":"ai","part":0,"phrase":"2-7-p030-04","plain":"A sorted variable requires a valid sort","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The paper defines a parenthesized variable name and sort; the formal definition checks only the sort expression’s version conditions. It does not define the pair’s spelling or resolve the variable name.","phrase":"2-7-p030-04"},{"fidelity":"different","fidelity_note":"The paper defines a parenthesized variable name and sort; the formal definition checks only the sort expression’s version conditions. It does not define the pair’s spelling or resolve the variable name.","phrase":"2-7-p106-06"}],"end_line":429,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines a parenthesized variable name and sort; the formal definition checks only the sort expression’s version conditions. It does not define the pair’s spelling or resolve the variable name.","fidelity_source":"ai","line":428,"lines":[428,429],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SortedVar.Valid","note":"","plain":"A sorted variable requires a valid sort","relation":"defines","annotation":"Only the sort component of a sorted variable is checked here. This amounts to checking the grammar of the sort and its arguments, independently of how the variable name will be used."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition pairs a variable’s symbol with its sort expression, matching the two components of the production.","phrase":"2-7-p030-04"},{"fidelity":"same","fidelity_note":"The formal definition pairs a variable’s symbol with its sort expression, matching the two components of the production.","phrase":"2-7-p106-06"}],"end_line":119,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition pairs a variable’s symbol with its sort expression, matching the two components of the production.","fidelity_source":"ai","line":117,"lines":[117,119],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.SortedVar","note":"","plain":"Variable name paired with sort","relation":"defines","annotation":"The two elements of the production become the fields `symbol` and `sort`. Lean can reuse the pair in a binder or in a function's parameter list."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition places the variable’s symbol and sort expression inside parentheses, exactly as specified.","phrase":"2-7-p030-04"},{"fidelity":"same","fidelity_note":"The formal definition places the variable’s symbol and sort expression inside parentheses, exactly as specified.","phrase":"2-7-p106-06"}],"end_line":141,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition places the variable’s symbol and sort expression inside parentheses, exactly as specified.","fidelity_source":"ai","line":140,"lines":[140,141],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SortedVar.tokens","note":"","plain":"Writing a variable with its sort","relation":"defines","annotation":"For a pair such as `(x Int)`, the name supplies one symbol token and the sort supplies its own tokens. `paren` groups them as one sorted variable."}],"tone":7,"topic":"variables-scope"},{"anchor":"sec-3.6","at":"b9637-9675","from_record":false,"lean":true,"lines":[436,438],"merged":[{"id":"2-7-p030-05","quote":"⟨symbol\\_⟩ ::= ⟨symbol ⟩ \\| \\_","role":"definition","topic":"pattern-matching"},{"id":"2-7-p106-07","quote":"⟨symbol\\_⟩ ::= ⟨symbol ⟩ \\| \\_","role":"definition","topic":"pattern-matching"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SymbolOrWildcard.Valid","origin":"ai","part":0,"phrase":"2-7-p030-05","plain":"Match wildcards from version 2.7","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The paper defines a symbol-or-wildcard category; the formal definition only requires version 2.7 when the wildcard is used. The alternatives themselves are defined separately.","phrase":"2-7-p030-05"},{"fidelity":"different","fidelity_note":"The paper defines a symbol-or-wildcard category; the formal definition only requires version 2.7 when the wildcard is used. The alternatives themselves are defined separately.","phrase":"2-7-p106-07"}],"end_line":438,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines a symbol-or-wildcard category; the formal definition only requires version 2.7 when the wildcard is used. The alternatives themselves are defined separately.","fidelity_source":"ai","line":436,"lines":[436,438],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SymbolOrWildcard.Valid","note":"","plain":"Match wildcards from version 2.7","relation":"defines","annotation":"The symbol branch has no further condition. The wildcard branch requires version 2.7 or later, even though `_` was already a reserved word for other uses."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition writes an ordinary symbol as its symbol token and the wildcard as the reserved underscore token, matching the two alternatives.","phrase":"2-7-p030-05"},{"fidelity":"same","fidelity_note":"The formal definition writes an ordinary symbol as its symbol token and the wildcard as the reserved underscore token, matching the two alternatives.","phrase":"2-7-p106-07"}],"end_line":150,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes an ordinary symbol as its symbol token and the wildcard as the reserved underscore token, matching the two alternatives.","fidelity_source":"ai","line":148,"lines":[148,150],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SymbolOrWildcard.token","note":"","plain":"Writing a symbol or wildcard","relation":"defines","annotation":"An ordinary name yields a symbol token and the wildcard yields the reserved token `_`. A quoted symbol such as `|_|` still uses the symbol branch."}],"tone":5,"topic":"pattern-matching"},{"anchor":"sec-3.6","at":"b9677-9747","from_record":false,"lean":true,"lines":[445,447],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Pattern.Valid","origin":"ai","part":0,"phrase":"2-7-p030-06","plain":"Constructor patterns need at least one valid argument","record":null,"relation":"defines","role":"definition","rows":[{"end_line":447,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper gives the complete pattern production; the formal definition requires a nonempty argument list for a constructor pattern and checks wildcard availability. Parentheses and the distinction between a single symbol and a constructor pattern are defined separately.","fidelity_source":"ai","line":445,"lines":[445,447],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Pattern.Valid","note":"","plain":"Constructor patterns need at least one valid argument","relation":"defines","annotation":"For the parenthesized branch, the plus in the production corresponds to `arguments ≠ []`. Every argument must also pass the version check, as must the single item in the plain branch."},{"end_line":438,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines whole patterns; the formal definition only restricts the symbol-or-wildcard component, requiring version 2.7 for a wildcard. It says nothing about constructor patterns or their argument lists.","fidelity_source":"ai","line":436,"lines":[436,438],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SymbolOrWildcard.Valid","note":"","plain":"Match wildcards from version 2.7","relation":"defines","annotation":"This is the check for each occurrence of the grammar's symbol-or-wildcard category. In a constructor pattern it applies to arguments, while the constructor name itself is stored as a symbol."},{"end_line":137,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper requires at least one argument in a parenthesized constructor pattern; the formal definition also allows an empty argument list. A separate grammatical condition excludes that extra case.","fidelity_source":"ai","line":135,"lines":[135,137],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.Pattern","note":"","plain":"Single or constructor match patterns","relation":"defines","annotation":"The `.single` branch contains a symbol or wildcard. The `.constructor` branch stores a constructor name and a list of symbol-or-wildcard arguments (see Remark 5 on nested patterns), with the requirement of at least one argument imposed by `Pattern.Valid`.","annotation_references":[{"start":152,"end":160,"key":"remark:5"}]},{"end_line":128,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines both single-symbol patterns and constructor patterns; the formal definition supplies only a symbol or wildcard, the component used inside those patterns.","fidelity_source":"ai","line":126,"lines":[126,128],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.SymbolOrWildcard","note":"","plain":"Named symbols or match wildcards","relation":"defines","annotation":"Lean uses the same two-constructor type for a pattern consisting of one item and for each argument of a parenthesized constructor pattern. Only the `.symbol` branch stores a name."},{"end_line":160,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes the two pattern forms, but can also write a parenthesized constructor without arguments. The paper’s plus sign excludes that case, which is ruled out only by a separate grammatical condition.","fidelity_source":"ai","line":157,"lines":[157,160],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Pattern.tokens","note":"","plain":"Writing a flat match pattern","relation":"defines","annotation":"The single case emits one token. The constructor case emits the name and then each argument token inside parentheses. An empty argument list can still be written by this function, so validity supplies the plus in the production."},{"end_line":150,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper specifies complete patterns; the formal definition emits just a symbol or an underscore. This explains one pattern component rather than the whole production.","fidelity_source":"ai","line":148,"lines":[148,150],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SymbolOrWildcard.token","note":"","plain":"Writing a symbol or wildcard","relation":"defines","annotation":"The one-token conversion is used both for a pattern consisting of a single item and for arguments after a constructor name. The parentheses in the latter case are added by `Pattern.tokens`."}],"tone":5,"topic":"pattern-matching"},{"anchor":"sec-3.6","at":"b9749-9802","from_record":false,"lean":true,"lines":[486,489],"merged":[{"id":"2-7-p030-07","quote":"⟨match\\_case ⟩ ::= ( ⟨pattern ⟩ ⟨term ⟩ )","role":"definition","topic":"pattern-matching"},{"id":"2-7-p106-09","quote":"⟨match\\_case ⟩ ::= ( ⟨pattern ⟩ ⟨term ⟩ )","role":"definition","topic":"pattern-matching"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.ValidCases","origin":"ai","part":0,"phrase":"2-7-p030-07","plain":"Each match case requires a valid pattern and body","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The paper defines one pattern–term pair; the formal definition checks the patterns and terms of a whole list of cases, allowing the list to be empty. It does not itself specify one case’s parentheses.","phrase":"2-7-p030-07"},{"fidelity":"different","fidelity_note":"The paper defines one pattern–term pair; the formal definition checks the patterns and terms of a whole list of cases, allowing the list to be empty. It does not itself specify one case’s parentheses.","phrase":"2-7-p106-09"}],"end_line":489,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines one pattern–term pair; the formal definition checks the patterns and terms of a whole list of cases, allowing the list to be empty. It does not itself specify one case’s parentheses.","fidelity_source":"ai","line":486,"lines":[486,489],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.ValidCases","note":"","plain":"Each match case requires a valid pattern and body","relation":"defines","annotation":"For each pattern–term pair the helper requires both parts to be valid in the selected version. The base case is `True`, so the enclosing `match` case of `Term.Valid` supplies the requirement that at least one case exists."},{"assessments":[{"fidelity":"different","fidelity_note":"The paper gives a single parenthesized pattern–term pair; the formal definition writes a sequence of such pairs. A one-case list gives the displayed form, while the full declaration handles the repetition inside match.","phrase":"2-7-p030-07"},{"fidelity":"different","fidelity_note":"The paper gives a single parenthesized pattern–term pair; the formal definition writes a sequence of such pairs. A one-case list gives the displayed form, while the full declaration handles the repetition inside match.","phrase":"2-7-p106-09"}],"end_line":218,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper gives a single parenthesized pattern–term pair; the formal definition writes a sequence of such pairs. A one-case list gives the displayed form, while the full declaration handles the repetition inside match.","fidelity_source":"ai","line":216,"lines":[216,218],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.caseTokens","note":"","plain":"Writing patterns with their case bodies","relation":"defines","annotation":"For one pair, the function emits the pattern followed by the result term inside parentheses, as in the production. Across several pairs it repeats that operation and concatenates the output in order."}],"tone":5,"topic":"pattern-matching"},{"anchor":"sec-3.6","at":"b9804-10158","from_record":false,"lean":true,"lines":[636,637],"merged":[{"id":"2-7-p030-08","quote":"⟨spec\\_constant ⟩ ⟨qual\\_identifier ⟩ ( ⟨qual\\_identifier ⟩ ⟨term ⟩+ ) ( let ( ⟨var\\_binding ⟩+ ) ⟨term ⟩ ) ( lambda ( ⟨sorted\\_var ⟩+ ) ⟨term ⟩ ) ( forall ( ⟨sorted\\_var ⟩+ ) ⟨term ⟩ ) ( exists ( ⟨sorted\\_var ⟩+ ) ⟨term ⟩ ) ( match ⟨term ⟩ ( ⟨match\\_case ⟩+ ) ) ( ! ⟨term ⟩ ⟨attribute ⟩+ )","role":"definition","topic":"term-grammar"},{"id":"2-7-p106-10","quote":"⟨spec\\_constant ⟩ ⟨qual\\_identifier ⟩ ( ⟨qual\\_identifier ⟩ ⟨term ⟩+ ) ( let ( ⟨var\\_binding ⟩+ ) ⟨term ⟩ ) ( lambda ( ⟨sorted\\_var ⟩+ ) ⟨term ⟩ ) ( forall ( ⟨sorted\\_var ⟩+ ) ⟨term ⟩ ) ( exists ( ⟨sorted\\_var ⟩+ ) ⟨term ⟩ ) ( match ⟨term ⟩ ( ⟨match\\_case ⟩+ ) ) ( ! ⟨term ⟩ ⟨attribute ⟩+ )","role":"definition","topic":"term-grammar"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Syntax.IsTerm","origin":"ai","part":0,"phrase":"2-7-p030-08","plain":"Tokens of a term valid in the current version","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"same","fidelity_note":"In version 2.7 a token sequence satisfies the formal definition of a term exactly when it writes one of these nine forms and each list that the grammar marks for one or more items is nonempty. Earlier versions exclude lambda, and versions before 2.6 also exclude match. The definition leaves well-sortedness and the conditions of the following subsections unchecked.","phrase":"2-7-p030-08"},{"fidelity":"same","fidelity_note":"In version 2.7 a token sequence satisfies the formal definition of a term exactly when it writes one of these nine forms and each list that the grammar marks for one or more items is nonempty. Earlier versions exclude lambda, and versions before 2.6 also exclude match. The definition leaves well-sortedness and the conditions of the following subsections unchecked.","phrase":"2-7-p106-10"}],"end_line":637,"exact_lines":false,"fidelity":"same","fidelity_note":"In version 2.7 a token sequence satisfies the formal definition of a term exactly when it writes one of these nine forms and each list that the grammar marks for one or more items is nonempty. Earlier versions exclude lambda, and versions before 2.6 also exclude match. The definition leaves well-sortedness and the conditions of the following subsections unchecked.","fidelity_source":"ai","line":636,"lines":[636,637],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Syntax.IsTerm","note":"","plain":"Tokens of a term valid in the current version","relation":"defines","annotation":"The relation requires `term.Valid version` for the recursive grammar and `term.tokens = tokens` for the concrete token sequence. Thus the nonempty repetitions in the production matter when matching a term tree to tokens."},{"assessments":[{"fidelity":"different","fidelity_note":"The formal condition requires a nonempty list wherever the production calls for one or more items. It also requires match to use version 2.6 or later, lambda to use version 2.7 or later, and each part to satisfy its own grammar conditions. The term forms themselves are defined separately.","phrase":"2-7-p030-08"},{"fidelity":"different","fidelity_note":"The formal condition requires a nonempty list wherever the production calls for one or more items. It also requires match to use version 2.6 or later, lambda to use version 2.7 or later, and each part to satisfy its own grammar conditions. The term forms themselves are defined separately.","phrase":"2-7-p106-10"}],"end_line":473,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal condition requires a nonempty list wherever the production calls for one or more items. It also requires match to use version 2.6 or later, lambda to use version 2.7 or later, and each part to satisfy its own grammar conditions. The term forms themselves are defined separately.","fidelity_source":"ai","line":457,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","note":"","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","relation":"defines","annotation":"Each plus in the term production has a corresponding nonempty-list test for that form. Lean also requires version 2.6 for `match` and 2.7 for `lambda`, and it checks the component terms in the same version."},{"assessments":[{"fidelity":"different","fidelity_note":"The formal definition has these alternatives, with forall and exists as one case that records the quantifier. Its lists may be empty, so it also represents forms the production excludes, such as an application with no arguments; a separate condition rules those out.","phrase":"2-7-p030-08"},{"fidelity":"different","fidelity_note":"The formal definition has these alternatives, with forall and exists as one case that records the quantifier. Its lists may be empty, so it also represents forms the production excludes, such as an application with no arguments; a separate condition rules those out.","phrase":"2-7-p106-10"}],"end_line":161,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition has these alternatives, with forall and exists as one case that records the quantifier. Its lists may be empty, so it also represents forms the production excludes, such as an application with no arguments; a separate condition rules those out.","fidelity_source":"ai","line":153,"lines":[153,161],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.Term","note":"","plain":"Concrete forms of term syntax","relation":"defines","annotation":"The two quantifier productions share a `.quantified` constructor whose first field chooses `forall` or `exists`. Other forms have their own constructors. Their list fields can be empty at this stage, with the grammar's nonempty tests in `Term.Valid`."},{"assessments":[{"fidelity":"different","fidelity_note":"The formal definition writes each form as the production reads, but it also writes empty lists, such as a let with no bindings. The plus signs of the production are enforced only by the separate condition.","phrase":"2-7-p030-08"},{"fidelity":"different","fidelity_note":"The formal definition writes each form as the production reads, but it also writes empty lists, such as a let with no bindings. The plus signs of the production are enforced only by the separate condition.","phrase":"2-7-p106-10"}],"end_line":195,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes each form as the production reads, but it also writes empty lists, such as a let with no bindings. The plus signs of the production are enforced only by the separate condition.","fidelity_source":"ai","line":174,"lines":[174,195],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.tokens","note":"","plain":"Writing a term as tokens","relation":"defines","annotation":"The branches assemble the printed forms out of syntax tokens, including the inner parentheses around repeated bindings, variables and cases. They can emit such lists even when empty, with the plus requirements checked by `Term.Valid`."},{"assessments":[{"fidelity":"different","fidelity_note":"The formal definition gives only the word forall or exists that begins two of these alternatives. It is a component of the term production, not the production.","phrase":"2-7-p106-10"}],"end_line":165,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition gives only the word forall or exists that begins two of these alternatives. It is a component of the term production, not the production.","fidelity_source":"ai","line":163,"lines":[163,165],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Quantifier.word","note":"","plain":"Universal or existential keyword","relation":"defines","annotation":"The quantified-term branch uses this function to choose its leading reserved token, `forall` or `exists`. Both choices use the same code for the variable list and the body."}],"tone":6,"topic":"term-grammar"},{"anchor":"sec-3.6.1","at":"b10261-10403","from_record":false,"lean":true,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","origin":"ai","part":0,"phrase":"2-7-p031-02","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","record":null,"relation":"defines","role":"definition","rows":[{"end_line":473,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper states that introduced variables have local scope; the formal definition only imposes grammar and version conditions. In particular, it does not define which occurrences are bound by which variable introduction.","fidelity_source":"ai","line":457,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","note":"","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","relation":"defines","annotation":"For a binder such as `let`, `Valid` checks the grammar of the bindings and the body. Free and bound occurrences are described separately in Section 3.6.2 of the standard, and no assignment from names to their binders appears in this predicate.","annotation_references":[{"start":140,"end":153,"key":"section:3.6.2"}]},{"end_line":195,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper describes local scope for introduced variables; the formal definition only writes the surrounding term syntax. It does not state any rule for free occurrences, scope, or shadowing.","fidelity_source":"ai","line":174,"lines":[174,195],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.tokens","note":"","plain":"Writing a term as tokens","relation":"defines","annotation":"The token function preserves the written positions of binders, names and bodies. For example it emits a `let` binding list before the body. The standard (Section 3.6.2) gives separate scope rules for identifying the occurrences that refer to each binding.","annotation_references":[{"start":154,"end":167,"key":"section:3.6.2"}]}],"tone":7,"topic":"variables-scope"},{"anchor":"sec-3.6.1","at":"b10405-10621","from_record":false,"lean":true,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","origin":"ai","part":0,"phrase":"2-7-p031-03","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","record":null,"relation":"defines","role":"definition","rows":[{"end_line":473,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper identifies a nonempty variable list with nested lambda abstractions; the formal definition requires the list to be nonempty and version 2.7 to be selected. It does not state the semantic equivalence with nested abstractions.","fidelity_source":"ai","line":457,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","note":"","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","relation":"defines","annotation":"The lambda case checks version 2.7, a nonempty list of sorted variables, and the grammar of each variable's sort and of the body. The identification of this list with nested abstractions is the standard's interpretation of the syntax."},{"end_line":195,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper says that a list of lambda variables abbreviates nested abstractions; the formal definition merely writes that list and body. It does not expand the abstraction or establish the equivalence.","fidelity_source":"ai","line":174,"lines":[174,195],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.tokens","note":"","plain":"Writing a term as tokens","relation":"defines","annotation":"A lambda node with two variables becomes a single `lambda` followed by a list with two entries and then the body. These are the tokens of the abbreviated form in Equation (3.1) before the expansion written in Equation (3.2).","annotation_references":[{"start":162,"end":176,"key":"equation:3.1"},{"start":209,"end":223,"key":"equation:3.2"}]}],"tone":7,"topic":"variables-scope"},{"anchor":"sec-3.6.1","at":"b10623-10963","from_record":false,"lean":true,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","origin":"ai","part":0,"phrase":"2-7-p031-07","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","record":null,"relation":"defines","role":"definition","rows":[{"end_line":473,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper gives quantified variables sorts and interprets their list as nested quantifiers; the formal definition requires a nonempty list with grammatical sort expressions. It establishes neither sorting nor the nested-quantifier semantics.","fidelity_source":"ai","line":457,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","note":"","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","relation":"defines","annotation":"Both quantifiers use the same check for a nonempty list of sorted variables and a grammatically valid body. The standard's expansion into nested quantifiers (Equation (3.4) for `forall`) belongs to the interpretation of the resulting expression.","annotation_references":[{"start":158,"end":172,"key":"equation:3.4"}]},{"end_line":141,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes one variable together with its sort in parentheses. The paper’s passage additionally describes a nonempty sequence of variables and its interpretation as nested quantifiers, which this declaration does not state.","fidelity_source":"ai","line":140,"lines":[140,141],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SortedVar.tokens","note":"","plain":"Writing a variable with its sort","relation":"defines","annotation":"Each quantified variable contributes a group such as `(x Int)`. The quantified-term branch collects the groups into one variable list before the body, as in the single `forall` of Equation (3.3).","annotation_references":[{"start":180,"end":194,"key":"equation:3.3"}]}],"tone":7,"topic":"variables-scope"},{"anchor":"sec-3.6.1","at":"b10965-11217","from_record":false,"lean":true,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","origin":"ai","part":0,"phrase":"2-7-p032-10","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","record":null,"relation":"defines","role":"definition","rows":[{"end_line":473,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper describes pattern matching on datatype values; the formal definition permits match from version 2.6 and checks its syntactic components. It does not require the scrutinized term to have a datatype sort or define how a case is selected.","fidelity_source":"ai","line":457,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","note":"","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","relation":"defines","annotation":"The `match` branch requires version 2.6 or later, a nonempty case list, and grammatical validity of the term being matched and each case. The datatype sort of that term must be determined outside this predicate."},{"end_line":195,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper describes pattern matching on datatype values; the formal definition writes a match expression and its cases. It does not identify a datatype or specify evaluation of the selected case.","fidelity_source":"ai","line":174,"lines":[174,195],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.tokens","note":"","plain":"Writing a term as tokens","relation":"defines","annotation":"The `match` branch writes the term to be matched first, then a parenthesized list of cases in order. The function emits this syntax for a given tree. Selecting a case is part of evaluation (see the `match` expansion at Equation (3.7)).","annotation_references":[{"start":219,"end":233,"key":"equation:3.7"}]}],"tone":5,"topic":"pattern-matching"},{"anchor":"sec-3.6.1","at":"b11219-12450","from_record":false,"lean":true,"lines":[445,447],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Pattern.Valid","origin":"ai","part":0,"phrase":"2-7-p033-01","plain":"Constructor patterns need at least one valid argument","record":null,"relation":"defines","role":"definition","rows":[{"end_line":447,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper requires constructor ranks, correctly sorted distinct variables, and exhaustive cases. The formal definition only requires constructor patterns to have arguments and wildcards to be available in the selected version; it does not express those semantic restrictions.","fidelity_source":"ai","line":445,"lines":[445,447],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Pattern.Valid","note":"","plain":"Constructor patterns need at least one valid argument","relation":"defines","annotation":"The predicate checks that a constructor pattern has arguments and that each argument is allowed in the version. A single symbol satisfies the same check whether it denotes a variable or a nullary constructor. That distinction and the rank conditions depend on the datatype declaration."},{"end_line":489,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper requires matching sorts, distinct pattern variables, exhaustiveness, and local scope. The formal definition checks each pattern and result term separately for grammar, even for an empty list, without imposing those requirements across the cases.","fidelity_source":"ai","line":486,"lines":[486,489],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.ValidCases","note":"","plain":"Each match case requires a valid pattern and body","relation":"defines","annotation":"The helper checks each pair's pattern and result term separately. There is no datatype or expected result sort among its inputs, so coverage of the datatype and agreement of result sorts lie outside the check (see the two `match` rules in Figure 5.3).","annotation_references":[{"start":239,"end":249,"key":"figure:5.3"}]},{"end_line":160,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper specifies the meaning and legality of patterns, including distinct variables and exhaustiveness. The formal definition only writes a pattern’s tokens; it checks neither constructor declarations nor any relationship between cases.","fidelity_source":"ai","line":157,"lines":[157,160],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Pattern.tokens","note":"","plain":"Writing a flat match pattern","relation":"defines","annotation":"A lone variable or nullary constructor is emitted as one symbol token, and a wildcard as `_`. In the constructor branch the head and the argument tokens appear inside parentheses. The encoding records the syntax before any checks on ranks or bound variables."}],"tone":5,"topic":"pattern-matching"},{"anchor":"sec-3.6.1","at":"b12452-12765","from_record":false,"lean":true,"lines":[135,137],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.Pattern","origin":"ai","part":0,"phrase":"2-7-p033-05","plain":"Single or constructor match patterns","record":null,"relation":"defines","role":"definition","rows":[{"end_line":137,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition permits only symbols or wildcards as constructor-pattern arguments, with no place for a nested constructor pattern. This matches the paper’s flat-pattern restriction.","fidelity_source":"ai","line":135,"lines":[135,137],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.Pattern","note":"","plain":"Single or constructor match patterns","relation":"defines","annotation":"The constructor's arguments have type `SymbolOrWildcard`. That type has cases for a symbol and a wildcard, so it cannot contain another constructor pattern."},{"end_line":160,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes constructor-pattern arguments only as individual symbols or wildcards. It has no operation that inserts a nested pattern as an argument, matching the stated restriction.","fidelity_source":"ai","line":157,"lines":[157,160],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Pattern.tokens","note":"","plain":"Writing a flat match pattern","relation":"defines","annotation":"After the constructor name, `Pattern.tokens` maps a one-token function over the arguments. There is no recursive call for an argument, reflecting the flat constructor patterns described in Remark 5.","annotation_references":[{"start":189,"end":197,"key":"remark:5"}]}],"tone":5,"topic":"pattern-matching"},{"anchor":"sec-3.6.1","at":"b12767-12864","from_record":false,"lean":true,"lines":[83,85],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Identifier.tokens","origin":"ai","part":0,"phrase":"2-7-p033-06","plain":"Writing simple and indexed identifiers","record":null,"relation":"defines","role":"definition","rows":[{"end_line":85,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper names two uses of the reserved word _. The formal definition writes only the first: an indexed identifier as an opening parenthesis, _, the symbol and its indices, with an identifier that has no indices written as the bare symbol.","fidelity_source":"ai","line":83,"lines":[83,85],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Identifier.tokens","note":"","plain":"Writing simple and indexed identifiers","relation":"defines","annotation":"In `(_ BitVec 32)`, the `_` is emitted once before the identifier's symbol and indices. Its position in the parenthesized group identifies this use as indexing."},{"end_line":160,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes patterns, where the wildcard may stand alone or as a constructor argument. This is the second use named here; indexed identifiers are written by a separate definition.","fidelity_source":"ai","line":157,"lines":[157,160],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Pattern.tokens","note":"","plain":"Writing a flat match pattern","relation":"defines","annotation":"In a pattern like `(cons x _)`, the underscore is emitted for an argument after the constructor name. A single-wildcard pattern instead emits that token alone."},{"end_line":150,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes a pattern position as its symbol or as the token _. It gives the wildcard use only, one token at a time.","fidelity_source":"ai","line":148,"lines":[148,150],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SymbolOrWildcard.token","note":"","plain":"Writing a symbol or wildcard","relation":"defines","annotation":"The wildcard branch produces the same reserved token spelling `_` that occurs in an indexed identifier. Which use it has depends on the grammar surrounding that token."}],"tone":5,"topic":"pattern-matching"},{"anchor":"sec-3.6.3","at":"b12981-13114","from_record":false,"lean":true,"lines":[419,421],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.QualIdentifier.Valid","origin":"ai","part":0,"phrase":"2-7-p036-07","plain":"A valid identifier with a valid sort when present","record":null,"relation":"defines","role":"definition","rows":[{"end_line":421,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper requires the annotated sort $\\tau$ to match the result sort of $f$, even when the symbol is unambiguous. The formal definition checks the identifier and sort expression against the grammar. The comparison with a function’s declared rank lies outside that check.","fidelity_source":"ai","line":419,"lines":[419,421],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.QualIdentifier.Valid","note":"","plain":"A valid identifier with a valid sort when present","relation":"defines","annotation":"In the `.as` case, `Valid` asks whether $f$ is a grammatically valid identifier and $\\tau$ a grammatically valid sort expression. The requirement in Remark 8 that $\\tau$ match a declared result sort needs the function's rank as well.","annotation_references":[{"start":149,"end":157,"key":"remark:8"}]},{"end_line":133,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes `(as f τ)` for any supplied identifier and sort expression. The paper’s remark also requires the annotation to match the declared result sort of the function.","fidelity_source":"ai","line":131,"lines":[131,133],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.QualIdentifier.tokens","note":"","plain":"Writing a sort-qualified identifier","relation":"defines","annotation":"The function can write a supplied identifier and sort in the `as` form without looking up the identifier. It accounts for the spelling in Remark 8, where the required agreement with the declared return sort is a semantic condition.","annotation_references":[{"start":138,"end":146,"key":"remark:8"}]}],"tone":6,"topic":"term-grammar"},{"anchor":"sec-3.6.4","at":"b13214-13545","from_record":false,"lean":true,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","origin":"ai","part":0,"phrase":"2-7-p036-08","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","record":null,"relation":"defines","role":"definition","rows":[{"end_line":473,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper states both nonempty term annotations and their lack of logical effect. The formal definition requires one or more grammatical attributes, but does not state that the annotated term has the same meaning as the original.","fidelity_source":"ai","line":457,"lines":[457,473],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.Valid","note":"","plain":"Nonempty repetitions, match from 2.6 and lambda from 2.7","relation":"defines","annotation":"The annotation case requires a valid inner term and at least one grammatically valid attribute. The standard also assigns the wrapper the same logical meaning as its inner term. `Valid` only checks the grammar of the wrapper."},{"end_line":195,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes the annotation wrapper around a term. It does not require the attribute list to be nonempty or prove the paper’s semantic equivalence between the annotated and unannotated term.","fidelity_source":"ai","line":174,"lines":[174,195],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Term.tokens","note":"","plain":"Writing a term as tokens","relation":"defines","annotation":"The annotated branch writes `!`, the inner term and the attribute sequence within one pair of parentheses. The function retains the wrapper and its attributes in the syntax, while the standard's equivalence concerns the meaning of the term."}],"tone":8,"topic":"term-annotations"},{"anchor":"sec-3.11","at":"b13664-14865","from_record":false,"lean":true,"lines":[26,36],"module":"BSmtLibSpec.Grammar.Script","name":"BSmtLibSpec.Grammar.Script","origin":"ai","part":0,"phrase":"2-7-p050-04","plain":"Version-valid command sequence with optional terminal exit","record":null,"relation":"defines","role":"definition","rows":[{"end_line":36,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper describes command sequences and their read-eval-print interaction; the formal definition restricts a sequence by version changes and termination at exit. It does not define solver state, execution, responses, or the semantics of options.","fidelity_source":"ai","line":26,"lines":[26,36],"module":"BSmtLibSpec.Grammar.Script","name":"BSmtLibSpec.Grammar.Script","note":"","plain":"Version-valid command sequence with optional terminal exit","relation":"defines","annotation":"A `Script` is a list of command trees checked in sequence, using the reading version left by the previous command. A recognized version declaration can change that version, and an `exit` ends the list. The relation covers the reading phase of the interaction described here."},{"end_line":334,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes commands as parenthesized names and arguments. The paper also describes execution, replies, and prescribed option meanings; none of those behaviours is supplied by a function that writes command tokens.","fidelity_source":"ai","line":291,"lines":[291,334],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Command.tokens","note":"","plain":"Writing complete command token sequences","relation":"defines","annotation":"Each branch uses `commandTokens` to put a command name and its arguments inside parentheses. A command with zero arguments such as `(check-sat)` still receives that wrapper. The solver responses described here are outside this conversion from command trees to tokens."}],"tone":11,"topic":"scripts-interaction"},{"anchor":"sec-3.11","at":"b14867-14920","from_record":false,"lean":true,"lines":[168,170],"merged":[{"id":"2-7-p051-01","quote":"⟨sort\\_dec ⟩ ::= ( ⟨symbol ⟩ ⟨numeral ⟩ )","role":"definition","topic":"declarations-definitions"},{"id":"2-7-p109-01","quote":"⟨sort\\_dec ⟩ ::= ( ⟨symbol ⟩ ⟨numeral ⟩ )","role":"definition","topic":"declarations-definitions"}],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.SortDec","origin":"ai","part":0,"phrase":"2-7-p051-01","plain":"Sort name with declared arity","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition represents a sort declaration by its symbol and the numeral giving its arity. The characters of that numeral are checked by the lexical rules, separately from this representation.","phrase":"2-7-p051-01"},{"fidelity":"same","fidelity_note":"The formal definition represents a sort declaration by its symbol and the numeral giving its arity. The characters of that numeral are checked by the lexical rules, separately from this representation.","phrase":"2-7-p109-01"}],"end_line":170,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition represents a sort declaration by its symbol and the numeral giving its arity. The characters of that numeral are checked by the lexical rules, separately from this representation.","fidelity_source":"ai","line":168,"lines":[168,170],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.SortDec","note":"","plain":"Sort name with declared arity","relation":"defines","annotation":"In a `declare-datatypes` sort declaration, `SortDec` stores a symbol and the arity's numeral as bytes. The `arity` field holds that spelling directly, without first converting it to a Lean natural number."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition writes the sort symbol and arity numeral inside parentheses, exactly as shown in the production.","phrase":"2-7-p051-01"},{"fidelity":"same","fidelity_note":"The formal definition writes the sort symbol and arity numeral inside parentheses, exactly as shown in the production.","phrase":"2-7-p109-01"}],"end_line":228,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes the sort symbol and arity numeral inside parentheses, exactly as shown in the production.","fidelity_source":"ai","line":227,"lines":[227,228],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SortDec.tokens","note":"","plain":"Writing a sort name and arity","relation":"defines","annotation":"The name and arity produce a symbol token and a numeral token inside one pair of parentheses. For example, a declaration of arity one for `List` produces the tokens of `(List 1)`."}],"tone":12,"topic":"declarations-definitions"},{"anchor":"sec-3.11","at":"b14922-14976","from_record":false,"lean":true,"lines":[498,499],"merged":[{"id":"2-7-p051-02","quote":"⟨selector\\_dec ⟩ ::= ( ⟨symbol ⟩ ⟨sort ⟩ )","role":"definition","topic":"declarations-definitions"},{"id":"2-7-p109-02","quote":"⟨selector\\_dec ⟩ ::= ( ⟨symbol ⟩ ⟨sort ⟩ )","role":"definition","topic":"declarations-definitions"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SelectorDec.Valid","origin":"ai","part":0,"phrase":"2-7-p051-02","plain":"A selector declaration requires a valid result sort","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The production defines a selector name and sort inside parentheses; the formal definition only checks the sort expression’s version conditions. It is one component of the grammar rather than the whole production.","phrase":"2-7-p051-02"},{"fidelity":"different","fidelity_note":"The production defines a selector name and sort inside parentheses; the formal definition only checks the sort expression’s version conditions. It is one component of the grammar rather than the whole production.","phrase":"2-7-p109-02"}],"end_line":499,"exact_lines":false,"fidelity":"different","fidelity_note":"The production defines a selector name and sort inside parentheses; the formal definition only checks the sort expression’s version conditions. It is one component of the grammar rather than the whole production.","fidelity_source":"ai","line":498,"lines":[498,499],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SelectorDec.Valid","note":"","plain":"A selector declaration requires a valid result sort","relation":"defines","annotation":"At this point the selector already has a symbol and a sort. `Valid` calls the grammar predicate on the sort in the selected version. The datatype declaration supplies the context in which the selector name is introduced."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition represents a selector declaration by its symbol and sort expression, the two components of the production.","phrase":"2-7-p051-02"},{"fidelity":"same","fidelity_note":"The formal definition represents a selector declaration by its symbol and sort expression, the two components of the production.","phrase":"2-7-p109-02"}],"end_line":179,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition represents a selector declaration by its symbol and sort expression, the two components of the production.","fidelity_source":"ai","line":177,"lines":[177,179],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.SelectorDec","note":"","plain":"Selector name with result sort","relation":"defines","annotation":"The production's two parts become the selector's `symbol` and `sort` fields. A constructor stores a list of these selector declarations."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition writes a selector’s symbol and sort expression inside parentheses, matching the production.","phrase":"2-7-p051-02"},{"fidelity":"same","fidelity_note":"The formal definition writes a selector’s symbol and sort expression inside parentheses, matching the production.","phrase":"2-7-p109-02"}],"end_line":236,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes a selector’s symbol and sort expression inside parentheses, matching the production.","fidelity_source":"ai","line":235,"lines":[235,236],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SelectorDec.tokens","note":"","plain":"Writing a selector with its sort","relation":"defines","annotation":"The selector contributes its name as one symbol token, then the tokens of its result sort. The enclosing pair of parentheses marks off that selector from other selectors in a constructor."}],"tone":12,"topic":"declarations-definitions"},{"anchor":"sec-3.11","at":"b14978-15047","from_record":false,"lean":true,"lines":[506,507],"merged":[{"id":"2-7-p051-03","quote":"⟨constructor\\_dec ⟩ ::= ( ⟨symbol ⟩ ⟨selector\\_dec ⟩∗ )","role":"definition","topic":"declarations-definitions"},{"id":"2-7-p109-03","quote":"⟨constructor\\_dec ⟩ ::= ( ⟨symbol ⟩ ⟨selector\\_dec ⟩∗ )","role":"definition","topic":"declarations-definitions"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.ConstructorDec.Valid","origin":"ai","part":0,"phrase":"2-7-p051-03","plain":"Every selector of a constructor must be valid","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The production gives a symbol and zero or more selector declarations; the formal definition only checks the sort expressions within those selectors. It does not itself state the constructor declaration’s spelling.","phrase":"2-7-p051-03"},{"fidelity":"different","fidelity_note":"The production gives a symbol and zero or more selector declarations; the formal definition only checks the sort expressions within those selectors. It does not itself state the constructor declaration’s spelling.","phrase":"2-7-p109-03"}],"end_line":507,"exact_lines":false,"fidelity":"different","fidelity_note":"The production gives a symbol and zero or more selector declarations; the formal definition only checks the sort expressions within those selectors. It does not itself state the constructor declaration’s spelling.","fidelity_source":"ai","line":506,"lines":[506,507],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.ConstructorDec.Valid","note":"","plain":"Every selector of a constructor must be valid","relation":"defines","annotation":"The check runs through the constructor's selectors and requires `SelectorDec.Valid` for each one. With no selectors it holds vacuously, consistent with the star in the production."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition consists of a constructor symbol and a possibly empty list of selector declarations, exactly the components allowed by the production.","phrase":"2-7-p051-03"},{"fidelity":"same","fidelity_note":"The formal definition consists of a constructor symbol and a possibly empty list of selector declarations, exactly the components allowed by the production.","phrase":"2-7-p109-03"}],"end_line":188,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition consists of a constructor symbol and a possibly empty list of selector declarations, exactly the components allowed by the production.","fidelity_source":"ai","line":186,"lines":[186,188],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.ConstructorDec","note":"","plain":"Constructor name with selectors","relation":"defines","annotation":"The name field represents the leading symbol, and the list field represents the repeated selector declarations. A nullary constructor uses the case with an empty selector list."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition places the constructor symbol and its zero or more selector declarations inside parentheses, matching the production.","phrase":"2-7-p051-03"},{"fidelity":"same","fidelity_note":"The formal definition places the constructor symbol and its zero or more selector declarations inside parentheses, matching the production.","phrase":"2-7-p109-03"}],"end_line":244,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition places the constructor symbol and its zero or more selector declarations inside parentheses, matching the production.","fidelity_source":"ai","line":243,"lines":[243,244],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.ConstructorDec.tokens","note":"","plain":"Writing a constructor and selectors","relation":"defines","annotation":"`ConstructorDec.tokens` starts with the name, appends the already grouped tokens of each selector, and encloses the result. For a nullary constructor such as `nil`, this leaves just `(nil)`."}],"tone":12,"topic":"declarations-definitions"},{"anchor":"sec-3.11","at":"b15049-15161","from_record":false,"lean":true,"lines":[515,516],"merged":[{"id":"2-7-p051-04","quote":"⟨datatype\\_dec ⟩ ::= ( ⟨constructor\\_dec ⟩+ ) \\| ( par ( ⟨symbol ⟩+ ) ( ⟨constructor\\_dec ⟩+ ) )","role":"definition","topic":"declarations-definitions"},{"id":"2-7-p109-04","quote":"⟨datatype\\_dec ⟩ ::= ( ⟨constructor\\_dec ⟩+ ) \\| ( par ( ⟨symbol ⟩+ ) ( ⟨constructor\\_dec ⟩+ ) )","role":"definition","topic":"declarations-definitions"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.DatatypeDec.Valid","origin":"ai","part":0,"phrase":"2-7-p051-04","plain":"A datatype needs a nonempty list of valid constructors","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The paper gives both forms of datatype declaration; the formal definition requires a nonempty constructor list and grammatical selector sorts. The distinction between the plain form and the par form is supplied by the separate representation and spelling.","phrase":"2-7-p051-04"},{"fidelity":"different","fidelity_note":"The paper gives both forms of datatype declaration; the formal definition requires a nonempty constructor list and grammatical selector sorts. The distinction between the plain form and the par form is supplied by the separate representation and spelling.","phrase":"2-7-p109-04"}],"end_line":516,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper gives both forms of datatype declaration; the formal definition requires a nonempty constructor list and grammatical selector sorts. The distinction between the plain form and the par form is supplied by the separate representation and spelling.","fidelity_source":"ai","line":515,"lines":[515,516],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.DatatypeDec.Valid","note":"","plain":"A datatype needs a nonempty list of valid constructors","relation":"defines","annotation":"The nonempty constructor condition supplies the plus shared by both alternatives. The same predicate checks the grammar of every constructor. Sort parameters and constructor arities are checked against the surrounding declarations when interpreting the datatype (see `declare-datatypes` in Section 4.2.3).","annotation_references":[{"start":290,"end":303,"key":"section:4.2.3"}]},{"assessments":[{"fidelity":"different","fidelity_note":"The production requires at least one constructor; the formal definition permits an empty constructor list. That additional case is excluded only by a separate grammar condition.","phrase":"2-7-p051-04"},{"fidelity":"different","fidelity_note":"The production requires at least one constructor; the formal definition permits an empty constructor list. That additional case is excluded only by a separate grammar condition.","phrase":"2-7-p109-04"}],"end_line":197,"exact_lines":false,"fidelity":"different","fidelity_note":"The production requires at least one constructor; the formal definition permits an empty constructor list. That additional case is excluded only by a separate grammar condition.","fidelity_source":"ai","line":195,"lines":[195,197],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.DatatypeDec","note":"","plain":"Datatype parameters and constructors","relation":"defines","annotation":"The declaration stores the parameters and constructors in two lists. An empty parameter list represents the plain form. An empty constructor list is possible as data and is excluded by `DatatypeDec.Valid`."},{"assessments":[{"fidelity":"different","fidelity_note":"The formal definition writes either a constructor list or its par form, but can write an empty constructor list in either case. The paper’s plus sign rules this out; the nonempty requirement is imposed separately.","phrase":"2-7-p051-04"},{"fidelity":"different","fidelity_note":"The formal definition writes either a constructor list or its par form, but can write an empty constructor list in either case. The paper’s plus sign rules this out; the nonempty requirement is imposed separately.","phrase":"2-7-p109-04"}],"end_line":256,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes either a constructor list or its par form, but can write an empty constructor list in either case. The paper’s plus sign rules this out; the nonempty requirement is imposed separately.","fidelity_source":"ai","line":252,"lines":[252,256],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.DatatypeDec.tokens","note":"","plain":"Datatype tokens with par for sort parameters","relation":"defines","annotation":"With no parameters the function encloses the constructors in one list. With parameters it emits the `par` wrapper with separate parameter and constructor groups. The function can write an empty constructor group, which the validity predicate excludes."}],"tone":12,"topic":"declarations-definitions"},{"anchor":"sec-3.11","at":"b15163-15243","from_record":false,"lean":true,"lines":[523,525],"merged":[{"id":"2-7-p051-05","quote":"⟨function\\_dec ⟩ ::= ( ⟨symbol ⟩ ( ⟨sorted\\_var ⟩∗ ) ⟨sort ⟩ )","role":"definition","topic":"declarations-definitions"},{"id":"2-7-p109-05","quote":"⟨function\\_dec ⟩ ::= ( ⟨symbol ⟩ ( ⟨sorted\\_var ⟩∗ ) ⟨sort ⟩ )","role":"definition","topic":"declarations-definitions"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.FunctionDec.Valid","origin":"ai","part":0,"phrase":"2-7-p051-05","plain":"A function declaration requires valid parameter and result sorts","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The production specifies a function name, parameter list, and result sort; the formal definition only checks the grammar of those sorts. It does not state the parentheses and sequence shown in the production.","phrase":"2-7-p051-05"},{"fidelity":"different","fidelity_note":"The production specifies a function name, parameter list, and result sort; the formal definition only checks the grammar of those sorts. It does not state the parentheses and sequence shown in the production.","phrase":"2-7-p109-05"}],"end_line":525,"exact_lines":false,"fidelity":"different","fidelity_note":"The production specifies a function name, parameter list, and result sort; the formal definition only checks the grammar of those sorts. It does not state the parentheses and sequence shown in the production.","fidelity_source":"ai","line":523,"lines":[523,525],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.FunctionDec.Valid","note":"","plain":"A function declaration requires valid parameter and result sorts","relation":"defines","annotation":"The check requires each parameter's sort and the result sort to be grammatical in the selected version. The star permits zero parameters, and the assertion over the parameter list holds vacuously in that case."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition represents a function name, zero or more sorted parameters, and a result sort, matching the components of the production.","phrase":"2-7-p051-05"},{"fidelity":"same","fidelity_note":"The formal definition represents a function name, zero or more sorted parameters, and a result sort, matching the components of the production.","phrase":"2-7-p109-05"}],"end_line":207,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition represents a function name, zero or more sorted parameters, and a result sort, matching the components of the production.","fidelity_source":"ai","line":204,"lines":[204,207],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.FunctionDec","note":"","plain":"Function parameters and result sort","relation":"defines","annotation":"The structure stores a name, a list of named parameters with their sorts, and the result sort. A `define-funs-rec` node stores these declarations separately from the associated body terms."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition surrounds the function declaration with parentheses and separately parenthesizes its possibly empty parameter list, as the production requires.","phrase":"2-7-p051-05"},{"fidelity":"same","fidelity_note":"The formal definition surrounds the function declaration with parentheses and separately parenthesizes its possibly empty parameter list, as the production requires.","phrase":"2-7-p109-05"}],"end_line":266,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition surrounds the function declaration with parentheses and separately parenthesizes its possibly empty parameter list, as the production requires.","fidelity_source":"ai","line":264,"lines":[264,266],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.FunctionDec.tokens","note":"","plain":"Writing a function's declared signature","relation":"defines","annotation":"The inner parentheses enclose the sorted variable list, even when it is empty. The outer pair groups the name, parameter list and result sort into a declaration that can be one entry in `define-funs-rec`."}],"tone":12,"topic":"declarations-definitions"},{"anchor":"sec-3.11","at":"b15245-15332","from_record":false,"lean":true,"lines":[532,534],"merged":[{"id":"2-7-p051-06","quote":"⟨function\\_def ⟩ ::= ⟨symbol ⟩ ( ⟨sorted\\_var ⟩∗ ) ⟨sort ⟩ ⟨term⟩","role":"definition","topic":"declarations-definitions"},{"id":"2-7-p109-06","quote":"⟨function\\_def ⟩ ::= ⟨symbol ⟩ ( ⟨sorted\\_var ⟩∗ ) ⟨sort ⟩ ⟨term⟩","role":"definition","topic":"declarations-definitions"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.FunctionDef.Valid","origin":"ai","part":0,"phrase":"2-7-p051-06","plain":"A function definition requires valid sorts and body","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"The production defines the sequence making up a function definition; the formal definition checks only the grammar of parameter sorts, result sort, and body. It neither writes that sequence nor requires the body to have the stated result sort.","phrase":"2-7-p051-06"},{"fidelity":"different","fidelity_note":"The production defines the sequence making up a function definition; the formal definition checks only the grammar of parameter sorts, result sort, and body. It neither writes that sequence nor requires the body to have the stated result sort.","phrase":"2-7-p109-06"}],"end_line":534,"exact_lines":false,"fidelity":"different","fidelity_note":"The production defines the sequence making up a function definition; the formal definition checks only the grammar of parameter sorts, result sort, and body. It neither writes that sequence nor requires the body to have the stated result sort.","fidelity_source":"ai","line":532,"lines":[532,534],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.FunctionDef.Valid","note":"","plain":"A function definition requires valid sorts and body","relation":"defines","annotation":"The check calls `Valid` on each sorted parameter, the stated result sort and the body. Grammatical validity of the body is a separate condition from having the declared result sort."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition consists of a function name, zero or more sorted parameters, a result sort, and a body term. These are exactly the four components in the production.","phrase":"2-7-p051-06"},{"fidelity":"same","fidelity_note":"The formal definition consists of a function name, zero or more sorted parameters, a result sort, and a body term. These are exactly the four components in the production.","phrase":"2-7-p109-06"}],"end_line":218,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition consists of a function name, zero or more sorted parameters, a result sort, and a body term. These are exactly the four components in the production.","fidelity_source":"ai","line":214,"lines":[214,218],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.FunctionDef","note":"","plain":"Function signature with a defining term","relation":"defines","annotation":"The `body` field contains the term at the end of this production. The same four-field structure is used inside `define-fun` and `define-fun-rec`."},{"assessments":[{"fidelity":"same","fidelity_note":"The formal definition writes the name, parenthesized parameter list, result sort, and body in that order. It adds no outer parentheses, matching this production’s role inside a command.","phrase":"2-7-p051-06"},{"fidelity":"same","fidelity_note":"The formal definition writes the name, parenthesized parameter list, result sort, and body in that order. It adds no outer parentheses, matching this production’s role inside a command.","phrase":"2-7-p109-06"}],"end_line":275,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition writes the name, parenthesized parameter list, result sort, and body in that order. It adds no outer parentheses, matching this production’s role inside a command.","fidelity_source":"ai","line":273,"lines":[273,275],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.FunctionDef.tokens","note":"","plain":"Writing a function's signature and body","relation":"defines","annotation":"Only the parameter list gets its own parentheses in this function. It emits the name, that list, the result sort and then the body. The wrapper for `define-fun` or `define-fun-rec` is added by the command branch."}],"tone":12,"topic":"declarations-definitions"},{"anchor":"sec-3.11","at":"b15334-16399","from_record":false,"lean":true,"lines":[646,647],"merged":[{"id":"2-7-p051-07","quote":"( assert ⟨term ⟩ ) ( check-sat ) ( check-sat-assuming ( ⟨term ⟩∗ ) ) ( declare-const ⟨symbol ⟩ ⟨sort ⟩ ) ( declare-datatype ⟨symbol ⟩ ⟨datatype\\_dec ⟩ ) ( declare-datatypes ( ⟨sort\\_dec ⟩ n+1 ) ( ⟨datatype\\_dec ⟩ n+1 ) ) ( declare-fun ⟨symbol ⟩ ( ⟨sort ⟩∗ ) ⟨sort ⟩ ) ( declare-sort ⟨symbol ⟩ ⟨numeral ⟩ ) ( declare-sort-parameter ⟨symbol ⟩ ) ( define-const ⟨symbol ⟩ ⟨sort ⟩ ⟨term ⟩ ) ( define-fun ⟨function\\_def ⟩ ) ( define-fun-rec ⟨function\\_def ⟩ ) ( define-funs-rec ( ⟨function\\_dec ⟩ n+1 ) ( ⟨term ⟩ n+1 ) ) ( define-sort ⟨symbol ⟩ ( ⟨symbol ⟩∗ ) ⟨sort ⟩ ) ( echo ⟨string ⟩ ) ( exit ) ( get-assertions ) ( get-assignment ) ( get-info ⟨info\\_flag ⟩ ) ( get-model ) ( get-option ⟨keyword ⟩ ) ( get-proof ) ( get-unsat-assumptions ) ( get-unsat-core ) ( get-value ( ⟨term ⟩+ ) ) ( pop ⟨numeral ⟩ ) ( push ⟨numeral ⟩ ) ( reset ) ( reset-assertions ) ( set-info ⟨attribute ⟩ ) ( set-logic ⟨symbol ⟩ ) ( set-option ⟨option ⟩ )","role":"definition","topic":"command-syntax-options"},{"id":"2-7-p109-07","quote":"( assert ⟨term ⟩ ) ( check-sat ) ( check-sat-assuming ( ⟨term ⟩∗ ) ) ( declare-const ⟨symbol ⟩ ⟨sort ⟩ ) ( declare-datatype ⟨symbol ⟩ ⟨datatype\\_dec ⟩ ) ( declare-datatypes ( ⟨sort\\_dec ⟩ n+1 ) ( ⟨datatype\\_dec ⟩ n+1 ) ) ( declare-fun ⟨symbol ⟩ ( ⟨sort ⟩∗ ) ⟨sort ⟩ ) ( declare-sort ⟨symbol ⟩ ⟨numeral ⟩ ) ( declare-sort-parameter ⟨symbol ⟩ ) ( define-const ⟨symbol ⟩ ⟨sort ⟩ ⟨term ⟩ ) ( define-fun ⟨function\\_def ⟩ ) ( define-fun-rec ⟨function\\_def ⟩ ) ( define-funs-rec ( ⟨function\\_dec ⟩ n+1 ) ( ⟨term ⟩ n+1 ) ) ( define-sort ⟨symbol ⟩ ( ⟨symbol ⟩∗ ) ⟨sort ⟩ ) ( echo ⟨string ⟩ ) ( exit ) ( get-assertions ) ( get-assignment ) ( get-info ⟨info\\_flag ⟩ ) ( get-model ) ( get-option ⟨keyword ⟩ ) ( get-proof ) ( get-unsat-assumptions ) ( get-unsat-core ) ( get-value ( ⟨term ⟩+ ) ) ( pop ⟨numeral ⟩ ) ( push ⟨numeral ⟩ ) ( reset ) ( reset-assertions ) ( set-info ⟨attribute ⟩ ) ( set-logic ⟨symbol ⟩ ) ( set-option ⟨option ⟩ )","role":"definition","topic":"command-syntax-options"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Syntax.IsCommand","origin":"ai","part":0,"phrase":"2-7-p051-07","plain":"Tokens of a command valid in the current version","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"same","fidelity_note":"In version 2.7 the formal definition accepts a token sequence as a command exactly when it writes one of these forms, with the paired lists of declare-datatypes and define-funs-rec of equal nonzero length and the terms of get-value nonempty. Option and information-flag arguments are checked as attributes and keywords, which their final alternatives allow.","phrase":"2-7-p051-07"},{"fidelity":"same","fidelity_note":"In version 2.7 the formal definition accepts a token sequence as a command exactly when it writes one of these forms, with the paired lists of declare-datatypes and define-funs-rec of equal nonzero length and the terms of get-value nonempty. Option and information-flag arguments are checked as attributes and keywords, which their final alternatives allow.","phrase":"2-7-p109-07"}],"end_line":647,"exact_lines":false,"fidelity":"same","fidelity_note":"In version 2.7 the formal definition accepts a token sequence as a command exactly when it writes one of these forms, with the paired lists of declare-datatypes and define-funs-rec of equal nonzero length and the terms of get-value nonempty. Option and information-flag arguments are checked as attributes and keywords, which their final alternatives allow.","fidelity_source":"ai","line":646,"lines":[646,647],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Syntax.IsCommand","note":"","plain":"Tokens of a command valid in the current version","relation":"defines","annotation":"`IsCommand` relates a given command tree to exactly the tokens it emits when the tree meets the version's grammar. For example, token equality fixes the spelling of `declare-datatypes`, and `Valid` checks that its two lists have equal positive length."},{"assessments":[{"fidelity":"different","fidelity_note":"The formal condition checks command availability by version, requires nonempty lists where specified, and requires equal lengths within each pair of lists marked $n+1$. It admits the older literal form of `check-sat-assuming` in versions 2.5 and 2.6. The command forms themselves are defined separately.","phrase":"2-7-p051-07"},{"fidelity":"different","fidelity_note":"The formal condition checks command availability by version, requires nonempty lists where specified, and requires equal lengths within each pair of lists marked $n+1$. It admits the older literal form of `check-sat-assuming` in versions 2.5 and 2.6. The command forms themselves are defined separately.","phrase":"2-7-p109-07"}],"end_line":593,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal condition checks command availability by version, requires nonempty lists where specified, and requires equal lengths within each pair of lists marked $n+1$. It admits the older literal form of `check-sat-assuming` in versions 2.5 and 2.6. The command forms themselves are defined separately.","fidelity_source":"ai","line":553,"lines":[553,593],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Command.Valid","note":"","plain":"Version limits and argument rules for commands","relation":"defines","annotation":"The $n+1$ repetitions in `declare-datatypes` and `define-funs-rec` become a nonempty test on the first list and an equality of lengths. The predicate also selects the term-argument branch of `check-sat-assuming` in 2.7 and the literal branch in 2.5 and 2.6."},{"assessments":[{"fidelity":"different","fidelity_note":"The formal definition has a case for each of these commands and one more, the version 2.5 and 2.6 form of check-sat-assuming with propositional literals. Its lists may be empty or of unequal length; a separate condition excludes those forms.","phrase":"2-7-p051-07"},{"fidelity":"different","fidelity_note":"The formal definition has a case for each of these commands and one more, the version 2.5 and 2.6 form of check-sat-assuming with propositional literals. Its lists may be empty or of unequal length; a separate condition excludes those forms.","phrase":"2-7-p109-07"}],"end_line":275,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition has a case for each of these commands and one more, the version 2.5 and 2.6 form of check-sat-assuming with propositional literals. Its lists may be empty or of unequal length; a separate condition excludes those forms.","fidelity_source":"ai","line":242,"lines":[242,275],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.Command","note":"","plain":"Concrete forms of script commands","relation":"defines","annotation":"Each command is stored with the arguments named in its production. The type also stores a separate `check-sat-assuming` form for the older grammar, and stores the two lists of `define-funs-rec` independently until validity is checked."},{"assessments":[{"fidelity":"different","fidelity_note":"The formal definition writes each command as the production reads, its name and arguments between parentheses. It writes lists of any length, so the repetitions and equal lengths marked here are enforced only by the separate condition.","phrase":"2-7-p051-07"},{"fidelity":"different","fidelity_note":"The formal definition writes each command as the production reads, its name and arguments between parentheses. It writes lists of any length, so the repetitions and equal lengths marked here are enforced only by the separate condition.","phrase":"2-7-p109-07"}],"end_line":334,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes each command as the production reads, its name and arguments between parentheses. It writes lists of any length, so the repetitions and equal lengths marked here are enforced only by the separate condition.","fidelity_source":"ai","line":291,"lines":[291,334],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Command.tokens","note":"","plain":"Writing complete command token sequences","relation":"defines","annotation":"`commandTokens` wraps each command name and the tokens of its arguments. The branch for `define-funs-rec`, for example, writes one group of declarations and a second group of bodies. Equal lengths are checked by `Command.Valid`."}],"tone":10,"topic":"command-syntax-options"},{"anchor":"sec-3.11","at":"b16401-16436","from_record":false,"lean":true,"lines":[26,36],"merged":[{"id":"2-7-p051-08","quote":"⟨script ⟩ ::= ⟨command ⟩∗","role":"definition","topic":"scripts-interaction"},{"id":"2-7-p109-08","quote":"⟨script ⟩ ::= ⟨command ⟩∗","role":"definition","topic":"scripts-interaction"}],"module":"BSmtLibSpec.Grammar.Script","name":"BSmtLibSpec.Grammar.Script","origin":"ai","part":0,"phrase":"2-7-p051-08","plain":"Version-valid command sequence with optional terminal exit","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"weaker","fidelity_note":"For command spellings satisfying the lexical rules, the production permits any finite command sequence. The formal definition additionally follows version changes, checks commands against the current version, and requires exit to be last; it therefore describes a narrower class than the repetition alone.","phrase":"2-7-p051-08"},{"fidelity":"weaker","fidelity_note":"For command spellings satisfying the lexical rules, the production permits any finite command sequence. The formal definition additionally follows version changes, checks commands against the current version, and requires exit to be last; it therefore describes a narrower class than the repetition alone.","phrase":"2-7-p109-08"}],"end_line":36,"exact_lines":false,"fidelity":"weaker","fidelity_note":"For command spellings satisfying the lexical rules, the production permits any finite command sequence. The formal definition additionally follows version changes, checks commands against the current version, and requires exit to be last; it therefore describes a narrower class than the repetition alone.","fidelity_source":"ai","line":26,"lines":[26,36],"module":"BSmtLibSpec.Grammar.Script","name":"BSmtLibSpec.Grammar.Script","note":"","plain":"Version-valid command sequence with optional terminal exit","relation":"defines","annotation":"The `.done` case allows the empty sequence in the star production. A step checks the next command in the current version and uses its resulting reading mode for the tail. In the stopping case, `exit` is the final command."}],"tone":11,"topic":"scripts-interaction"},{"anchor":"sec-3.11","at":"b16438-16950","from_record":false,"lean":true,"lines":[121,123],"merged":[{"id":"2-7-p052-02","quote":":diagnostic-output-channel ⟨string ⟩ :global-declarations ⟨b\\_value ⟩ :interactive-mode ⟨b\\_value ⟩ :print-success ⟨b\\_value ⟩ :produce-assertions ⟨b\\_value ⟩ :produce-assignments ⟨b\\_value ⟩ :produce-models ⟨b\\_value ⟩ :produce-proofs ⟨b\\_value ⟩ :produce-unsat-assumptions ⟨b\\_value ⟩ :produce-unsat-cores ⟨b\\_value ⟩ :random-seed ⟨numeral ⟩ :regular-output-channel ⟨string ⟩ :reproducible-resource-limit ⟨numeral ⟩ :verbosity ⟨numeral ⟩ ⟨attribute ⟩","role":"definition","topic":"command-syntax-options"},{"id":"2-7-p108-03","quote":":diagnostic-output-channel ⟨string ⟩ :global-declarations ⟨b\\_value ⟩ :interactive-mode ⟨b\\_value ⟩ :print-success ⟨b\\_value ⟩ :produce-assertions ⟨b\\_value ⟩ :produce-assignments ⟨b\\_value ⟩ :produce-models ⟨b\\_value ⟩ :produce-proofs ⟨b\\_value ⟩ :produce-unsat-assumptions ⟨b\\_value ⟩ :produce-unsat-cores ⟨b\\_value ⟩ :random-seed ⟨numeral ⟩ :regular-output-channel ⟨string ⟩ :reproducible-resource-limit ⟨numeral ⟩ :verbosity ⟨numeral ⟩ ⟨attribute ⟩","role":"definition","topic":"command-syntax-options"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Attribute.tokens","origin":"ai","part":0,"phrase":"2-7-p052-02","plain":"Writing a keyword and optional value","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"same","fidelity_note":"Every listed option is a keyword followed by a string, a Boolean value or a numeral, and the last alternative is any attribute, so as written text the options are exactly the attributes. The formal definition writes an attribute as its keyword, followed by its value when it has one; it does not single out the named options.","phrase":"2-7-p052-02"},{"fidelity":"same","fidelity_note":"Every listed option is a keyword followed by a string, a Boolean value or a numeral, and the last alternative is any attribute, so as written text the options are exactly the attributes. The formal definition writes an attribute as its keyword, followed by its value when it has one; it does not single out the named options.","phrase":"2-7-p108-03"}],"end_line":123,"exact_lines":false,"fidelity":"same","fidelity_note":"Every listed option is a keyword followed by a string, a Boolean value or a numeral, and the last alternative is any attribute, so as written text the options are exactly the attributes. The formal definition writes an attribute as its keyword, followed by its value when it has one; it does not single out the named options.","fidelity_source":"ai","line":121,"lines":[121,123],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Attribute.tokens","note":"","plain":"Writing a keyword and optional value","relation":"defines","annotation":"A named option like `:random-seed 17` uses the value-bearing case, with a keyword and a numeral token. The final alternative in the production admits the general attribute form, which this function also writes with no value when the field is `none`."},{"assessments":[{"fidelity":"different","fidelity_note":"The formal definition writes whole commands; set-option is written with its argument as an attribute, which covers every listed option. It does not define the option category on its own or the meaning of each option.","phrase":"2-7-p052-02"},{"fidelity":"different","fidelity_note":"The formal definition writes whole commands; set-option is written with its argument as an attribute, which covers every listed option. It does not define the option category on its own or the meaning of each option.","phrase":"2-7-p108-03"}],"end_line":334,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes whole commands; set-option is written with its argument as an attribute, which covers every listed option. It does not define the option category on its own or the meaning of each option.","fidelity_source":"ai","line":291,"lines":[291,334],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Command.tokens","note":"","plain":"Writing complete command token sequences","relation":"defines","annotation":"The `set-option` branch writes its argument using `Attribute.tokens`. It uses the same branch for a predefined name such as `:produce-models` and a solver-specific option. The meaning of each option is specified separately."}],"tone":10,"topic":"command-syntax-options"},{"anchor":"sec-3.11","at":"b16952-17077","from_record":false,"lean":true,"lines":[291,334],"merged":[{"id":"2-7-p052-04","quote":":all-statistics \\| :assertion-stack-levels \\| :authors :error-behavior \\| :name \\| :reason-unknown :version \\| ⟨keyword ⟩","role":"definition","topic":"command-syntax-options"},{"id":"2-7-p108-01","quote":":all-statistics \\| :assertion-stack-levels \\| :authors :error-behavior \\| :name \\| :reason-unknown :version \\| ⟨keyword ⟩","role":"definition","topic":"command-syntax-options"}],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Command.tokens","origin":"ai","part":0,"phrase":"2-7-p052-04","plain":"Writing complete command token sequences","record":null,"relation":"defines","role":"definition","rows":[{"assessments":[{"fidelity":"different","fidelity_note":"Every listed flag is a keyword, and the last alternative is any keyword, so the flags are exactly the keywords. The formal definition writes whole commands; get-info is written with one keyword after it. It does not define the flags on their own or their meanings.","phrase":"2-7-p052-04"},{"fidelity":"different","fidelity_note":"Every listed flag is a keyword, and the last alternative is any keyword, so the flags are exactly the keywords. The formal definition writes whole commands; get-info is written with one keyword after it. It does not define the flags on their own or their meanings.","phrase":"2-7-p108-01"}],"end_line":334,"exact_lines":false,"fidelity":"different","fidelity_note":"Every listed flag is a keyword, and the last alternative is any keyword, so the flags are exactly the keywords. The formal definition writes whole commands; get-info is written with one keyword after it. It does not define the flags on their own or their meanings.","fidelity_source":"ai","line":291,"lines":[291,334],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Command.tokens","note":"","plain":"Writing complete command token sequences","relation":"defines","annotation":"The `get-info` case puts one keyword token after the command name. Because the production ends with the general keyword alternative, the function needs no separate cases for flags such as `:version` or `:name`."}],"tone":10,"topic":"command-syntax-options"},{"anchor":"sec-3.11","at":"b17079-17585","from_record":false,"lean":true,"lines":[291,334],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Command.tokens","origin":"ai","part":0,"phrase":"2-7-p052-06","plain":"Writing complete command token sequences","record":null,"relation":"defines","role":"definition","rows":[{"end_line":334,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper describes prescribed and solver-specific information flags and refers to their semantics. The formal definition only writes get-info with a keyword argument, leaving both the flag’s meaning and the solver’s response unspecified.","fidelity_source":"ai","line":291,"lines":[291,334],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Command.tokens","note":"","plain":"Writing complete command token sequences","relation":"defines","annotation":"The token function writes `(get-info :time)` by the same rule it uses for `(get-info :name)`. The choice of flag changes the keyword payload. Whether that flag is supported and what the solver returns are questions about execution."}],"tone":11,"topic":"scripts-interaction"},{"anchor":"sec-appendix-b","at":"b17703-18046","from_record":false,"lean":true,"lines":[254,255],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.reserved","origin":"ai","part":0,"phrase":"2-7-p104-01","plain":"Matching a reserved word","record":null,"relation":"defines","role":"definition","rows":[{"end_line":255,"exact_lines":false,"fidelity":"same","fidelity_note":"At version 2.7 the formal reserved-word set excludes every predefined symbol in this list. This supports the distinction between predefined symbols and reserved words; their predefined meanings are not supplied by the lexical definition.","fidelity_source":"ai","line":254,"lines":[254,255],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.reserved","note":"","plain":"Matching a reserved word","relation":"defines","annotation":"Predefined spellings such as `Bool`, `true` and `sat` are absent from both lists supplied to `litOneOf` at version 2.7. Their special meanings are distinct from whether the lexer classifies them as reserved words."},{"end_line":273,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition admits each listed spelling as a simple symbol at version 2.7. It does not assign their predefined meanings, but it agrees that the spellings are not excluded as reserved words.","fidelity_source":"ai","line":271,"lines":[271,273],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.simpleSymbol","note":"","plain":"Unquoted symbols exclude initial digits and reserved words","relation":"defines","annotation":"The listed names pass the simple-symbol spelling test at version 2.7. For example, the hyphen in `continued-execution` is allowed punctuation and the complete name is outside the reserved-word set. The rule applies before the name is assigned a meaning."}],"tone":2,"topic":"symbols-keywords"},{"anchor":"sec-appendix-b","at":"b18048-18109","from_record":false,"lean":true,"lines":[58,58],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.whiteSpaceChar","origin":"ai","part":0,"phrase":"2-7-p104-03","plain":"Tab, line feed, carriage return and space","record":null,"relation":"defines","role":"definition","rows":[{"end_line":58,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition recognizes exactly tab, line feed, carriage return, and space: character codes 9, 10, 13, and 32.","fidelity_source":"ai","line":58,"lines":[58,58],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.whiteSpaceChar","note":"","plain":"Tab, line feed, carriage return and space","relation":"defines","annotation":"Each decimal code in the appendix becomes one `code` alternative in `whiteSpaceChar`. These are byte values $9$, $10$, $13$ and $32$, with comments handled by the separate whitespace rule."}],"tone":1,"topic":"character-classes"},{"anchor":"sec-appendix-b","at":"b18111-18197","from_record":false,"lean":true,"lines":[67,67],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.printableChar","origin":"ai","part":0,"phrase":"2-7-p104-04","plain":"Printable byte codes 32–126 and 128–255","record":null,"relation":"defines","role":"definition","rows":[{"end_line":67,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition recognizes exactly the two byte ranges printed here: 32–126 and 128–255. Unlike the broader Unicode wording in Section 3.1, this appendix production has the same finite bounds as the formal definition.","fidelity_source":"ai","line":67,"lines":[67,67],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.printableChar","note":"","plain":"Printable byte codes 32–126 and 128–255","relation":"defines","annotation":"The two runs in the appendix coincide with the two inclusive byte ranges in `printableChar`. The alternatives include $126$ and $128$ but skip $127$."}],"tone":1,"topic":"character-classes"},{"anchor":"sec-appendix-b","at":"b18199-18232","from_record":false,"lean":true,"lines":[74,74],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.digit","origin":"ai","part":0,"phrase":"2-7-p104-05","plain":"Decimal digit characters","record":null,"relation":"defines","role":"definition","rows":[{"end_line":74,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition recognizes exactly the ASCII digits 0 through 9, with codes 48 through 57.","fidelity_source":"ai","line":74,"lines":[74,74],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.digit","note":"","plain":"Decimal digit characters","relation":"defines","annotation":"The appendix writes the glyphs `0` through `9`, and `range 48 57` uses their ASCII byte values. Each match contains a single byte."}],"tone":1,"topic":"character-classes"},{"anchor":"sec-appendix-b","at":"b18234-18288","from_record":false,"lean":true,"lines":[84,84],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.letter","origin":"ai","part":0,"phrase":"2-7-p104-06","plain":"Uppercase and lowercase ASCII letters","record":null,"relation":"defines","role":"definition","rows":[{"end_line":84,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition recognizes exactly the two ASCII letter ranges A through Z and a through z, with codes 65–90 and 97–122.","fidelity_source":"ai","line":84,"lines":[84,84],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.letter","note":"","plain":"Uppercase and lowercase ASCII letters","relation":"defines","annotation":"The alphabet here matches the two branches of `letter`. They use the inclusive ASCII intervals $65$ to $90$ for uppercase and $97$ to $122$ for lowercase."}],"tone":1,"topic":"character-classes"},{"anchor":"sec-appendix-b","at":"b18290-18364","from_record":false,"lean":true,"lines":[132,132],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.numeral","origin":"ai","part":0,"phrase":"2-7-p105-03","plain":"Zero or a sequence of digits without a leading zero","record":null,"relation":"defines","role":"definition","rows":[{"end_line":132,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition allows 0 by itself or a nonempty sequence of decimal digits whose first digit is not 0. Leading zeros are excluded from longer numerals.","fidelity_source":"ai","line":132,"lines":[132,132],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.numeral","note":"","plain":"Zero or a sequence of digits without a leading zero","relation":"defines","annotation":"The two parts of the appendix rule become an alternation with `lit \"0\"` and a subtraction from `plus digit`. The subtraction removes digit sequences that begin with `0`, so only the first branch can accept `0`."}],"tone":3,"topic":"numeric-literals"},{"anchor":"sec-appendix-b","at":"b18366-18419","from_record":false,"lean":true,"lines":[139,139],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.decimal","origin":"ai","part":0,"phrase":"2-7-p105-04","plain":"Decimal literals have digits on both sides of the point","record":null,"relation":"defines","role":"definition","rows":[{"end_line":139,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition is a numeral, a decimal point, zero or more zeros, and another numeral. Thus there is at least one digit after the point, while zeros may begin the fractional part.","fidelity_source":"ai","line":139,"lines":[139,139],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.decimal","note":"","plain":"Decimal literals have digits on both sides of the point","relation":"defines","annotation":"`seq` joins a numeral, the literal point, the starred run of zeroes, and another numeral. That is why `1.00` has the required final digit even though its fractional digits are all zero."}],"tone":3,"topic":"numeric-literals"},{"anchor":"sec-appendix-b","at":"b18421-18535","from_record":false,"lean":true,"lines":[147,147],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.hexadecimal","origin":"ai","part":0,"phrase":"2-7-p105-05","plain":"Hexadecimal literals have a #x prefix and a nonempty digit string","record":null,"relation":"defines","role":"definition","rows":[{"end_line":147,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition requires the lowercase prefix #x followed by one or more digits or letters A–F or a–f. Only the hexadecimal digits are case-insensitive.","fidelity_source":"ai","line":147,"lines":[147,147],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.hexadecimal","note":"","plain":"Hexadecimal literals have a #x prefix and a nonempty digit string","relation":"defines","annotation":"The expression starts with the fixed literal `#x`. The disjunction inside `plus` is where capital and lowercase letters are both accepted, for as many hex digits as follow the prefix."}],"tone":3,"topic":"numeric-literals"},{"anchor":"sec-appendix-b","at":"b18537-18613","from_record":false,"lean":true,"lines":[154,154],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.binary","origin":"ai","part":0,"phrase":"2-7-p105-06","plain":"Binary literals have a #b prefix and a nonempty digit string","record":null,"relation":"defines","role":"definition","rows":[{"end_line":154,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition requires the lowercase prefix #b followed by one or more characters, each either 0 or 1.","fidelity_source":"ai","line":154,"lines":[154,154],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.binary","note":"","plain":"Binary literals have a #b prefix and a nonempty digit string","relation":"defines","annotation":"`lit \"#b\"` fixes the prefix and `plus` requires at least one byte from `oneOf \"01\"`. Every unit after the prefix is a single binary digit."}],"tone":3,"topic":"numeric-literals"},{"anchor":"sec-appendix-b","at":"b18615-18721","from_record":false,"lean":true,"lines":[162,165],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.string","origin":"ai","part":0,"phrase":"2-7-p105-07","plain":"String literals use doubled quotation marks from version 2.5","record":null,"relation":"defines","role":"definition","rows":[{"end_line":165,"exact_lines":false,"fidelity":"same","fidelity_note":"Using the appendix’s byte-based character ranges, the formal definition permits whitespace and printable contents between double quotes, with every interior quote doubled. This matches the displayed lexical rule.","fidelity_source":"ai","line":162,"lines":[162,165],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.string","note":"","plain":"String literals use doubled quotation marks from version 2.5","relation":"defines","annotation":"The outer two `lit` expressions match the delimiters. Each repetition inside them consumes a permitted byte other than a quote or two quotes together, so the pair counts as one unit of the interior."},{"end_line":174,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition replaces each doubled quote in the contents by one quote and leaves every other byte unchanged. This supplies the escape interpretation named in the production, separately from recognizing the literal’s delimiters.","fidelity_source":"ai","line":172,"lines":[172,174],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.unescape","note":"","plain":"Decode doubled quotation marks","relation":"defines","annotation":"The appendix names the escape `\"\"`. In Lean the two-quote branch consumes both bytes and copies one quote to the result. The surrounding delimiter quotes have already been removed when `Token.content` calls this function."}],"tone":4,"topic":"string-literals"},{"anchor":"sec-appendix-b","at":"b18723-18807","from_record":false,"lean":true,"lines":[271,273],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.simpleSymbol","origin":"ai","part":0,"phrase":"2-7-p105-08","plain":"Unquoted symbols exclude initial digits and reserved words","record":null,"relation":"defines","role":"definition","rows":[{"end_line":273,"exact_lines":false,"fidelity":"different","fidelity_note":"The selected production ends before its punctuation list and restrictions. The formal definition also specifies those characters, excludes an initial digit, and excludes reserved words; the complete source span is needed for an exact comparison.","fidelity_source":"ai","line":271,"lines":[271,273],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.simpleSymbol","note":"","plain":"Unquoted symbols exclude initial digits and reserved words","relation":"defines","annotation":"The rest of the production lists the punctuation and excludes a digit at the start and a reserved word as the complete spelling. Lean first forms the nonempty sequence with `plus`, then applies those two exclusions."},{"end_line":262,"exact_lines":false,"fidelity":"different","fidelity_note":"The quotation stops before the punctuation characters themselves. The formal definition gives their precise set, so the following lines of the production should be included.","fidelity_source":"ai","line":262,"lines":[262,262],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.symbolPunctuation","note":"","plain":"Punctuation permitted in simple symbols","relation":"defines","annotation":"The characters listed in the continuation fill the literal passed to `oneOf`. Any one of them may occur within a candidate simple symbol, subject to the rule for the complete name."}],"tone":2,"topic":"symbols-keywords"},{"anchor":"sec-appendix-b","at":"b18809-18970","from_record":false,"lean":true,"lines":[281,282],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.quotedSymbol","origin":"ai","part":0,"phrase":"2-7-p105-09","plain":"Quoted symbols forbid interior bars and backslashes","record":null,"relation":"defines","role":"definition","rows":[{"end_line":282,"exact_lines":false,"fidelity":"same","fidelity_note":"The formal definition is the second alternative: a vertical bar, then whitespace and printable characters other than a vertical bar or backslash, then a vertical bar. Its printable characters are the byte ranges Appendix B prints for that category.","fidelity_source":"ai","line":281,"lines":[281,282],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.quotedSymbol","note":"","plain":"Quoted symbols forbid interior bars and backslashes","relation":"defines","annotation":"The second alternative is the bar-delimited one. `quotedSymbol` matches an empty interior or a sequence of white space and printable bytes after removing the two forbidden interior characters, the bar and backslash."},{"end_line":273,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition is the first alternative only, a simple symbol; the quoted alternative is a separate definition. Together the two give the production.","fidelity_source":"ai","line":271,"lines":[271,273],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.simpleSymbol","note":"","plain":"Unquoted symbols exclude initial digits and reserved words","relation":"defines","annotation":"The first alternative calls for a simple symbol, whose spelling is checked against `simpleSymbol` in the selected version. For example, `abc` uses this regular expression and `|abc|` uses the bar-delimited expression."}],"tone":2,"topic":"symbols-keywords"},{"anchor":"sec-appendix-b","at":"b18972-19013","from_record":false,"lean":true,"lines":[294,294],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.keyword","origin":"ai","part":0,"phrase":"2-7-p105-10","plain":"Colon-prefixed attribute, option names","record":null,"relation":"defines","role":"definition","rows":[{"end_line":294,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper specifies a colon followed by a simple symbol; the formal definition also permits an initial digit or a reserved word after the colon, such as :56 or :let. This follows the older keyword rule and the paper’s own :56 example, rather than the displayed production literally.","fidelity_source":"ai","line":294,"lines":[294,294],"module":"BSmtLibSpec.Lexicon","name":"BSmtLibSpec.Lexicon.keyword","note":"","plain":"Colon-prefixed attribute, option names","relation":"defines","annotation":"The appendix refers to the entire simple-symbol rule after the colon. Lean instead calls for a nonempty letter, digit or punctuation sequence. It therefore admits `:56` (printed under Keywords in Section 3.1) and `:let`, following the older rule documented beside `keyword`.","annotation_references":[{"start":196,"end":207,"key":"section:3.1"}]}],"tone":2,"topic":"symbols-keywords"},{"anchor":"sec-appendix-b","at":"b19015-19084","from_record":false,"lean":true,"lines":[445,447],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Pattern.Valid","origin":"ai","part":0,"phrase":"2-7-p106-08","plain":"Constructor patterns need at least one valid argument","record":null,"relation":"defines","role":"definition","rows":[{"end_line":447,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper gives the complete pattern production; the formal definition requires a nonempty argument list for a constructor pattern and checks wildcard availability. Parentheses and the distinction between a single symbol and a constructor pattern are defined separately.","fidelity_source":"ai","line":445,"lines":[445,447],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Pattern.Valid","note":"","plain":"Constructor patterns need at least one valid argument","relation":"defines","annotation":"Compare the plus in the appendix with `arguments ≠ []` in the constructor branch. The remaining test checks each argument in the selected version, including whether a wildcard is available."},{"end_line":438,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines whole patterns; the formal definition only restricts the symbol-or-wildcard component, requiring version 2.7 for a wildcard. It says nothing about constructor patterns or their argument lists.","fidelity_source":"ai","line":436,"lines":[436,438],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SymbolOrWildcard.Valid","note":"","plain":"Match wildcards from version 2.7","relation":"defines","annotation":"The metavariable `symbol_` marks a position that can hold a wildcard. `Valid` accepts the symbol case unconditionally and the wildcard case from 2.7 onward."},{"end_line":137,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper requires at least one argument in a parenthesized constructor pattern; the formal definition also allows an empty argument list. A separate grammatical condition excludes that extra case.","fidelity_source":"ai","line":135,"lines":[135,137],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.Pattern","note":"","plain":"Single or constructor match patterns","relation":"defines","annotation":"The appendix's two alternatives correspond to `.single` and `.constructor`. The constructor's argument field is an ordinary list, with the plus in the appendix enforced by the separate grammar predicate."},{"end_line":128,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper defines both single-symbol patterns and constructor patterns; the formal definition supplies only a symbol or wildcard, the component used inside those patterns.","fidelity_source":"ai","line":126,"lines":[126,128],"module":"BSmtLibSpec.Grammar.Tree","name":"BSmtLibSpec.Grammar.Tree.SymbolOrWildcard","note":"","plain":"Named symbols or match wildcards","relation":"defines","annotation":"A bare pattern or a constructor argument can contain a value of this type. Its two alternatives are a named symbol and a wildcard, which is why the constructor arguments in this representation are flat."},{"end_line":160,"exact_lines":false,"fidelity":"different","fidelity_note":"The formal definition writes the two pattern forms, but can also write a parenthesized constructor without arguments. The paper’s plus sign excludes that case, which is ruled out only by a separate grammatical condition.","fidelity_source":"ai","line":157,"lines":[157,160],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.Pattern.tokens","note":"","plain":"Writing a flat match pattern","relation":"defines","annotation":"The single case emits one token and the constructor case writes the head and argument tokens inside parentheses. `Pattern.Valid` rules out a constructor spelling with only the head."},{"end_line":150,"exact_lines":false,"fidelity":"different","fidelity_note":"The paper specifies complete patterns; the formal definition emits just a symbol or an underscore. This explains one pattern component rather than the whole production.","fidelity_source":"ai","line":148,"lines":[148,150],"module":"BSmtLibSpec.Grammar.Syntax","name":"BSmtLibSpec.Grammar.Tree.SymbolOrWildcard.token","note":"","plain":"Writing a symbol or wildcard","relation":"defines","annotation":"Each occurrence of `symbol_` in the production contributes one token, either the supplied symbol or the reserved `_`. The outer pattern branch decides whether that token stands alone or occurs among constructor arguments."}],"tone":5,"topic":"pattern-matching"}],"topics":[{"dark":"oklch(0.613 0.200 14.4)","description":"Source files are divided into lexical tokens, with whitespace and comments separating them.","family":"source-text","id":"source-text-tokenization","light":"oklch(0.433 0.173 14.4)","name":"Source text and tokenization","part":0,"tone":0},{"dark":"oklch(0.737 0.160 21.6)","description":"The lexical rules distinguish whitespace, printable characters, digits, and ASCII letters.","family":"source-text","id":"character-classes","light":"oklch(0.557 0.181 21.6)","name":"Character classes","part":0,"tone":1},{"dark":"oklch(0.516 0.122 58.7)","description":"Symbols, keywords, and reserved words supply the names and fixed vocabulary of the language.","family":"lexical-tokens","id":"symbols-keywords","light":"oklch(0.336 0.080 58.7)","name":"Symbols and reserved words","part":0,"tone":2},{"dark":"oklch(0.640 0.142 65.9)","description":"Numerals, decimals, hexadecimal literals, and binary literals each have a prescribed spelling.","family":"lexical-tokens","id":"numeric-literals","light":"oklch(0.460 0.102 65.9)","name":"Numeric literals","part":0,"tone":3},{"dark":"oklch(0.764 0.162 73.1)","description":"Double quotes delimit strings, and doubling an interior quote gives the language’s single lexical escape.","family":"lexical-tokens","id":"string-literals","light":"oklch(0.584 0.124 73.1)","name":"String literals","part":0,"tone":4},{"dark":"oklch(0.561 0.117 102.7)","description":"Flat constructor patterns, variable patterns, and wildcards describe the cases of a match expression.","family":"terms","id":"pattern-matching","light":"oklch(0.381 0.080 102.7)","name":"Pattern matching","part":0,"tone":5},{"dark":"oklch(0.685 0.149 109.9)","description":"Terms combine constants, identifiers, applications, abstractions, quantifiers, local definitions, matches, and annotations.","family":"terms","id":"term-grammar","light":"oklch(0.505 0.110 109.9)","name":"Term grammar","part":0,"tone":6},{"dark":"oklch(0.809 0.171 117.1)","description":"Local variable declarations associate names with terms or sorts and determine the scope of their occurrences.","family":"terms","id":"variables-scope","light":"oklch(0.629 0.145 117.1)","name":"Variables and scope","part":0,"tone":7},{"dark":"oklch(0.673 0.161 156.7)","description":"Attributes attach additional information to a term without changing its logical meaning.","family":"attributes","id":"term-annotations","light":"oklch(0.493 0.118 156.7)","name":"Term annotations","part":0,"tone":8},{"dark":"oklch(0.797 0.170 163.9)","description":"An attribute consists of a keyword with an optional special constant, symbol, or parenthesized list as its value.","family":"attributes","id":"attribute-syntax","light":"oklch(0.617 0.131 163.9)","name":"Attribute syntax","part":0,"tone":9},{"dark":"oklch(0.556 0.097 214.0)","description":"Command productions specify their arguments, including option attributes and information flags.","family":"commands-scripts","id":"command-syntax-options","light":"oklch(0.376 0.066 214.0)","name":"Command syntax and options","part":0,"tone":10},{"dark":"oklch(0.680 0.124 221.2)","description":"Scripts sequence commands that control a solver and request its responses.","family":"commands-scripts","id":"scripts-interaction","light":"oklch(0.500 0.091 221.2)","name":"Scripts and solver interaction","part":0,"tone":11},{"dark":"oklch(0.804 0.126 228.4)","description":"Sort, datatype, constructor, selector, and function declarations describe the components introduced by commands.","family":"commands-scripts","id":"declarations-definitions","light":"oklch(0.624 0.122 228.4)","name":"Declarations and definitions","part":0,"tone":12},{"dark":"oklch(0.770 0.117 273.1)","description":"Special constants and other atoms combine into possibly empty parenthesized S-expressions.","family":"sexpressions","id":"sexpressions-constants","light":"oklch(0.590 0.190 273.1)","name":"S-expressions and constants","part":0,"tone":13},{"dark":"oklch(0.613 0.200 317.5)","description":"Identifiers are symbols, optionally qualified by one or more numeral or symbol indices.","family":"identifiers-sorts","id":"indexed-identifiers","light":"oklch(0.433 0.200 317.5)","name":"Indexed identifiers","part":0,"tone":14},{"dark":"oklch(0.737 0.181 324.7)","description":"Sort expressions are identifiers, optionally applied to one or more sort expressions.","family":"identifiers-sorts","id":"sort-expressions","light":"oklch(0.557 0.181 324.7)","name":"Sort expressions","part":0,"tone":15}]}