aa
com.cliffc.aa.HM.HM3.HMType Class Referenceabstract
Inheritance diagram for com.cliffc.aa.HM.HM3.HMType:
[legend]
Collaboration diagram for com.cliffc.aa.HM.HM3.HMType:
[legend]

Public Member Functions

String str ()
 
final String toString ()
 

Package Functions

 HMType ()
 
abstract boolean _eq (HMType v, BitSetSparse dups)
 
abstract HMType _fresh (VStack vstk, HashMap< HMVar, HMVar > vars, HashMap< Oper, Oper > opers)
 
abstract SB _str (SB sb, VBitSet vbs, boolean debug)
 
final boolean eq (HMType v)
 
abstract HMType find ()
 
HMType fresh (VStack vstk)
 
boolean is_top ()
 
boolean occurs_in (HMType[] args, VBitSet dups)
 
boolean occurs_in (VStack vstk, VBitSet dups)
 
boolean occurs_in_type (HMType v, VBitSet dups)
 
abstract HMType union (HMType t, Worklist work)
 

Static Package Functions

static void reset ()
 

Package Attributes

Ary< Ident_ids
 
HMType _u
 
final int _uid
 

Static Package Attributes

static final HashMap< HMVar, HMVarEQS = new HashMap<>()
 

Static Private Attributes

static int CNT
 

Detailed Description

Definition at line 277 of file HM3.java.

Constructor & Destructor Documentation

◆ HMType()

com.cliffc.aa.HM.HM3.HMType.HMType ( )
package

Definition at line 282 of file HM3.java.

282 { _uid=CNT++; }

References com.cliffc.aa.HM.HM3.HMType._uid, and com.cliffc.aa.HM.HM3.HMType.CNT.

Member Function Documentation

◆ _eq()

abstract boolean com.cliffc.aa.HM.HM3.HMType._eq ( HMType  v,
BitSetSparse  dups 
)
abstractpackage

Reimplemented in com.cliffc.aa.HM.HM3.Oper, and com.cliffc.aa.HM.HM3.HMVar.

Referenced by com.cliffc.aa.HM.HM3.Oper._eq(), and com.cliffc.aa.HM.HM3.HMType.eq().

Here is the caller graph for this function:

◆ _fresh()

abstract HMType com.cliffc.aa.HM.HM3.HMType._fresh ( VStack  vstk,
HashMap< HMVar, HMVar vars,
HashMap< Oper, Oper opers 
)
abstractpackage

Reimplemented in com.cliffc.aa.HM.HM3.Oper, and com.cliffc.aa.HM.HM3.HMVar.

Referenced by com.cliffc.aa.HM.HM3.Oper._fresh(), and com.cliffc.aa.HM.HM3.HMType.fresh().

Here is the caller graph for this function:

◆ _str()

abstract SB com.cliffc.aa.HM.HM3.HMType._str ( SB  sb,
VBitSet  vbs,
boolean  debug 
)
abstractpackage

Reimplemented in com.cliffc.aa.HM.HM3.Oper, and com.cliffc.aa.HM.HM3.HMVar.

Referenced by com.cliffc.aa.HM.HM3.HMVar._str(), com.cliffc.aa.HM.HM3.Oper._str(), com.cliffc.aa.HM.HM3.HMType.str(), and com.cliffc.aa.HM.HM3.HMType.toString().

Here is the caller graph for this function:

◆ eq()

final boolean com.cliffc.aa.HM.HM3.HMType.eq ( HMType  v)
package

Definition at line 291 of file HM3.java.

291 { EQS.clear(); return find()._eq(v, new BitSetSparse()); }

References com.cliffc.aa.HM.HM3.HMType._eq(), com.cliffc.aa.HM.HM3.HMType.EQS, and com.cliffc.aa.HM.HM3.HMType.find().

Referenced by com.cliffc.aa.HM.HM3.Lambda.progress(), com.cliffc.aa.HM.HM3.Let.progress(), and com.cliffc.aa.HM.HM3.Apply.progress().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find()

◆ fresh()

HMType com.cliffc.aa.HM.HM3.HMType.fresh ( VStack  vstk)
package

Definition at line 294 of file HM3.java.

294  {
295  HashMap<HMVar,HMVar> vars = new HashMap<>();
296  HashMap<Oper,Oper> opers = new HashMap<>();
297  return find()._fresh(vstk,vars,opers);
298  }

References com.cliffc.aa.HM.HM3.HMType._fresh(), and com.cliffc.aa.HM.HM3.HMType.find().

Referenced by com.cliffc.aa.HM.HM3.Ident.hm().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_top()

boolean com.cliffc.aa.HM.HM3.HMType.is_top ( )
package

Definition at line 289 of file HM3.java.

289 { return _u==null; }

References com.cliffc.aa.HM.HM3.HMType._u.

Referenced by com.cliffc.aa.HM.HM3.Oper._eq(), com.cliffc.aa.HM.HM3.HMVar._fresh(), com.cliffc.aa.HM.HM3.Oper._fresh(), com.cliffc.aa.HM.HM3.HMType.occurs_in_type(), and com.cliffc.aa.HM.HM3.HMVar.type().

Here is the caller graph for this function:

◆ occurs_in() [1/2]

boolean com.cliffc.aa.HM.HM3.HMType.occurs_in ( HMType[]  args,
VBitSet  dups 
)
package

Definition at line 306 of file HM3.java.

306  {
307  for( HMType x : args ) if( occurs_in_type(x,dups) ) return true;
308  return false;
309  }

References com.cliffc.aa.HM.HM3.HMType.occurs_in_type().

Here is the call graph for this function:

◆ occurs_in() [2/2]

boolean com.cliffc.aa.HM.HM3.HMType.occurs_in ( VStack  vstk,
VBitSet  dups 
)
package

