public static void PrintSymbolicTrace(SymbolicTrace st) { foreach (SymbolicBlock b in st) { b.Emit(new TokenTextWriter(Console.Out, true)); } }
//traverse down a trace (List<Block>). At each program point: // -Write the new SymbolicStore at each AssignCmd. // -Write the guard condition for each AssumeCmd. //the latter will be overwritten by an ExecUp public static SymbolicTrace ExecDown(List <Block> bs, List <Variable> args) { SymbolicStore curStore = new SymbolicStore(), nextStore; ////initialize args with symbolic values List <Variable> symbolicConstants = new List <Variable>(); for (int i = 0; i < args.Count; i++) { var v = args[i]; symbolicConstants.Add(B.Factory.MakeConstant(v.Name, v.TypedIdent.Type)); curStore.Add(new StoreLhs(v), Expr.Ident(symbolicConstants[i])); } var newTrace = new SymbolicTrace(); foreach (Block b in bs) { var tmp = ExecBlockDown(b, curStore, out nextStore); newTrace.Add(ExecBlockDown(b, curStore, out nextStore)); curStore = nextStore; } return(newTrace); }
public static Constraint ExecUp(SymbolicTrace trace) { var curCons = Constraint.True; for (int i = trace.Count - 1; i >= 0; i--) { curCons = ExecBlockUp(trace[i], curCons); } return(curCons); }