Class Resolver3.Instance

java.lang.Object
eu.bandm.tools.d2d2.base.Resolver3.Instance
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Resolver3.LocalInstance
Enclosing class:
Resolver3

protected class Resolver3.Instance extends Object implements Cloneable
The parametrized instance of one particular d2d model Definition. Goes through several states:

      \(creation by resolveAllPublics(..))
        \ 
          ownClass
          [isClass=true,hypo=requires=false,representative=null]
                                            ^
                                            |
      \(creation by newHypthesis(old))      |setIsClass()
        \                                   |
          hypoEquivalent                    |
        h=[isClass=requires=falsified=false, hypo=true,representative=old,requiredBy={}]
            |^     |^                         |    |           ^
            ||     ||                         |    |           |
            ||Equivalence.match(h)            |    |hypothesisFalsified()  
            || with currentHypothesis=x       |    |           |newHypothesis(old)
            ||     ||                         |    |           |
            ||     ||Equivalence.match(some hypo)  |           |
            ||     ||with currentHypothesis=h |    |           |
            V|     ||                         |    |           |
          [  ..., requiredBy={x...}]          |    V           |
                   |V                         |  falsified     |
          [ ..., requires=true, ...]          |  [.., representative=null, falsified=true,..]
                                              |   
                         hypothesisConfirmed()|   
                                              V
                                       equivWithOther                   
                                       [.. hypothetical=false..]

  
  • Field Details

    • rewritten

      final Definition rewritten
      The rewritten definition, created when constructing this.
    • reprRef

      @Opt final @Opt Reference reprRef
      FIXME RAUS !?!?! A representative which can be re-put into Resolver3.waitingForEquivalence when the hypotheses fails.
    • ic

      The fixed import context for which this instance is valid. Per raw definition and import context max. one Instance exists.
    • requiredBy

      final Set<Resolver3.Instance> requiredBy
      Set of other hypotheses which rely on this one. Failure of this hypthesis will be propagated to them.
    • different

      final Set<Resolver3.ImportContext> different
      Set of other instantiations/rewritings which have been proven to be non-equivalent.
  • Constructor Details

  • Method Details

    • setIsClass

      public void setIsClass()
    • isClass

      public boolean isClass()
    • isBound

      public boolean isBound()
      Is its own class or hypothetically bound or confirmed bound. "Unbound" only happens after a hypothesis has failed. I
    • representative

      public Resolver3.Instance representative()
    • newHypothesis

      public Resolver3.Instance newHypothesis(Resolver3.Instance other)
      Delivers an instance which is hypothetically equivalent with "other". Other must be a class on its own (i.e. a representative).
      If the current instance depends on other hypotheses (indicated by requires==true, technically a new object must be built, because the existing one is in (at least) one set for delivering future fail events. Otherwise the object can be reused.
      The returned setting is "this.representative=other; hypothetical=true;falsified=false;"
    • hypothesisConfirmed

      public void hypothesisConfirmed()
      The hypothetical equivalence to representative is changed to a confirmed equivalence.
    • hypothesisFalsified

      public void hypothesisFalsified()
      The hypothetical equivalence to representative has been falsified. This is reflected by setting that field to ==null. This failure is propagated to all Instances in requiredBy. It is memorized in different for quick check of later hypotheses. It is memorized in falsified only for optimization, to skip propagation in case of multiple calls to this method.
    • validDefinition

      Definition validDefinition()
      Return the rewritten definition, either owned by itself, or by the representative of the equivalence class.
    • format

      public Format format()