spacer
spacer search


Software Model Checking Framework

Search
spacer
header
Main Menu
Home
Team
Downloads
Papers
Documentation
API
Examples
Repository
Bug Reports
Licenses
Forums
Bogor Users Map
Site Map
Contact Us
Search
Login Form





Lost Password?
 
Home arrow Examples arrow Low-level BIR Examples arrow SumToN Example

SumToN Example
system SumToN {
  const PARAM { N = 1; }
  typealias byte int wrap (0,255);
  
  byte x := 1;
  byte t1;
  byte t2;
	
  active thread Thread1() {
    loc loc0: 
      do { t1 := x; }
      goto loc1;

    loc loc1: 
      do { t2 := x; }
      goto loc2;
			
    loc loc2: 
      do { x := t1 + t2; }
      goto loc0;
  }
  
  active thread Thread2() {
    loc loc0: 
      do { t1 := x; }
      goto loc1;
			
    loc loc1: 
      do { t2 := x; }
      goto loc2;
			
    loc loc2: 
      do { x := t1 + t2; }
      goto loc0;
  }

  active thread Thread0() {
    loc loc0: 
      do { assert (x != (byte)PARAM.N); }
      return;
  }
}
 
< Prev   Next >
spacer
Popular
Newsflash

 
(c) SAnToS Laboratory, Kansas State University, 2002-2006
spacer