Automata.Visualization 1.1.1

dotnet add package Automata.Visualization --version 1.1.1                
NuGet\Install-Package Automata.Visualization -Version 1.1.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Automata.Visualization" Version="1.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Automata.Visualization --version 1.1.1                
#r "nuget: Automata.Visualization, 1.1.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Automata.Visualization as a Cake Addin
#addin nuget:?package=Automata.Visualization&version=1.1.1

// Install Automata.Visualization as a Cake Tool
#tool nuget:?package=Automata.Visualization&version=1.1.1                

🔂 Automata: A Lightweight Library for Finite-State Automata

NuGet Version Automata.Core - Core library (zero-dependency library, optimal if you do not need visualization).

NuGet Version Automata.Visualization - Full library that also includes visualization and rendering of automata.

Documentation Documentation


The Automata library provides functionality for working with finite-state automata. The library is highly optimized and ideal for very large automata.

⭐ Example Features:

  • Create automata from regular expressions, sequences, or other data.
  • Convert NFAs to DFAs.
  • Minimize Automata to their optimal minimal representation.
  • Provides Alang (Automata Language) as an option for defining and creating automata.
  • Perform many operations on automata (union, intersection, difference, complement, etc.).
  • Visualize automata as graphs (Automata.Visualization).

Example image

🔨 Automata.Core - Core Library

The core library all provides essential tools for finite-state automata operations. It offers a fast, lightweight and clean solution without visualization features.

💡 C# Example: Create and Operate on Automata

The following example utilizes regular expressions written in Alang. Alang (Automata Language) is a language for defining automata using regular operations. Read more about Alang in the Automata documentation.

// Compile a regex to a FSA (all sequences of {a, b, c} where any 'a' must be followed by 'b' or 'c')
var fsa = AlangRegex.Compile("(a? (b | c) )+");

// Compile two other automata
var test1 = AlangRegex.Compile("a b b c b");
var test2 = AlangRegex.Compile("a b a a b");

// Test the language overlap of the FSA with the two test regexes
Console.WriteLine(fsa.Overlaps(test1)); //output: true
Console.WriteLine(fsa.Overlaps(test2)); //output: false

🖼️ Automata.Visualization: Automata.Core + Visualization

The Automata.Visualization library extends the core Automata functionality with visualization capabilities, utilizing MSAGL (Microsoft Automatic Graph Library) for layout.

🔑 Key Features:

  • All Automata.Core functionality.
  • Visualize automata as graphs.

💡 C# Full Example Program: Create an Automaton and Display it from a Console Application

var fsa = AlangRegex.Compile("(a? (b | c) )+");  // Create an FSA from a regex

Console.WriteLine("Creating a minimal FSA and displaying it."); // Write some info to the console

Graph graph = fsa.CreateGraph(displayStateIDs: true); // Create a graph object (FSA with layout) 

GraphView graphView = GraphView.OpenNew(graph); // Open a new non-modal window that displays the graph

Console.WriteLine("FSA is displayed."); // Write some info to the console

📘 Automata Documentation.


📦 NuGet Package Installation

Install the packages via the .NET CLI or Package Manager in Visual Studio.

Automata.Core

dotnet add package Automata.Core

Automata.Visualization (Includes Automata.Core)

dotnet add package Automata.Visualization

💻 Target Framework Compatibility

  • Automata.Core: .NET 9.0 and later
  • Automata.Visualization: .NET 9.0 and later
    • Requires Windows compile target <TargetFramework>net9.0-windows</TargetFramework>

🔗 Dependencies

  • Automata.Core:

    • None
  • Automata.Visualization:

📜 License

This project is licensed under the MIT License.

👌 Credits

This repository uses the following libraries and tools:

Product Compatible and additional computed target framework versions.
.NET net9.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 33 1/19/2025
1.1.0 30 1/18/2025
1.0.4 92 12/31/2024
1.0.3 88 12/26/2024
1.0.2 71 12/23/2024
1.0.1 87 12/22/2024
1.0.0 90 12/17/2024

New version with many new features