Automata.Core
1.1.1
dotnet add package Automata.Core --version 1.1.1
NuGet\Install-Package Automata.Core -Version 1.1.1
<PackageReference Include="Automata.Core" Version="1.1.1" />
paket add Automata.Core --version 1.1.1
#r "nuget: Automata.Core, 1.1.1"
// Install Automata.Core as a Cake Addin #addin nuget:?package=Automata.Core&version=1.1.1 // Install Automata.Core as a Cake Tool #tool nuget:?package=Automata.Core&version=1.1.1
🔂 Automata: A Lightweight Library for Finite-State Automata
Automata.Core - Core library (zero-dependency library, optimal if you do not need visualization).
Automata.Visualization - Full library that also includes visualization and rendering of automata.
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).
🔨 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>
- Requires Windows compile target
🔗 Dependencies
Automata.Core:
- None
Automata.Visualization:
-
These dependencies will be automatically installed when you install
Automata.Visualization
via NuGet.
📜 License
This project is licensed under the MIT License.
👌 Credits
This repository uses the following libraries and tools:
- FSM layout and rendering (in project Automata.Visualization): Microsoft.MSAGL
- Docs generation: docfx
- Docs template SingulinkFX
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Automata.Core:
Package | Downloads |
---|---|
Automata.Visualization
A library for layout and visualization of Automata. Includes core library Automata.Core. |
GitHub repositories
This package is not used by any popular GitHub repositories.
New version with many new features