Skip to Content.
Sympa Menu

k-user - Re: [K-user] semantic of assing activity in K

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] semantic of assing activity in K


Chronological Thread 
  • From: "Moore, Brandon Michael" <bmmoore AT illinois.edu>
  • To: Khaled Annane <khaledannane AT gmail.com>, "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
  • Subject: Re: [K-user] semantic of assing activity in K
  • Date: Thu, 24 Apr 2014 18:44:17 +0000
  • Accept-language: en-US
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

How much of your language have you defined?
Do you need help getting started with K, or is there a specific problem with this assign command?

If all the assignments are supposed to happen at the same time it's a little more complicated.
Would a block like this swap the value of X.part and Y.part?

<assign name="swap">
<copy>
<from variable="X" part="part"/>
<to variable="Y" part="part"/>
</copy>
<copy>
<from variable="Y" part="part"/>
<to variable="X" part="part"/>
</copy>
</assign>

If that should swap the values (rather than overwriting one with the other),
then you'll need to define your K rules so that all the "from" elements are
evaluated to values before you start evaluating any of the assignments.

One way might be rules like this, using an extra "write" command.

assign(Copy, Copies) => Copy ~> assign(Copies)
assign(.Copies) => .K
copy(V:KResult,To) ~> assign(Copies) => assign(Copies) ~> write(V,To)

The idea is that whenever the assign block still has more copy elements
one is moved out front.
Then a other rules or a strictness annotation or something evaluates the
"from" clause to an actual value,
and then the third rule moves the command after the assign block in
the K sequence, so we'll finish the rest of the lookups before doing any writes.

You'll have to define "write" as an extra command in your semantics, and give
it rules so it writes a value to the "To" location.

Brandon


From: k-user-bounces AT cs.uiuc.edu [k-user-bounces AT cs.uiuc.edu] on behalf of Khaled Annane [khaledannane AT gmail.com]
Sent: Thursday, April 24, 2014 5:05 AM
To: k-user AT cs.uiuc.edu
Subject: [K-user] semantic of assing activity in K

Hi,

I am new user of K.
I am working for assign activity in BPEL language,this is an example of using this activitiy :
 
<assign name="PrepareInputForAAandDA">
<copy>
<from variable="TravelRequest" part="flightData"/>
<to variable="FlightDetails" part="flightData"/>
</copy>
<copy>
<from variable="EmployeeTravelStatusResponse"
part="travelClass"/>
<to variable="FlightDetails" part="travelClass"/>
</copy>
</assign>


Could anybody suggest me how to do this  or give me related site I could check?

Thank you in advance.

 



Archive powered by MHonArc 2.6.16.

Top of Page