MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / meet

Method meet

chapter18/src/main/java/com/seaofnodes/simple/type/Type.java:136–148  ·  view source on GitHub ↗
(Type t)

Source from the content-addressed store, hash-verified

134
135 // ----------------------------------------------------------
136 public final Type meet(Type t) {
137 // Shortcut for the self case
138 if( t == this ) return this;
139 // Same-type is always safe in the subclasses
140 if( _type==t._type ) return xmeet(t);
141 // TypeNil vs TypeNil meet
142 if( this instanceof TypeNil ptr0 && t instanceof TypeNil ptr1 )
143 return ptr0.nmeet(ptr1);
144 // Reverse; xmeet 2nd arg is never "is_simple" and never equal to "this".
145 if( is_simple() ) return this.xmeet(t );
146 if( t.is_simple() ) return t .xmeet(this);
147 return Type.BOTTOM; // Mixing 2 unrelated types
148 }
149
150 // Compute meet right now. Overridden in subclasses.
151 // Handle cases where 'this.is_simple()' and unequal to 't'.

Callers 15

testMeetMethod · 0.95
testTypeAdHocMethod · 0.95
testLatticeTheoryMethod · 0.95
check_symmetricMethod · 0.95
assocMethod · 0.95
isaMethod · 0.95
computeMethod · 0.95
computeMethod · 0.95
computeMethod · 0.95
check_commuteMethod · 0.45
typeMethod · 0.45
parseTrinaryMethod · 0.45

Calls 3

xmeetMethod · 0.95
is_simpleMethod · 0.95
nmeetMethod · 0.45

Tested by 6

testMeetMethod · 0.76
testTypeAdHocMethod · 0.76
testLatticeTheoryMethod · 0.76
check_symmetricMethod · 0.76
assocMethod · 0.76
check_commuteMethod · 0.36