Esempio n. 1
0
  public boolean equiv(final Type other, final EquivState state) {
    final Type otherDeref = other.deref();

    if (otherDeref instanceof TypeParam) {
      final TypeParam otherParam = (TypeParam) otherDeref;
      return state.matchParam(this, otherParam);
    }

    return false;
  }
Esempio n. 2
0
  public boolean equiv(final Type other, final EquivState state) {
    if (state.checkVisited(this, other)) return true;

    if (isAbsApply()) {
      return eval().equiv(other, state);
    }

    final Type otherEval = other.deref().eval();

    if (otherEval instanceof TypeApp) {
      final TypeApp otherApp = (TypeApp) otherEval;
      return base.equiv(otherApp.base, state) && arg.equiv(otherApp.arg, state);
    }

    return false;
  }