Skip to content

Extend merc_lps with native exploration - #153

Open
mlaveaux wants to merge 14 commits into
MERCorg:mainfrom
mlaveaux:feature/lps
Open

mlaveaux wants to merge 14 commits into
MERCorg:mainfrom
mlaveaux:feature/lps

Conversation

@mlaveaux

Copy link
Copy Markdown
Collaborator

Overview

Ported several modules from the tools/mcrl2 workspace into the main workspace to allow it to operate on the LPSs defined there, for example control flow graphs. It would be nice to generalize them, but there are now two different aterm representations, the native one and the mCRL2 one that cannot be easily merged.

@mlaveaux mlaveaux self-assigned this Nov 10, 2026
Copilot AI balanced review requested due to automatic review settings November 10, 2026 19:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A missing workspace member, unresolved modules and imports, and an undefined forwarded feature block builds, while number-encoding detection also misclassifies machine-word specifications.

8 open issues
What changed in this PR

This PR begins moving LPS support from the mCRL2 tools workspace into the main workspace, using native ATerms to support exploration and control-flow analysis.

Changes:

  • Adds native LPS data structures, binary I/O, formatting, and control-flow exploration code.
  • Adds runtime rewriter selection and exposes supporting action, sort, and numeric APIs.
  • Updates workspace dependencies and semantic-version check exclusions.
File Description
crates/​transition_systems/​lts/​src/​multi_action.rs Types action-label arguments as sorts and adds an accessor.
crates/​transition_systems/​lts/​src/​lib.rs Exports action term types for LPS I/O.
crates/​rewriter/​sabre/​src/​rewriter.rs Adds runtime rewrite-engine selection.
crates/​rewriter/​data/​src/​lib.rs Exports additional sort predicates.
crates/​rewriter/​data/​src/​data_terms.rs Adds structured-sort detection and exposes sort predicates.
crates/​rewriter/​data/​src/​data_expression.rs Makes machine-number values publicly accessible.
crates/​language/​lps/​src/​lps_terms.rs Defines distribution and initializer terms for binary I/O.
crates/​language/​lps/​src/​linear_process.rs Defines native LPS structures and display implementations.
crates/​language/​lps/​src/​lib.rs Establishes the LPS crate’s public model and I/O API.
crates/​language/​lps/​src/​io_lps.rs Implements binary LPS reading and writing.
crates/​language/​lps/​src/​control_flow.rs Adds control-flow parameter and edge analysis.
crates/​language/​lps/​src/​cfg_lps.rs Adds a CFG-based exploration wrapper and pruning metrics.
crates/​language/​lps/​README.md Documents the native LPS model and binary I/O usage.
crates/​language/​lps/​Cargo.toml Defines the new crate’s dependencies and features.
crates/​language/​lowering/​src/​system_symbols.rs Adds the negative-integer constructor name and declaration test.
crates/​language/​lowering/​src/​number_encoding.rs Adds numeric-encoding detection and tests.
crates/​language/​lowering/​src/​lowering.rs Reuses the shared machine-word width and reorganizes helpers.
crates/​language/​lowering/​src/​lib.rs Exports numeric-encoding detection.
crates/​language/​lowering/​Cargo.toml Adds supporting dependencies and a test dependency.
crates/​core/​number/​src/​machine_word.rs Exposes the machine-word width and updates its uses.
crates/​core/​number/​src/​lib.rs Re-exports the machine-word width constant.
Cargo.toml Registers the native LPS library and tool workspace entries.
Cargo.lock Records native LPS packages and dependency updates.
.github/​workflows/​semver.yml Excludes the new LPS packages from semantic-version checks.

Review effort: Balanced

Comment thread Cargo.toml

"crates/xtask",

"tools/lps",
Comment on lines +31 to +32
if matches!(term.arg(0).get_head_symbol().name(), C1 | C_DUB | C_NAT) {
return NumberEncoding::Binary;
metrics = ["merc_explore/metrics", "merc_symbolic/metrics"]

# Derives the `clap::ValueEnum` trait.
clap = ["merc_sabre/clap"]
#![forbid(unsafe_code)]

mod io_lps;
mod linear_process;
use merc_data::Mcrl2DataSpecification;
use merc_data::SortExpression;
use merc_data::is_bool_literal;
use merc_lowering::Pretty;
Comment on lines +10 to +14
use crate::explore_explicit::ExplicitContext;
use crate::explore_explicit::ExplicitLinearProcessSpecification;
use crate::explore_explicit::ExplicitSummand;
use crate::explore_explicit::LpsMultiActionLabel;
use crate::transformations::TransformedLps;
Comment on lines +128 to +130
if !self.action_labels.is_empty() {
writeln!(f, "act {};", self.action_labels.iter().format(", "))?;
}
}

/// A rewriter of the selected [RewriterKind].
pub enum DataRewriter {

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants