Sha256: a81e542213a3916ebc197cf9fc415a6dad3228e4533cdd725658e3eccbdf9035

Contents?: true

Size: 1.42 KB

Versions: 2

Compression:

Stored size: 1.42 KB

Contents

    (***********************************************************************
     Macros to control process execution && time
     ***********************************************************************)
    macro tick() {
          now := TickNext( now ); \* now := now + 1;
    }
    
    macro enable( s ) {
      (* head in sequence 'steps' enable processes *)
      \* await Len( steps ) # 0 /\ ProcessEnabled( steps, s );
      await ProcessEnabled( steps, s );
      
      (* process entered, remove head from sequence 'steps' *)
      step  := ProcessRunning( steps ); \* Head( steps );
      step_parameter  := ProcessParameter( steps );
      \* steps := ProcessesToRun( steps ); \* Tail( steps );

      (* Reset infrastructure service responses on process entry *)
      responses := InfrastructureServiceInit;

      (* Flag Transaction started *)
      tx_running := TRUE;

      (* time advances by one tick for each process step *)
      tick();
      \* debug( s );
    }

    (*  Remove currently running prosess from head of 'step'.
    
	Calling this macro enables next process to take turn.
        If a process comprises several steps, this results
	processes runing parallel, unless 'process_done' is
	called in the end of the process.
    
    *)
    
    macro process_done( s ) {
    
        steps := ProcessesToRun( steps ); \* Tail( steps );
	
	(* Flag Transaction started *)
        tx_running := FALSE;
	
    }

    
    

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tla-sbuilder-0.2.2 mustache/tla/macro_run.mustache
tla-sbuilder-0.2.1 mustache/tla/macro_run.mustache