Query modes and scope
Documentation status: architecture — see Maturity and evidence.
The ask envelope supports three reasoning modes. Scope options are independent of the selected mode.
Modes
| Mode | Use it when |
|---|---|
homomorphic |
the desired answer already exists as a persisted conceptual structure; this is the default |
unifying |
several compatible conceptual descriptions must be merged into one canonical value |
resolving |
a goal must be proved through facts and Horn-style rules |
ask homomorphic .:#Person(p)[name='Ada'] return p;
ask unifying (.:#Pair(x, #right), .:#Pair(#left, y)) return (x, y);
ask resolving .:#reachable(#warehouseA, destination) return destination;
Homomorphic wildcard positions are unconstrained positions, not nil constraints. Unifying mode requires at least two operands and rejects constructor, arity or rigid-value conflicts. Resolving mode may produce multiple answers through alternative clauses and recursive/tabled resolution where supported.
Current implementation boundary
The current source review confirms grammar/command decoding for homomorphic, unifying and resolving, plus a tested Horn-resolution engine. Homomorphic and unifying ask execution have dedicated tests. The inspected direct ask resolving commit path still exposes an integration placeholder before Horn compilation/execution, so end-to-end ask resolving must not yet be treated as a certified public execution path. The syntax and reasoning model are documented here because they are part of the declarative guide and current architecture; verify the target Runtime generation before depending on direct resolving queries.
Scope options
instances/instances onlyinclude or restrict results to instances;types/types onlyinclude or restrict results to types;subtypes/subtypes onlytraverse the requested type and descendants;supertypes/supertypes onlytraverse the requested type and ancestors;maskedapplies the active masking/visibility policy.
ask homomorphic subtypes instances .:#Document(item)[title=title]
return (item, title);
Subtype and supertype traversal is a semantic choice. Do not enable it merely to compensate for an imprecise type declaration. Inherited traversal can change candidate selection and role mapping.
Selection rule
Choose the reasoning mode first, then add only the scope needed by the business question.