Package ai.domain

Examples of ai.domain.Variable


      if (EvaluationUtils.isBooleanType(node)) {
        Boolean aValue = EvaluationUtils.tryGetBooleanValue(node);
        if (aValue != null) { // a constant??
          value = Bool.get(aValue);
        } else {// variable??
          Variable var = EvaluationUtils.tryGetVariable(node);
          if (var == null) { // not a variable, we know nothing :(
            value = Bool.TOP;
          } else
            value = EvaluationUtils.getValueForVariable(input.getLeft(), var);
        }
View Full Code Here


    @Override
    public ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>> processBooleanAssignment(
        ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>> input, Expression toWhat,
        Bool value) {
      Variable var = EvaluationUtils.tryGetVariable(toWhat);
      if (var != null)
        return input.setLeft(input.getLeft().updateVariable(var, value));
      else
        // FIXME: ???
        return input;
View Full Code Here

  }

  @Override
  public NonRelationalDomain<Bool> processEmptyEdge(NonRelationalDomain<Bool> input, List<SimpleName> variablesToRemove) {
    for(SimpleName name: variablesToRemove){
      Variable var = EvaluationUtils.tryGetVariable(name);
      if (var == null)
        continue;
      input = input.removeVariable(var);
    }
    return input;
View Full Code Here

      if (input.isBottom())
        return input;
      if (value.isBottom())
        return input.getBottom();

      Variable var = EvaluationUtils.tryGetVariable(node);
      if (var == null) // no change in state
        return input;
      else
        return input.setRight(EvaluationUtils.updateValueOfVariable(input.getRight(), var, value));
    }
View Full Code Here

      if (EvaluationUtils.isBooleanType(node)) {
        Boolean aValue = EvaluationUtils.tryGetBooleanValue(node);
        if (aValue!=null) { // a constant??
          value = Bool.get(aValue);
        } else {// variable??
          Variable var = EvaluationUtils.tryGetVariable(node);
          if (var == null){ // not a variable, we know nothing :(
            value = Bool.TOP;
          } else
            value = input.getValueFor(var);
        }
View Full Code Here

    }

    @Override
    public NonRelationalDomain<Bool> processBooleanAssignment(NonRelationalDomain<Bool> input, Expression toWhat,
        Bool value) {
      Variable var = EvaluationUtils.tryGetVariable(toWhat);
      if (var != null)
        return input.updateVariable(var, value);
      else // FIXME: ??
        return input;
    }
View Full Code Here

      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
            value = EvaluationUtils.getValueForVariable(input.right.getRight(), var);
        }
View Full Code Here

    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

    @Override
    public Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> processIntegerAssignment(
        Pair<Interval, ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>>> input,
        Expression toWhat) {
      Variable var = EvaluationUtils.tryGetVariable(toWhat);
      if (var == null)
        return input;

      ProductDomain<NonRelationalDomain<Bool>, NonRelationalDomain<Interval>> output = input.right;
      output = output.setRight(output.getRight().updateVariable(var, input.left));
View Full Code Here

      throw new DomainException("Join only allowed with the same variables!!, mine: "+this +", other:"+other);

    //join of values
    Map<Variable, DI> result = new HashMap<Variable, DI>();
    for(Map.Entry<Variable, DI> entry: variableValues.entrySet()) {
      Variable var = entry.getKey();
      DI value = entry.getValue();
      DI resultValue = value.join(other.variableValues.get(var));
      result.put(var, resultValue);
    }
//   
View Full Code Here

TOP

Related Classes of ai.domain.Variable

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.