//////////////////////////////////////////////////////////////////////////////
// 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-projection]]
== Event-based automaton projection

indexterm:[event-based automaton projection]
indexterm:[tools,event-based automaton projection]
indexterm:[event-based synthesis toolset,event-based automaton projection]
indexterm:[event-based automaton projection,event-based synthesis toolset]
The event-based automaton projection takes an automaton and a subset of the events of its alphabet that should be preserved.
The other events of the alphabet are considered to be internal steps and get replaced by `epsilon` at the edges.
The algorithm produces a deterministic automaton with the subset as its alphabet that has the same language.

The tool takes a CIF file containing one automaton, and the names of the events that should be preserved.
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 with respect to the set of preserved events.
The resulting automaton has the same kind as the input automaton.
The resulting automaton is a DFA that it 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 automaton projection,start]

=== Starting the automaton projection 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 automaton projection...].

* 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 automaton projection...].

* Use the `cifproj` 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 `cifproj` command line tool.

indexterm:[event-based automaton projection,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.

* _Preserved events_: Comma and/or whitespace separated absolute names of events that should be preserved.

* _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 `+_projected.cif+` file extension is added.
The `projected` 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 `projected`.
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.
