예제 #1
0
파일: TypeParam.java 프로젝트: bhosmer/mesh
  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;
  }
예제 #2
0
파일: TypeApp.java 프로젝트: brbaker/mesh
  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;
  }