Difference between revisions of "Sequential Composition"

From Mesham
Jump to navigationJump to search
(Created page with '== Syntax == body ; body == Semantics == Will execute the code before the sequential composition, '';'', and then (if this terminates) will execute the code after the sequenti…')
 
m
Line 5: Line 5:
 
== Semantics ==
 
== Semantics ==
  
Will execute the code before the sequential composition, '';'', and then (if this terminates) will execute the code after the sequential composition.
+
Will execute the code before the sequential composition, '';'', and then (if this terminates) will execute the code after the sequential composition.<br><br>
 +
''Note:'' Unlike many imperative languages, all blocks must be terminated by a form of composition (sequential or parallel.)
  
 
== Examples ==
 
== Examples ==
Line 13: Line 14:
 
In the above example variable ''a'' is declared to be equal to 12, after this the variable is then modified to hold the value of 99.
 
In the above example variable ''a'' is declared to be equal to 12, after this the variable is then modified to hold the value of 99.
  
  function1[] ; function2[]
+
  function1() ; function2()
  
 
In the second example ''function1'' will execute and then after (if it terminates) the function ''function2'' will be called
 
In the second example ''function1'' will execute and then after (if it terminates) the function ''function2'' will be called
  
 
[[category:sequential]]
 
[[category:sequential]]

Revision as of 15:57, 12 January 2013

Syntax

body ; body

Semantics

Will execute the code before the sequential composition, ;, and then (if this terminates) will execute the code after the sequential composition.

Note: Unlike many imperative languages, all blocks must be terminated by a form of composition (sequential or parallel.)

Examples

var a:=12 ; a:=99

In the above example variable a is declared to be equal to 12, after this the variable is then modified to hold the value of 99.

function1() ; function2()

In the second example function1 will execute and then after (if it terminates) the function function2 will be called