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
44
45
46
47
//! Schema algebra: `prune`, `minimize`/`normalize`, `subschema`, `extract`,
//! `lint`, `isomorphic`, `signature` -- ported from `~/dev/omnist/omnist/ops/`
//! (issue #12), one module per op (matching the Python layout, which is
//! already a reasonable structure per "architecture freedom").
//!
//! ## The `any` type
//!
//! [`crate::schema::FieldType`] has three kinds: `Scalar`, `Ref`, and `Any`
//! (issue #29). Every op in this family treats `Any` the same way the
//! Python reference's `AnyType` is treated in the corresponding op:
//! satisfiability treats it like a `Scalar` (always satisfiable, never
//! blocks a mandatory field); `local_signature`/minimize give it its own
//! target-blind shape key (`("any",)`); `subschema` treats `any` on the
//! superschema side as absorbing everything, and `any` only on the
//! subschema side as never compatible with a non-`any` target; `lint`'s
//! `any-field` check inventories every `Any`-typed field in the schema.
//!
//! ## Determinism
//!
//! Every op here produces a "canonical form" (a pruned/minimized schema, a
//! sorted lint report, a deterministic equivalence-class partition). None of
//! this module's code uses `std::collections::HashMap`/`HashSet` --
//! `indexmap`'s `IndexMap`/`IndexSet` everywhere an ordered structure is
//! needed, and an explicit `.sort()` everywhere the Python reference itself
//! sorts for canonical output (see `signature::local_signature`, `lint::lint`,
//! `minimize::normalize`). See `tests.rs` for the repeated-run determinism
//! proof and the `omnist-ts#56` ordering-regression tests (codepoint, not
//! locale, order; `prune`'s declaration-order environment reconstruction).
pub use extract;
pub use is_isomorphic;
pub use ;
pub use ;
pub use ;
pub use local_signature;
pub use ;