// substitute id -> value into pending IdResult substitute(IdPending pending, long id, Value value) { IntIdComponent[] sum = pending.delta; for (IntIdComponent intIdComponent : sum) { if (intIdComponent.remove(id)) { intIdComponent.value = lattice.meet(intIdComponent.value, value); } } return normalize(sum); }
IdResult normalize(IntIdComponent[] sum) { Value acc = lattice.bot; boolean computableNow = true; for (IntIdComponent prod : sum) { if (prod.isEmpty() || prod.value == lattice.bot) { acc = lattice.join(acc, prod.value); } else { computableNow = false; } } return (acc == lattice.top || computableNow) ? new IdFinal(acc) : new IdPending(sum); }