File size: 1,238 Bytes
e1ced61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""Typed DSL AST, canonicalization, and type system (``docs/02`` §7, ``docs/07`` §4).

P2 builds the shared program machinery consumed by the executor (P3) and the C2
model compiler (P4):

  * :mod:`ast` — immutable typed AST + :class:`Program` envelope conforming to
    ``schemas/compiled_program.schema.json`` ``$defs/astNode``.
  * :mod:`canonicalize` — the §7.2 six-step canonicalization + canonical hash.
  * :mod:`typecheck` — dangling-selector / type-mismatch rejection and the
    COUNT/EXIST (set) vs scalar selector cardinality distinction.
  * :mod:`plotdsl` / :mod:`geometrydsl` / :mod:`tabledsl` — per-DSL operator
    signature tables and the C1 source compilers (tabledsl grammar only).

P2 produces a typed :class:`~explicit_learning.dsl.ast.Program` *structurally*
(no execution, no model calls, no reproduction gates — those are P3/P4).
"""

from __future__ import annotations

from .ast import (
    AstNode,
    CompileStatus,
    Dsl,
    Program,
    ProgramError,
    ast_node_from_dict,
    lit,
    ref,
    validate_ast_node,
)

__all__ = [
    "AstNode",
    "CompileStatus",
    "Dsl",
    "Program",
    "ProgramError",
    "ast_node_from_dict",
    "lit",
    "ref",
    "validate_ast_node",
]