Formal Model
The MultiState framework extends traditional state machine theory with capabilities for multiple simultaneous active states, dynamic transitions, and occlusion semantics.
Core Definition
The system is formally defined as a tuple:
Where:
- S: finite set of states
- T ⊆ S × P(S) × P(S): transition relation
- G ⊆ P(S): set of state groups
- ω: S × S × ℝ → [0,1]: occlusion function
- T_d: ℝ × P(S) → P(T): dynamic transition generator
States
Definition & Properties
A state represents a distinguishable system configuration with:
- Unique identity
- Associated UI elements/components
- Boolean blocking indicator
- Optional group membership
Active States
The system maintains active states . Unlike traditional FSMs where , MultiState allows .
Transitions
Definition
A transition consists of:
- F ⊆ S: "from" states (preconditions)
- A ⊆ S: states to activate
- E ⊆ S: states to exit
Multi-State Activation
Innovation: , enabling atomic activation of multiple states simultaneously.
Execution Enablement
A transition is enabled when:
State Groups
Definition & Constraints
A group activates/deactivates atomically. Group constraint ensures: for any transition and group , all states in transition together:
Occlusion Function
The function models state visibility, where:
- : covering state
- : hidden state
- : occlusion probability
Types
- Modal (): Complete occlusion
- Spatial (): Partial overlap
- Logical (): Semantic exclusion
Dynamic Transitions
Generated at runtime:
Types
- Reveal Transitions: Generated when occluding state closes
- Self-Transitions: Validate current state without change
- Discovery Transitions: Found through runtime exploration
Reveal Generation
When state covering is removed:
Phased Execution Model
Execution Sequence
VALIDATE → OUTGOING → ACTIVATE → INCOMING → EXIT
Phase Definitions
-
VALIDATE: Check preconditions
-
OUTGOING: Execute exit actions
-
ACTIVATE: Add states (infallible)
-
INCOMING: Execute entry actions
-
EXIT: Remove exited states
Rollback Semantics
If INCOMING fails, rollback restores:
Multi-Target Pathfinding
Problem Definition
Given current states and target states , find path such that:
Optimality
Optimal path:
Complexity
Search space: , where is state count and is target count.
Theorems
Theorem 1 (Activation Atomicity): State activation is atomic and infallible; it's a pure set operation that cannot fail.
Theorem 2 (Group Atomicity): States in a group are always activated/deactivated together per group constraints.
Theorem 3 (Multi-Target Optimality): The algorithm explores all reachable state combinations using dynamic programming with memoization, guaranteeing optimal solutions.
Theorem 4 (Occlusion Transitivity): If occludes and occludes , then occludes .
Theorem 5 (Safe Rollback): Failed incoming transitions preserve system state; rollback restores original state and skips EXIT phase.
Comparison with Existing Models
| Property | MultiState | FSM | Statecharts | Petri Nets |
|---|---|---|---|---|
| States | P(S) | S | P(S) | Markings |
| Transitions | (F,A,E) | (s₁,s₂) | Complex | Token flow |
| Concurrency | Native | None | Orthogonal | Token-based |
| Hierarchy | Groups | None | Nested | Subnets |
| Dynamics | T_d function | Static | Static | Static |
Formal Verification
Verification completed through:
- Mathematical proofs for all core properties
- Property-based testing achieving 100% theorem coverage
- Bounded model checking for safety properties