Package ai.domain.interval

Examples of ai.domain.interval.Interval


    @Override
    public Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> processIntegerNode(
        Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> input,
        SimpleName node) {
      Interval value;
      if (EvaluationUtils.isIntegerType(node)) {
        IntervalValue aValue = EvaluationUtils.tryGetIntervalValue(node);
        if (aValue != null) { // a constant??
          value = new Interval(aValue);
        } else {// variable??
          Variable var = EvaluationUtils.tryGetVariable(node);
          if (var == null) { // not a variable, we know nothing :(
            value = Interval.TOP;
          } else
View Full Code Here


    @Override
    public Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> processIntegerNode(
        Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> input,
        QualifiedName node) {
      IntervalValue aValue = EvaluationUtils.tryGetIntervalValue(node);
      return Pair.create((aValue != null) ? new Interval(aValue) : Interval.TOP, input.right);
    }
View Full Code Here

    @Override
    public Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> processIntegerNode(
        Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> input,
        SuperFieldAccess node) {
      IntervalValue value = EvaluationUtils.tryGetIntervalValue(node);
      return Pair.create(value != null ? new Interval(value) : Interval.TOP, input.right);
    }
View Full Code Here

    @Override
    public Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> processIntegerNode(
        Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> input,
        NumberLiteral node, long value) {
      return Pair.create(new Interval(value, value), input.right);
    }
View Full Code Here

    @Override
    public Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> processIntegerNode(
        Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> input,
        CharacterLiteral node, long value) {
      return Pair.create(new Interval(value, value), input.right);
    }
View Full Code Here

   
    @Override
    public Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> processIntegerValueChange(
        Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> input,
        Expression ofWhat, int delta, boolean postfixOrPrefix) {
      Interval valueBeforeChange = input.left;
      Interval valueAfterChange = sem.delta(valueBeforeChange, delta);
      Variable var = EvaluationUtils.tryGetVariable(ofWhat);
      NonRelationalDomain<Interval> output = input.right.getRight();
      if (var != null && EvaluationUtils.isIntegerType(ofWhat))
        output = output.updateVariable(var, valueAfterChange);
      return Pair.create(postfixOrPrefix ? valueBeforeChange : valueAfterChange, input.right.setRight(output));
View Full Code Here

    for(Variable var: bools.getVariables())
      bools = bools.updateVariable(var, Bool.TOP);
    //process integers
    NonRelationalDomain<Interval> intv = NonRelationalDomain.getInitialValue();
    for(Variable var: input.getRight().getVariables())
      intv = intv.addNewVariable(var, new Interval(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY), false);
    IntegerBoxes boxes = IntegerBoxesHelper.fromIntervalBox(intv);
    return ProductDomain.create(bools, boxes);
  }
View Full Code Here

public class BoxesWideningFactory {
 
  private static Map<Variable, Set<Double>> surroundingBox(NonRelationalDomain<Interval> box) {
    Map<Variable, Set<Double>> result = new HashMap<Variable, Set<Double>>();
    for(Variable var: box.getVariables()){
      Interval interval = box.getValueFor(var);
      Set<Double> varThresholds = new HashSet<Double>();
      result.put(var, varThresholds);
      if (interval.getLeft() > Double.NEGATIVE_INFINITY)
        varThresholds.add(interval.getLeft());
      if (interval.getRight() < Double.POSITIVE_INFINITY)
        varThresholds.add(interval.getRight()+1);
    }
    return result;
  }
View Full Code Here

  private NonRelationalDomain<Interval> prepareBox(IntervalValue... data) {
    int idx = 0;
    NonRelationalDomain<Interval> res = NonRelationalDomain.getInitialValue();
    for(int i=data.length-1; i>=0; i--) {
      IntervalValue val = data[i];
      res = res.addNewVariable(new DummyVariable("TestVariable " + idx, idx++), new Interval(val), false);
    }
    return res;
  }
View Full Code Here

TOP

Related Classes of ai.domain.interval.Interval

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.