Definition at line 301 of file HM3.java.

301  {
302  if( vstk==null ) return false;
303  for( HMVar x : vstk ) if( occurs_in_type(x,dups) ) return true;
304  return false;
305  }

References com.cliffc.aa.HM.HM3.HMType.occurs_in_type().

Referenced by com.cliffc.aa.HM.HM3.HMVar._fresh(), and com.cliffc.aa.HM.HM3.HMType.occurs_in_type().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ occurs_in_type()

boolean com.cliffc.aa.HM.HM3.HMType.occurs_in_type ( HMType  v,
VBitSet  dups 
)
package

Definition at line 310 of file HM3.java.

310  {
311  assert is_top();
312  if( dups.tset(v._uid) )
313  return false; // Been there, done that
314  HMType y = v.find(); // Find top
315  if( y==this ) // Occurs in type?
316  return true; // Yup, occurs in type right here
317  if( y instanceof Oper ) // Structural recursive test
318  return occurs_in(((Oper)y)._args,dups);
319  return false;
320  }

References com.cliffc.aa.HM.HM3.HMType._uid, com.cliffc.aa.HM.HM3.HMType.find(), com.cliffc.aa.HM.HM3.HMType.is_top(), com.cliffc.aa.HM.HM3.HMType.occurs_in(), and com.cliffc.aa.util.VBitSet.tset().

Referenced by com.cliffc.aa.HM.HM3.HMType.occurs_in(), and com.cliffc.aa.HM.HM3.HMVar.union().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

static void com.cliffc.aa.HM.HM3.HMType.reset ( )
staticpackage

Definition at line 281 of file HM3.java.

281 { CNT=1; }

References com.cliffc.aa.HM.HM3.HMType.CNT.

Referenced by com.cliffc.aa.HM.HM3.reset().

Here is the caller graph for this function:

◆ str()

String com.cliffc.aa.HM.HM3.HMType.str ( )

Definition at line 287 of file HM3.java.

287 { return _str(new SB(),new VBitSet(),false).toString(); }

References com.cliffc.aa.HM.HM3.HMType._str(), and com.cliffc.aa.util.SB.toString().

Here is the call graph for this function:

◆ toString()

final String com.cliffc.aa.HM.HM3.HMType.toString ( )

Definition at line 286 of file HM3.java.

286 { return _str(new SB(),new VBitSet(),true).toString(); }

References com.cliffc.aa.HM.HM3.HMType._str(), and com.cliffc.aa.util.SB.toString().

Here is the call graph for this function:

◆ union()

abstract HMType com.cliffc.aa.HM.HM3.HMType.union ( HMType  t,
Worklist  work 
)
abstractpackage

Reimplemented in com.cliffc.aa.HM.HM3.Oper, and com.cliffc.aa.HM.HM3.HMVar.

Referenced by com.cliffc.aa.HM.HM3.Let.hm(), com.cliffc.aa.HM.HM3.Apply.hm(), com.cliffc.aa.HM.HM3.HMVar.union(), and com.cliffc.aa.HM.HM3.Oper.union().

Here is the caller graph for this function:

Member Data Documentation

◆ _ids

Ary<Ident> com.cliffc.aa.HM.HM3.HMType._ids
package

◆ _u

◆ _uid

◆ CNT

int com.cliffc.aa.HM.HM3.HMType.CNT
staticprivate

◆ EQS

final HashMap<HMVar,HMVar> com.cliffc.aa.HM.HM3.HMType.EQS = new HashMap<>()
staticpackage

Definition at line 290 of file HM3.java.

Referenced by com.cliffc.aa.HM.HM3.HMVar._eq(), and com.cliffc.aa.HM.HM3.HMType.eq().


The documentation for this class was generated from the following file:
com.cliffc.aa.HM.HM3.HMType.HMType
HMType()
Definition: HM3.java:282
com.cliffc.aa.HM.HM3.HMType.occurs_in
boolean occurs_in(VStack vstk, VBitSet dups)
Definition: HM3.java:301
com.cliffc.aa.HM.HM3.HMType._u
HMType _u
Definition: HM3.java:278
com.cliffc.aa.util.BitSetSparse
Definition: BitSetSparse.java:4
com.cliffc.aa.HM.HM3.HMType.find
abstract HMType find()
com.cliffc.aa.util.VBitSet.tset
boolean tset(int idx)
Definition: VBitSet.java:7
com.cliffc.aa.HM.HM3.HMType._uid
final int _uid
Definition: HM3.java:279
com.cliffc.aa.util.VBitSet
Definition: VBitSet.java:5
com.cliffc.aa.util.SB
Tight/tiny StringBuilder wrapper.
Definition: SB.java:8
com.cliffc.aa.HM.HM3.HMType._eq
abstract boolean _eq(HMType v, BitSetSparse dups)
com.cliffc.aa.HM.HM3.HMType.is_top
boolean is_top()
Definition: HM3.java:289
com.cliffc.aa.HM.HM3.HMType.CNT
static int CNT
Definition: HM3.java:280
com.cliffc.aa.HM.HM3.HMType._str
abstract SB _str(SB sb, VBitSet vbs, boolean debug)
com.cliffc.aa.HM.HM3.HMType._fresh
abstract HMType _fresh(VStack vstk, HashMap< HMVar, HMVar > vars, HashMap< Oper, Oper > opers)
com.cliffc.aa.HM.HM3.HMType.EQS
static final HashMap< HMVar, HMVar > EQS
Definition: HM3.java:290
com.cliffc.aa.util.SB.toString
String toString()
Definition: SB.java:62
com.cliffc.aa.HM.HM3.HMType.occurs_in_type
boolean occurs_in_type(HMType v, VBitSet dups)
Definition: HM3.java:310