# Checkpoint 1 language ```text document ::= definition+ definition ::= "define" NAME "accepting" "(" parameters? ")" "returning" TYPE "." "Its result is" expression "." parameters ::= parameter ("," parameter)* parameter ::= NAME "as" TYPE TYPE ::= "integer" | "boolean" expression ::= INTEGER | BOOLEAN | NAME | conditional | application conditional ::= "if" expression "then" expression "otherwise" expression application ::= "the result of" NAME "with" "(" arguments? ")" arguments ::= expression ("," expression)* BOOLEAN ::= "true" | "false" ``` NAME is backtick-delimited and matches `[A-Za-z][A-Za-z0-9]*( [A-Za-z][A-Za-z0-9]*)*`. Names are case-sensitive; internal spaces are significant. No newlines or escapes are allowed in names. INTEGER is an optional minus followed by decimal digits, with value in signed 64-bit range. Outside names, ASCII spaces, tabs, and newlines are interchangeable separators. Punctuation delimits tokens; words and integers must have token boundaries. All input must be consumed. There are no comments, synonyms, implicit arguments, overloads, or additional expression forms. Definitions occupy a global namespace; parameters have separate scopes per definition. A bare NAME refers only to a parameter; a call refers only to a global definition. Forward references are allowed. Duplicate definitions or parameters, missing references, wrong arity or argument types, nonboolean conditions, different branch types, and bodies differing from declared result types are errors. Every definition and both conditional branches are checked before execution. Every call-graph cycle, even an unreachable one, is rejected. Execution evaluates arguments once each, left to right, and only the selected conditional branch. The result is a typed integer or boolean. Names confer no behavior: bodies alone define meaning. Arithmetic, comparisons, collections, mutation, loops, recursion, generics, effects, optimization, code generation, and grammar extensions are outside this checkpoint. The pipeline is parsing → resolution/type checking → typed representation → interpretation. Resolved parameter and definition indices are stable within a compiled document. The five typed expression constructors are integer, boolean, parameter, conditional, and call. Diagnostics expose a stable category, message, and 1-based line and column (byte columns), plus a 0-based byte offset. Entry/argument errors use the declaration location when available, otherwise the start of the document. Categories are `syntax`, `integer_range`, `duplicate_definition`, `duplicate_parameter`, `unknown_parameter`, `unknown_definition`, `arity`, `type`, `cycle`, `entry`, and `argument`. Compilation returns the first error deterministically. CLI arguments use explicit `integer:DECIMAL` or `boolean:true|false` tokens. Integers never pass through floating point. Entry names are supplied without backticks. Result output uses the same typed token syntax.