More examples, better defaults

grammar_separated is grammar but with all functions exposed
This commit is contained in:
elvis
2025-10-17 19:45:20 +02:00
parent 164e1d883c
commit 08d195ab06
30 changed files with 8698 additions and 49 deletions

View File

@ -1,6 +1,6 @@
[workspace] [workspace]
resolver = "3" resolver = "3"
members = [ "analysis", "assert", "bisimilarity", "execution","grammar", "rsprocess"] members = [ "analysis", "assert", "bisimilarity", "execution","grammar", "rsprocess", "grammar_separated" ]
exclude = ["*.system", "*.experiment", "/testing/", "*.serial", "*.dot", "*.trace", "*.svg"] exclude = ["*.system", "*.experiment", "/testing/", "*.serial", "*.dot", "*.trace", "*.svg"]
[profile.dev] [profile.dev]

View File

@ -6,5 +6,6 @@ edition = "2024"
[dependencies] [dependencies]
rand = { version = "*" } rand = { version = "*" }
rsprocess = { path = "../rsprocess/" } rsprocess = { path = "../rsprocess/" }
serde = { version = ">=1"}
petgraph = { version = "*", features = ["serde-1"] } petgraph = { version = "*", features = ["serde-1"] }
petgraph-graphml = { version = "*" } petgraph-graphml = { version = "*" }

View File

