Subject: Re: [boost] [MSM] Is there any interest in C++14 Boost.MSM-eUML like library which compiles up to 60x quicker whilst being a slightly faster too?
From: Kris (krzysztof_at_[hidden])
Date: 2016-02-03 08:46:51
On Wed, Feb 3, 2016 at 9:12 AM, Rob Stewart [via Boost] <
> On February 2, 2016 4:29:35 PM EST, Krzysztof Jusiak <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4683164&i=0>> wrote:
> > If it comes to the transition table DSL. I was concidering a lot of
> > options. For example MSM3(eUML2) is using src + event [guard] / action
> > -> dst
> > which looks great, however, having a dst state at the end is not
> > really
> > practical, especially after a lot of noice introduced by guard and
> > actions
> > (for example in place lambda expressions).
> > Right now, I'm thinking of introducing DSL which would look like that.
> > make_transition_table(
> > "idle* -> state1"_t + event [ guard ] / action
> > , "state1 -> X"_t [ guard ] / action
> > );
> > Nevertheless, I'm not sure whether such approach would be seen
> > positively
> > because following MSM approach it should be more like that.
> > make_transition_table(
> > "state1 <- idle*"_t + event [ guard ] / action
> > , "X <- state1"_t [ guard ] / action
> > );
> We're accustomed to seeing the target on the left of an assignment, so
> what about "state1 = idle*"?
> I get your interest in seeing the current state on the left, because the
> transition is from the current state to the new one. If there can be
> multiple transitions from one state, the only readable form puts the
> current state first, IMO. Using "if_" or "when" to separate the transition
> from the condition might help:
> (from -> to).when(event[guard]/condition)
> You could omit "when" with the parens:
> from -> to (event[guard]/condition)
Thanks for your valuable input. Yea, it's all about the parens in the end.
Right now I do understand that my assumptions were wrong as I was putting
the parens (in my mind) the following way.
(s1 == s2) + event [ guard ] / action (although they weren't really there).
Anyway, thanks to the input provided I realized it wasn't the best idea and
therefore I have changed the DSL to.
// Prefix Notation
"state"_s <= *"idle"_s + event [ guard ] / action
// Postfix Notation
*"idle"_s + event [ guard ] / action = "state"_s
// '=>' would be better, however C++ only allows for '>=' which is not
Moreover, I have added a few UML-like notations. For initial state(*),
terminate state(X), history state(H).
X <= "idle"_s(H) + event [ guard ] / action
"idle"_s(H) + event [ guard ] / action = X
Please take a look at the new versions of examples:
and please let me know what do you think.
> (Sent from my portable computation engine)
> Unsubscribe & other changes:
> If you reply to this email, your message will be added to the discussion
> To unsubscribe from [MSM] Is there any interest in C++14 Boost.MSM-eUML
> like library which compiles up to 60x quicker whilst being a slightly
> faster too?, click here
-- View this message in context: http://boost.2283326.n4.nabble.com/MSM-Is-there-any-interest-in-C-14-Boost-MSM-eUML-like-library-which-compiles-up-to-60x-quicker-whils-tp4683016p4683167.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk