//////////////////////////////////////////////////////////////////////////////
// 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-product]]
== Event-based synchronous product

indexterm:[event-based synchronous product]
indexterm:[tools,event-based synchronous product]
indexterm:[event-based synthesis toolset,event-based synchronous product]
indexterm:[event-based synchronous product,event-based synthesis toolset]
The event-based synchronous product takes one or more plant or requirement automata, and computes the synchronous product.
Synchronous product means events on edges can only be taken if all automata with that event in their alphabet can take an edge with the same event at that time.
This tool essentially computes the <<tools-cifsim-traces-state-space,state space>>.

The tool takes a CIF file containing at least one automaton, and produces a new CIF file with the product of the automata.
In addition, the <<tools-eventbased-supported-specifications,general event-based restrictions>> apply as well.

If the <<tools-eventbased-kinds,kinds>> of the source automata are all the same, the resulting product automaton is of that kinds as well.
Otherwise, the product automaton has unknown kind.

indexterm:[event-based synchronous product,start]

=== Starting the synchronous product 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 synchronous product...].

* 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 synchronous product...].

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

indexterm:[event-based synchronous product,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 `+_product.cif+` file extension is added.
The `product` part of the default extension depends on the _Result name_ option.

* _Result name_: The name to use for the product automaton.
If not specified, defaults to `product`.
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.
