Boost logo

Boost :

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] <
ml-node+s2283326n4683164h3_at_[hidden]> wrote:

> 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).
>
> Agreed
>
> > 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
ideal here

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

or

"idle"_s(H) + event [ guard ] / action = X

Please take a look at the new versions of examples:

http://boost-experimental.github.io/msm-lite/examples/index.html#hello-world

http://boost-experimental.github.io/msm-lite/examples/index.html#euml-emulation

http://boost-experimental.github.io/msm-lite/examples/index.html#sdl2-integration

and please let me know what do you think.

Cheers, Kris

> ___
> Rob
>
> (Sent from my portable computation engine)
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> 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-tp4683016p4683164.html
> 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
> <http://boost.2283326.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4683016&code=a3J6eXN6dG9mQGp1c2lhay5uZXR8NDY4MzAxNnwtMTY0MTkzNTIwMA==>
> .
> NAML
> <http://boost.2283326.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

--
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