@ -1,4 +1,5 @@
use std::collections::HashMap; use std::collections::HashMap;
use serde::{Serialize, Deserialize};
use rsprocess::set::BasicSet; use rsprocess::set::BasicSet;
use rsprocess::{element, graph, label, process, set, system, translator}; use rsprocess::{element, graph, label, process, set, system, translator};
@ -8,12 +9,12 @@ use rsprocess::{element, graph, label, process, set, system, translator};
/// AssertExpression /// AssertExpression
type IntegerType = i64; type IntegerType = i64;
#[derive(Clone)] #[derive(Clone, Serialize, Deserialize, Hash)]
pub struct Assert<S> { pub struct Assert<S> {
pub tree: Tree<S>, pub tree: Tree<S>,
} }
#[derive(Clone)] #[derive(Clone, Serialize, Deserialize, Hash)]
pub enum Tree<S> { pub enum Tree<S> {
Concat(Box<Tree<S>>, Box<Tree<S>>), Concat(Box<Tree<S>>, Box<Tree<S>>),
If(Box<Expression<S>>, Box<Tree<S>>), If(Box<Expression<S>>, Box<Tree<S>>),
@ -23,7 +24,7 @@ pub enum Tree<S> {
For(Variable<S>, Range<S>, Box<Tree<S>>), For(Variable<S>, Range<S>, Box<Tree<S>>),
} }
#[derive(Clone, PartialEq, Eq, Hash)] #[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Variable<S> { pub enum Variable<S> {
Id(String), Id(String),
Special(S), Special(S),
@ -52,7 +53,7 @@ pub(super) trait SpecialVariables<G>:
fn correct_type(&self, other: &AssertReturnValue) -> bool; fn correct_type(&self, other: &AssertReturnValue) -> bool;
} }
#[derive(Clone)] #[derive(Clone, Serialize, Deserialize, Hash)]
pub enum Expression<S> { pub enum Expression<S> {
True, True,
False, False,
@ -67,13 +68,13 @@ pub enum Expression<S> {
Binary(Binary, Box<Expression<S>>, Box<Expression<S>>), Binary(Binary, Box<Expression<S>>, Box<Expression<S>>),
} }
#[derive(Clone)] #[derive(Clone, Serialize, Deserialize, Hash)]
pub enum Range<S> { pub enum Range<S> {
IterateOverSet(Box<Expression<S>>), IterateOverSet(Box<Expression<S>>),
IterateInRange(Box<Expression<S>>, Box<Expression<S>>), IterateInRange(Box<Expression<S>>, Box<Expression<S>>),
} }
#[derive(Clone, Copy)] #[derive(Clone, Copy, Serialize, Deserialize, Hash)]
pub enum Unary { pub enum Unary {
Not, Not,
Rand, Rand,
@ -85,7 +86,7 @@ pub enum Unary {
Qualifier(Qualifier), Qualifier(Qualifier),
} }
#[derive(Clone, Copy)] #[derive(Clone, Copy, Serialize, Deserialize, Hash)]
pub enum QualifierRestricted { pub enum QualifierRestricted {
Entities, Entities,
Context, Context,
@ -96,32 +97,32 @@ pub enum QualifierRestricted {
Products, Products,
} }
#[derive(Clone, Copy)] #[derive(Clone, Copy, Serialize, Deserialize, Hash)]
pub enum QualifierLabel { pub enum QualifierLabel {
AvailableEntities, AvailableEntities,
AllReactants, AllReactants,
AllInhibitors, AllInhibitors,
} }
#[derive(Clone, Copy)] #[derive(Clone, Copy, Serialize, Deserialize, Hash)]
pub enum QualifierSystem { pub enum QualifierSystem {
Entities, Entities,
Context, Context,
} }
#[derive(Clone, Copy)] #[derive(Clone, Copy, Serialize, Deserialize, Hash)]
pub enum QualifierEdge { pub enum QualifierEdge {
Source, Source,
Target, Target,
} }
#[derive(Clone, Copy)] #[derive(Clone, Copy, Serialize, Deserialize, Hash)]
pub enum QualifierNode { pub enum QualifierNode {
Neighbours, Neighbours,
System, System,
} }
#[derive(Clone, Copy)] #[derive(Clone, Copy, Serialize, Deserialize, Hash)]
pub enum Qualifier { pub enum Qualifier {
System(QualifierSystem), System(QualifierSystem),
Label(QualifierLabel), Label(QualifierLabel),
@ -130,7 +131,7 @@ pub enum Qualifier {
Node(QualifierNode), Node(QualifierNode),
} }
#[derive(Clone, Copy)] #[derive(Clone, Copy, Serialize, Deserialize, Hash)]
pub enum Binary { pub enum Binary {
And, And,
Or, Or,
@ -155,7 +156,7 @@ pub enum Binary {
CommonSubStr, CommonSubStr,
} }
#[derive(Copy, Clone, PartialEq, Eq)] #[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
pub(super) enum AssertionTypes { pub(super) enum AssertionTypes {
Boolean, Boolean,
Integer, Integer,
@ -174,7 +175,7 @@ pub(super) enum AssertionTypes {
Edge, Edge,
} }
#[derive(Clone, Hash, PartialEq, Eq)] #[derive(Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub enum AssertReturnValue { pub enum AssertReturnValue {
Boolean(bool), Boolean(bool),
Integer(IntegerType), Integer(IntegerType),
@ -193,6 +194,12 @@ pub enum AssertReturnValue {
// Implementations for types // Implementations for types
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
impl<S> Default for Assert<S> {
fn default() -> Self {
Self { tree: Tree::Return(Box::new(Expression::True)) }
}
}
impl QualifierRestricted { impl QualifierRestricted {
pub(super) fn referenced_mut<'a>( pub(super) fn referenced_mut<'a>(
&self, &self,

View File

@ -1,4 +1,5 @@
use std::collections::HashMap; use std::collections::HashMap;
use serde::{Serialize, Deserialize};
use rsprocess::translator::PrintableWithTranslator; use rsprocess::translator::PrintableWithTranslator;
use rsprocess::{graph, label, set, system, translator}; use rsprocess::{graph, label, set, system, translator};
@ -46,13 +47,13 @@ pub mod useful_types_edge_relabeler {
// Implementation for graph labeling in bisimulation. // Implementation for graph labeling in bisimulation.
#[derive(Copy, Clone, PartialEq, Eq, Hash)] #[derive(Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum EdgeRelablerInput { pub enum EdgeRelablerInput {
Label, Label,
Edge, Edge,
} }
#[derive(Clone)] #[derive(Clone, Serialize, Deserialize)]
enum EdgeRelablerInputValues { enum EdgeRelablerInputValues {
Label(label::Label), Label(label::Label),
Edge(petgraph::graph::EdgeIndex), Edge(petgraph::graph::EdgeIndex),
@ -211,13 +212,13 @@ pub mod useful_types_node_relabeler {
pub type Special = super::NodeRelablerInput; pub type Special = super::NodeRelablerInput;
} }
#[derive(Copy, Clone, PartialEq, Eq, Hash)] #[derive(Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum NodeRelablerInput { pub enum NodeRelablerInput {
Entities, Entities,
Node, Node,
} }
#[derive(Clone)] #[derive(Clone, Serialize, Deserialize)]
enum NodeRelablerInputValues { enum NodeRelablerInputValues {
Entities(set::Set), Entities(set::Set),
Node(petgraph::graph::NodeIndex), Node(petgraph::graph::NodeIndex),

View File

@ -742,8 +742,7 @@ where
.map_edges(edge_relabeler, &mut system_b.translator)?; .map_edges(edge_relabeler, &mut system_b.translator)?;
Ok(format!( Ok(format!(
"{}", "{}",
// bisimilarity::bisimilarity_kanellakis_smolka::bisimilarity(& // bisimilarity::bisimilarity_kanellakis_smolka::bisimilarity(&&a, &&b)
// &a, &&b)
// bisimilarity::bisimilarity_paige_tarjan::bisimilarity_ignore_labels(&&a, &&b) // bisimilarity::bisimilarity_paige_tarjan::bisimilarity_ignore_labels(&&a, &&b)
bisimilarity::bisimilarity_paige_tarkan::bisimilarity(&&a, &&b) bisimilarity::bisimilarity_paige_tarkan::bisimilarity(&&a, &&b)
)) ))

View File

@ -1,3 +1,6 @@
fn main() { fn main() {
lalrpop::process_src().unwrap(); lalrpop::Configuration::new()
.emit_rerun_directives(true)
.process_dir("./src")
.unwrap();
} }

View File

@ -294,7 +294,6 @@ CTX_process: process::Process = {
} }
}; };
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// EnvironmentParser // EnvironmentParser
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -794,7 +793,7 @@ NodeDisplayBase: graph::NodeDisplayBase = {
graph::NodeDisplayBase::Context, graph::NodeDisplayBase::Context,
"UncommonEntities" => "UncommonEntities" =>
graph::NodeDisplayBase::UncommonEntities, graph::NodeDisplayBase::UncommonEntities,
"MaskUncommonentities" <mask: Set> => "MaskUncommonEntities" <mask: Set> =>
graph::NodeDisplayBase::MaskUncommonEntities{mask}, graph::NodeDisplayBase::MaskUncommonEntities{mask},
} }

View File

@ -4,8 +4,13 @@ pub mod user_error {
pub use crate::custom_error::*; pub use crate::custom_error::*;
} }
lalrpop_util::lalrpop_mod!( #[rustfmt::skip]
#[allow(clippy::extra_unused_lifetimes)]
#[allow(clippy::needless_lifetimes)]
#[allow(clippy::let_unit_value)]
#[allow(clippy::just_underscores_and_digits)]
#[allow(clippy::uninlined_format_args)] #[allow(clippy::uninlined_format_args)]
#[allow(clippy::type_complexity)] pub grammar, // name of module #[allow(clippy::type_complexity)]
"/grammar.rs" // location of parser pub mod grammar {
); include!(concat!(env!("OUT_DIR"), "/src/grammar.rs"));
}

View File

@ -0,0 +1,14 @@
[package]
name = "grammar_separated"
version = "0.1.0"
edition = "2024"
[build-dependencies]
lalrpop = "*"
[dependencies]
rsprocess = { path = "../rsprocess/" }
assert = { path = "../assert/" }
execution = { path = "../execution/" }
regex = { version = "*", features = ["unicode-bool"] }
lalrpop-util = { version = "*", features = ["lexer", "unicode"] }

View File

@ -0,0 +1,6 @@
fn main() {
lalrpop::Configuration::new()
.emit_rerun_directives(true)
.process_dir("./src")
.unwrap();
}

View File

@ -0,0 +1,294 @@
use std::str::FromStr;
use lalrpop_util::ParseError;
use assert::relabel;
use rsprocess::{set, label};
use rsprocess::translator::Translator;
use crate::custom_error;
grammar(translator: &mut Translator);
extern {
type Error = custom_error::UserError;
}
// -----------------------------------------------------------------------------
// Helpers
// -----------------------------------------------------------------------------
// order
match {
"!", "!=", "%", "&&", "'", "(", ")", "*", "+", ",", "-", "..", "/", ":",
"::", ";", "<", "<=", "=", "==", ">", ">=", "AllInhibitors", "AllReactants",
"AvailableEntities", "Context", "Entities", "Inhibitors",
"InhibitorsPresent", "Products", "Reactants", "ReactantsAbsent",
"SystemContext", "SystemEntities", "[", "\"", "]", "^", "^^", "edge",
"else", "empty", "false", "for", "if", "in", "label", "length", "let",
"neighbours", "not", "rand", "return", "source", "system", "target", "then",
"toel", "tostr", "true", "{", "||", "}",
} else {
r"[0-9]+" => NUMBER
} else {
r"([[:alpha:]])([[:word:]])*" => WORD
// r"(\p{L}|\p{Emoji})(\p{L}|\p{Emoji}|\p{Dash}|\p{N})*" => WORD,
} else {
r#""[^"]+""# => PATH, // " <- ignore comment, its for the linter in emacs
} else {
_
}
// matches words (letter followed by numbers, letters or _)
Literal: String = {
WORD => <>.into(),
};
Num: i64 = {
<sign: "-"?> <start: @L> <n: NUMBER> <end: @R> =>? {
if sign.is_some() {
i64::from_str(n)
.map(|n| -n)
.map_err(|_| ParseError::User {
error: custom_error::UserError {
token: (start, n.into(), end),
error: custom_error::UserErrorTypes::NumberTooBigi64
}
})
} else {
i64::from_str(n)
.map_err(|_| ParseError::User {
error: custom_error::UserError {
token: (start, n.into(), end),
error: custom_error::UserErrorTypes::NumberTooBigi64
}
})
}
}
};
// macro for matching sequence of patterns with C as separator
Separated<T, C>: Vec<T> = {
<mut v:(<T> C)+> <e:T?> => match e {
None => v,
Some(e) => {
v.push(e);
v
}
}
};
Separated_Or<T, C>: Vec<T> = {
<v: T> => vec![v],
<v: Separated<T, C>> => v
}
Separated_Empty<LP, T, C, RP>: Vec<T> = {
LP RP => vec![],
LP <v: T> RP => vec![v],
LP <v: Separated<T, C>> RP => v
}
// -----------------------------------------------------------------------------
// SetParser
// -----------------------------------------------------------------------------
Set: set::Set = {
<s: Separated_Empty<"{", Literal, ",", "}">> =>
set::Set::from(s.into_iter().map(|t| translator.encode(t))
.collect::<Vec<_>>())
};
// -----------------------------------------------------------------------------
// LabelParser
// -----------------------------------------------------------------------------
Label: label::Label = {
"["
"Entities" ":" <e: Set> ","
"Context" ":" <c: Set> ","
"Reactants" ":" <r: Set> ","
"ReactantsAbsent" ":" <r_a: Set> ","
"Inhibitors" ":" <i: Set> ","
"InhibitorsPresent" ":" <i_p: Set> ","
"Products" ":" <p: Set> ","?
"]" => label::Label::create(e, c, r, r_a, i, i_p, p)
}
// -----------------------------------------------------------------------------
// AssertParser
// -----------------------------------------------------------------------------
pub Assert: Box<relabel::Assert> = {
"label" "{" <f: AssertTree> "}" =>
Box::new(relabel::Assert{tree: f}),
};
AssertTree: relabel::Tree = {
<t1: AssertTree2> <t2: AssertTree> =>
relabel::Tree::Concat(Box::new(t1), Box::new(t2)),
<t: AssertTree2> => t,
}
AssertTree2: relabel::Tree = {
#[precedence(level="1")]
"if" <e: AssertExpression>
"then" "{" <t: AssertTree> "}" ";"? =>
relabel::Tree::If(Box::new(e), Box::new(t)),
#[precedence(level="0")]
"if" <e: AssertExpression>
"then" "{" <t1: AssertTree> "}"
"else" "{" <t2: AssertTree> "}" ";"? =>
relabel::Tree::IfElse(Box::new(e), Box::new(t1), Box::new(t2)),
"let" <v: AssertVariable> <q: AssertQualifier?> "=" <e: AssertExpression>
";"
=> relabel::Tree::Assignment(v, q, Box::new(e)),
"return" <e: AssertExpression> ";" =>
relabel::Tree::Return(Box::new(e)),
"for" <v: AssertVariable> "in" <r: AssertRange> "{" <t: AssertTree> "}" ";"?
=> relabel::Tree::For(v, r, Box::new(t)),
}
AssertVariable: relabel::Variable = {
#[precedence(level="0")]
"label" => relabel::Variable::Special(relabel::Special::Label),
"edge" => relabel::Variable::Special(relabel::Special::Edge),
#[precedence(level="1")]
<v: Literal> => relabel::Variable::Id(v),
}
AssertExpression: relabel::Expression = {
#[precedence(level="100")]
<unp: AssertUnaryPrefix> "(" <e: AssertExpression> ")" =>
relabel::Expression::Unary(unp, Box::new(e)),
#[precedence(level="50")]
<e: AssertExpression> "." <uns: AssertUnarySuffix> =>
relabel::Expression::Unary(uns, Box::new(e)),
#[precedence(level="100")] #[assoc(side="left")]
"(" <e1: AssertExpression> <b: AssertBinary> <e2: AssertExpression> ")" =>
relabel::Expression::Binary(b, Box::new(e1), Box::new(e2)),
#[precedence(level="100")]
<b: AssertBinaryPrefix>
"(" <e1: AssertExpression> "," <e2: AssertExpression> ")" =>
relabel::Expression::Binary(b, Box::new(e1), Box::new(e2)),
#[precedence(level="0")]
<t: AssertTerm> => t,
}
AssertTerm: relabel::Expression = {
"true" => relabel::Expression::True,
"false" => relabel::Expression::False,
<v: AssertVariable> => relabel::Expression::Var(v),
// If changing IntegerType in assert.rs, also change from Num to another
// similar parser with different return type
<i: Num> => relabel::Expression::Integer(i),
<lab: Label> => relabel::Expression::Label(Box::new(lab)),
<set: Set> => relabel::Expression::Set(set),
"'" <el: Literal> "'" =>
relabel::Expression::Element(translator.encode(el)),
// strings
PATH => relabel::Expression::String(<>.trim_end_matches("\"")
.trim_start_matches("\"")
.to_string()),
// allow arbitrary parenthesis
"(" <e: AssertExpression> ")" => e,
}
AssertRange: relabel::Range = {
"{" <e: AssertExpression> "}" =>
relabel::Range::IterateOverSet(Box::new(e)),
"{" <e1: AssertExpression> ".." <e2: AssertExpression> "}" =>
relabel::Range::IterateInRange(Box::new(e1), Box::new(e2)),
}
AssertUnaryPrefix: relabel::Unary = {
"not" => relabel::Unary::Not,
"rand" => relabel::Unary::Rand,
}
AssertUnarySuffix: relabel::Unary = {
#[precedence(level="0")]
"empty" => relabel::Unary::Empty,
"length" => relabel::Unary::Length,
"tostr" => relabel::Unary::ToStr,
"toel" => relabel::Unary::ToEl,
#[precedence(level="1")]
<q: AssertQualifier> => relabel::Unary::Qualifier(q),
}
AssertQualifierRestricted: relabel::QualifierRestricted = {
"Entities" => relabel::QualifierRestricted::Entities,
"Context" => relabel::QualifierRestricted::Context,
"Reactants" => relabel::QualifierRestricted::Reactants,
"ReactantsAbsent" => relabel::QualifierRestricted::ReactantsAbsent,
"Inhibitors" => relabel::QualifierRestricted::Inhibitors,
"InhibitorsPresent" => relabel::QualifierRestricted::InhibitorsPresent,
"Products" => relabel::QualifierRestricted::Products,
}
AssertQualifierLabel: relabel::QualifierLabel = {
"AvailableEntities" => relabel::QualifierLabel::AvailableEntities,
"AllReactants" => relabel::QualifierLabel::AllReactants,
"AllInhibitors" => relabel::QualifierLabel::AllInhibitors,
}
AssertQualifierSystem: relabel::QualifierSystem = {
"SystemEntities" => relabel::QualifierSystem::Entities,
"SystemContext" => relabel::QualifierSystem::Context,
}
AssertQualifierEdge: relabel::QualifierEdge = {
"source" => relabel::QualifierEdge::Source,
"target" => relabel::QualifierEdge::Target,
}
AssertQualifierNode: relabel::QualifierNode = {
"neighbours" => relabel::QualifierNode::Neighbours,
"system" => relabel::QualifierNode::System,
}
AssertQualifier: relabel::Qualifier = {
<q: AssertQualifierSystem> => relabel::Qualifier::System(q),
<q: AssertQualifierLabel> => relabel::Qualifier::Label(q),
<q: AssertQualifierRestricted> => relabel::Qualifier::Restricted(q),
<q: AssertQualifierEdge> => relabel::Qualifier::Edge(q),
<q: AssertQualifierNode> => relabel::Qualifier::Node(q),
}
AssertBinary: relabel::Binary = {
"&&" => relabel::Binary::And,
"||" => relabel::Binary::Or,
"^^" => relabel::Binary::Xor,
"<" => relabel::Binary::Less,
"<=" => relabel::Binary::LessEq,
">" => relabel::Binary::More,
">=" => relabel::Binary::MoreEq,
"==" => relabel::Binary::Eq,
"!=" => relabel::Binary::NotEq,
"+" => relabel::Binary::Plus,
"-" => relabel::Binary::Minus,
"*" => relabel::Binary::Times,
"^" => relabel::Binary::Exponential,
"/" => relabel::Binary::Quotient,
"%" => relabel::Binary::Reminder,
"::" => relabel::Binary::Concat,
}
AssertBinaryPrefix: relabel::Binary = {
"substr" => relabel::Binary::SubStr,
"min" => relabel::Binary::Min,
"max" => relabel::Binary::Max,
"commonsubstr" => relabel::Binary::CommonSubStr,
}

View File

@ -0,0 +1,30 @@
use std::fmt::Display;
pub enum UserErrorTypes {
NumberTooBigUsize,
NumberTooBigi64,
}
impl Display for UserErrorTypes {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
| Self::NumberTooBigUsize => write!(
f,
"Specified number is too big (greater than {})",
usize::MAX
),
| Self::NumberTooBigi64 => write!(
f,
"Specified number is too big (lesser than {} or \
greater than {})",
i64::MIN,
i64::MAX
),
}
}
}
pub struct UserError {
pub token: (usize, String, usize),
pub error: UserErrorTypes,
}

View File

@ -0,0 +1,313 @@
use std::rc::Rc;
use std::str::FromStr;
use lalrpop_util::ParseError;
// use assert::{relabel, grouping};
use rsprocess::{set, reaction, process, environment, system, label};
use rsprocess::element::IdType;
use rsprocess::translator::Translator;
// use execution::presets;
// use rsprocess::graph;
use crate::custom_error;
grammar(translator: &mut Translator);
extern {
type Error = custom_error::UserError;
}
// -----------------------------------------------------------------------------
// Helpers
// -----------------------------------------------------------------------------
// order
match {
"!", "(", ")", "+", ",", "-", ".", ":", ";", "<", "<=", "=", "==", ">",
">=", "?", "AbsentReactants", "Bisimilarity", "Context",
"Context.EntitySet", "Context.Nill", "Context.NonDeterministicChoice",
"Context.RecursiveIdentifier", "Context.Summation", "Context.WaitEntity",
"Deserialize", "Difference", "Digraph", "Dot", "Entities", "EntitiesAdded",
"EntitiesDeleted", "Environment", "ExcludeEntities", "FastFrequency",
"GraphML", "Grequency", "Hide", "Inhibitors", "InhibitorsPresent", "Initial
Entities", "Limit", "LimitFrequency", "Loop", "MaskContext",
"MaskDifference", "MaskEntities", "MaskEntitiesAdded",
"MaskEntitiesDeleted", "MaskProducts", "MaskUncommonEntities", "MaskUnion",
"PresentInhibitors", "Print", "Products", "Reactants", "ReactantsAbsent",
"Reactions", "Run", "Save", "Serialize", "Sets", "Stats", "T", "Target",
"UncommonContext", "UncommonDifference", "UncommonEntities",
"UncommonEntitiesAdded", "UncommonEntitiesDeleted", "UncommonMaskContext",
"UncommonMaskDifference", "UncommonMaskEntities",
"UncommonMaskEntitiesAdded", "UncommonMaskEntitiesDeleted",
"UncommonMaskProducts", "UncommonMaskUnion", "UncommonProducts",
"UncommonUnion", "Union", "Weights", "[", "]", "i:", "nill", "p:", "r:",
"relabel", "{", "|", "}", "⊂", "⊃", "⊆", "⊇",
} else {
r"[0-9]+" => NUMBER
} else {
r"([[:alpha:]])([[:word:]])*" => WORD
// r"(\p{L}|\p{Emoji})(\p{L}|\p{Emoji}|\p{Dash}|\p{N})*" => WORD,
} else {
r#""[^"]+""# => PATH, // " <- ignore comment, its for the linter in emacs
} else {
_
}
// matches words (letter followed by numbers, letters or _)
Literal: String = {
WORD => <>.into(),
};
LiteralProcess: String = {
Literal => <>,
"AbsentReactants" => <>.into(),
"Bisimilarity" => <>.into(),
"Context" => <>.into(),
"Context.EntitySet" => <>.into(),
"Context.Nill" => <>.into(),
"Context.NonDeterministicChoice" => <>.into(),
"Context.RecursiveIdentifier" => <>.into(),
"Context.Summation" => <>.into(),
"Context.WaitEntity" => <>.into(),
"Deserialize" => <>.into(),
"Difference" => <>.into(),
"Digraph" => <>.into(),
"Dot" => <>.into(),
"Entities" => <>.into(),
"EntitiesAdded" => <>.into(),
"EntitiesDeleted" => <>.into(),
"Environment" => <>.into(),
"ExcludeEntities" => <>.into(),
"FastFrequency" => <>.into(),
"GraphML" => <>.into(),
"Grequency" => <>.into(),
"Hide" => <>.into(),
"Inhibitors" => <>.into(),
"InhibitorsPresent" => <>.into(),
"Initial" => <>.into(),
"Limit" => <>.into(),
"LimitFrequency" => <>.into(),
"Loop" => <>.into(),
"MaskContext" => <>.into(),
"MaskDifference" => <>.into(),
"MaskEntities" => <>.into(),
"MaskEntitiesAdded" => <>.into(),
"MaskEntitiesDeleted" => <>.into(),
"MaskProducts" => <>.into(),
"MaskUncommonEntities" => <>.into(),
"MaskUnion" => <>.into(),
"PresentInhibitors" => <>.into(),
"Print" => <>.into(),
"Products" => <>.into(),
"Reactants" => <>.into(),
"ReactantsAbsent" => <>.into(),
"Reactions" => <>.into(),
"Run" => <>.into(),
"Save" => <>.into(),
"Serialize" => <>.into(),
"Sets" => <>.into(),
"Stats" => <>.into(),
"T" => <>.into(),
"Target" => <>.into(),
"UncommonContext" => <>.into(),
"UncommonDifference" => <>.into(),
"UncommonEntities" => <>.into(),
"UncommonEntitiesAdded" => <>.into(),
"UncommonEntitiesDeleted" => <>.into(),
"UncommonMaskContext" => <>.into(),
"UncommonMaskDifference" => <>.into(),
"UncommonMaskEntities" => <>.into(),
"UncommonMaskEntitiesAdded" => <>.into(),
"UncommonMaskEntitiesDeleted" => <>.into(),
"UncommonMaskProducts" => <>.into(),
"UncommonMaskUnion" => <>.into(),
"UncommonProducts" => <>.into(),
"UncommonUnion" => <>.into(),
"Union" => <>.into(),
"Weights" => <>.into(),
"relabel" => <>.into(),
};
Num: i64 = {
<sign: "-"?> <start: @L> <n: NUMBER> <end: @R> =>? {
if sign.is_some() {
i64::from_str(n)
.map(|n| -n)
.map_err(|_| ParseError::User {
error: custom_error::UserError {
token: (start, n.into(), end),
error: custom_error::UserErrorTypes::NumberTooBigi64
}
})
} else {
i64::from_str(n)
.map_err(|_| ParseError::User {
error: custom_error::UserError {
token: (start, n.into(), end),
error: custom_error::UserErrorTypes::NumberTooBigi64
}
})
}
}
};
NumUsize: usize = {
<start: @L> <n: NUMBER> <end: @R> =>? usize::from_str(n)
.map_err(|_| ParseError::User {
error: custom_error::UserError {
token: (start, n.into(), end),
error: custom_error::UserErrorTypes::NumberTooBigUsize
}
})
};
Path: String = {
PATH => <>.trim_end_matches("\"").trim_start_matches("\"").to_string()
};
// macro for matching sequence of patterns with C as separator
Separated<T, C>: Vec<T> = {
<mut v:(<T> C)+> <e:T?> => match e {
None => v,
Some(e) => {
v.push(e);
v
}
}
};
Separated_Or<T, C>: Vec<T> = {
<v: T> => vec![v],
<v: Separated<T, C>> => v
}
Separated_Empty<LP, T, C, RP>: Vec<T> = {
LP RP => vec![],
LP <v: T> RP => vec![v],
LP <v: Separated<T, C>> RP => v
}
// -----------------------------------------------------------------------------
// SetParser
// -----------------------------------------------------------------------------
pub Set: set::Set = {
<s: Separated_Empty<"{", Literal, ",", "}">> =>
set::Set::from(s.into_iter().map(|t| translator.encode(t))
.collect::<Vec<_>>())
};
// -----------------------------------------------------------------------------
// ReactionParser
// -----------------------------------------------------------------------------
pub Reactions: Vec<reaction::Reaction> = {
<s: Separated_Empty<"(", Reaction, ";", ")">> => s
}
Reaction: reaction::Reaction = {
#[precedence(level="1")]
"[" <r: Set> "," <i: Set> "," <p: Set> "]" =>
reaction::Reaction::from(r, i, p),
#[precedence(level="0")]
"[" "r:" <r: Set> "," "i:" <i: Set> "," "p:" <p: Set> "]" =>
reaction::Reaction::from(r, i, p),
}
// -----------------------------------------------------------------------------
// ContextParser
// -----------------------------------------------------------------------------
pub Context: process::Process = {
<t: Separated_Empty<"[", ContextProcess, ",", "]">> =>
process::Process::NondeterministicChoice{
children: t.into_iter().map(Rc::new).collect::<Vec<_>>()
}
};
ContextProcess: process::Process = {
"nill" => process::Process::Nill,
<c: Set> "." <k: ContextProcess> =>
process::Process::EntitySet{ entities: c, next_process: Rc::new(k) },
"(" <k: ContextProcess> ")" => k,
"(" <k: Separated<ContextProcess, "+">> ")" =>
process::Process::Summation{
children: k.into_iter().map(Rc::new).collect::<Vec<_>>()
},
"?" <r: Reaction> "?" "." <k: ContextProcess> =>
process::Process::Guarded{ reaction: r, next_process: Rc::new(k) },
"<" <n: Num> "," <k1: ContextProcess> ">" "." <k: ContextProcess> =>
process::Process::WaitEntity{ repeat: n,
repeated_process: Rc::new(k1),
next_process: Rc::new(k) },
<identifier: LiteralProcess> =>
process::Process::RecursiveIdentifier{
identifier: translator.encode(identifier)
}
};
// -----------------------------------------------------------------------------
// EnvironmentParser
// -----------------------------------------------------------------------------
pub Environment: Box<environment::Environment> = {
<t: Separated_Empty<"[", Env_term, ",", "]">> =>
Box::new(environment::Environment::from(t))
};
Env_term: (IdType, process::Process) = {
<identifier: LiteralProcess> "=" <k: ContextProcess> =>
(translator.encode(identifier), k)
};
// -----------------------------------------------------------------------------
// LabelParser
// -----------------------------------------------------------------------------
pub Label: label::Label = {
"["
"Entities" ":" <e: Set> ","
"Context" ":" <c: Set> ","
"Reactants" ":" <r: Set> ","
"ReactantsAbsent" ":" <r_a: Set> ","
"Inhibitors" ":" <i: Set> ","
"InhibitorsPresent" ":" <i_p: Set> ","
"Products" ":" <p: Set> ","?
"]" => label::Label::create(e, c, r, r_a, i, i_p, p)
}
// ----------------------------------------------------------------------------
// File Parsing
// ----------------------------------------------------------------------------
// system
// a system is an environment, a set of entities as initial state, a context and
// a set of reaction rules.
pub System: system::System = {
"Environment" ":" <delta: Environment>
"Initial Entities" ":" <available_entities: Set>
"Context" ":" <context_process: Context>
"Reactions" ":" <reaction_rules: Reactions>
=> system::System::from(delta.into(),
available_entities,
context_process,
Rc::new(reaction_rules))
}
// experiment
// an experiment is composed by a sequence of weights and a sequence of sets of
// entities of equal length.
pub Experiment: (Vec<u32>, Vec<set::Set>) = {
"Weights" ":" <w: Separated_Or<Num, ",">>
"Sets" ":" <s: Separated_Or<Set, ",">>
=> (w.into_iter().map(|x| x as u32).collect::<Vec<_>>(), s),
}

View File

@ -0,0 +1,302 @@
use std::rc::Rc;
use std::str::FromStr;
use lalrpop_util::ParseError;
use assert::{relabel, grouping};
use rsprocess::{set, reaction, process, environment, system, label};
use rsprocess::element::IdType;
use rsprocess::translator::Translator;
use execution::presets;
use rsprocess::graph;
use crate::custom_error;
grammar(translator: &mut Translator);
extern {
type Error = custom_error::UserError;
}
// -----------------------------------------------------------------------------
// Helpers
// -----------------------------------------------------------------------------
// order
match {
"!",
} else {
r"[0-9]+" => NUMBER
} else {
r"([[:alpha:]])([[:word:]])*" => WORD
// r"(\p{L}|\p{Emoji})(\p{L}|\p{Emoji}|\p{Dash}|\p{N})*" => WORD,
} else {
r#""[^"]+""# => PATH, // " <- ignore comment, its for the linter in emacs
} else {
_
}
// matches words (letter followed by numbers, letters or _)
Literal: String = {
WORD => <>.into(),
};
Num: i64 = {
<sign: "-"?> <start: @L> <n: NUMBER> <end: @R> =>? {
if sign.is_some() {
i64::from_str(n)
.map(|n| -n)
.map_err(|_| ParseError::User {
error: custom_error::UserError {
token: (start, n.into(), end),
error: custom_error::UserErrorTypes::NumberTooBigi64
}
})
} else {
i64::from_str(n)
.map_err(|_| ParseError::User {
error: custom_error::UserError {
token: (start, n.into(), end),
error: custom_error::UserErrorTypes::NumberTooBigi64
}
})
}
}
};
// macro for matching sequence of patterns with C as separator
Separated<T, C>: Vec<T> = {
<mut v:(<T> C)+> <e:T?> => match e {
None => v,
Some(e) => {
v.push(e);
v
}
}
};
Separated_Or<T, C>: Vec<T> = {
<v: T> => vec![v],
<v: Separated<T, C>> => v
}
Separated_Empty<LP, T, C, RP>: Vec<T> = {
LP RP => vec![],
LP <v: T> RP => vec![v],
LP <v: Separated<T, C>> RP => v
}
// -----------------------------------------------------------------------------
// SetParser
// -----------------------------------------------------------------------------
pub Set: set::Set = {
<s: Separated_Empty<"{", Literal, ",", "}">> =>
set::Set::from(t.into_iter().map(|t| translator.encode(t))
.collect::<Vec<_>>())
};
// -----------------------------------------------------------------------------
// LabelParser
// -----------------------------------------------------------------------------
pub Label: label::Label = {
"["
"Entities" ":" <e: Set> ","
"Context" ":" <c: Set> ","
"Reactants" ":" <r: Set> ","
"ReactantsAbsent" ":" <r_a: Set> ","
"Inhibitors" ":" <i: Set> ","
"InhibitorsPresent" ":" <i_p: Set> ","
"Products" ":" <p: Set> ","?
"]" => label::Label::create(e, c, r, r_a, i, i_p, p)
}
// -----------------------------------------------------------------------------
// GroupingParser
// -----------------------------------------------------------------------------
Group: Box<grouping::Assert> = {
">" "node" "{" <f: GroupTree> "}" =>
Box::new(grouping::Assert{tree: f}),
};
GroupTree: grouping::Tree = {
<t1: GroupTree2> <t2: GroupTree> =>
grouping::Tree::Concat(Box::new(t1), Box::new(t2)),
<t: GroupTree2> => t,
}
GroupTree2: grouping::Tree = {
#[precedence(level="1")]
"if" <e: GroupExpression>
"then" "{" <t: GroupTree> "}" ";"? =>
grouping::Tree::If(Box::new(e), Box::new(t)),
#[precedence(level="0")]
"if" <e: GroupExpression>
"then" "{" <t1: GroupTree> "}"
"else" "{" <t2: GroupTree> "}" ";"? =>
grouping::Tree::IfElse(Box::new(e), Box::new(t1), Box::new(t2)),
"let" <v: GroupVariable> <q: GroupQualifier?> "=" <e: GroupExpression> ";"
=> grouping::Tree::Assignment(v, q, Box::new(e)),
"return" <e: GroupExpression> ";" =>
grouping::Tree::Return(Box::new(e)),
"for" <v: GroupVariable> "in" <r: GroupRange> "{" <t: GroupTree> "}" ";"? =>
grouping::Tree::For(v, r, Box::new(t)),
}
GroupVariable: grouping::Variable = {
#[precedence(level="0")]
"entities" => grouping::Variable::Special(grouping::Special::Entities),
"node" => grouping::Variable::Special(grouping::Special::Node),
#[precedence(level="1")]
<v: Literal> => grouping::Variable::Id(v),
}
GroupExpression: grouping::Expression = {
#[precedence(level="100")]
<unp: GroupUnaryPrefix> "(" <e: GroupExpression> ")" =>
grouping::Expression::Unary(unp, Box::new(e)),
#[precedence(level="50")]
<e: GroupExpression> "." <uns: GroupUnarySuffix> =>
grouping::Expression::Unary(uns, Box::new(e)),
#[precedence(level="100")] #[assoc(side="left")]
<e1: GroupExpression> <b: GroupBinary> <e2: GroupExpression> =>
grouping::Expression::Binary(b, Box::new(e1), Box::new(e2)),
#[precedence(level="100")]
<b: GroupBinaryPrefix>
"(" <e1: GroupExpression> "," <e2: GroupExpression> ")" =>
grouping::Expression::Binary(b, Box::new(e1), Box::new(e2)),
#[precedence(level="0")]
<t: GroupTerm> => t,
}
GroupTerm: grouping::Expression = {
"true" => grouping::Expression::True,
"false" => grouping::Expression::False,
<v: GroupVariable> => grouping::Expression::Var(v),
// If changing IntegerType in assert.rs, also change from Num to another
// similar parser with different return type
<i: Num> => grouping::Expression::Integer(i),
<lab: Label> => grouping::Expression::Label(Box::new(lab)),
<set: Set> => grouping::Expression::Set(set),
"'" <el: Literal> "'" =>
grouping::Expression::Element(translator.encode(el)),
// strings
PATH => grouping::Expression::String(<>.trim_end_matches("\"")
.trim_start_matches("\"")
.to_string()),
// allow arbitrary parenthesis
"(" <e: GroupExpression> ")" => e,
}
#[inline]
GroupRange: grouping::Range = {
"{" <e: GroupExpression> "}" =>
grouping::Range::IterateOverSet(Box::new(e)),
"{" <e1: GroupExpression> ".." <e2: GroupExpression> "}" =>
grouping::Range::IterateInRange(Box::new(e1), Box::new(e2)),
}
#[inline]
GroupUnaryPrefix: grouping::Unary = {
"not" => grouping::Unary::Not,
"rand" => grouping::Unary::Rand,
}
#[inline]
GroupUnarySuffix: grouping::Unary = {
#[precedence(level="0")]
"empty" => grouping::Unary::Empty,
"length" => grouping::Unary::Length,
"tostr" => grouping::Unary::ToStr,
"toel" => grouping::Unary::ToEl,
#[precedence(level="1")]
<q: GroupQualifier> => grouping::Unary::Qualifier(q),
}
#[inline]
GroupQualifierRestricted: grouping::QualifierRestricted = {
"Entities" => grouping::QualifierRestricted::Entities,
"Context" => grouping::QualifierRestricted::Context,
"Reactants" => grouping::QualifierRestricted::Reactants,
"ReactantsAbsent" => grouping::QualifierRestricted::ReactantsAbsent,
"Inhibitors" => grouping::QualifierRestricted::Inhibitors,
"InhibitorsPresent" => grouping::QualifierRestricted::InhibitorsPresent,
"Products" => grouping::QualifierRestricted::Products,
}
#[inline]
GroupQualifierLabel: grouping::QualifierLabel = {
"AvailableEntities" => grouping::QualifierLabel::AvailableEntities,
"AllReactants" => grouping::QualifierLabel::AllReactants,
"AllInhibitors" => grouping::QualifierLabel::AllInhibitors,
}
#[inline]
GroupQualifierSystem: grouping::QualifierSystem = {
"SystemEntities" => grouping::QualifierSystem::Entities,
"SystemContext" => grouping::QualifierSystem::Context,
}
#[inline]
GroupQualifierEdge: grouping::QualifierEdge = {
"source" => grouping::QualifierEdge::Source,
"target" => grouping::QualifierEdge::Target,
}
#[inline]
GroupQualifierNode: grouping::QualifierNode = {
"neighbours" => grouping::QualifierNode::Neighbours,
"system" => grouping::QualifierNode::System,
}
#[inline]
GroupQualifier: grouping::Qualifier = {
<q: GroupQualifierSystem> => grouping::Qualifier::System(q),
<q: GroupQualifierLabel> => grouping::Qualifier::Label(q),
<q: GroupQualifierRestricted> => grouping::Qualifier::Restricted(q),
<q: GroupQualifierEdge> => grouping::Qualifier::Edge(q),
<q: GroupQualifierNode> => grouping::Qualifier::Node(q),
}
#[inline]
GroupBinary: grouping::Binary = {
"&&" => grouping::Binary::And,
"||" => grouping::Binary::Or,
"^^" => grouping::Binary::Xor,
"<" => grouping::Binary::Less,
"<=" => grouping::Binary::LessEq,
">" => grouping::Binary::More,
">=" => grouping::Binary::MoreEq,
"==" => grouping::Binary::Eq,
"!=" => grouping::Binary::NotEq,
"+" => grouping::Binary::Plus,
"-" => grouping::Binary::Minus,
"*" => grouping::Binary::Times,
"^" => grouping::Binary::Exponential,
"/" => grouping::Binary::Quotient,
"%" => grouping::Binary::Reminder,
"::" => grouping::Binary::Concat,
}
#[inline]
GroupBinaryPrefix: grouping::Binary = {
"substr" => grouping::Binary::SubStr,
"min" => grouping::Binary::Min,
"max" => grouping::Binary::Max,
"commonsubstr" => grouping::Binary::CommonSubStr,
}

View File

@ -0,0 +1,481 @@
use std::str::FromStr;
use lalrpop_util::ParseError;
use rsprocess::set;
use rsprocess::translator::Translator;
use rsprocess::graph;
use crate::custom_error;
grammar(translator: &mut Translator);
extern {
type Error = custom_error::UserError;
}
// -----------------------------------------------------------------------------
// Helpers
// -----------------------------------------------------------------------------
// order
match {
"!", "(", ")", ",", "<", "<=", "=", "==", ">", ">=", "?", "AbsentReactants",
"Context", "Context.EntitySet", "Context.Nill",
"Context.NonDeterministicChoice", "Context.RecursiveIdentifier",
"Context.Summation", "Context.WaitEntity", "Difference", "Entities",
"EntitiesAdded", "EntitiesDeleted", "ExcludeEntities", "Hide", "Inhibitors",
"MaskContext", "MaskDifference", "MaskEntities", "MaskEntitiesAdded",
"MaskEntitiesDeleted", "MaskProducts", "MaskUncommonEntities", "MaskUnion",
"PresentInhibitors", "Products", "Reactants", "T", "UncommonContext",
"UncommonDifference", "UncommonEntities", "UncommonEntitiesAdded",
"UncommonEntitiesDeleted", "UncommonMaskContext", "UncommonMaskDifference",
"UncommonMaskEntities", "UncommonMaskEntitiesAdded",
"UncommonMaskEntitiesDeleted", "UncommonMaskProducts", "UncommonMaskUnion",
"UncommonProducts", "UncommonUnion", "Union", "\"", "{", "||", "}", "⊂",
"⊃", "⊆", "⊇",
} else {
r"[0-9]+" => NUMBER
} else {
r"([[:alpha:]])([[:word:]])*" => WORD
// r"(\p{L}|\p{Emoji})(\p{L}|\p{Emoji}|\p{Dash}|\p{N})*" => WORD,
} else {
r#""[^"]+""# => PATH, // " <- ignore comment, its for the linter in emacs
} else {
_
}
// matches words (letter followed by numbers, letters or _)
Literal: String = {
WORD => <>.into(),
};
LiteralProcess: String = {
Literal => <>,
"AbsentReactants" => <>.into(),
"Context" => <>.into(),
"Context.EntitySet" => <>.into(),
"Context.Nill" => <>.into(),
"Context.NonDeterministicChoice" => <>.into(),
"Context.RecursiveIdentifier" => <>.into(),
"Context.Summation" => <>.into(),
"Context.WaitEntity" => <>.into(),
"Difference" => <>.into(),
"Entities" => <>.into(),
"EntitiesAdded" => <>.into(),
"EntitiesDeleted" => <>.into(),
"ExcludeEntities" => <>.into(),
"Hide" => <>.into(),
"Inhibitors" => <>.into(),
"MaskContext" => <>.into(),
"MaskDifference" => <>.into(),
"MaskEntities" => <>.into(),
"MaskEntitiesAdded" => <>.into(),
"MaskEntitiesDeleted" => <>.into(),
"MaskProducts" => <>.into(),
"MaskUncommonEntities" => <>.into(),
"MaskUnion" => <>.into(),
"PresentInhibitors" => <>.into(),
"Products" => <>.into(),
"Reactants" => <>.into(),
"T" => <>.into(),
"UncommonContext" => <>.into(),
"UncommonDifference" => <>.into(),
"UncommonEntities" => <>.into(),
"UncommonEntitiesAdded" => <>.into(),
"UncommonEntitiesDeleted" => <>.into(),
"UncommonMaskContext" => <>.into(),
"UncommonMaskDifference" => <>.into(),
"UncommonMaskEntities" => <>.into(),
"UncommonMaskEntitiesAdded" => <>.into(),
"UncommonMaskEntitiesDeleted" => <>.into(),
"UncommonMaskProducts" => <>.into(),
"UncommonMaskUnion" => <>.into(),
"UncommonProducts" => <>.into(),
"UncommonUnion" => <>.into(),
"Union" => <>.into(),
};
Num: i64 = {
<sign: "-"?> <start: @L> <n: NUMBER> <end: @R> =>? {
if sign.is_some() {
i64::from_str(n)
.map(|n| -n)
.map_err(|_| ParseError::User {
error: custom_error::UserError {
token: (start, n.into(), end),
error: custom_error::UserErrorTypes::NumberTooBigi64
}
})
} else {
i64::from_str(n)
.map_err(|_| ParseError::User {
error: custom_error::UserError {
token: (start, n.into(), end),
error: custom_error::UserErrorTypes::NumberTooBigi64
}
})
}
}
};
NumUsize: usize = {
<start: @L> <n: NUMBER> <end: @R> =>? usize::from_str(n)
.map_err(|_| ParseError::User {
error: custom_error::UserError {
token: (start, n.into(), end),
error: custom_error::UserErrorTypes::NumberTooBigUsize
}
})
};
Path: String = {
PATH => <>.trim_end_matches("\"").trim_start_matches("\"").to_string()
};
// macro for matching sequence of patterns with C as separator
Separated<T, C>: Vec<T> = {
<mut v:(<T> C)+> <e:T?> => match e {
None => v,
Some(e) => {
v.push(e);
v
}
}
};
Separated_Or<T, C>: Vec<T> = {
<v: T> => vec![v],
<v: Separated<T, C>> => v
}
Separated_Empty<LP, T, C, RP>: Vec<T> = {
LP RP => vec![],
LP <v: T> RP => vec![v],
LP <v: Separated<T, C>> RP => v
}
// -----------------------------------------------------------------------------
// SetParser
// -----------------------------------------------------------------------------
pub Set: set::Set = {
<s: Separated_Empty<"{", Literal, ",", "}">> =>
set::Set::from(s.into_iter().map(|t| translator.encode(t))
.collect::<Vec<_>>())
};
// ~~~~~~~~~~~~~~~~~~~
// Instruction Parsing
// ~~~~~~~~~~~~~~~~~~~
/// Match for strings between nodes formatters
LiteralSeparatorNode: graph::NodeDisplayBase = {
PATH =>
graph::NodeDisplayBase::String {
string: <>.trim_end_matches("\"")
.trim_start_matches("\"")
.to_string()
}
};
/// Match for strings between edge formatters
LiteralSeparatorEdge: graph::EdgeDisplayBase = {
PATH =>
graph::EdgeDisplayBase::String {
string: <>.trim_end_matches("\"")
.trim_start_matches("\"")
.to_string()
}
};
NodeDisplayBase: graph::NodeDisplayBase = {
"Hide" =>
graph::NodeDisplayBase::Hide,
"Entities" =>
graph::NodeDisplayBase::Entities,
"MaskEntities" <mask: Set> =>
graph::NodeDisplayBase::MaskEntities{mask},
"ExcludeEntities" <mask: Set> =>
graph::NodeDisplayBase::ExcludeEntities{mask},
"Context" =>
graph::NodeDisplayBase::Context,
"UncommonEntities" =>
graph::NodeDisplayBase::UncommonEntities,
"MaskUncommonEntities" <mask: Set> =>
graph::NodeDisplayBase::MaskUncommonEntities{mask},
}
/// Node display formatters separated by arbitrary strings in quotes
pub SeparatorNode: graph::NodeDisplay = {
<v: NodeDisplayBase> => graph::NodeDisplay {base: vec![v]},
<v:(<NodeDisplayBase> <LiteralSeparatorNode>)+> <e: NodeDisplayBase?> =>
match e {
None => graph::NodeDisplay {
base:
v.iter().fold(vec![],
|mut acc, (a, b)| {
acc.push(a.clone());
acc.push(b.clone());
acc.clone()
})
},
Some(e) => {
let mut v = v.iter().fold(vec![],
|mut acc, (a, b)| {
acc.push(a.clone());
acc.push(b.clone());
acc.clone()
});
v.push(e);
graph::NodeDisplay { base: v }
}
}
}
// -----------------------------------------------------------------------------
EdgeDisplay: graph::EdgeDisplayBase = {
"Hide" =>
graph::EdgeDisplayBase::Hide,
"Products" =>
graph::EdgeDisplayBase::Products
{ mask: None, filter_common: false },
"MaskProducts" <mask: Set> =>
graph::EdgeDisplayBase::Entities
{ mask: Some(mask), filter_common: false },
"UncommonProducts" =>
graph::EdgeDisplayBase::Products
{ mask: None, filter_common: true },
"UncommonMaskProducts" <mask: Set> =>
graph::EdgeDisplayBase::Entities
{ mask: Some(mask), filter_common: true },
"Entities" =>
graph::EdgeDisplayBase::Entities
{ mask: None, filter_common: false },
"MaskEntities" <mask: Set> =>
graph::EdgeDisplayBase::Entities
{ mask: Some(mask), filter_common: false },
"UncommonEntities" =>
graph::EdgeDisplayBase::Entities
{ mask: None, filter_common: true },
"UncommonMaskEntities" <mask: Set> =>
graph::EdgeDisplayBase::Entities
{ mask: Some(mask), filter_common: true },
"Context" =>
graph::EdgeDisplayBase::Context
{ mask: None, filter_common: false },
"MaskContext" <mask: Set> =>
graph::EdgeDisplayBase::Context
{ mask: Some(mask), filter_common: false },
"UncommonContext" =>
graph::EdgeDisplayBase::Context
{ mask: None, filter_common: true },
"UncommonMaskContext" <mask: Set> =>
graph::EdgeDisplayBase::Context
{ mask: Some(mask), filter_common: true },
"Union" =>
graph::EdgeDisplayBase::Union
{ mask: None, filter_common: false },
"MaskUnion" <mask: Set> =>
graph::EdgeDisplayBase::Union
{ mask: Some(mask), filter_common: false },
"UncommonUnion" =>
graph::EdgeDisplayBase::Union
{ mask: None, filter_common: true },
"UncommonMaskUnion" <mask: Set> =>
graph::EdgeDisplayBase::Union
{ mask: Some(mask), filter_common: true },
"Difference" =>
graph::EdgeDisplayBase::Difference
{ mask: None, filter_common: false },
"MaskDifference" <mask: Set> =>
graph::EdgeDisplayBase::Difference
{ mask: Some(mask), filter_common: false },
"UncommonDifference" =>
graph::EdgeDisplayBase::Difference
{ mask: None, filter_common: true },
"UncommonMaskDifference" <mask: Set> =>
graph::EdgeDisplayBase::Difference
{ mask: Some(mask), filter_common: true },
"EntitiesDeleted" =>
graph::EdgeDisplayBase::EntitiesDeleted
{ mask: None, filter_common: false },
"MaskEntitiesDeleted" <mask: Set> =>
graph::EdgeDisplayBase::EntitiesDeleted
{ mask: Some(mask), filter_common: false },
"UncommonEntitiesDeleted" =>
graph::EdgeDisplayBase::EntitiesDeleted
{ mask: None, filter_common: true },
"UncommonMaskEntitiesDeleted" <mask: Set> =>
graph::EdgeDisplayBase::EntitiesDeleted
{ mask: Some(mask), filter_common: true },
"EntitiesAdded" =>
graph::EdgeDisplayBase::EntitiesAdded
{ mask: None, filter_common: false },
"MaskEntitiesAdded" <mask: Set> =>
graph::EdgeDisplayBase::EntitiesAdded
{ mask: Some(mask), filter_common: false },
"UncommonEntitiesAdded" =>
graph::EdgeDisplayBase::EntitiesAdded
{ mask: None, filter_common: true },
"UncommonMaskEntitiesAdded" <mask: Set> =>
graph::EdgeDisplayBase::EntitiesAdded
{ mask: Some(mask), filter_common: true },
}
/// Edge display formatters separated by arbitrary strings in quotes
pub SeparatorEdge: graph::EdgeDisplay = {
<v: EdgeDisplay> => graph::EdgeDisplay{ base: vec![v] },
<v:(<EdgeDisplay> <LiteralSeparatorEdge>)+> <e: EdgeDisplay?> =>
match e {
None => graph::EdgeDisplay{ base: v.iter().fold(vec![],
|mut acc, (a, b)| {
acc.push(a.clone());
acc.push(b.clone());
acc.clone()
}) },
Some(e) => {
let mut v = v.iter().fold(vec![],
|mut acc, (a, b)| {
acc.push(a.clone());
acc.push(b.clone());
acc.clone()
});
v.push(e);
graph::EdgeDisplay{ base: v }
}
}
}
// -----------------------------------------------------------------------------
Operation: graph::OperationType = {
"==" => graph::OperationType::Equals,
"=" => graph::OperationType::Equals,
"<" => graph::OperationType::Subset,
"⊂" => graph::OperationType::Subset,
"<=" => graph::OperationType::SubsetEqual,
"⊆" => graph::OperationType::SubsetEqual,
">" => graph::OperationType::Superset,
"⊃" => graph::OperationType::Superset,
">=" => graph::OperationType::SupersetEqual,
"⊇" => graph::OperationType::SupersetEqual
}
NodeColorConditional: (graph::NodeColorConditional, String) = {
"Entities" <op: Operation> <set: Set> "?" <color: PATH> =>
(graph::NodeColorConditional::EntitiesConditional(op, set),
color.to_string()),
"Context.Nill" "?" <color: PATH> =>
(graph::NodeColorConditional::ContextConditional(
graph::ContextColorConditional::Nill),
color.to_string()),
"Context.RecursiveIdentifier" "(" <x: Literal> ")" "?" <color: PATH> =>
(graph::NodeColorConditional::ContextConditional(
graph::ContextColorConditional::RecursiveIdentifier(
translator.encode(x)
)),
color.to_string()),
"Context.EntitySet" <op: Operation> <set: Set> "?" <color: PATH> =>
(graph::NodeColorConditional::ContextConditional(
graph::ContextColorConditional::EntitySet(op, set)),
color.to_string()),
"Context.NonDeterministicChoice" "?" <color: PATH> =>
(graph::NodeColorConditional::ContextConditional(
graph::ContextColorConditional::NonDeterministicChoice),
color.to_string()),
"Context.Summation" "?" <color: PATH> =>
(graph::NodeColorConditional::ContextConditional(
graph::ContextColorConditional::Summation),
color.to_string()),
"Context.WaitEntity" "?" <color: PATH> =>
(graph::NodeColorConditional::ContextConditional(
graph::ContextColorConditional::WaitEntity),
color.to_string()),
}
/// Node color formatter
pub ColorNode: graph::NodeColor = {
<conditionals: Separated_Or<NodeColorConditional, "||">>
"!" <base_color: PATH> =>
graph::NodeColor { conditionals,
base_color: base_color.to_string() },
"!" <base_color: PATH> =>
graph::NodeColor { conditionals: vec![],
base_color: base_color.to_string() },
}
// -----------------------------------------------------------------------------
EdgeColorConditional: (graph::EdgeColorConditional, String) = {
"Entities" <op: Operation> <set: Set> "?" <color: PATH> =>
(graph::EdgeColorConditional::Entities(op, set),
color.to_string()),
"Context" <op: Operation> <set: Set> "?" <color: PATH> =>
(graph::EdgeColorConditional::Context(op, set),
color.to_string()),
"T" <op: Operation> <set: Set> "?" <color: PATH> =>
(graph::EdgeColorConditional::T(op, set),
color.to_string()),
"Reactants" <op: Operation> <set: Set> "?" <color: PATH> =>
(graph::EdgeColorConditional::Reactants(op, set),
color.to_string()),
"AbsentReactants" <op: Operation> <set: Set> "?" <color: PATH> =>
(graph::EdgeColorConditional::ReactantsAbsent(op, set),
color.to_string()),
"Inhibitors" <op: Operation> <set: Set> "?" <color: PATH> =>
(graph::EdgeColorConditional::Inhibitors(op, set),
color.to_string()),
"PresentInhibitors" <op: Operation> <set: Set> "?" <color: PATH> =>
(graph::EdgeColorConditional::InhibitorsPresent(op, set),
color.to_string()),
"Products" <op: Operation> <set: Set> "?" <color: PATH> =>
(graph::EdgeColorConditional::Products(op, set),
color.to_string()),
}
pub ColorEdge: graph::EdgeColor = {
<conditionals: Separated_Or<EdgeColorConditional, "||">>
"!" <base_color: PATH> =>
graph::EdgeColor { conditionals,
base_color: base_color.to_string() },
"!" <base_color: PATH> =>
graph::EdgeColor { conditionals: vec![],
base_color: base_color.to_string() },
}
// -----------------------------------------------------------------------------
// pub GraphSaveOptions: presets::GraphSaveOptions = {
// "Dot"
// "|"? <s_node: SeparatorNode>
// "|" <s_edge: SeparatorEdge>
// "|" <c_node: ColorNode>
// "|" <c_edge: ColorEdge>
// ">" <so: SaveOptions> =>
// presets::GraphSaveOptions::Dot { node_display: s_node,
// edge_display: s_edge,
// node_color: c_node,
// edge_color: c_edge,
// so },
// "GraphML"
// "|"? <s_node: SeparatorNode>
// "|" <s_edge: SeparatorEdge>
// ">" <so: SaveOptions> =>
// presets::GraphSaveOptions::GraphML { node_display: s_node,
// edge_display: s_edge,
// so },
// "Serialize" "(" <path: Path> ")" =>
// presets::GraphSaveOptions::Serialize { path },
// }

View File

@ -0,0 +1,38 @@
mod custom_error;
pub mod user_error {
pub use crate::custom_error::*;
}
#[rustfmt::skip]
#[allow(clippy::extra_unused_lifetimes)]
#[allow(clippy::needless_lifetimes)]
#[allow(clippy::let_unit_value)]
#[allow(clippy::just_underscores_and_digits)]
#[allow(clippy::uninlined_format_args)]
#[allow(clippy::type_complexity)]
pub mod grammar {
include!(concat!(env!("OUT_DIR"), "/src/grammar.rs"));
}
#[rustfmt::skip]
#[allow(clippy::extra_unused_lifetimes)]
#[allow(clippy::needless_lifetimes)]
#[allow(clippy::let_unit_value)]
#[allow(clippy::just_underscores_and_digits)]
#[allow(clippy::uninlined_format_args)]
#[allow(clippy::type_complexity)]
pub mod assert {
include!(concat!(env!("OUT_DIR"), "/src/assert.rs"));
}
#[rustfmt::skip]
#[allow(clippy::extra_unused_lifetimes)]
#[allow(clippy::needless_lifetimes)]
#[allow(clippy::let_unit_value)]
#[allow(clippy::just_underscores_and_digits)]
#[allow(clippy::uninlined_format_args)]
#[allow(clippy::type_complexity)]
pub mod instructions {
include!(concat!(env!("OUT_DIR"), "/src/instructions.rs"));
}

View File

@ -1,6 +1,7 @@
use std::cmp; use std::cmp;
use std::collections::{HashMap, HashSet}; use std::collections::{BTreeMap, HashMap, HashSet};
use std::fmt::Debug; use std::fmt::Debug;
use std::hash::Hash;
use std::rc::Rc; use std::rc::Rc;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@ -256,9 +257,9 @@ where
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
#[derive(Clone, Debug, Default, Serialize, Deserialize)] #[derive(Clone, Debug, Default, Serialize, Deserialize, Hash)]
pub struct Environment { pub struct Environment {
definitions: HashMap<IdType, Process>, definitions: BTreeMap<IdType, Process>,
} }
impl BasicEnvironment for Environment { impl BasicEnvironment for Environment {
@ -411,7 +412,7 @@ impl PrintableWithTranslator for Environment {
impl IntoIterator for Environment { impl IntoIterator for Environment {
type Item = (IdType, Process); type Item = (IdType, Process);
type IntoIter = std::collections::hash_map::IntoIter<IdType, Process>; type IntoIter = std::collections::btree_map::IntoIter<IdType, Process>;
fn into_iter(self) -> Self::IntoIter { fn into_iter(self) -> Self::IntoIter {
self.definitions.into_iter() self.definitions.into_iter()
@ -420,7 +421,7 @@ impl IntoIterator for Environment {
impl<'a> IntoIterator for &'a Environment { impl<'a> IntoIterator for &'a Environment {
type Item = (&'a IdType, &'a Process); type Item = (&'a IdType, &'a Process);
type IntoIter = std::collections::hash_map::Iter<'a, IdType, Process>; type IntoIter = std::collections::btree_map::Iter<'a, IdType, Process>;
fn into_iter(self) -> Self::IntoIter { fn into_iter(self) -> Self::IntoIter {
self.definitions.iter() self.definitions.iter()
@ -430,7 +431,7 @@ impl<'a> IntoIterator for &'a Environment {
impl<const N: usize> From<[(IdType, Process); N]> for Environment { impl<const N: usize> From<[(IdType, Process); N]> for Environment {
fn from(arr: [(IdType, Process); N]) -> Self { fn from(arr: [(IdType, Process); N]) -> Self {
Environment { Environment {
definitions: HashMap::from(arr), definitions: BTreeMap::from(arr),
} }
} }
} }
@ -438,7 +439,7 @@ impl<const N: usize> From<[(IdType, Process); N]> for Environment {
impl From<&[(IdType, Process)]> for Environment { impl From<&[(IdType, Process)]> for Environment {
fn from(arr: &[(IdType, Process)]) -> Self { fn from(arr: &[(IdType, Process)]) -> Self {
Environment { Environment {
definitions: HashMap::from_iter(arr.to_vec()), definitions: BTreeMap::from_iter(arr.to_vec()),
} }
} }
} }
@ -446,11 +447,12 @@ impl From<&[(IdType, Process)]> for Environment {
impl From<Vec<(IdType, Process)>> for Environment { impl From<Vec<(IdType, Process)>> for Environment {
fn from(arr: Vec<(IdType, Process)>) -> Self { fn from(arr: Vec<(IdType, Process)>) -> Self {
Environment { Environment {
definitions: HashMap::from_iter(arr), definitions: BTreeMap::from_iter(arr),
} }
} }
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Confluence // Confluence
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------

View File

@ -4,6 +4,7 @@ use std::rc::Rc;
use petgraph::visit::{IntoEdgeReferences, IntoNodeReferences}; use petgraph::visit::{IntoEdgeReferences, IntoNodeReferences};
use petgraph::{Directed, Graph}; use petgraph::{Directed, Graph};
use serde::{Deserialize, Serialize};
use super::element::IdType; use super::element::IdType;
use super::label::Label; use super::label::Label;
@ -97,7 +98,7 @@ common_label!(
// Nodes ----------------------------------------------------------------------- // Nodes -----------------------------------------------------------------------
/// Helper structure that specifies what information to display for nodes. /// Helper structure that specifies what information to display for nodes.
#[derive(Clone)] #[derive(Clone, Debug, Serialize, Deserialize, Hash)]
pub enum NodeDisplayBase { pub enum NodeDisplayBase {
String { string: String }, String { string: String },
Hide, Hide,
@ -109,6 +110,7 @@ pub enum NodeDisplayBase {
MaskUncommonEntities { mask: Set }, MaskUncommonEntities { mask: Set },
} }
#[derive(Clone, Debug, Serialize, Deserialize, Hash)]
pub struct NodeDisplay { pub struct NodeDisplay {
pub base: Vec<NodeDisplayBase>, pub base: Vec<NodeDisplayBase>,
} }
@ -183,7 +185,7 @@ impl NodeDisplay {
// Edges ----------------------------------------------------------------------- // Edges -----------------------------------------------------------------------
#[derive(Clone)] #[derive(Clone, Debug, Serialize, Deserialize, Hash)]
pub enum EdgeDisplayBase { pub enum EdgeDisplayBase {
String { String {
string: String, string: String,
@ -219,6 +221,7 @@ pub enum EdgeDisplayBase {
}, },
} }
#[derive(Clone, Debug, Serialize, Deserialize, Hash)]
pub struct EdgeDisplay { pub struct EdgeDisplay {
pub base: Vec<EdgeDisplayBase>, pub base: Vec<EdgeDisplayBase>,
} }
@ -481,7 +484,7 @@ type RSformatNodeTyOpt<'a> = dyn Fn(
) -> Option<String> ) -> Option<String>
+ 'a; + 'a;
#[derive(Clone, Copy)] #[derive(Clone, Copy, Debug, Serialize, Deserialize, Hash)]
pub enum OperationType { pub enum OperationType {
Equals, Equals,
Subset, Subset,
@ -502,7 +505,7 @@ impl OperationType {
} }
} }
#[derive(Clone)] #[derive(Clone, Debug, Serialize, Deserialize, Hash)]
pub enum ContextColorConditional { pub enum ContextColorConditional {
Nill, Nill,
RecursiveIdentifier(IdType), RecursiveIdentifier(IdType),
@ -512,13 +515,13 @@ pub enum ContextColorConditional {
WaitEntity, WaitEntity,
} }
#[derive(Clone)] #[derive(Clone, Debug, Serialize, Deserialize, Hash)]
pub enum NodeColorConditional { pub enum NodeColorConditional {
ContextConditional(ContextColorConditional), ContextConditional(ContextColorConditional),
EntitiesConditional(OperationType, Set), EntitiesConditional(OperationType, Set),
} }
#[derive(Clone)] #[derive(Clone, Debug, Serialize, Deserialize, Hash)]
pub struct NodeColor { pub struct NodeColor {
pub conditionals: Vec<(NodeColorConditional, String)>, pub conditionals: Vec<(NodeColorConditional, String)>,
pub base_color: String, pub base_color: String,
@ -620,7 +623,7 @@ type RSformatEdgeTyOpt<'a> = dyn Fn(
) -> Option<String> ) -> Option<String>
+ 'a; + 'a;
#[derive(Clone)] #[derive(Clone, Debug, Serialize, Deserialize, Hash)]
pub enum EdgeColorConditional { pub enum EdgeColorConditional {
Entities(OperationType, Set), Entities(OperationType, Set),
Context(OperationType, Set), Context(OperationType, Set),
@ -632,7 +635,7 @@ pub enum EdgeColorConditional {
Products(OperationType, Set), Products(OperationType, Set),
} }
#[derive(Clone)] #[derive(Clone, Debug, Serialize, Deserialize, Hash)]
pub struct EdgeColor { pub struct EdgeColor {
pub conditionals: Vec<(EdgeColorConditional, String)>, pub conditionals: Vec<(EdgeColorConditional, String)>,
pub base_color: String, pub base_color: String,

View File

@ -0,0 +1,219 @@
Environment: [
eafib1 = (?[{},{afib},{}]?.eafib1 + ?[{afib},{},{}]?.ehr),
ehr = (?[{},{heart_rate},{}]?.ehr + ?[{heart_rate},{},{}]?.ebb),
ebb = ({}.ebb + e_cbb + e_nsbb + e_sbb),
e_cbb = (?[{},{verapamil},{get_diltiazem}]?.empty
+ ?[{},{diltiazem},{get_verapamil}]?.empty),
e_nsbb = (?[{},{carvedilol},{get_propranolol}]?.empty
+ ?[{},{propranolol},{get_carvedilol}]?.empty),
e_sbb = (?[{},{atenolol},{get_bisoprolol}]?.empty
+ ?[{},{bisoprolol},{get_atenolol}]?.empty),
eafib2 = (?[{},{afib},{}]?.eafib2 + ?[{afib},{},{}]?.ehf),
ehf = (?[{},{has_fib},{}]?.ehf + ?[{has_fib},{},{}]?.eflec),
eflec = ({}.eflec + e_flec),
e_flec = {get_flecainide}.empty,
eafib3 = (?[{},{afib},{}]?.eafib3 + ?[{afib},{},{}]?.econs),
econs = (?[{},{heart_rate,has_fib},{}]?.econs
+ ?[{},{consensus_acei},{}]?.econs
+ ?[{consensus_acei,heart_rate},{},{}]?.estroke
+ ?[{consensus_acei,has_fib},{},{}]?.estroke),
estroke = (?[{},{diseases,over75},{}]?.ewarf
+ ?[{over75},{doac_fail,doac_int},{}]?.edoac
+ ?[{diseases},{doac_fail,doac_int},{}]?.edoac
+ ?[{over75,doac_fail},{},{}]?.evkant
+ ?[{over75,doac_int},{},{}]?.evkant
+ ?[{diseases,doac_fail},{},{}]?.evkant
+ ?[{diseases,doac_int},{},{}]?.evkant),
ewarf = ({}.ewarf + e_warf),
e_warf = {get_warfarin}.empty,
edoac = ({}.edoac + e_doac),
e_doac = (?[{},{dabigatran},{get_apixaban}]?.e_doacfail
+ ?[{},{apixaban},{get_dabigatran}]?.e_doacfail),
e_doacfail = (?[{doac_fail},{},{stop_doac}]?.evkant
+ ?[{},{doac_fail},{}]?.e_doacfail),
evkant = ({}.evkant + e_vkant),
e_vkant = {get_vkant}.empty,
ghyper = (?[{},{hyper},{}]?.ghyper + ?[{hyper},{},{}]?.g1),
g1 = (?[{diabete},{},{}]?.g2
+ ?[{below55},{diabete,origin},{}]?.g2
+ ?[{},{below55,diabete},{}]?.g3
+ ?[{origin},{diabete},{}]?.g3),
g2 = ({}.g2 + <1,e_acei>.g4 + <1,e_arb>.g5),
g3 = ({}.g3 + <1,e_cbb>.g6),
g4 = ({}.g4 + <1,e_cbb>.g7 + <1,e_td>.g8),
g5 = ({}.g5 + <1,e_cbb>.g9 + <1,e_td>.g10),
g6 = ({}.g6 + <1,e_acei>.g7 + <1,e_arb>.g9 + <1,e_td>.g11),
g7 = ({}.g7 + <1,e_arb>.etd + <1,e_td>.earb),
g8 = ({}.g8 + <1,e_arb>.ecbb + <1,e_cbb>.earb),
g9 = ({}.g9 + <1,e_acei>.etd + <1,e_td>.eacei),
g10 = ({}.g10 + <1,e_acei>.ecbb + <1,e_cbb>.eacei),
g11 = ({}.g11 + <1,e_acei>.earb + <1,e_arb>.eacei),
ecbb = ({}.ecbb + e_cbb),
eacei = ({}.eacei + e_acei),
e_acei = (?[{},{captopril},{get_benazepril}]?.empty
+ ?[{},{benazepril},{get_captopril}]?.empty),
earb = ({}.earb + e_arb),
e_arb = (?[{},{irbesartan},{get_olmesortan}]?.empty
+ ?[{},{olmesortan},{get_irbesartan}]?.empty),
etd = ({}.etd + e_td),
e_td = (?[{},{chlorothiazide},{get_indapamide}]?.empty
+ ?[{},{indapamide},{get_chlorothiazide}]?.empty),
k_doac = (?[{doac_test},{},{doac_ok}]?.empty
+ ?[{doac_test},{},{doac_fail}]?.empty
+ ?[{},{doac_test},{}]?.k_doac),
empty = {}.empty,
kafib = {afib}.empty,
khf = {has_fib}.empty,
khr = {heart_rate}.empty,
kcons = {consensus_acei}.empty,
kageA = {over75}.empty,
kageB = {below55}.empty,
kdiabete = {diabete}.empty,
kdoacint = {doac_int}.empty,
khyper = {hyper}.empty,
korigin = {origin}.empty
]
Initial Entities: {}
Context: [
eafib1,
eafib2,
eafib3,
ghyper,
kafib,
khf,
empty,
empty,
empty,
empty,
empty,
empty,
khyper,
empty,
k_doac
]
Reactions: (
[{hyper}, {}, {hyper}];
[{afib}, {}, {afib}];
[{has_fib}, {}, {has_fib}];
[{heart_rate}, {}, {heart_rate}];
[{consensus_acei}, {}, {consensus_acei}];
[{over75}, {}, {over75}];
[{below55}, {}, {below55}];
[{diabete}, {}, {diabete}];
[{origin}, {}, {origin}];
[{doac_int}, {}, {doac_int}];
[{doac}, {doac_ok,doac_fail}, {doac_test}];
[{doac_ok}, {doac_fail}, {doac_ok}];
[{doac_fail}, {doac_ok}, {doac_fail}];
[{hyper}, {}, {diseases}];
[{diabete}, {}, {diseases}];
[{get_diltiazem}, {stop_cbb}, {diltiazem,cbb}];
[{diltiazem}, {stop_cbb}, {diltiazem,cbb}];
[{get_verapamil}, {stop_cbb}, {verapamil,cbb}];
[{verapamil}, {stop_cbb}, {verapamil,cbb}];
[{diltiazem,verapamil}, {stop_cbb}, {alert_dup}];
[{get_propranolol}, {stop_nsbb}, {propranolol,nsbb}];
[{propranolol}, {stop_nsbb}, {propranolol,nsbb}];
[{get_carvedilol}, {stop_nsbb}, {carvedilol,nsbb}];
[{carvedilol}, {stop_nsbb}, {carvedilol,nsbb}];
[{propranolol,carvedilol}, {stop_nsbb}, {alert_dup}];
[{get_bisoprolol}, {stop_sbb}, {bisoprolol,sbb}];
[{bisoprolol}, {stop_sbb}, {bisoprolol,sbb}];
[{get_atenolol}, {stop_sbb}, {atenolol,sbb}];
[{atenolol}, {stop_sbb}, {atenolol,sbb}];
[{bisoprolol,atenolol}, {stop_sbb}, {alert_dup}];
[{get_flecainide}, {stop_flec}, {flecainide}];
[{flecainide}, {stop_flec}, {flecainide}];
[{get_warfarin}, {stop_warf}, {warfarin}];
[{warfarin}, {stop_warf}, {warfarin}];
[{get_apixaban}, {stop_doac}, {apixaban,doac}];
[{apixaban}, {stop_doac}, {apixaban,doac}];
[{get_dabigatran}, {stop_doac}, {dabigatran,doac}];
[{dabigatran}, {stop_doac}, {dabigatran,doac}];
[{apixaban,dabigatran}, {stop_doac}, {alert_dup}];
[{get_vkant}, {stop_vkant}, {vkant}];
[{vkant}, {stop_vkant}, {vkant}];
[{get_benazepril}, {stop_acei}, {benazepril,acei}];
[{benazepril}, {stop_acei}, {benazepril,acei}];
[{get_captopril}, {stop_acei}, {captopril,acei}];
[{captopril}, {stop_acei}, {captopril,acei}];
[{benazepril,captopril}, {stop_acei}, {alert_dup}];
[{get_olmesortan}, {stop_arb}, {olmesortan,arb}];
[{olmesortan}, {stop_arb}, {olmesortan,arb}];
[{get_irbesartan}, {stop_arb}, {irbesartan,arb}];
[{irbesartan}, {stop_arb}, {irbesartan,arb}];
[{olmesortan,irbesartan}, {stop_arb}, {alert_dup}];
[{get_indapamide}, {stop_td}, {indapamide,td}];
[{indapamide}, {stop_td}, {indapamide,td}];
[{get_chlorothiazide}, {stop_td}, {chlorothiazide,td}];
[{chlorothiazide}, {stop_td}, {chlorothiazide,td}];
[{indapamide,chlorothiazide}, {stop_td}, {alert_dup}];
[{doac,doac_fail}, {stop_doac}, {doac_danger}];
[{doac,doac_danger}, {stop_doac}, {danger}];
[{get_apixaban,get_diltiazem}, {}, {moderate}];
[{get_apixaban,diltiazem}, {}, {moderate}];
[{apixaban,get_diltiazem}, {}, {moderate}];
[{apixaban,diltiazem}, {}, {moderate}];
[{get_apixaban,get_verapamil}, {}, {moderate}];
[{get_apixaban,verapamil}, {}, {moderate}];
[{apixaban,get_verapamil}, {}, {moderate}];
[{apixaban,verapamil}, {}, {moderate}];
[{get_dabigatran,get_diltiazem}, {}, {moderate}];
[{get_dabigatran,diltiazem}, {}, {moderate}];
[{dabigatran,get_diltiazem}, {}, {moderate}];
[{dabigatran,diltiazem}, {}, {moderate}];
[{get_dabigatran,get_verapamil}, {}, {major}];
[{get_dabigatran,verapamil}, {}, {major}];
[{dabigatran,get_verapamil}, {}, {major}];
[{dabigatran,verapamil}, {}, {major}];
[{get_dabigatran,get_carvedilol}, {}, {moderate}];
[{get_dabigatran,carvedilol}, {}, {moderate}];
[{dabigatran,get_carvedilol}, {}, {moderate}];
[{dabigatran,carvedilol}, {}, {moderate}];
[{get_warfarin,get_benazepril}, {}, {minor}];
[{get_warfarin,benazepril}, {}, {minor}];
[{warfarin,get_benazepril}, {}, {minor}];
[{warfarin,benazepril}, {}, {minor}];
[{get_warfarin,get_indapamide}, {}, {minor}];
[{get_warfarin,indapamide}, {}, {minor}];
[{warfarin,get_indapamide}, {}, {minor}];
[{warfarin,indapamide}, {}, {minor}];
[{get_warfarin,get_chlorothiazide}, {}, {minor}];
[{get_warfarin,chlorothiazide}, {}, {minor}];
[{warfarin,get_chlorothiazide}, {}, {minor}];
[{warfarin,chlorothiazide}, {}, {minor}];
[{get_warfarin,get_propranolol}, {}, {minor}];
[{get_warfarin,propranolol}, {}, {minor}];
[{warfarin,get_propranolol}, {}, {minor}];
[{warfarin,propranolol}, {}, {minor}];
[{get_flecainide,get_diltiazem}, {}, {major}];
[{get_flecainide,diltiazem}, {}, {major}];
[{flecainide,get_diltiazem}, {}, {major}];
[{flecainide,diltiazem}, {}, {major}];
[{get_flecainide,get_verapamil}, {}, {major}];
[{get_flecainide,verapamil}, {}, {major}];
[{flecainide,get_verapamil}, {}, {major}];
[{flecainide,verapamil}, {}, {major}];
[{get_flecainide,get_bisoprolol}, {}, {moderate}];
[{get_flecainide,bisoprolol}, {}, {moderate}];
[{flecainide,get_bisoprolol}, {}, {moderate}];
[{flecainide,bisoprolol}, {}, {moderate}];
[{get_flecainide,get_atenolol}, {}, {moderate}];
[{get_flecainide,atenolol}, {}, {moderate}];
[{flecainide,get_atenolol}, {}, {moderate}];
[{flecainide,atenolol}, {}, {moderate}];
[{get_flecainide,get_propranolol}, {}, {moderate}];
[{get_flecainide,propranolol}, {}, {moderate}];
[{flecainide,get_propranolol}, {}, {moderate}];
[{flecainide,propranolol}, {}, {moderate}];
[{get_flecainide,get_carvedilol}, {}, {moderate}];
[{get_flecainide,carvedilol}, {}, {moderate}];
[{flecainide,get_carvedilol}, {}, {moderate}];
[{flecainide,carvedilol}, {}, {moderate}];
[{major}, {}, {major}];
[{moderate}, {}, {moderate}];
[{minor}, {}, {minor}];
[{alert_dup}, {}, {alert_dup}];
[{danger},{},{danger}]
)

39
testing/mex/convert.plx Normal file
View File

@ -0,0 +1,39 @@
#!/usr/bin/perl
use warnings;
use strict;
my %structure = (
Environment => (),
InitialEntities => (),
Context => (),
Reactions => (),
);
open FILE, $ARGV[0] or die $!;
my @data = <FILE>;
my $data = "@data";
$data =~ /myentities\(\[([^\]]*)\]\)/s;
$structure{InitialEntities} = $1;
$data =~ /myenvironment\(\"\[([^\]]*)\]\"\)/s;
$structure{Environment} = $1;
$data =~ /mycontext\(\"\[([^\]]*)\]\"\)/s;
$structure{Context} = $1;
my $line;
for $line (@data) {
$_ = $line;
if (/react.*\]\),?$/) {
s/react\(\[(.*?)\],\[(.*?)\],\[(.*?)\]\),?/[{$1}, {$2}, {$3}]/;
chomp $_;
$structure{Reactions} .= "$_;\n";
}
}
print ("Environment: [", $structure{Environment}, "]\n");
print ("Initial Entities: {", $structure{InitialEntities} ,"}\n");
print ("Context: [", $structure{Context}, "]\n");
print ("Reactions: (\n", $structure{Reactions}, ")\n");

169
testing/mex/mex10.system Normal file
View File

@ -0,0 +1,169 @@
Environment: [
k = ({act_1}.k + {act_2}.k + {act_3}.k + {act_4}.k + {act_5}.k + {act_6}.k +
{act_7}.k + {act_8}.k + {act_9}.k + {act_10}.k)
]
Initial Entities: {out_1,out_2,out_3,out_4,out_5,out_6,out_7,out_8,out_9,out_10}
Context: [k, k]
Reactions: (
[{out_1}, {act_1}, {out_1}];
[{out_1,act_1}, {}, {req_1}];
[{req_1}, {act_1}, {req_1}];
[{req_1,lock}, {}, {req_1}];
[{in_1}, {act_1}, {in_1}];
[{in_1,act_1}, {}, {out_1,done}];
[{req_1,act_2}, {}, {req_1}];
[{req_1,act_3}, {}, {req_1}];
[{req_1,act_4}, {}, {req_1}];
[{req_1,act_5}, {}, {req_1}];
[{req_1,act_6}, {}, {req_1}];
[{req_1,act_7}, {}, {req_1}];
[{req_1,act_8}, {}, {req_1}];
[{req_1,act_9}, {}, {req_1}];
[{req_1,act_10}, {}, {req_1}];
[{req_1,act_1}, {lock,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10}, {in_1,lock}];
[{out_2}, {act_2}, {out_2}];
[{out_2,act_2}, {}, {req_2}];
[{req_2}, {act_2}, {req_2}];
[{req_2,lock}, {}, {req_2}];
[{in_2}, {act_2}, {in_2}];
[{in_2,act_2}, {}, {out_2,done}];
[{req_2,act_1}, {}, {req_2}];
[{req_2,act_3}, {}, {req_2}];
[{req_2,act_4}, {}, {req_2}];
[{req_2,act_5}, {}, {req_2}];
[{req_2,act_6}, {}, {req_2}];
[{req_2,act_7}, {}, {req_2}];
[{req_2,act_8}, {}, {req_2}];
[{req_2,act_9}, {}, {req_2}];
[{req_2,act_10}, {}, {req_2}];
[{req_2,act_2}, {lock,act_1,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10}, {in_2,lock}];
[{out_3}, {act_3}, {out_3}];
[{out_3,act_3}, {}, {req_3}];
[{req_3}, {act_3}, {req_3}];
[{req_3,lock}, {}, {req_3}];
[{in_3}, {act_3}, {in_3}];
[{in_3,act_3}, {}, {out_3,done}];
[{req_3,act_1}, {}, {req_3}];
[{req_3,act_2}, {}, {req_3}];
[{req_3,act_4}, {}, {req_3}];
[{req_3,act_5}, {}, {req_3}];
[{req_3,act_6}, {}, {req_3}];
[{req_3,act_7}, {}, {req_3}];
[{req_3,act_8}, {}, {req_3}];
[{req_3,act_9}, {}, {req_3}];
[{req_3,act_10}, {}, {req_3}];
[{req_3,act_3}, {lock,act_1,act_2,act_4,act_5,act_6,act_7,act_8,act_9,act_10}, {in_3,lock}];
[{out_4}, {act_4}, {out_4}];
[{out_4,act_4}, {}, {req_4}];
[{req_4}, {act_4}, {req_4}];
[{req_4,lock}, {}, {req_4}];
[{in_4}, {act_4}, {in_4}];
[{in_4,act_4}, {}, {out_4,done}];
[{req_4,act_1}, {}, {req_4}];
[{req_4,act_2}, {}, {req_4}];
[{req_4,act_3}, {}, {req_4}];
[{req_4,act_5}, {}, {req_4}];
[{req_4,act_6}, {}, {req_4}];
[{req_4,act_7}, {}, {req_4}];
[{req_4,act_8}, {}, {req_4}];
[{req_4,act_9}, {}, {req_4}];
[{req_4,act_10}, {}, {req_4}];
[{req_4,act_4}, {lock,act_1,act_2,act_3,act_5,act_6,act_7,act_8,act_9,act_10}, {in_4,lock}];
[{out_5}, {act_5}, {out_5}];
[{out_5,act_5}, {}, {req_5}];
[{req_5}, {act_5}, {req_5}];
[{req_5,lock}, {}, {req_5}];
[{in_5}, {act_5}, {in_5}];
[{in_5,act_5}, {}, {out_5,done}];
[{req_5,act_1}, {}, {req_5}];
[{req_5,act_2}, {}, {req_5}];
[{req_5,act_3}, {}, {req_5}];
[{req_5,act_4}, {}, {req_5}];
[{req_5,act_6}, {}, {req_5}];
[{req_5,act_7}, {}, {req_5}];
[{req_5,act_8}, {}, {req_5}];
[{req_5,act_9}, {}, {req_5}];
[{req_5,act_10}, {}, {req_5}];
[{req_5,act_5}, {lock,act_1,act_2,act_3,act_4,act_6,act_7,act_8,act_9,act_10}, {in_5,lock}];
[{out_6}, {act_6}, {out_6}];
[{out_6,act_6}, {}, {req_6}];
[{req_6}, {act_6}, {req_6}];
[{req_6,lock}, {}, {req_6}];
[{in_6}, {act_6}, {in_6}];
[{in_6,act_6}, {}, {out_6,done}];
[{req_6,act_1}, {}, {req_6}];
[{req_6,act_2}, {}, {req_6}];
[{req_6,act_3}, {}, {req_6}];
[{req_6,act_4}, {}, {req_6}];
[{req_6,act_5}, {}, {req_6}];
[{req_6,act_7}, {}, {req_6}];
[{req_6,act_8}, {}, {req_6}];
[{req_6,act_9}, {}, {req_6}];
[{req_6,act_10}, {}, {req_6}];
[{req_6,act_6}, {lock,act_1,act_2,act_3,act_4,act_5,act_7,act_8,act_9,act_10}, {in_6,lock}];
[{out_7}, {act_7}, {out_7}];
[{out_7,act_7}, {}, {req_7}];
[{req_7}, {act_7}, {req_7}];
[{req_7,lock}, {}, {req_7}];
[{in_7}, {act_7}, {in_7}];
[{in_7,act_7}, {}, {out_7,done}];
[{req_7,act_1}, {}, {req_7}];
[{req_7,act_2}, {}, {req_7}];
[{req_7,act_3}, {}, {req_7}];
[{req_7,act_4}, {}, {req_7}];
[{req_7,act_5}, {}, {req_7}];
[{req_7,act_6}, {}, {req_7}];
[{req_7,act_8}, {}, {req_7}];
[{req_7,act_9}, {}, {req_7}];
[{req_7,act_10}, {}, {req_7}];
[{req_7,act_7}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_8,act_9,act_10}, {in_7,lock}];
[{out_8}, {act_8}, {out_8}];
[{out_8,act_8}, {}, {req_8}];
[{req_8}, {act_8}, {req_8}];
[{req_8,lock}, {}, {req_8}];
[{in_8}, {act_8}, {in_8}];
[{in_8,act_8}, {}, {out_8,done}];
[{req_8,act_1}, {}, {req_8}];
[{req_8,act_2}, {}, {req_8}];
[{req_8,act_3}, {}, {req_8}];
[{req_8,act_4}, {}, {req_8}];
[{req_8,act_5}, {}, {req_8}];
[{req_8,act_6}, {}, {req_8}];
[{req_8,act_7}, {}, {req_8}];
[{req_8,act_9}, {}, {req_8}];
[{req_8,act_10}, {}, {req_8}];
[{req_8,act_8}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_9,act_10}, {in_8,lock}];
[{out_9}, {act_9}, {out_9}];
[{out_9,act_9}, {}, {req_9}];
[{req_9}, {act_9}, {req_9}];
[{req_9,lock}, {}, {req_9}];
[{in_9}, {act_9}, {in_9}];
[{in_9,act_9}, {}, {out_9,done}];
[{req_9,act_1}, {}, {req_9}];
[{req_9,act_2}, {}, {req_9}];
[{req_9,act_3}, {}, {req_9}];
[{req_9,act_4}, {}, {req_9}];
[{req_9,act_5}, {}, {req_9}];
[{req_9,act_6}, {}, {req_9}];
[{req_9,act_7}, {}, {req_9}];
[{req_9,act_8}, {}, {req_9}];
[{req_9,act_10}, {}, {req_9}];
[{req_9,act_9}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_10}, {in_9,lock}];
[{out_10}, {act_10}, {out_10}];
[{out_10,act_10}, {}, {req_10}];
[{req_10}, {act_10}, {req_10}];
[{req_10,lock}, {}, {req_10}];
[{in_10}, {act_10}, {in_10}];
[{in_10,act_10}, {}, {out_10,done}];
[{req_10,act_1}, {}, {req_10}];
[{req_10,act_2}, {}, {req_10}];
[{req_10,act_3}, {}, {req_10}];
[{req_10,act_4}, {}, {req_10}];
[{req_10,act_5}, {}, {req_10}];
[{req_10,act_6}, {}, {req_10}];
[{req_10,act_7}, {}, {req_10}];
[{req_10,act_8}, {}, {req_10}];
[{req_10,act_9}, {}, {req_10}];
[{req_10,act_10}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9}, {in_10,lock}];
[{lock}, {done}, {lock}];
)

325
testing/mex/mex15.system Normal file
View File

@ -0,0 +1,325 @@
Environment: [
k = ({act_1}.k + {act_2}.k + {act_3}.k + {act_4}.k + {act_5}.k + {act_6}.k +
{act_7}.k + {act_8}.k + {act_9}.k + {act_10}.k + {act_11}.k +
{act_12}.k + {act_13}.k + {act_14}.k + {act_15}.k)
]
Initial Entities: {out_1,out_2,out_3,out_4,out_5,out_6,out_7,out_8,out_9,out_10,out_11,out_12,out_13,out_14,out_15}
Context: [k, k]
Reactions: (
[{out_1}, {act_1}, {out_1}];
[{out_1,act_1}, {}, {req_1}];
[{req_1}, {act_1}, {req_1}];
[{req_1,lock}, {}, {req_1}];
[{in_1}, {act_1}, {in_1}];
[{in_1,act_1}, {}, {out_1,done}];
[{req_1,act_2}, {}, {req_1}];
[{req_1,act_3}, {}, {req_1}];
[{req_1,act_4}, {}, {req_1}];
[{req_1,act_5}, {}, {req_1}];
[{req_1,act_6}, {}, {req_1}];
[{req_1,act_7}, {}, {req_1}];
[{req_1,act_8}, {}, {req_1}];
[{req_1,act_9}, {}, {req_1}];
[{req_1,act_10}, {}, {req_1}];
[{req_1,act_11}, {}, {req_1}];
[{req_1,act_12}, {}, {req_1}];
[{req_1,act_13}, {}, {req_1}];
[{req_1,act_14}, {}, {req_1}];
[{req_1,act_15}, {}, {req_1}];
[{req_1,act_1}, {lock,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15}, {in_1,lock}];
[{out_2}, {act_2}, {out_2}];
[{out_2,act_2}, {}, {req_2}];
[{req_2}, {act_2}, {req_2}];
[{req_2,lock}, {}, {req_2}];
[{in_2}, {act_2}, {in_2}];
[{in_2,act_2}, {}, {out_2,done}];
[{req_2,act_1}, {}, {req_2}];
[{req_2,act_3}, {}, {req_2}];
[{req_2,act_4}, {}, {req_2}];
[{req_2,act_5}, {}, {req_2}];
[{req_2,act_6}, {}, {req_2}];
[{req_2,act_7}, {}, {req_2}];
[{req_2,act_8}, {}, {req_2}];
[{req_2,act_9}, {}, {req_2}];
[{req_2,act_10}, {}, {req_2}];
[{req_2,act_11}, {}, {req_2}];
[{req_2,act_12}, {}, {req_2}];
[{req_2,act_13}, {}, {req_2}];
[{req_2,act_14}, {}, {req_2}];
[{req_2,act_15}, {}, {req_2}];
[{req_2,act_2}, {lock,act_1,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15}, {in_2,lock}];
[{out_3}, {act_3}, {out_3}];
[{out_3,act_3}, {}, {req_3}];
[{req_3}, {act_3}, {req_3}];
[{req_3,lock}, {}, {req_3}];
[{in_3}, {act_3}, {in_3}];
[{in_3,act_3}, {}, {out_3,done}];
[{req_3,act_1}, {}, {req_3}];
[{req_3,act_2}, {}, {req_3}];
[{req_3,act_4}, {}, {req_3}];
[{req_3,act_5}, {}, {req_3}];
[{req_3,act_6}, {}, {req_3}];
[{req_3,act_7}, {}, {req_3}];
[{req_3,act_8}, {}, {req_3}];
[{req_3,act_9}, {}, {req_3}];
[{req_3,act_10}, {}, {req_3}];
[{req_3,act_11}, {}, {req_3}];
[{req_3,act_12}, {}, {req_3}];
[{req_3,act_13}, {}, {req_3}];
[{req_3,act_14}, {}, {req_3}];
[{req_3,act_15}, {}, {req_3}];
[{req_3,act_3}, {lock,act_1,act_2,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15}, {in_3,lock}];
[{out_4}, {act_4}, {out_4}];
[{out_4,act_4}, {}, {req_4}];
[{req_4}, {act_4}, {req_4}];
[{req_4,lock}, {}, {req_4}];
[{in_4}, {act_4}, {in_4}];
[{in_4,act_4}, {}, {out_4,done}];
[{req_4,act_1}, {}, {req_4}];
[{req_4,act_2}, {}, {req_4}];
[{req_4,act_3}, {}, {req_4}];
[{req_4,act_5}, {}, {req_4}];
[{req_4,act_6}, {}, {req_4}];
[{req_4,act_7}, {}, {req_4}];
[{req_4,act_8}, {}, {req_4}];
[{req_4,act_9}, {}, {req_4}];
[{req_4,act_10}, {}, {req_4}];
[{req_4,act_11}, {}, {req_4}];
[{req_4,act_12}, {}, {req_4}];
[{req_4,act_13}, {}, {req_4}];
[{req_4,act_14}, {}, {req_4}];
[{req_4,act_15}, {}, {req_4}];
[{req_4,act_4}, {lock,act_1,act_2,act_3,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15}, {in_4,lock}];
[{out_5}, {act_5}, {out_5}];
[{out_5,act_5}, {}, {req_5}];
[{req_5}, {act_5}, {req_5}];
[{req_5,lock}, {}, {req_5}];
[{in_5}, {act_5}, {in_5}];
[{in_5,act_5}, {}, {out_5,done}];
[{req_5,act_1}, {}, {req_5}];
[{req_5,act_2}, {}, {req_5}];
[{req_5,act_3}, {}, {req_5}];
[{req_5,act_4}, {}, {req_5}];
[{req_5,act_6}, {}, {req_5}];
[{req_5,act_7}, {}, {req_5}];
[{req_5,act_8}, {}, {req_5}];
[{req_5,act_9}, {}, {req_5}];
[{req_5,act_10}, {}, {req_5}];
[{req_5,act_11}, {}, {req_5}];
[{req_5,act_12}, {}, {req_5}];
[{req_5,act_13}, {}, {req_5}];
[{req_5,act_14}, {}, {req_5}];
[{req_5,act_15}, {}, {req_5}];
[{req_5,act_5}, {lock,act_1,act_2,act_3,act_4,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15}, {in_5,lock}];
[{out_6}, {act_6}, {out_6}];
[{out_6,act_6}, {}, {req_6}];
[{req_6}, {act_6}, {req_6}];
[{req_6,lock}, {}, {req_6}];
[{in_6}, {act_6}, {in_6}];
[{in_6,act_6}, {}, {out_6,done}];
[{req_6,act_1}, {}, {req_6}];
[{req_6,act_2}, {}, {req_6}];
[{req_6,act_3}, {}, {req_6}];
[{req_6,act_4}, {}, {req_6}];
[{req_6,act_5}, {}, {req_6}];
[{req_6,act_7}, {}, {req_6}];
[{req_6,act_8}, {}, {req_6}];
[{req_6,act_9}, {}, {req_6}];
[{req_6,act_10}, {}, {req_6}];
[{req_6,act_11}, {}, {req_6}];
[{req_6,act_12}, {}, {req_6}];
[{req_6,act_13}, {}, {req_6}];
[{req_6,act_14}, {}, {req_6}];
[{req_6,act_15}, {}, {req_6}];
[{req_6,act_6}, {lock,act_1,act_2,act_3,act_4,act_5,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15}, {in_6,lock}];
[{out_7}, {act_7}, {out_7}];
[{out_7,act_7}, {}, {req_7}];
[{req_7}, {act_7}, {req_7}];
[{req_7,lock}, {}, {req_7}];
[{in_7}, {act_7}, {in_7}];
[{in_7,act_7}, {}, {out_7,done}];
[{req_7,act_1}, {}, {req_7}];
[{req_7,act_2}, {}, {req_7}];
[{req_7,act_3}, {}, {req_7}];
[{req_7,act_4}, {}, {req_7}];
[{req_7,act_5}, {}, {req_7}];
[{req_7,act_6}, {}, {req_7}];
[{req_7,act_8}, {}, {req_7}];
[{req_7,act_9}, {}, {req_7}];
[{req_7,act_10}, {}, {req_7}];
[{req_7,act_11}, {}, {req_7}];
[{req_7,act_12}, {}, {req_7}];
[{req_7,act_13}, {}, {req_7}];
[{req_7,act_14}, {}, {req_7}];
[{req_7,act_15}, {}, {req_7}];
[{req_7,act_7}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15}, {in_7,lock}];
[{out_8}, {act_8}, {out_8}];
[{out_8,act_8}, {}, {req_8}];
[{req_8}, {act_8}, {req_8}];
[{req_8,lock}, {}, {req_8}];
[{in_8}, {act_8}, {in_8}];
[{in_8,act_8}, {}, {out_8,done}];
[{req_8,act_1}, {}, {req_8}];
[{req_8,act_2}, {}, {req_8}];
[{req_8,act_3}, {}, {req_8}];
[{req_8,act_4}, {}, {req_8}];
[{req_8,act_5}, {}, {req_8}];
[{req_8,act_6}, {}, {req_8}];
[{req_8,act_7}, {}, {req_8}];
[{req_8,act_9}, {}, {req_8}];
[{req_8,act_10}, {}, {req_8}];
[{req_8,act_11}, {}, {req_8}];
[{req_8,act_12}, {}, {req_8}];
[{req_8,act_13}, {}, {req_8}];
[{req_8,act_14}, {}, {req_8}];
[{req_8,act_15}, {}, {req_8}];
[{req_8,act_8}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_9,act_10,act_11,act_12,act_13,act_14,act_15}, {in_8,lock}];
[{out_9}, {act_9}, {out_9}];
[{out_9,act_9}, {}, {req_9}];
[{req_9}, {act_9}, {req_9}];
[{req_9,lock}, {}, {req_9}];
[{in_9}, {act_9}, {in_9}];
[{in_9,act_9}, {}, {out_9,done}];
[{req_9,act_1}, {}, {req_9}];
[{req_9,act_2}, {}, {req_9}];
[{req_9,act_3}, {}, {req_9}];
[{req_9,act_4}, {}, {req_9}];
[{req_9,act_5}, {}, {req_9}];
[{req_9,act_6}, {}, {req_9}];
[{req_9,act_7}, {}, {req_9}];
[{req_9,act_8}, {}, {req_9}];
[{req_9,act_10}, {}, {req_9}];
[{req_9,act_11}, {}, {req_9}];
[{req_9,act_12}, {}, {req_9}];
[{req_9,act_13}, {}, {req_9}];
[{req_9,act_14}, {}, {req_9}];
[{req_9,act_15}, {}, {req_9}];
[{req_9,act_9}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_10,act_11,act_12,act_13,act_14,act_15}, {in_9,lock}];
[{out_10}, {act_10}, {out_10}];
[{out_10,act_10}, {}, {req_10}];
[{req_10}, {act_10}, {req_10}];
[{req_10,lock}, {}, {req_10}];
[{in_10}, {act_10}, {in_10}];
[{in_10,act_10}, {}, {out_10,done}];
[{req_10,act_1}, {}, {req_10}];
[{req_10,act_2}, {}, {req_10}];
[{req_10,act_3}, {}, {req_10}];
[{req_10,act_4}, {}, {req_10}];
[{req_10,act_5}, {}, {req_10}];
[{req_10,act_6}, {}, {req_10}];
[{req_10,act_7}, {}, {req_10}];
[{req_10,act_8}, {}, {req_10}];
[{req_10,act_9}, {}, {req_10}];
[{req_10,act_11}, {}, {req_10}];
[{req_10,act_12}, {}, {req_10}];
[{req_10,act_13}, {}, {req_10}];
[{req_10,act_14}, {}, {req_10}];
[{req_10,act_15}, {}, {req_10}];
[{req_10,act_10}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_11,act_12,act_13,act_14,act_15}, {in_10,lock}];
[{out_11}, {act_11}, {out_11}];
[{out_11,act_11}, {}, {req_11}];
[{req_11}, {act_11}, {req_11}];
[{req_11,lock}, {}, {req_11}];
[{in_11}, {act_11}, {in_11}];
[{in_11,act_11}, {}, {out_11,done}];
[{req_11,act_1}, {}, {req_11}];
[{req_11,act_2}, {}, {req_11}];
[{req_11,act_3}, {}, {req_11}];
[{req_11,act_4}, {}, {req_11}];
[{req_11,act_5}, {}, {req_11}];
[{req_11,act_6}, {}, {req_11}];
[{req_11,act_7}, {}, {req_11}];
[{req_11,act_8}, {}, {req_11}];
[{req_11,act_9}, {}, {req_11}];
[{req_11,act_10}, {}, {req_11}];
[{req_11,act_12}, {}, {req_11}];
[{req_11,act_13}, {}, {req_11}];
[{req_11,act_14}, {}, {req_11}];
[{req_11,act_15}, {}, {req_11}];
[{req_11,act_11}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_12,act_13,act_14,act_15}, {in_11,lock}];
[{out_12}, {act_12}, {out_12}];
[{out_12,act_12}, {}, {req_12}];
[{req_12}, {act_12}, {req_12}];
[{req_12,lock}, {}, {req_12}];
[{in_12}, {act_12}, {in_12}];
[{in_12,act_12}, {}, {out_12,done}];
[{req_12,act_1}, {}, {req_12}];
[{req_12,act_2}, {}, {req_12}];
[{req_12,act_3}, {}, {req_12}];
[{req_12,act_4}, {}, {req_12}];
[{req_12,act_5}, {}, {req_12}];
[{req_12,act_6}, {}, {req_12}];
[{req_12,act_7}, {}, {req_12}];
[{req_12,act_8}, {}, {req_12}];
[{req_12,act_9}, {}, {req_12}];
[{req_12,act_10}, {}, {req_12}];
[{req_12,act_11}, {}, {req_12}];
[{req_12,act_13}, {}, {req_12}];
[{req_12,act_14}, {}, {req_12}];
[{req_12,act_15}, {}, {req_12}];
[{req_12,act_12}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_13,act_14,act_15}, {in_12,lock}];
[{out_13}, {act_13}, {out_13}];
[{out_13,act_13}, {}, {req_13}];
[{req_13}, {act_13}, {req_13}];
[{req_13,lock}, {}, {req_13}];
[{in_13}, {act_13}, {in_13}];
[{in_13,act_13}, {}, {out_13,done}];
[{req_13,act_1}, {}, {req_13}];
[{req_13,act_2}, {}, {req_13}];
[{req_13,act_3}, {}, {req_13}];
[{req_13,act_4}, {}, {req_13}];
[{req_13,act_5}, {}, {req_13}];
[{req_13,act_6}, {}, {req_13}];
[{req_13,act_7}, {}, {req_13}];
[{req_13,act_8}, {}, {req_13}];
[{req_13,act_9}, {}, {req_13}];
[{req_13,act_10}, {}, {req_13}];
[{req_13,act_11}, {}, {req_13}];
[{req_13,act_12}, {}, {req_13}];
[{req_13,act_14}, {}, {req_13}];
[{req_13,act_15}, {}, {req_13}];
[{req_13,act_13}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_14,act_15}, {in_13,lock}];
[{out_14}, {act_14}, {out_14}];
[{out_14,act_14}, {}, {req_14}];
[{req_14}, {act_14}, {req_14}];
[{req_14,lock}, {}, {req_14}];
[{in_14}, {act_14}, {in_14}];
[{in_14,act_14}, {}, {out_14,done}];
[{req_14,act_1}, {}, {req_14}];
[{req_14,act_2}, {}, {req_14}];
[{req_14,act_3}, {}, {req_14}];
[{req_14,act_4}, {}, {req_14}];
[{req_14,act_5}, {}, {req_14}];
[{req_14,act_6}, {}, {req_14}];
[{req_14,act_7}, {}, {req_14}];
[{req_14,act_8}, {}, {req_14}];
[{req_14,act_9}, {}, {req_14}];
[{req_14,act_10}, {}, {req_14}];
[{req_14,act_11}, {}, {req_14}];
[{req_14,act_12}, {}, {req_14}];
[{req_14,act_13}, {}, {req_14}];
[{req_14,act_15}, {}, {req_14}];
[{req_14,act_14}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_15}, {in_14,lock}];
[{out_15}, {act_15}, {out_15}];
[{out_15,act_15}, {}, {req_15}];
[{req_15}, {act_15}, {req_15}];
[{req_15,lock}, {}, {req_15}];
[{in_15}, {act_15}, {in_15}];
[{in_15,act_15}, {}, {out_15,done}];
[{req_15,act_1}, {}, {req_15}];
[{req_15,act_2}, {}, {req_15}];
[{req_15,act_3}, {}, {req_15}];
[{req_15,act_4}, {}, {req_15}];
[{req_15,act_5}, {}, {req_15}];
[{req_15,act_6}, {}, {req_15}];
[{req_15,act_7}, {}, {req_15}];
[{req_15,act_8}, {}, {req_15}];
[{req_15,act_9}, {}, {req_15}];
[{req_15,act_10}, {}, {req_15}];
[{req_15,act_11}, {}, {req_15}];
[{req_15,act_12}, {}, {req_15}];
[{req_15,act_13}, {}, {req_15}];
[{req_15,act_14}, {}, {req_15}];
[{req_15,act_15}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14}, {in_15,lock}];
[{lock}, {done}, {lock}];
)

View File

@ -0,0 +1,2 @@
Weights: 10, 10
Sets: {a, b}, {a}

25
testing/mex/mex2.system Normal file
View File

@ -0,0 +1,25 @@
Environment: [
k1 = ({}.k1 + {act_1}.k1),
k2 = ({}.k2 + {act_2}.k2)
]
Initial Entities: {out_1, out_2}
Context: [k1, k2]
Reactions: (
[{out_1}, {act_1}, {out_1}];
[{req_1}, {act_1}, {req_1}];
[{req_1,lock}, {}, {req_1}];
[{req_1,act_2}, {}, {req_1}];
[{in_1}, {act_1}, {in_1}];
[{out_1,act_1}, {}, {req_1}];
[{req_1,act_1}, {lock,act_2}, {in_1,lock}];
[{in_1,act_1}, {}, {out_1,done}];
[{out_2}, {act_2}, {out_2}];
[{req_2}, {act_2}, {req_2}];
[{req_2,lock}, {}, {req_2}];
[{req_2,act_1}, {}, {req_2}];
[{in_2}, {act_2}, {in_2}];
[{out_2,act_2}, {}, {req_2}];
[{req_2,act_2}, {lock,act_1}, {in_2,lock}];
[{in_2,act_2}, {}, {out_2,done}];
[{lock}, {done}, {lock}]
)

528
testing/mex/mex20.system Normal file
View File

@ -0,0 +1,528 @@
Environment: [
k = ({act_1}.k + {act_2}.k + {act_3}.k + {act_4}.k + {act_5}.k + {act_6}.k + {act_7}.k + {act_8}.k + {act_9}.k + {act_10}.k + {act_11}.k + {act_12}.k + {act_13}.k + {act_14}.k + {act_15}.k + {act_16}.k + {act_17}.k + {act_18}.k + {act_19}.k + {act_20}.k)
]
Initial Entities: {out_1,out_2,out_3,out_4,out_5,out_6,out_7,out_8,out_9,out_10,out_11,out_12,out_13,out_14,out_15,out_16,out_17,out_18,out_19,out_20}
Context: [k,k]
Reactions: (
[{out_1}, {act_1}, {out_1}];
[{out_1,act_1}, {}, {req_1}];
[{req_1}, {act_1}, {req_1}];
[{req_1,lock}, {}, {req_1}];
[{in_1}, {act_1}, {in_1}];
[{in_1,act_1}, {}, {out_1,done}];
[{req_1,act_2}, {}, {req_1}];
[{req_1,act_3}, {}, {req_1}];
[{req_1,act_4}, {}, {req_1}];
[{req_1,act_5}, {}, {req_1}];
[{req_1,act_6}, {}, {req_1}];
[{req_1,act_7}, {}, {req_1}];
[{req_1,act_8}, {}, {req_1}];
[{req_1,act_9}, {}, {req_1}];
[{req_1,act_10}, {}, {req_1}];
[{req_1,act_11}, {}, {req_1}];
[{req_1,act_12}, {}, {req_1}];
[{req_1,act_13}, {}, {req_1}];
[{req_1,act_14}, {}, {req_1}];
[{req_1,act_15}, {}, {req_1}];
[{req_1,act_16}, {}, {req_1}];
[{req_1,act_17}, {}, {req_1}];
[{req_1,act_18}, {}, {req_1}];
[{req_1,act_19}, {}, {req_1}];
[{req_1,act_20}, {}, {req_1}];
[{req_1,act_1}, {lock,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_1,lock}];
[{out_2}, {act_2}, {out_2}];
[{out_2,act_2}, {}, {req_2}];
[{req_2}, {act_2}, {req_2}];
[{req_2,lock}, {}, {req_2}];
[{in_2}, {act_2}, {in_2}];
[{in_2,act_2}, {}, {out_2,done}];
[{req_2,act_1}, {}, {req_2}];
[{req_2,act_3}, {}, {req_2}];
[{req_2,act_4}, {}, {req_2}];
[{req_2,act_5}, {}, {req_2}];
[{req_2,act_6}, {}, {req_2}];
[{req_2,act_7}, {}, {req_2}];
[{req_2,act_8}, {}, {req_2}];
[{req_2,act_9}, {}, {req_2}];
[{req_2,act_10}, {}, {req_2}];
[{req_2,act_11}, {}, {req_2}];
[{req_2,act_12}, {}, {req_2}];
[{req_2,act_13}, {}, {req_2}];
[{req_2,act_14}, {}, {req_2}];
[{req_2,act_15}, {}, {req_2}];
[{req_2,act_16}, {}, {req_2}];
[{req_2,act_17}, {}, {req_2}];
[{req_2,act_18}, {}, {req_2}];
[{req_2,act_19}, {}, {req_2}];
[{req_2,act_20}, {}, {req_2}];
[{req_2,act_2}, {lock,act_1,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_2,lock}];
[{out_3}, {act_3}, {out_3}];
[{out_3,act_3}, {}, {req_3}];
[{req_3}, {act_3}, {req_3}];
[{req_3,lock}, {}, {req_3}];
[{in_3}, {act_3}, {in_3}];
[{in_3,act_3}, {}, {out_3,done}];
[{req_3,act_1}, {}, {req_3}];
[{req_3,act_2}, {}, {req_3}];
[{req_3,act_4}, {}, {req_3}];
[{req_3,act_5}, {}, {req_3}];
[{req_3,act_6}, {}, {req_3}];
[{req_3,act_7}, {}, {req_3}];
[{req_3,act_8}, {}, {req_3}];
[{req_3,act_9}, {}, {req_3}];
[{req_3,act_10}, {}, {req_3}];
[{req_3,act_11}, {}, {req_3}];
[{req_3,act_12}, {}, {req_3}];
[{req_3,act_13}, {}, {req_3}];
[{req_3,act_14}, {}, {req_3}];
[{req_3,act_15}, {}, {req_3}];
[{req_3,act_16}, {}, {req_3}];
[{req_3,act_17}, {}, {req_3}];
[{req_3,act_18}, {}, {req_3}];
[{req_3,act_19}, {}, {req_3}];
[{req_3,act_20}, {}, {req_3}];
[{req_3,act_3}, {lock,act_1,act_2,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_3,lock}];
[{out_4}, {act_4}, {out_4}];
[{out_4,act_4}, {}, {req_4}];
[{req_4}, {act_4}, {req_4}];
[{req_4,lock}, {}, {req_4}];
[{in_4}, {act_4}, {in_4}];
[{in_4,act_4}, {}, {out_4,done}];
[{req_4,act_1}, {}, {req_4}];
[{req_4,act_2}, {}, {req_4}];
[{req_4,act_3}, {}, {req_4}];
[{req_4,act_5}, {}, {req_4}];
[{req_4,act_6}, {}, {req_4}];
[{req_4,act_7}, {}, {req_4}];
[{req_4,act_8}, {}, {req_4}];
[{req_4,act_9}, {}, {req_4}];
[{req_4,act_10}, {}, {req_4}];
[{req_4,act_11}, {}, {req_4}];
[{req_4,act_12}, {}, {req_4}];
[{req_4,act_13}, {}, {req_4}];
[{req_4,act_14}, {}, {req_4}];
[{req_4,act_15}, {}, {req_4}];
[{req_4,act_16}, {}, {req_4}];
[{req_4,act_17}, {}, {req_4}];
[{req_4,act_18}, {}, {req_4}];
[{req_4,act_19}, {}, {req_4}];
[{req_4,act_20}, {}, {req_4}];
[{req_4,act_4}, {lock,act_1,act_2,act_3,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_4,lock}];
[{out_5}, {act_5}, {out_5}];
[{out_5,act_5}, {}, {req_5}];
[{req_5}, {act_5}, {req_5}];
[{req_5,lock}, {}, {req_5}];
[{in_5}, {act_5}, {in_5}];
[{in_5,act_5}, {}, {out_5,done}];
[{req_5,act_1}, {}, {req_5}];
[{req_5,act_2}, {}, {req_5}];
[{req_5,act_3}, {}, {req_5}];
[{req_5,act_4}, {}, {req_5}];
[{req_5,act_6}, {}, {req_5}];
[{req_5,act_7}, {}, {req_5}];
[{req_5,act_8}, {}, {req_5}];
[{req_5,act_9}, {}, {req_5}];
[{req_5,act_10}, {}, {req_5}];
[{req_5,act_11}, {}, {req_5}];
[{req_5,act_12}, {}, {req_5}];
[{req_5,act_13}, {}, {req_5}];
[{req_5,act_14}, {}, {req_5}];
[{req_5,act_15}, {}, {req_5}];
[{req_5,act_16}, {}, {req_5}];
[{req_5,act_17}, {}, {req_5}];
[{req_5,act_18}, {}, {req_5}];
[{req_5,act_19}, {}, {req_5}];
[{req_5,act_20}, {}, {req_5}];
[{req_5,act_5}, {lock,act_1,act_2,act_3,act_4,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_5,lock}];
[{out_6}, {act_6}, {out_6}];
[{out_6,act_6}, {}, {req_6}];
[{req_6}, {act_6}, {req_6}];
[{req_6,lock}, {}, {req_6}];
[{in_6}, {act_6}, {in_6}];
[{in_6,act_6}, {}, {out_6,done}];
[{req_6,act_1}, {}, {req_6}];
[{req_6,act_2}, {}, {req_6}];
[{req_6,act_3}, {}, {req_6}];
[{req_6,act_4}, {}, {req_6}];
[{req_6,act_5}, {}, {req_6}];
[{req_6,act_7}, {}, {req_6}];
[{req_6,act_8}, {}, {req_6}];
[{req_6,act_9}, {}, {req_6}];
[{req_6,act_10}, {}, {req_6}];
[{req_6,act_11}, {}, {req_6}];
[{req_6,act_12}, {}, {req_6}];
[{req_6,act_13}, {}, {req_6}];
[{req_6,act_14}, {}, {req_6}];
[{req_6,act_15}, {}, {req_6}];
[{req_6,act_16}, {}, {req_6}];
[{req_6,act_17}, {}, {req_6}];
[{req_6,act_18}, {}, {req_6}];
[{req_6,act_19}, {}, {req_6}];
[{req_6,act_20}, {}, {req_6}];
[{req_6,act_6}, {lock,act_1,act_2,act_3,act_4,act_5,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_6,lock}];
[{out_7}, {act_7}, {out_7}];
[{out_7,act_7}, {}, {req_7}];
[{req_7}, {act_7}, {req_7}];
[{req_7,lock}, {}, {req_7}];
[{in_7}, {act_7}, {in_7}];
[{in_7,act_7}, {}, {out_7,done}];
[{req_7,act_1}, {}, {req_7}];
[{req_7,act_2}, {}, {req_7}];
[{req_7,act_3}, {}, {req_7}];
[{req_7,act_4}, {}, {req_7}];
[{req_7,act_5}, {}, {req_7}];
[{req_7,act_6}, {}, {req_7}];
[{req_7,act_8}, {}, {req_7}];
[{req_7,act_9}, {}, {req_7}];
[{req_7,act_10}, {}, {req_7}];
[{req_7,act_11}, {}, {req_7}];
[{req_7,act_12}, {}, {req_7}];
[{req_7,act_13}, {}, {req_7}];
[{req_7,act_14}, {}, {req_7}];
[{req_7,act_15}, {}, {req_7}];
[{req_7,act_16}, {}, {req_7}];
[{req_7,act_17}, {}, {req_7}];
[{req_7,act_18}, {}, {req_7}];
[{req_7,act_19}, {}, {req_7}];
[{req_7,act_20}, {}, {req_7}];
[{req_7,act_7}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_7,lock}];
[{out_8}, {act_8}, {out_8}];
[{out_8,act_8}, {}, {req_8}];
[{req_8}, {act_8}, {req_8}];
[{req_8,lock}, {}, {req_8}];
[{in_8}, {act_8}, {in_8}];
[{in_8,act_8}, {}, {out_8,done}];
[{req_8,act_1}, {}, {req_8}];
[{req_8,act_2}, {}, {req_8}];
[{req_8,act_3}, {}, {req_8}];
[{req_8,act_4}, {}, {req_8}];
[{req_8,act_5}, {}, {req_8}];
[{req_8,act_6}, {}, {req_8}];
[{req_8,act_7}, {}, {req_8}];
[{req_8,act_9}, {}, {req_8}];
[{req_8,act_10}, {}, {req_8}];
[{req_8,act_11}, {}, {req_8}];
[{req_8,act_12}, {}, {req_8}];
[{req_8,act_13}, {}, {req_8}];
[{req_8,act_14}, {}, {req_8}];
[{req_8,act_15}, {}, {req_8}];
[{req_8,act_16}, {}, {req_8}];
[{req_8,act_17}, {}, {req_8}];
[{req_8,act_18}, {}, {req_8}];
[{req_8,act_19}, {}, {req_8}];
[{req_8,act_20}, {}, {req_8}];
[{req_8,act_8}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_8,lock}];
[{out_9}, {act_9}, {out_9}];
[{out_9,act_9}, {}, {req_9}];
[{req_9}, {act_9}, {req_9}];
[{req_9,lock}, {}, {req_9}];
[{in_9}, {act_9}, {in_9}];
[{in_9,act_9}, {}, {out_9,done}];
[{req_9,act_1}, {}, {req_9}];
[{req_9,act_2}, {}, {req_9}];
[{req_9,act_3}, {}, {req_9}];
[{req_9,act_4}, {}, {req_9}];
[{req_9,act_5}, {}, {req_9}];
[{req_9,act_6}, {}, {req_9}];
[{req_9,act_7}, {}, {req_9}];
[{req_9,act_8}, {}, {req_9}];
[{req_9,act_10}, {}, {req_9}];
[{req_9,act_11}, {}, {req_9}];
[{req_9,act_12}, {}, {req_9}];
[{req_9,act_13}, {}, {req_9}];
[{req_9,act_14}, {}, {req_9}];
[{req_9,act_15}, {}, {req_9}];
[{req_9,act_16}, {}, {req_9}];
[{req_9,act_17}, {}, {req_9}];
[{req_9,act_18}, {}, {req_9}];
[{req_9,act_19}, {}, {req_9}];
[{req_9,act_20}, {}, {req_9}];
[{req_9,act_9}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_9,lock}];
[{out_10}, {act_10}, {out_10}];
[{out_10,act_10}, {}, {req_10}];
[{req_10}, {act_10}, {req_10}];
[{req_10,lock}, {}, {req_10}];
[{in_10}, {act_10}, {in_10}];
[{in_10,act_10}, {}, {out_10,done}];
[{req_10,act_1}, {}, {req_10}];
[{req_10,act_2}, {}, {req_10}];
[{req_10,act_3}, {}, {req_10}];
[{req_10,act_4}, {}, {req_10}];
[{req_10,act_5}, {}, {req_10}];
[{req_10,act_6}, {}, {req_10}];
[{req_10,act_7}, {}, {req_10}];
[{req_10,act_8}, {}, {req_10}];
[{req_10,act_9}, {}, {req_10}];
[{req_10,act_11}, {}, {req_10}];
[{req_10,act_12}, {}, {req_10}];
[{req_10,act_13}, {}, {req_10}];
[{req_10,act_14}, {}, {req_10}];
[{req_10,act_15}, {}, {req_10}];
[{req_10,act_16}, {}, {req_10}];
[{req_10,act_17}, {}, {req_10}];
[{req_10,act_18}, {}, {req_10}];
[{req_10,act_19}, {}, {req_10}];
[{req_10,act_20}, {}, {req_10}];
[{req_10,act_10}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_10,lock}];
[{out_11}, {act_11}, {out_11}];
[{out_11,act_11}, {}, {req_11}];
[{req_11}, {act_11}, {req_11}];
[{req_11,lock}, {}, {req_11}];
[{in_11}, {act_11}, {in_11}];
[{in_11,act_11}, {}, {out_11,done}];
[{req_11,act_1}, {}, {req_11}];
[{req_11,act_2}, {}, {req_11}];
[{req_11,act_3}, {}, {req_11}];
[{req_11,act_4}, {}, {req_11}];
[{req_11,act_5}, {}, {req_11}];
[{req_11,act_6}, {}, {req_11}];
[{req_11,act_7}, {}, {req_11}];
[{req_11,act_8}, {}, {req_11}];
[{req_11,act_9}, {}, {req_11}];
[{req_11,act_10}, {}, {req_11}];
[{req_11,act_12}, {}, {req_11}];
[{req_11,act_13}, {}, {req_11}];
[{req_11,act_14}, {}, {req_11}];
[{req_11,act_15}, {}, {req_11}];
[{req_11,act_16}, {}, {req_11}];
[{req_11,act_17}, {}, {req_11}];
[{req_11,act_18}, {}, {req_11}];
[{req_11,act_19}, {}, {req_11}];
[{req_11,act_20}, {}, {req_11}];
[{req_11,act_11}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_11,lock}];
[{out_12}, {act_12}, {out_12}];
[{out_12,act_12}, {}, {req_12}];
[{req_12}, {act_12}, {req_12}];
[{req_12,lock}, {}, {req_12}];
[{in_12}, {act_12}, {in_12}];
[{in_12,act_12}, {}, {out_12,done}];
[{req_12,act_1}, {}, {req_12}];
[{req_12,act_2}, {}, {req_12}];
[{req_12,act_3}, {}, {req_12}];
[{req_12,act_4}, {}, {req_12}];
[{req_12,act_5}, {}, {req_12}];
[{req_12,act_6}, {}, {req_12}];
[{req_12,act_7}, {}, {req_12}];
[{req_12,act_8}, {}, {req_12}];
[{req_12,act_9}, {}, {req_12}];
[{req_12,act_10}, {}, {req_12}];
[{req_12,act_11}, {}, {req_12}];
[{req_12,act_13}, {}, {req_12}];
[{req_12,act_14}, {}, {req_12}];
[{req_12,act_15}, {}, {req_12}];
[{req_12,act_16}, {}, {req_12}];
[{req_12,act_17}, {}, {req_12}];
[{req_12,act_18}, {}, {req_12}];
[{req_12,act_19}, {}, {req_12}];
[{req_12,act_20}, {}, {req_12}];
[{req_12,act_12}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_13,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_12,lock}];
[{out_13}, {act_13}, {out_13}];
[{out_13,act_13}, {}, {req_13}];
[{req_13}, {act_13}, {req_13}];
[{req_13,lock}, {}, {req_13}];
[{in_13}, {act_13}, {in_13}];
[{in_13,act_13}, {}, {out_13,done}];
[{req_13,act_1}, {}, {req_13}];
[{req_13,act_2}, {}, {req_13}];
[{req_13,act_3}, {}, {req_13}];
[{req_13,act_4}, {}, {req_13}];
[{req_13,act_5}, {}, {req_13}];
[{req_13,act_6}, {}, {req_13}];
[{req_13,act_7}, {}, {req_13}];
[{req_13,act_8}, {}, {req_13}];
[{req_13,act_9}, {}, {req_13}];
[{req_13,act_10}, {}, {req_13}];
[{req_13,act_11}, {}, {req_13}];
[{req_13,act_12}, {}, {req_13}];
[{req_13,act_14}, {}, {req_13}];
[{req_13,act_15}, {}, {req_13}];
[{req_13,act_16}, {}, {req_13}];
[{req_13,act_17}, {}, {req_13}];
[{req_13,act_18}, {}, {req_13}];
[{req_13,act_19}, {}, {req_13}];
[{req_13,act_20}, {}, {req_13}];
[{req_13,act_13}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_14,act_15,act_16,act_17,act_18,act_19,act_20}, {in_13,lock}];
[{out_14}, {act_14}, {out_14}];
[{out_14,act_14}, {}, {req_14}];
[{req_14}, {act_14}, {req_14}];
[{req_14,lock}, {}, {req_14}];
[{in_14}, {act_14}, {in_14}];
[{in_14,act_14}, {}, {out_14,done}];
[{req_14,act_1}, {}, {req_14}];
[{req_14,act_2}, {}, {req_14}];
[{req_14,act_3}, {}, {req_14}];
[{req_14,act_4}, {}, {req_14}];
[{req_14,act_5}, {}, {req_14}];
[{req_14,act_6}, {}, {req_14}];
[{req_14,act_7}, {}, {req_14}];
[{req_14,act_8}, {}, {req_14}];
[{req_14,act_9}, {}, {req_14}];
[{req_14,act_10}, {}, {req_14}];
[{req_14,act_11}, {}, {req_14}];
[{req_14,act_12}, {}, {req_14}];
[{req_14,act_13}, {}, {req_14}];
[{req_14,act_15}, {}, {req_14}];
[{req_14,act_16}, {}, {req_14}];
[{req_14,act_17}, {}, {req_14}];
[{req_14,act_18}, {}, {req_14}];
[{req_14,act_19}, {}, {req_14}];
[{req_14,act_20}, {}, {req_14}];
[{req_14,act_14}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_15,act_16,act_17,act_18,act_19,act_20}, {in_14,lock}];
[{out_15}, {act_15}, {out_15}];
[{out_15,act_15}, {}, {req_15}];
[{req_15}, {act_15}, {req_15}];
[{req_15,lock}, {}, {req_15}];
[{in_15}, {act_15}, {in_15}];
[{in_15,act_15}, {}, {out_15,done}];
[{req_15,act_1}, {}, {req_15}];
[{req_15,act_2}, {}, {req_15}];
[{req_15,act_3}, {}, {req_15}];
[{req_15,act_4}, {}, {req_15}];
[{req_15,act_5}, {}, {req_15}];
[{req_15,act_6}, {}, {req_15}];
[{req_15,act_7}, {}, {req_15}];
[{req_15,act_8}, {}, {req_15}];
[{req_15,act_9}, {}, {req_15}];
[{req_15,act_10}, {}, {req_15}];
[{req_15,act_11}, {}, {req_15}];
[{req_15,act_12}, {}, {req_15}];
[{req_15,act_13}, {}, {req_15}];
[{req_15,act_14}, {}, {req_15}];
[{req_15,act_16}, {}, {req_15}];
[{req_15,act_17}, {}, {req_15}];
[{req_15,act_18}, {}, {req_15}];
[{req_15,act_19}, {}, {req_15}];
[{req_15,act_20}, {}, {req_15}];
[{req_15,act_15}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_16,act_17,act_18,act_19,act_20}, {in_15,lock}];
[{out_16}, {act_16}, {out_16}];
[{out_16,act_16}, {}, {req_16}];
[{req_16}, {act_16}, {req_16}];
[{req_16,lock}, {}, {req_16}];
[{in_16}, {act_16}, {in_16}];
[{in_16,act_16}, {}, {out_16,done}];
[{req_16,act_1}, {}, {req_16}];
[{req_16,act_2}, {}, {req_16}];
[{req_16,act_3}, {}, {req_16}];
[{req_16,act_4}, {}, {req_16}];
[{req_16,act_5}, {}, {req_16}];
[{req_16,act_6}, {}, {req_16}];
[{req_16,act_7}, {}, {req_16}];
[{req_16,act_8}, {}, {req_16}];
[{req_16,act_9}, {}, {req_16}];
[{req_16,act_10}, {}, {req_16}];
[{req_16,act_11}, {}, {req_16}];
[{req_16,act_12}, {}, {req_16}];
[{req_16,act_13}, {}, {req_16}];
[{req_16,act_14}, {}, {req_16}];
[{req_16,act_15}, {}, {req_16}];
[{req_16,act_17}, {}, {req_16}];
[{req_16,act_18}, {}, {req_16}];
[{req_16,act_19}, {}, {req_16}];
[{req_16,act_20}, {}, {req_16}];
[{req_16,act_16}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_17,act_18,act_19,act_20}, {in_16,lock}];
[{out_17}, {act_17}, {out_17}];
[{out_17,act_17}, {}, {req_17}];
[{req_17}, {act_17}, {req_17}];
[{req_17,lock}, {}, {req_17}];
[{in_17}, {act_17}, {in_17}];
[{in_17,act_17}, {}, {out_17,done}];
[{req_17,act_1}, {}, {req_17}];
[{req_17,act_2}, {}, {req_17}];
[{req_17,act_3}, {}, {req_17}];
[{req_17,act_4}, {}, {req_17}];
[{req_17,act_5}, {}, {req_17}];
[{req_17,act_6}, {}, {req_17}];
[{req_17,act_7}, {}, {req_17}];
[{req_17,act_8}, {}, {req_17}];
[{req_17,act_9}, {}, {req_17}];
[{req_17,act_10}, {}, {req_17}];
[{req_17,act_11}, {}, {req_17}];
[{req_17,act_12}, {}, {req_17}];
[{req_17,act_13}, {}, {req_17}];
[{req_17,act_14}, {}, {req_17}];
[{req_17,act_15}, {}, {req_17}];
[{req_17,act_16}, {}, {req_17}];
[{req_17,act_18}, {}, {req_17}];
[{req_17,act_19}, {}, {req_17}];
[{req_17,act_20}, {}, {req_17}];
[{req_17,act_17}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_18,act_19,act_20}, {in_17,lock}];
[{out_18}, {act_18}, {out_18}];
[{out_18,act_18}, {}, {req_18}];
[{req_18}, {act_18}, {req_18}];
[{req_18,lock}, {}, {req_18}];
[{in_18}, {act_18}, {in_18}];
[{in_18,act_18}, {}, {out_18,done}];
[{req_18,act_1}, {}, {req_18}];
[{req_18,act_2}, {}, {req_18}];
[{req_18,act_3}, {}, {req_18}];
[{req_18,act_4}, {}, {req_18}];
[{req_18,act_5}, {}, {req_18}];
[{req_18,act_6}, {}, {req_18}];
[{req_18,act_7}, {}, {req_18}];
[{req_18,act_8}, {}, {req_18}];
[{req_18,act_9}, {}, {req_18}];
[{req_18,act_10}, {}, {req_18}];
[{req_18,act_11}, {}, {req_18}];
[{req_18,act_12}, {}, {req_18}];
[{req_18,act_13}, {}, {req_18}];
[{req_18,act_14}, {}, {req_18}];
[{req_18,act_15}, {}, {req_18}];
[{req_18,act_16}, {}, {req_18}];
[{req_18,act_17}, {}, {req_18}];
[{req_18,act_19}, {}, {req_18}];
[{req_18,act_20}, {}, {req_18}];
[{req_18,act_18}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_19,act_20}, {in_18,lock}];
[{out_19}, {act_19}, {out_19}];
[{out_19,act_19}, {}, {req_19}];
[{req_19}, {act_19}, {req_19}];
[{req_19,lock}, {}, {req_19}];
[{in_19}, {act_19}, {in_19}];
[{in_19,act_19}, {}, {out_19,done}];
[{req_19,act_1}, {}, {req_19}];
[{req_19,act_2}, {}, {req_19}];
[{req_19,act_3}, {}, {req_19}];
[{req_19,act_4}, {}, {req_19}];
[{req_19,act_5}, {}, {req_19}];
[{req_19,act_6}, {}, {req_19}];
[{req_19,act_7}, {}, {req_19}];
[{req_19,act_8}, {}, {req_19}];
[{req_19,act_9}, {}, {req_19}];
[{req_19,act_10}, {}, {req_19}];
[{req_19,act_11}, {}, {req_19}];
[{req_19,act_12}, {}, {req_19}];
[{req_19,act_13}, {}, {req_19}];
[{req_19,act_14}, {}, {req_19}];
[{req_19,act_15}, {}, {req_19}];
[{req_19,act_16}, {}, {req_19}];
[{req_19,act_17}, {}, {req_19}];
[{req_19,act_18}, {}, {req_19}];
[{req_19,act_20}, {}, {req_19}];
[{req_19,act_19}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_20}, {in_19,lock}];
[{out_20}, {act_20}, {out_20}];
[{out_20,act_20}, {}, {req_20}];
[{req_20}, {act_20}, {req_20}];
[{req_20,lock}, {}, {req_20}];
[{in_20}, {act_20}, {in_20}];
[{in_20,act_20}, {}, {out_20,done}];
[{req_20,act_1}, {}, {req_20}];
[{req_20,act_2}, {}, {req_20}];
[{req_20,act_3}, {}, {req_20}];
[{req_20,act_4}, {}, {req_20}];
[{req_20,act_5}, {}, {req_20}];
[{req_20,act_6}, {}, {req_20}];
[{req_20,act_7}, {}, {req_20}];
[{req_20,act_8}, {}, {req_20}];
[{req_20,act_9}, {}, {req_20}];
[{req_20,act_10}, {}, {req_20}];
[{req_20,act_11}, {}, {req_20}];
[{req_20,act_12}, {}, {req_20}];
[{req_20,act_13}, {}, {req_20}];
[{req_20,act_14}, {}, {req_20}];
[{req_20,act_15}, {}, {req_20}];
[{req_20,act_16}, {}, {req_20}];
[{req_20,act_17}, {}, {req_20}];
[{req_20,act_18}, {}, {req_20}];
[{req_20,act_19}, {}, {req_20}];
[{req_20,act_20}, {lock,act_1,act_2,act_3,act_4,act_5,act_6,act_7,act_8,act_9,act_10,act_11,act_12,act_13,act_14,act_15,act_16,act_17,act_18,act_19}, {in_20,lock}];
[{lock}, {done}, {lock}];
)

