Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Manifold DSL

The Manifold DSL is the declarative source language for a Manifold model. A source file can declare condition vocabularies, entities, permitted mutations, and tasks that describe desired state.

The current pipeline has four visible stages:

  1. The lexer recognizes tokens and retains source spans.
  2. The parser builds a syntax tree and expression arena.
  3. The resolver decodes identities, resolves references and roles, and builds a syntax-independent model.
  4. Validation rejects duplicate identities, invalid component paths, unsupported state values, incompatible capacities, and undeclared mutation role values.

The manifold-dsl check command runs these stages and renders source diagnostics. Engine materialization and planning are not implemented by this pipeline yet.

Declarations

A source file accepts four top-level declarations:

DeclarationPurposeIdentity form
conditionDeclares a named set of condition variants.Identifier
entityDeclares an identity and its current components.Quoted string
mutationDeclares roles, requirements, resource uses, and changes.Quoted string
taskDeclares predicates for a desired state.Quoted string

The resolver collects declarations before it resolves their bodies. A local entity can therefore refer to an entity declared later in the same file.

Read Language structure for lexical rules and block syntax. The complete example is the same representative source checked by the DSL test suite and the documentation recipe.