Search in sources :

Example 1 with OplPushout

use of catdata.opl.OplExp.OplPushout in project fql by CategoricalData.

the class OplChase method chase.

static OplInst chase(OplInst I, List<OplQuery> EDs, int limit) {
    OplInst ret = I;
    for (int i = 0; i < limit; i++) {
        boolean changed = false;
        for (OplQuery ed : EDs) {
            OplPushout ret2 = step(ret, ed);
            if (ret2 != null) {
                ret = (OplInst) ret2.pushout().first;
                changed = true;
            }
        }
        if (!changed) {
            return ret;
        }
    }
    throw new RuntimeException("Limit exceeded, last instance:\n\n" + ret);
}
Also used : OplPushout(catdata.opl.OplExp.OplPushout) OplInst(catdata.opl.OplExp.OplInst)

Aggregations

OplInst (catdata.opl.OplExp.OplInst)1 OplPushout (catdata.opl.OplExp.OplPushout)1