Logic system

See how formulas, lookups, parameter resolution, state selection, and injection turn authored blocks into deterministic behavior.

What to keep in mind

  • Logic combines parameters, variables, formulas, lookup tables, and injection.
  • Variable resolution follows dependencies rather than authoring order.
  • Parameter values resolve before the rest of block logic executes.
  • State selection chooses which authored behavior is active for a given evaluation.
  • Lookups and injection let one evaluated context drive both geometry and structured outputs.

Logic defines relationships inside blocks

Logic defines how a block responds to inputs and produces consistent results.

Logic defines relationships. The logic system combines parameters, variables, formulas, lookup tables, state selection, and resolved-value usage so block behavior responds deterministically to inputs.

Parameters and variables serve different roles. Parameters are the authored or inherited inputs to an instance. Variables are the derived values computed from those inputs. Parameters tell the system what was supplied. Variables express what the system concludes from that data.

What logic controls is broader than formulas alone. Logic can affect geometry, state choice, directives, nested value propagation, and the values that later reach outputs.

Why logic matters in real models

  • It centralizes system behavior so repeated instances stay consistent.
  • It removes the need to hand-maintain many derived dimensions, labels, and selections.
  • It becomes essential when one input must coordinate many downstream consequences.
  • It lets a model stay expressive without becoming a fragile sequence of manual overrides.

In practice, logic is what turns a static block into a responsive system definition. A control transformer, for example, can size itself from load and voltage rules instead of relying on manual coordination.

Logic sits between inputs and execution

  • Authored in Blocks: block definitions define behavior and hold the logic surface.
  • Defined here: logic defines relationships between parameters, variables, states, and resolved values.
  • Executed in Evaluation: evaluation executes those relationships in a specific instance context.
  • Used through Composition: child systems consume values produced by parent logic.
  • Surfaced in Outputs: outputs are derived from evaluated instances using values logic helped determine.

Evaluation is dependency-based, not author-order based

Variables And Formulas

Variables are defined by formulas and evaluated in block scope. Formulas can reference parameters, variables, and supported helper functions. They are used for derived dimensions, calculated labels, selection logic, and other computed behavior.

Variable resolution is dependency-based rather than sequential. The engine resolves references between variables, evaluates what each variable depends on, and detects circular dependency cases. A variable does not have to appear earlier in the authored list to be usable.

This matters because logic in LogiDraft describes relationships, not a line-by-line script. A formula is not strong because it appears first. It is strong because the system can resolve what it depends on.

Definition is separate from execution

Logic defines relationships. Evaluation executes those relationships.

This distinction matters because logic belongs to the authored definition, while evaluation belongs to the runtime instance. A block can define the same rules once and then have those rules executed many times by different block references with different inputs.

Parameters resolve before broader block behavior

Parameter values on a block reference are not limited to raw literals. They can resolve from direct values, inherited parent values, direct token references, or evaluated expressions. When a parameter is missing on a nested reference, the engine can inherit a same-named value from parent scope before falling back to the parameter default.

This parameter resolution happens before block logic executes, so variables and state selection operate on resolved inputs rather than raw authored values. Parameter dependencies are also resolved by relationship, not by authoring order.

A selection formula can choose the active state for a given evaluation, while authored defaults or instance-level state choices provide fallback when needed. The active state controls which geometry and behaviors are used for that instance.

Lookup tables provide data-driven logic inside blocks. Instead of encoding every branch as nested formulas, a block can query table data using exact-match or numeric-range lookup behavior.

Resolved values must still be applied

Injection is not the same layer as logic itself. Logic determines values and relationships. Injection is the mechanism that applies those resolved values into text, properties, transforms, directives, and output fields.

In other words, logic determines what a value should be. Injection determines where that resolved value gets used. This distinction becomes especially important in Evaluation, where injection occurs during realization rather than during pure value resolution.

Logic defines behavior, not sequence

A useful mental model is to think of LogiDraft logic as a dependency graph rather than a script. The system is solving for the values required to realize a block, not reading formulas top to bottom as instructions.

That is why parameters, variables, state selection, and lookups can remain expressive without becoming brittle. The engine focuses on what must be true for the block to resolve correctly.

Circular dependencies and fallbacks keep resolution predictable

Variables and parameter expressions evaluate defensively. When formulas are missing, invalid, or circular, the engine falls back to safe default values so the system can continue resolving in a predictable way instead of leaving behavior undefined.

Circular dependency handling is important because logic often grows organically. If variable A depends on variable B and variable B depends back on variable A, the system must break that loop safely rather than produce unstable or order-dependent results.

Ways to keep logic maintainable

  • Use variables to centralize derived values that multiple parts of a block need.
  • Use lookup tables when a rule is really maintained data, not a long chain of nested conditions.
  • Use parameters for input variation and variables for derived system behavior.

A control transformer is a concrete example. Load and voltage enter as parameters. Logic derives the required transformer sizing, protection values, and labels. Evaluation later executes those relationships and realizes geometry and outputs from them.

To see where these rules run, continue to Evaluation. For exact function signatures and lookup syntax, use Reference. To see these ideas in a working system, use Help or open the Control Power Panel example.

Keep exploring

Evaluation

Learn the execution sequence that turns block definitions into realized results.

Help

Follow a guided example to watch these ideas update in a working LogiDraft model.

Reference

Use the reference when you want exact syntax, commands, function signatures, and field names.

Control Power Panel Example

See formulas, state logic, and value propagation resolve from the same authored rules.