37
testing/mex/mex3.system Normal file
View File

@ -0,0 +1,37 @@
Environment: [
k1 = ({}.k1 + {act_1}.k1),
k2 = ({}.k2 + {act_2}.k2),
k3 = ({}.k3 + {act_3}.k3),
]
Initial Entities: {out_1, out_2, out_3}
Context: [k1, k2, k3]
Reactions: (
[{out_1}, {act_1}, {out_1}];
[{req_1}, {act_1}, {req_1}];
[{req_1,lock}, {}, {req_1}];
[{req_1,act_2}, {}, {req_1}];
[{req_1,act_3}, {}, {req_1}];
[{in_1}, {act_1}, {in_1}];
[{out_1,act_1}, {}, {req_1}];
[{req_1,act_1}, {lock,act_2,act_3}, {in_1,lock}];
[{in_1,act_1}, {}, {out_1,done}];
[{out_2}, {act_2}, {out_2}];
[{req_2}, {act_2}, {req_2}];
[{req_2,lock}, {}, {req_2}];
[{req_2,act_1}, {}, {req_2}];
[{req_2,act_3}, {}, {req_2}];
[{in_2}, {act_2}, {in_2}];
[{out_2,act_2}, {}, {req_2}];
[{req_2,act_2}, {lock,act_1,act_3}, {in_2,lock}];
[{in_2,act_2}, {}, {out_2,done}];
[{out_3}, {act_3}, {out_3}];
[{req_3}, {act_3}, {req_3}];
[{req_3,lock}, {}, {req_3}];
[{req_3,act_1}, {}, {req_3}];
[{req_3,act_2}, {}, {req_3}];
[{in_3}, {act_3}, {in_3}];
[{out_3,act_3}, {}, {req_3}];
[{req_3,act_3}, {lock,act_1,act_2}, {in_3,lock}];
[{in_3,act_3}, {}, {out_3,done}];
[{lock}, {done}, {lock}];
)

