private boolean unifyConst ( int fn , int addr ) { boolean success ; int deref = deref ( addr ) ; int tag = derefTag ; int val = derefVal ; // case STORE[addr] of switch ( tag ) { case REF : { // <REF, _> : // STORE[addr] <- <CON, c> data . put ( deref , constantCell ( fn ) ) ; // trail(addr) trail ( deref ) ; success = true ; break ; } case CON : { // <CON, c'> : // fail <- (c != c'); success = val == fn ; break ; } default : { // other: fail <- true; success = false ; } } return success ; }
A simplified unification algorithm for unifying against a constant .