Skip to main content
Jump to: navigation, search

VIATRA2/Examples/VTCL/ASM

< VIATRA2‎ | Examples‎ | VTCL
Revision as of 12:21, 17 February 2009 by Daniel.varro.gmail.com (Talk | contribs) (New page: == Abstract State Machines == Abstract state machines (ASMs) provide a high-level means for assembling complex transformation programs. === ASM functions === ASM functions provide a non...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Abstract State Machines

Abstract state machines (ASMs) provide a high-level means for assembling complex transformation programs.

ASM functions

ASM functions provide a non-persistent map to store values. Each ASM function needs to be declared prior to its first use. Initial values can also be set when defining an ASM function. The values stored at a certain location of an ASM function can be updated using the update ASM construct.

machine asmFuns {
 asmfunction team / 2 {
 		(1, "real") = "Casillas";
 		(7, "real") = "Raul";
 }
}

In the new (upcoming) VIATRA2 version, types can also be defined for ASM functions as follows.

import datatypes;
machine asmFuns {
 asmfunction team(Integer, String) : String / 2 {
 		(1, "real") = "Casillas";
 		(7, "real") = "Raul";
 }
}

Simple rules

Back to the top