public BDD load(BufferedReader ifile) throws IOException {  tokenizer = null;  int lh_nodenum = Integer.parseInt(readNext(ifile)); int vnum = Integer.parseInt(readNext(ifile));   if (lh_nodenum == 0 && vnum == 0) { int r = Integer.parseInt(readNext(ifile)); return r == 0 ? zero() : one();
public BDD load(String filename) throws IOException { BufferedReader r = null; try { r = new BufferedReader(new FileReader(filename)); BDD result = load(r); return result; } finally { if (r != null) try { r.close(); } catch (IOException _) { }
    public BDD load(BufferedReader ifile) throws IOException {        tokenizer = null;                int lh_nodenum = Integer.parseInt(readNext(ifile));        int vnum = Integer.parseInt(readNext(ifile));        // Check for constant true / false        if (lh_nodenum == 0 && vnum == 0) {            int r = Integer.parseInt(readNext(ifile));            return r == 0 ? zero() : one();        }        // Not actually used.        int[] loadvar2level = new int[vnum];        for (int n = 0; n < vnum; n++) {            loadvar2level[n] = Integer.parseInt(readNext(ifile));        }        if (vnum > varNum())            setVarNum(vnum);        LoadHash[] lh_table = new LoadHash[lh_nodenum];        for (int n = 0; n < lh_nodenum; n++) {            lh_table[n] = new LoadHash();            lh_table[n].first = -1;            lh_table[n].next = n + 1;        }        lh_table[lh_nodenum - 1].next = -1;        int lh_freepos = 0;        BDD root = null;        for (int n = 0; n < lh_nodenum; n++) {            int key = Integer.parseInt(readNext(ifile));            int var = Integer.parseInt(readNext(ifile));            int lowi = Integer.parseInt(readNext(ifile));            int highi = Integer.parseInt(readNext(ifile));            BDD low, high;                        low = loadhash_get(lh_table, lh_nodenum, lowi);            high = loadhash_get(lh_table, lh_nodenum, highi);            if (low == null || high == null || var < 0)                throw new BDDException("Incorrect file format");            BDD b = ithVar(var);            root = b.ite(high, low);            b.free();            int hash = key % lh_nodenum;            int pos = lh_freepos;            lh_freepos = lh_table[pos].next;            lh_table[pos].next = lh_table[hash].first;            lh_table[hash].first = pos;            lh_table[pos].key = key;            lh_table[pos].data = root;        }        BDD tmproot = root.id();                for (int n = 0; n < lh_nodenum; n++)            lh_table[n].data.free();        lh_table = null;        loadvar2level = null;        return tmproot;    }