//////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2010, 2026 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available
// under the terms of the MIT License which is available at
// https://opensource.org/licenses/MIT
//
// SPDX-License-Identifier: MIT
//////////////////////////////////////////////////////////////////////////////

include::../_part_attributes.asciidoc[]

:leveloffset: -2

[[tools-eventbased-chapter-nfa-to-dfa]]
== Event-based NFA to DFA automaton conversion

indexterm:[event-based NFA to DFA automaton conversion]
indexterm:[tools,event-based NFA to DFA automaton conversion]
indexterm:[event-based synthesis toolset,event-based NFA to DFA automaton conversion]
indexterm:[event-based NFA to DFA automaton conversion,event-based synthesis toolset]
The event-based NFA to DFA automaton conversion takes a non-deterministic automaton and produces a deterministic automaton with the same language.
It thus determinizes the NFA to a DFA.

The tool takes a CIF file containing one automaton.
In addition, the <<tools-eventbased-supported-specifications,general event-based restrictions>> apply as well.

The output is a CIF file containing a deterministic automaton that is language equivalent with the input automaton.
The resulting automaton has the same supervisory kind as the input automaton.
The resulting DFA is not necessarily link:https://en.wikipedia.org/wiki/DFA_minimization[minimal], but can be minimized using the <<tools-eventbased-chapter-dfa-minimization,DFA minimizer>>.

indexterm:[event-based NFA to DFA automaton conversion,start]

=== Starting the NFA to DFA automaton conversion tool

The tool can be started in the following ways:

* In Eclipse, right click a `.cif` or `.cifx` file in the _Project Explorer_ tab or _Package Explorer_ tab and choose menu:CIF synthesis tools[Event-based synthesis tools > Apply NFA to DFA automaton conversion...].

* In Eclipse, right click an open text editor for a `.cif` or `.cifx` file and choose menu:CIF synthesis tools[Event-based synthesis tools > Apply NFA to DFA automaton conversion...].

* Use the `cifnfadfa` tool in a ToolDef script.
See the <<tools-scripting-chapter-intro,scripting documentation>> and <<tools-scripting-chapter-tools,tools overview>> page for details.

* Use the `cifnfadfa` command line tool.

indexterm:[event-based NFA to DFA automaton conversion,options]

=== Options

Besides the general application options, this application has the following options:

* _Input file_: The absolute or relative local file system path to the input CIF specification.

* _Output file_: The absolute or relative local file system path to the output CIF specification.
If not specified, defaults to the input file path, where the `.cif` file extension is removed (if present), and a `+_dfa.cif+` file extension is added.
The `dfa` part of the default extension depends on the _Result name_ option.

* _Result name_: The name to use for the projected automaton.
If not specified, defaults to `dfa`.
Also affects the _Output file_ option.

* _Add state annotations_: Add <<lang-tut-annotations-state,state annotations>> to the locations of the automaton in the output CIF file.
This option is enabled by default.
If the output CIF file has an automaton with only a single non-initial location, then the location does not get a state annotation, regardless of whether the option is enabled or not.
