Exemple #1
0
        public InductiveSequentialization(AtomicAction inputAction, AtomicAction outputAction,
                                          AtomicAction invariantAction, Dictionary <AtomicAction, AtomicAction> elim)
        {
            this.inputAction     = inputAction;
            this.outputAction    = outputAction;
            this.invariantAction = invariantAction;
            this.elim            = elim;

            // TODO: check frame computation
            // We could compute a tighter frame per check. For example, base/conclusion checkers
            // don't have to take the eliminated actions into account.
            var frameVars = new List <AtomicAction> {
                invariantAction, outputAction, inputAction
            }
            .Union(elim.Select(kv => kv.Value))
            .SelectMany(a => a.gateUsedGlobalVars.Union(a.modifiedGlobalVars)).Distinct();

            this.frame    = new HashSet <Variable>(frameVars);
            this.modifies = frame.Select(Expr.Ident).ToList();

            newPAs = Expr.Ident(VarHelper.LocalVariable("newPAs", PendingAsyncMultisetType));
            if (HasChoice)
            {
                choice = Expr.Ident(invariantAction.impl.OutParams.Last());
            }
            else
            {
                choice = Expr.Ident(VarHelper.LocalVariable("choice", PendingAsyncType));
            }
        }
            private void MakeNewCopy(Variable v)
            {
                int id      = varCopies[v].Count;
                var copyVar = VarHelper.LocalVariable(string.Format(copierFormat, v.Name, id), v.TypedIdent.Type);

                varCopies[v].Add(copyVar);
                copyToOriginalVar[copyVar] = v;
            }
Exemple #3
0
 private static LocalVariable CopyLocal(Variable v)
 {
     return(VarHelper.LocalVariable(v.Name, v.TypedIdent.Type));
 }