Package wycs.core

Examples of wycs.core.SemanticType$Set


  }

  private SemanticType propagate(Expr.IndexOf e,
      HashMap<String, SemanticType> environment,
      HashSet<String> generics, WyalFile.Context context) {
    SemanticType src_type = propagate(e.operand, environment, generics,
        context);
    SemanticType index_type = propagate(e.index, environment, generics,
        context);
    if(src_type instanceof SemanticType.EffectiveTuple) {
      SemanticType.EffectiveTuple tt = (SemanticType.EffectiveTuple) src_type;
      checkIsSubtype(SemanticType.Int, index_type, e.operand);
      if (!(e.index instanceof Expr.Constant)) {
View Full Code Here


  }

  private SemanticType propagate(Expr.Binary e,
      HashMap<String, SemanticType> environment,
      HashSet<String> generics, WyalFile.Context context) {
    SemanticType lhs_type = propagate(e.leftOperand,environment,generics,context);
    SemanticType rhs_type = propagate(e.rightOperand,environment,generics,context);

    if (e.op != Expr.Binary.Op.IN
        && SemanticType.And(lhs_type, rhs_type) instanceof SemanticType.Void) {
      // This is useful to sanity check that the operands make sense. For
      // example, the expression "1.0 == 1" does not yield an automaton
View Full Code Here

  }

  private SemanticType propagate(Expr.Ternary e,
      HashMap<String, SemanticType> environment,
      HashSet<String> generics, WyalFile.Context context) {
    SemanticType firstType = propagate(e.firstOperand,environment,generics,context);
    SemanticType secondType = propagate(e.secondOperand,environment,generics,context);
    SemanticType thirdType = propagate(e.thirdOperand,environment,generics,context);
    switch(e.op) {
    case UPDATE:
      checkIsSubtype(SemanticType.SetTupleAnyAny,firstType,e.firstOperand);
      // FIXME: should this handle map updates?
      checkIsSubtype(SemanticType.Int, secondType, e.secondOperand);
View Full Code Here

      HashMap<String, SemanticType> environment,
      HashSet<String> generics, WyalFile.Context context) {
    environment = new HashMap<String,SemanticType>(environment);

    propagate(e.pattern,environment,generics,context);
    SemanticType r = propagate(e.operand,environment,generics,context);
    checkIsSubtype(SemanticType.Bool,r,e.operand);

    return SemanticType.Bool;
  }
View Full Code Here

  }

  private void propagate(TypePattern pattern,
      HashMap<String, SemanticType> environment,
      HashSet<String> generics, WyalFile.Context context) {
    SemanticType type = builder.convert(pattern.toSyntacticType(),
        generics, context);

    if (pattern instanceof TypePattern.Tuple) {
      TypePattern.Tuple tt = (TypePattern.Tuple) pattern;
      for (TypePattern p : tt.elements) {
View Full Code Here

              + e.generics.size() + ", required "
              + fn_generics.length + ")", context.file()
              .filename(), e);
    }

    SemanticType argument = propagate(e.operand, environment, generics,
        context);
    HashMap<String, SemanticType> binding = new HashMap<String, SemanticType>();

    for (int i = 0; i != e.generics.size(); ++i) {
      SemanticType.Var gv = (SemanticType.Var) fn_generics[i];
View Full Code Here

   *
   * @param e
   * @return
   */
  public static SemanticType returnType(Expr e) {
    SemanticType type = e.attribute(TypeAttribute.class).type;
    if (e instanceof Expr.Variable || e instanceof Expr.Constant
        || e instanceof Expr.Quantifier) {
      return type;
    } else if(e instanceof Expr.Unary) {
      Expr.Unary ue = (Expr.Unary) e;
View Full Code Here

TOP

Related Classes of wycs.core.SemanticType$Set

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.