Exemple #1
0
        public string PrettyPrint(CsPred <T> t)
        {
            string s = "";

            foreach (var prod in t.GetSumOfProducts())
            {
                if (s != "")
                {
                    s += ";";
                }
                var    pp  = NodeAlgebra.Second as IPrettyPrinter <T>;
                string inp = "";
                if (pp != null)
                {
                    inp = pp.PrettyPrint(prod.Item2);
                }
                else
                {
                    inp = prod.Item2.ToString();
                }
                string cc = prod.Item1.ToString();
                s += inp;
                if (cc != "")
                {
                    s += "&" + cc;
                }
            }
            return(s);
        }
 CsLabel(bool isFinalCondition, CsPred <S> guard, CsUpdateSeq updates, Func <S, string> inputToString)
 {
     this.isFinalCondition = isFinalCondition;
     this.Guard            = guard;
     this.Updates          = updates;
     this.InputToString    = inputToString;
 }
Exemple #3
0
 public CsAlgebra(IBooleanAlgebra <T> leafAlgebra, ICounter[] counters)
 {
     this.counters       = counters;
     this.LeafAlgebra    = leafAlgebra;
     this.NodeAlgebra    = new BDDAlgebra <T>(leafAlgebra);
     __false             = new CsPred <T>(this, (BDD <T>)NodeAlgebra.False);
     __true              = new CsPred <T>(this, (BDD <T>)NodeAlgebra.True);
     this.K              = counters.Length;
     TrueCsConditionSeq  = CsConditionSeq.MkTrue(counters.Length);
     FalseCsConditionSeq = CsConditionSeq.MkFalse(counters.Length);
 }
Exemple #4
0
 public string PrettyPrintCS(CsPred <T> t, Func <CsPred <T>, string> varLookup)
 {
     throw new NotImplementedException();
 }
Exemple #5
0
 public CsPred <T> Simplify(CsPred <T> predicate)
 {
     return(predicate);
 }
Exemple #6
0
        public CsPred <T> MkSymmetricDifference(CsPred <T> pred1, CsPred <T> pred2)
        {
            var bdd = (BDD <T>)NodeAlgebra.MkSymmetricDifference((BDD)pred1.pred, pred2.pred);

            return(new CsPred <T>(this, bdd));
        }
Exemple #7
0
        public CsPred <T> MkOr(CsPred <T> pred1, CsPred <T> pred2)
        {
            var bdd = (BDD <T>)NodeAlgebra.MkOr((BDD)pred1.pred, (BDD)pred2.pred);

            return(new CsPred <T>(this, bdd));
        }
Exemple #8
0
        public CsPred <T> MkNot(CsPred <T> pred)
        {
            var bdd = (BDD <T>)NodeAlgebra.MkNot((BDD)pred.pred);

            return(new CsPred <T>(this, bdd));
        }
Exemple #9
0
 public bool IsSatisfiable(CsPred <T> predicate)
 {
     return(NodeAlgebra.IsSatisfiable((BDD)predicate.pred));
 }
Exemple #10
0
 public CsPred <T> GetAtom(CsPred <T> psi)
 {
     throw new AutomataException(AutomataExceptionKind.BooleanAlgebraIsNotAtomic);
 }
Exemple #11
0
 public bool EvaluateAtom(CsPred <T> atom, CsPred <T> psi)
 {
     throw new AutomataException(AutomataExceptionKind.BooleanAlgebraIsNotAtomic);
 }
Exemple #12
0
 public bool CheckImplication(CsPred <T> lhs, CsPred <T> rhs)
 {
     return(NodeAlgebra.CheckImplication((BDD)lhs.pred, rhs.pred));
 }
Exemple #13
0
 public bool AreEquivalent(CsPred <T> pred1, CsPred <T> pred2)
 {
     return(NodeAlgebra.AreEquivalent((BDD)pred1.pred, pred2.pred));
 }
 public static CsLabel <S> MkTransitionLabel(CsPred <S> guard, CsUpdateSeq updates, Func <S, string> inputToString = null)
 {
     return(new CsLabel <S>(false, guard, updates, inputToString));
 }
 public static CsLabel <S> MkFinalCondition(CsPred <S> guard, Func <S, string> inputToString = null)
 {
     return(new CsLabel <S>(true, guard, null, inputToString));
 }