Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages
unification.cc File Reference#include "unification.h"
#include "linker.h"
#include "memoryblock.h"
#include "memorymodel.h"
#include "location.h"
Go to the source code of this file.
|
Compounds |
class | findVarAssign |
class | testUnify |
Defines |
#define | delete_and_return |
#define | size_operand(x, value) |
#define | new_field_ECR(X, type, container) |
#define | huge_pending 1400 |
#define | is_dismantler_tmp(name) ((name).find("__T") == 0) |
#define | ensure_parent_child(child, parent, child_type) |
#define | return_unify(t) |
#define | max_Lambda(t1, ty1, t2, ty2, l) |
#define | sizeOfType(t, ty) |
#define | max_Size(t1, ty1, t2, ty2, s) |
#define | parentsOfType(t, ty) |
#define | max_Parents(t1, ty1, t2, ty2, p) |
#define | consolidate_struct_fields(struc, result) |
#define | consolidate_sim_obj_fields(alpha, result) |
#define | insert_into_set(set, Dp) |
#define | CX_INVARIANT |
#define | print_one_ecr(E) |
Variables |
bool | debug = false |
Phases | unify_phase ("unify", new testUnify()) |
Define Documentation
#define consolidate_sim_obj_fields |
( |
alpha, |
|
|
result |
|
) |
|
|
|
Value: {\
if(result) join(result,alpha->tao()); \
else result = alpha->tao(); \
}
|
#define consolidate_struct_fields |
( |
struc, |
|
|
result |
|
) |
|
|
|
Value: {\
EltMap map = struc->m; \
for(EltMap::iterator m=map.begin(); m!=map.end(); m++) \
if(m->second) { \
if(result) join(result, m->second); \
else result = m->second; \
} \
}
|
#define delete_and_return
|
|
|
Value: { \
if(is_new) delete p; \
return; \
}
|
#define ensure_parent_child |
( |
child, |
|
|
parent, |
|
|
child_type |
|
) |
|
|
|
Value: { \
switch(child->type()->objTyp()) { \
case BOTTOM: { \
Unify_Size child_size(Unify_Size::sizeOf(child_type)); \
settype(child, new UnifyType(new Unify_Blank(child_size, \
Unify_Parents(false))));\
\
} \
case BLANK: child->type()->blank()->p.parents().insert(parent); break; \
case SIMPLE: child->type()->simple()->p.parents().insert(parent); break; \
case STRUCTURE: child->type()->structure()->p.parents().insert(parent); \
break; \
case OBJECT: child->type()->object()->p.parents().insert(parent); \
} }
|
#define huge_pending 1400
|
|
#define insert_into_set |
( |
set, |
|
|
Dp |
|
) |
|
|
|
Value: { \
if(Dp == n_pos.back()) set->insert(n.begin(), n.end()); \
else set->insert(Dp); \
if(Dp != n_pos.front()) { \
\
for(declSet::iterator N=n.begin(); N!=n.end(); N++) { \
decl_list all_fields = _field2sue[*N]->fields(); \
FieldOrder::iterator fo1 = s->fo.begin(); \
for(decl_list_p f=all_fields.begin(); f!=all_fields.end(); f++) { \
if(_fieldpos[*f].size() >= _fieldpos[Dp].size()) break; \
else { \
Unify_ECR *E = s->m[*fo1]; \
s->m.erase(*fo1); \
fo1->insert(*f); \
s->m[*fo1] = E; \
break; \
} \
if(++fo1==s->fo.end()) break; \
} \
} \
} \
}
|
#define is_dismantler_tmp |
( |
name |
|
) |
((name).find("__T") == 0)
|
|
#define max_Lambda |
( |
t1, |
|
|
ty1, |
|
|
t2, |
|
|
ty2, |
|
|
l |
|
) |
|
|
#define max_Parents |
( |
t1, |
|
|
ty1, |
|
|
t2, |
|
|
ty2, |
|
|
p |
|
) |
|
|
|
Value: if(t1->is_bottom()) \
p = parentsOfType(t2,ty2); \
else if(t2->is_bottom()) \
p = parentsOfType(t1,ty1); \
else { \
Unify_Parents p1 = parentsOfType(t1,ty1), \
p2 = parentsOfType(t2,ty2); \
for(set<Unify_ECR*>::iterator P=p1.parents().begin(); \
P!=p1.parents().end(); P++)\
p.parents().insert((*P)->root()); \
for(set<Unify_ECR*>::iterator P=p2.parents().begin(); \
P!=p2.parents().end(); P++)\
p.parents().insert((*P)->root()); \
if(!p1.is_top() || ! p2.is_top()) p.top(false); \
}
|
#define max_Size |
( |
t1, |
|
|
ty1, |
|
|
t2, |
|
|
ty2, |
|
|
s |
|
) |
|
|
|
Value: if(t1->is_bottom()) \
s = sizeOfType(t2,ty2); \
else if(t2->is_bottom()) \
s = sizeOfType(t1,ty1); \
else { \
s = sizeOfType(t1,ty1); \
Unify_Size s2 = sizeOfType(t2,ty2); \
if(s.is_top()) ; \
else if(s2.is_top()) s=s2; \
else if( s.size() < s2.size() ) s=s2; \
}
|
#define new_field_ECR |
( |
X, |
|
|
type, |
|
|
container |
|
) |
|
|
#define parentsOfType |
( |
t, |
|
|
ty |
|
) |
|
|
#define print_one_ecr |
( |
E |
|
) |
|
|
|
Value: (E)->print(); \
cout << endl;
|
#define return_unify |
( |
t |
|
) |
|
|
|
Value: { \
UnifyType *T = (t)->ecr()->type(); \
memoryBlock *block = t1->block() ? t1->block() : t2->block(); \
if(! T->block()) T->block(block); \
else assert(T->block()==block); \
\
if(t1 != T) T->procs().insert(t1->procs().begin(), t1->procs().end()); \
if(t2 != T) T->procs().insert(t2->procs().begin(), t2->procs().end()); \
\
return T; \
}
|
#define size_operand |
( |
x, |
|
|
value |
|
) |
|
|
#define sizeOfType |
( |
t, |
|
|
ty |
|
) |
|
|
Variable Documentation
bool debug = false [static]
|
|
|