Example #1
0
 private void SetNonUniform(string procedureName, WhileCmd wc)
 {
     nonUniformLoops[procedureName].Add(GetLoopId(wc));
     RecordProcedureChanged();
 }
Example #2
0
	void WhileCmd(out WhileCmd/*!*/ wcmd) {
		Contract.Ensures(Contract.ValueAtReturn(out wcmd) != null); IToken/*!*/ x;  Token z;
		Expr guard;  Expr/*!*/ e;  bool isFree;
		List<PredicateCmd/*!*/> invariants = new List<PredicateCmd/*!*/>();
		StmtList/*!*/ body;
		QKeyValue kv = null;
		
		Expect(43);
		x = t; 
		Guard(out guard);
		Contract.Assume(guard == null || cce.Owner.None(guard)); 
		while (la.kind == 36 || la.kind == 44) {
			isFree = false; z = la/*lookahead token*/; 
			if (la.kind == 36) {
				Get();
				isFree = true;  
			}
			Expect(44);
			while (la.kind == 28) {
				Attribute(ref kv);
			}
			Expression(out e);
			if (isFree) {
			 invariants.Add(new AssumeCmd(z, e, kv));
			} else {
			 invariants.Add(new AssertCmd(z, e, kv));
			}
			kv = null;
			
			Expect(9);
		}
		Expect(28);
		StmtList(out body);
		wcmd = new WhileCmd(x, guard, invariants, body); 
	}
Example #3
0
 private int GetLoopId(WhileCmd wc)
 {
     AssertCmd inv = wc.Invariants[0] as AssertCmd;
     Debug.Assert(inv.Attributes.Key.Contains("loophead_"));
     return Convert.ToInt32(inv.Attributes.Key.Substring("loophead_".Length));
 }