public override PolyhedraEnvironment <Expression> VisitNotEqual(Expression left, Expression right, PolyhedraEnvironment <Expression> data) { // left != right AI.IExpr notEq = linearfactory.Neq(Converter.Box(left, this.Decoder), Converter.Box(right, this.Decoder)); return(data.Factory(UnderlyingPolyhedra.Constrain(data.embedded, notEq), data.intv)); }
public FlatAbstractDomain <bool> CheckIfLessEqualThan(Expression e1, Expression e2) { // exp1 <= exp2 ? AI.IExpr toAssume = linearfactory.AtMost(Converter.Box(e1, decoder), Converter.Box(e2, decoder)); return(ToFlatAbstractDomain(UnderlyingPolyhedra.CheckPredicate(embedded, toAssume)).Meet(intv.CheckIfLessEqualThan(e1, e2))); }
public INumericalAbstractDomain <Variable, Expression> TestTrueLessEqualThan(Expression exp1, Expression exp2) { // exp1 <= exp2 AI.IExpr toAssume = linearfactory.AtMost(Converter.Box(exp1, decoder), Converter.Box(exp2, decoder)); return(Factory(UnderlyingPolyhedra.Constrain(embedded, toAssume), intv.TestTrueLessEqualThan(exp1, exp2))); }
public FlatAbstractDomain <bool> CheckIfGreaterEqualThanZero(Expression exp) { // exp >= 0 ? AI.IExpr toCheck = linearfactory.AtMost(linearfactory.Const(0), Converter.Box <Expression>(exp, decoder)); return(ToFlatAbstractDomain(UnderlyingPolyhedra.CheckPredicate(embedded, toCheck)).Meet(intv.CheckIfGreaterEqualThanZero(exp))); }
public AI.IFunApp Add(AI.IExpr p, AI.IExpr q) { Expression e1 = Converter.Unbox <Expression>(p); Expression e2 = Converter.Unbox <Expression>(q); return(Converter.Box(encoder.CompoundExpressionFor(ExpressionType.Int32, ExpressionOperator.Addition, e1, e2), decoder)); }
public INumericalAbstractDomain <Variable, Expression> TestTrueGeqZero(Expression exp) { // 0 <= exp AI.IExpr toAssume = linearfactory.AtMost(linearfactory.Const(0), Converter.Box <Expression>(exp, decoder)); return(Factory(UnderlyingPolyhedra.Constrain(embedded, toAssume), intv.TestTrueGeqZero(exp))); }
public AI.IFunApp Neq(AI.IExpr p, AI.IExpr q) { Expression e1 = Converter.Unbox <Expression>(p); Expression e2 = Converter.Unbox <Expression>(q); return(Converter.Box(encoder.CompoundExpressionFor(ExpressionType.Bool, ExpressionOperator.NotEqual, e1, e2), decoder)); }
public INumericalAbstractDomain <Variable, Expression> TestTrueLessThan(Expression exp1, Expression exp2) { // exp1 <= exp2 -1 AI.IExpr toAssume = linearfactory.AtMost(Converter.Box(exp1, this.decoder), linearfactory.Add(Converter.Box(exp2, this.decoder), linearfactory.Const(-1))); return(Factory(UnderlyingPolyhedra.Constrain(this.embedded, toAssume), this.intv.TestTrueLessThan(exp1, exp2))); }
public AI.IFunApp AtMost(AI.IExpr p, AI.IExpr q) { Expression e1 = Converter.Unbox <Expression>(p); Expression e2 = Converter.Unbox <Expression>(q); return(Converter.Box(this.encoder.CompoundExpressionFor(ExpressionType.Bool, ExpressionOperator.LessEqualThan, e1, e2), this.decoder)); }
public FlatAbstractDomain <bool> CheckIfLessThan(Expression e1, Expression e2) { // exp1 <= exp2 -1 ? AI.IExpr toAssume = linearfactory.AtMost(Converter.Box(e1, this.decoder), linearfactory.Add(Converter.Box(e2, this.decoder), linearfactory.Const(-1))); return(ToFlatAbstractDomain(UnderlyingPolyhedra.CheckPredicate(this.embedded, toAssume)).Meet(this.intv.CheckIfLessThan(e1, e2))); }
private void AssignIntervalJustInPolyhedra(Expression x, Interval value) { if (!value.IsBottom) { if (!value.LowerBound.IsInfinity) { AI.IExpr lowerBound = linearfactory.AtMost(linearfactory.Const((Int32)value.LowerBound.PreviousInteger), Converter.BoxAsVariable(x, decoder)); embedded = UnderlyingPolyhedra.Constrain(embedded, lowerBound); } if (!value.UpperBound.IsInfinity) { AI.IExpr upperBound = linearfactory.AtMost(Converter.BoxAsVariable(x, decoder), linearfactory.Const((Int32)value.UpperBound.NextInteger)); embedded = UnderlyingPolyhedra.Constrain(embedded, upperBound); } } }
static public E Unbox <E>(AI.IExpr boxed) { return(((Exp <E>)boxed).InExp); }
public AI.IFunApp Not(AI.IExpr p) { Expression e = Converter.Unbox <Expression>(p); return(Converter.Box(encoder.CompoundExpressionFor(ExpressionType.Bool, ExpressionOperator.Not, e), decoder)); }
public AI.IFunApp Implies(AI.IExpr p, AI.IExpr q) { return(new UninterestingFunctions()); }