Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## escjava.sp
Class VarMap

    java.lang.Object
      escjava.sp.VarMap

public class VarMap
extends java.lang.Object

Field Summary
`private static VarMap` | `botMap`
`private static VarMap` | `idMap`
`private java.util.Hashtable` | `table`

Constructor Summary
`private` | `VarMap()` Clients should construct new "base" VarMap's only by calling identity() or bottom().

Method Summary
`Expr` | `apply(Expr e)` Returns the result of applying "this", viewed as a substituiton, to "e".
`static VarMap` | `bottom()` Returns the special "bottom" VarMap.
`VarMap` | `extend(GenericVarDecl v, Expr e)` Returns a VarMap identical to "this", except mapping "v" to "e".
`VarMap` | `extend(java.util.Hashtable h)` Returns a VarMap identical to "this", except mapping "v" to "e" for every pair in the hashtable h.
`Expr` | `get(GenericVarDecl v)`
`static VarMap` | `identity()` Returns the identity VarMap.
`boolean` | `isBottom()`
`(package private) static VarMap` | `merge(VarMap[] mm, GuardedCmdVec[] rename, int loc, int p, java.util.Hashtable lastVarUse)` If all elements of "mm" are "bottom" then the result is "bottom".
`(package private) static VarMap` | `merge(VarMap m, VarMap n, GuardedCmdVec[] rename, int loc, int p, java.util.Hashtable lastVarUse)` This is the two-input-map version of the more general `merge` method below.
`VarMap` | `unmap(GenericVarDeclVec vec)` Returns a VarMap identical to "this", except mapping each element of "vec" to itself.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### table

    private java.util.Hashtable table

### botMap

    private static final VarMap botMap

### idMap

    private static final VarMap idMap

Constructor Detail

### VarMap

    private VarMap()

  Clients should construct new "base" VarMap's only by calling identity() or bottom().

Method Detail

### bottom

    public static VarMap bottom()

  Returns the special "bottom" VarMap.

### isBottom

    public boolean isBottom()

### identity

    public static VarMap identity()

  Returns the identity VarMap.

### extend

    public VarMap extend(GenericVarDecl v,
                         Expr e)

  Returns a VarMap identical to "this", except mapping "v" to "e".

### extend

    public VarMap extend(java.util.Hashtable h)

  Returns a VarMap identical to "this", except mapping "v" to "e" for every pair in the hashtable h.

### unmap

    public VarMap unmap(GenericVarDeclVec vec)

  Returns a VarMap identical to "this", except mapping each element of "vec" to itself.

### get

    public Expr get(GenericVarDecl v)

### merge

    static VarMap merge(VarMap m,
                        VarMap n,
                        GuardedCmdVec[] rename,
                        int loc,
                        int p,
                        java.util.Hashtable lastVarUse)

  This is the two-input-map version of the more general `merge` method below.

### merge

    static VarMap merge(VarMap[] mm,
                        GuardedCmdVec[] rename,
                        int loc,
                        int p,
                        java.util.Hashtable lastVarUse)

  If all elements of "mm" are "bottom" then the result is "bottom". Otherwise, the result is a map whose domain is the union of the domains of the elements of "mm", restricted to those variables whose "lastVarUse" value is at least "p" (if a variable is not in the domain of "lastVarUse", its "lastVarUse" value is considered to be negative infinity). For each variable "v" in the domain of the output map:
  - if all non-"bottom" elements of "mm" map "v" to the same expression, then the output map also maps "v" to that expression;
  - otherwise, the output map maps "v" to a fresh variable "v'" (where the print name of "v'" is appropriately chosen given "v" and "loc"), and for each non-"bottom" "mm[i]", "rename[i]" includes "assume v' == mm[i][[v]]".
  Parameter `lastVarUse` may be passed in as `null`, in which case the method acts as if `lastVarUse` had been a hashtable that maps every variable to max infinity.

### apply

    public Expr apply(Expr e)

  Returns the result of applying "this", viewed as a substituiton, to "e".

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

The ESC/Java2 Project Homepage