Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix quotient so invariant is not applied in wrong rules #146

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/TransitionSystems/quotient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl TransitionSystem for Quotient {
// In the following comments we use ϕ to symbolize the guard of the transition
// ϕ_T ∧ Inv(l2_t)[r |-> 0] ∧ Inv(l1_t) ∧ ϕ_S ∧ Inv(l2_s)[r |-> 0] ∧ Inv(l1_s)
let guard_zone = get_allowed_fed(loc_t, t_transition)
.intersection(&get_allowed_fed(loc_s, s_transition));
.intersection(&get_allowed_fed_and_invariant(loc_s, s_transition));

let target_locations = merge(
&t_transition.target_locations,
Expand All @@ -220,7 +220,7 @@ impl TransitionSystem for Quotient {
if self.S.actions_contain(action) && !self.T.actions_contain(action) {
//Independent S
for s_transition in &s {
let guard_zone = get_allowed_fed(loc_s, s_transition);
let guard_zone = get_allowed_fed_and_invariant(loc_s, s_transition);

let target_locations = merge(loc_t, &s_transition.target_locations);
let updates = s_transition.updates.clone();
Expand Down Expand Up @@ -420,11 +420,15 @@ fn merge(t: &LocationTuple, s: &LocationTuple) -> LocationTuple {
LocationTuple::merge_as_quotient(t, s)
}

fn get_allowed_fed(from: &LocationTuple, transition: &Transition) -> OwnedFederation {
fn get_allowed_fed_and_invariant(from: &LocationTuple, transition: &Transition) -> OwnedFederation {
let fed = transition.get_allowed_federation();
from.apply_invariants(fed)
}

fn get_allowed_fed(_from: &LocationTuple, transition: &Transition) -> OwnedFederation {
transition.get_allowed_federation()
}

fn get_invariant(loc: &LocationTuple, dim: ClockIndex) -> OwnedFederation {
match loc.get_invariants() {
Some(inv) => inv.clone(),
Expand Down