1088
testing/mex/mex30.system Normal file

File diff suppressed because it is too large Load Diff

1848
testing/mex/mex40.system Normal file

File diff suppressed because it is too large Load Diff

63
testing/mex/mex5.system Normal file
View File

@ -0,0 +1,63 @@
Environment: [
k = ({act_1}.k + {act_2}.k + {act_3}.k + {act_4}.k + {act_5}.k)
]
Initial Entities: {out_1, out_2, out_3, out_4, out_5}
Context: [k, k]
Reactions: (
[{out_1}, {act_1}, {out_1}];
[{out_1,act_1}, {}, {req_1}];
[{req_1}, {act_1}, {req_1}];
[{req_1,lock}, {}, {req_1}];
[{in_1}, {act_1}, {in_1}];
[{in_1,act_1}, {}, {out_1,done}];
[{req_1,act_2}, {}, {req_1}];
[{req_1,act_3}, {}, {req_1}];
[{req_1,act_4}, {}, {req_1}];
[{req_1,act_5}, {}, {req_1}];
[{req_1,act_1}, {lock,act_2,act_3,act_4,act_5}, {in_1,lock}];
[{out_2}, {act_2}, {out_2}];
[{out_2,act_2}, {}, {req_2}];
[{req_2}, {act_2}, {req_2}];
[{req_2,lock}, {}, {req_2}];
[{in_2}, {act_2}, {in_2}];
[{in_2,act_2}, {}, {out_2,done}];
[{req_2,act_1}, {}, {req_2}];
[{req_2,act_3}, {}, {req_2}];
[{req_2,act_4}, {}, {req_2}];
[{req_2,act_5}, {}, {req_2}];
[{req_2,act_2}, {lock,act_1,act_3,act_4,act_5}, {in_2,lock}];
[{out_3}, {act_3}, {out_3}];
[{out_3,act_3}, {}, {req_3}];
[{req_3}, {act_3}, {req_3}];
[{req_3,lock}, {}, {req_3}];
[{in_3}, {act_3}, {in_3}];
[{in_3,act_3}, {}, {out_3,done}];
[{req_3,act_1}, {}, {req_3}];
[{req_3,act_2}, {}, {req_3}];
[{req_3,act_4}, {}, {req_3}];
[{req_3,act_5}, {}, {req_3}];
[{req_3,act_3}, {lock,act_1,act_2,act_4,act_5}, {in_3,lock}];
[{out_4}, {act_4}, {out_4}];
[{out_4,act_4}, {}, {req_4}];
[{req_4}, {act_4}, {req_4}];
[{req_4,lock}, {}, {req_4}];
[{in_4}, {act_4}, {in_4}];
[{in_4,act_4}, {}, {out_4,done}];
[{req_4,act_1}, {}, {req_4}];
[{req_4,act_2}, {}, {req_4}];
[{req_4,act_3}, {}, {req_4}];
[{req_4,act_5}, {}, {req_4}];
[{req_4,act_4}, {lock,act_1,act_2,act_3,act_5}, {in_4,lock}];
[{out_5}, {act_5}, {out_5}];
[{out_5,act_5}, {}, {req_5}];
[{req_5}, {act_5}, {req_5}];
[{req_5,lock}, {}, {req_5}];
[{in_5}, {act_5}, {in_5}];
[{in_5,act_5}, {}, {out_5,done}];
[{req_5,act_1}, {}, {req_5}];
[{req_5,act_2}, {}, {req_5}];
[{req_5,act_3}, {}, {req_5}];
[{req_5,act_4}, {}, {req_5}];
[{req_5,act_5}, {lock,act_1,act_2,act_3,act_4}, {in_5,lock}];
[{lock}, {done}, {lock}];
)

2808
testing/mex/mex50.system Normal file

File diff suppressed because it is too large Load Diff