| Crates.io | merc_lts |
| lib.rs | merc_lts |
| version | 1.1.0 |
| created_at | 2025-12-27 22:40:55.101913+00 |
| updated_at | 2025-12-28 16:02:43.997276+00 |
| description | Implements labelled transition systems for various I/O formats using a general LTS trait. |
| homepage | https://mercorg.github.io/merc/ |
| repository | https://github.com/MERCorg/merc |
| max_upload_size | |
| id | 2007960 |
| size | 96,929 |
This crate contains functionality for manipulating labelled transition systems,
including writing and reading LTSs from files. A labelled transition system is a
tuple (s0, S, Act, T) where s0 is the initial state, S is a set of states,
Act is a set of action labels, and T is a set of transitions T ⊆ S × Act × S.
The main concept of this crate is the central LTS trait that encapsulates
labelled transition systems with generic action label types. This trait uses
strong types for the various indices used (states, actions, etc) to avoid
mixing them up at compile time. This is implemented using the TagIndex type of
the merc_utilities crate.
The crate supports reading and writing LTSs in both the mCRL2 binary
.lts format and the
AUTomaton .aut (also called ALDEBARAN)
format. For the mCRL2 format the action label is a MultiAction to account for
multi-actions. Furthermore, the crate also contains an LtsBuilder that can be
used to generate LTSs programmatically. Internally, the crate also uses
compressed vectors to store transitions memory efficiently.
use merc_lts::LTS;
use merc_lts::LtsBuilder;
use merc_lts::StateIndex;
let mut builder = LtsBuilder::new(vec!["a".to_string(), "b".to_string()], vec![]);
builder.add_transition(StateIndex::new(0), "a", StateIndex::new(1));
builder.add_transition(StateIndex::new(1), "b", StateIndex::new(1));
let lts = builder.finish(StateIndex::new(0));
assert_eq!(lts.num_of_states(), 2);
assert_eq!(lts.num_of_transitions(), 2);
The central LTS trait allows one to implement various algorithms on LTSs in a
generic way.
Removed add_transition_index from LtsBuilder and LtsBuilderFast since it
is not correct. These builders change the indices of labels internally to
accomodate for the internal actions.
This crate contains no unsafe code.
We do not maintain an official minimum supported rust version (MSRV), and it may be upgraded at any time when necessary.
All MERC crates are licensed under the BSL-1.0 license. See the LICENSE file in the repository root for more information.