package com.github.vlsi.mat.optiq;

public class HeapFunctions {
    public static int get_id(Object r) {
        if (r == null || !(r instanceof HeapReference)) return -1;
        return ((HeapReference) r).getIObject().getObjectId();
    }
}

@@ -234,11 +234,129 @@
 );%0A    %7D
+%0A%0A    public static String toString(Object r) %7B%0A        if (r == null) return null;%0A        return r.toString();%0A    %7D
 %0A%7D%0A

Add toString to simplify conversion to String (e.g. references)