/** * Provides an iterator pointing after the last APElement * in the subset represented by the APMonom <i>m</i>. * @param ap_set the underlying APSet * @param m the APMonom over which we iterate * @return the iterator. */ public static APMonom2APElements end(APSet ap_set, APMonom m) { APMonom2APElements m2e = new APMonom2APElements(ap_set, m); m2e._end_marker = true; return(m2e); }
/** * Constructor that generates an iterator pointing * to a specific APElement. * @param ap_set the underlying APSet * @param m the APMonom over which we iterate * @param cur_e the current APElement */ public APMonom2APElements(APSet ap_set, APMonom m, APElement cur_e) { _ap_set = ap_set; _m = m; _cur_e = cur_e; _end_marker = false; if (m.isFalse()) { _end_marker = true; } }
/** * Constructor that generates an iterator pointing * to a specific APElement. * @param ap_set the underlying APSet * @param m the APMonom over which we iterate * @param cur_e the current APElement */ public APMonom2APElements(APSet ap_set, APMonom m, APElement cur_e) { _ap_set = ap_set; _m = m; _cur_e = cur_e; _end_marker = false; if (m.isFalse()) { _end_marker = true; } }
/** * Constructor that generates an iterator pointing to the first * APElement. * @param ap_set the underlying APSet * @param m the APMonom over which we iterate */ public APMonom2APElements(APSet ap_set, APMonom m) { _ap_set = ap_set; _m = m; _cur_e = new APElement(m.getValueBits()); _end_marker = false; if (m.isFalse()) { _end_marker = true; } }
/** * Constructor that generates an iterator pointing to the first * APElement. * @param ap_set the underlying APSet * @param m the APMonom over which we iterate */ public APMonom2APElements(APSet ap_set, APMonom m) { _ap_set = ap_set; _m = m; _cur_e = new APElement(m.getValueBits()); _end_marker = false; if (m.isFalse()) { _end_marker = true; } }
/** * Calls Functor::operator(APMonom& m) for each monom of the formula. * Formula has to be in DNF! */ //template <class Functor> public void forEachMonom(EdgeCreator f) { if (getType() == type_t.T_OR) { getLeft().forEachMonom(f); getRight().forEachMonom(f); } else { APMonom m = this.toMonom(); f.apply(m); } }
/** Add an edge. */ public void addEdge(APMonom label, NBA_State state) { APSet ap_set = _state.getGraph().getAPSet(); APMonom2APElements start = APMonom2APElements.begin(ap_set, label); //for (APMonom2APElements it=APMonom2APElements::begin(ap_set, label);it!=APMonom2APElements::end(ap_set, label);++it) while (!start.equal(APMonom2APElements.end(ap_set, label)))///////////////***********note sth wrong here don't skip sth extra { APElement it = start._cur_e; addEdge(it, state); start.increment(); } }
/** Returns an APMonom representing the formula rooted at * this node. Formula has to be in DNF. */ APMonom toMonom() { APMonom result = APMonom.TRUE; switch (getType()) { case type_t.T_AND: { APMonom left = getLeft().toMonom(); APMonom right = getRight().toMonom(); result = left & right; return(result); } case type_t.T_NOT: switch (getLeft().getType()) { case type_t.T_AP: result.setValue(getLeft().getAP(), false); return(result); case type_t.T_FALSE: result = APMonom.TRUE; return(result); case type_t.T_TRUE: result = APMonom.FALSE; return(result); default: throw new Exception("Formula not in DNF!"); } case type_t.T_AP: result.setValue(getAP(), true); return(result); case type_t.T_FALSE: result = APMonom.FALSE; return(result); case type_t.T_TRUE: result = APMonom.TRUE; return(result); default: throw new Exception("Formula not in DNF!"); } }
/** * Performs an intersection check. * @param m1 the first APMonom * @param m2 the second APMonom * @return <b>true</b> if the intersection of <i>m1</i> and <i>m2</i> is empty. */ public static bool isIntersectionEmpty(APMonom m1, APMonom m2) { // check if there are contradicting values int set_in_both = m1.getSetBits().bitset & m2.getSetBits().bitset; if ((m1.getValueBits().bitset & set_in_both) != (m2.getValueBits().bitset & set_in_both)) { // contradiction return(true); } else { return(false); } }
public void apply(APMonom m) { _nba.nba_i_addEdge(_from, m, _to); }
/** * Add edge(s) from this state to the other state * @param monom an APMonom for the label(s) * @param to_state the target state */ public void addEdge(APMonom monom, NBA_State to_state) { _edge_manager.addEdge(monom, to_state); }
public void apply(APMonom m) { _nba.nba_i_addEdge(_from, m, _to); }
/** Add an edge. */ public void addEdge(APMonom label, NBA_State state) { APSet ap_set=_state.getGraph().getAPSet(); APMonom2APElements start = APMonom2APElements.begin(ap_set, label); //for (APMonom2APElements it=APMonom2APElements::begin(ap_set, label);it!=APMonom2APElements::end(ap_set, label);++it) while (!start.equal(APMonom2APElements.end(ap_set, label)))///////////////***********note sth wrong here don't skip sth extra { APElement it = start._cur_e; addEdge(it, state); start.increment(); } }
/** * Constructor. * @param set_bits integer representation of the bits which are set * @param value_bits integer representation of the value bits */ public void SetAPMonom(APMonom AP) { //APMonmType = AP.APMonmType; bits_set.set(AP.bits_set.bitset); bits_value.set(AP.bits_value.bitset); }
/** * Add an edge from state <i>from</i> to state <i>to</i> * for the edges covered by the APMonom. * @param from the index of the 'from' state * @param m the APMonom * @param to the index of the 'to' state */ public void nba_i_addEdge(int from, APMonom m, int to) { this[from].addEdge(m, this[to]); }
/** * Add edge(s) from this state to the other state * @param monom an APMonom for the label(s) * @param to_state the target state */ public void addEdge(APMonom monom, NBA_State to_state) { _edge_manager.addEdge(monom, to_state); }
/** * Performs an intersection check. * @param m1 the first APMonom * @param m2 the second APMonom * @return <b>true</b> if the intersection of <i>m1</i> and <i>m2</i> is empty. */ public static bool isIntersectionEmpty(APMonom m1, APMonom m2) { // check if there are contradicting values int set_in_both = m1.getSetBits().bitset & m2.getSetBits().bitset; if ((m1.getValueBits().bitset & set_in_both) != (m2.getValueBits().bitset & set_in_both)) { // contradiction return true; } else { return false; } }
/** * Provides an iterator pointing to the first APElement * in the subset represented by the APMonom <i>m</i>. * @param ap_set the underlying APSet * @param m the APMonom over which we iterate * @return the iterator. */ public static APMonom2APElements begin(APSet ap_set, APMonom m) { return new APMonom2APElements(ap_set, m); }
/** * Add an edge from state <i>from</i> to state <i>to</i> * for the edges covered by the APMonom. * @param from the index of the 'from' state * @param m the APMonom * @param to the index of the 'to' state */ public void nba_i_addEdge(int from, APMonom m, int to) { this[from].addEdge(m, this[to]); }
/** * Provides an iterator pointing after the last APElement * in the subset represented by the APMonom <i>m</i>. * @param ap_set the underlying APSet * @param m the APMonom over which we iterate * @return the iterator. */ public static APMonom2APElements end(APSet ap_set, APMonom m) { APMonom2APElements m2e = new APMonom2APElements(ap_set, m); m2e._end_marker = true; return m2e; }
/** * Constructor. * @param set_bits integer representation of the bits which are set * @param value_bits integer representation of the value bits */ public void SetAPMonom(APMonom AP) { //APMonmType = AP.APMonmType; bits_set.set(AP.bits_set.bitset); bits_value.set(AP.bits_value.bitset); }
/** * Provides an iterator pointing to the first APElement * in the subset represented by the APMonom <i>m</i>. * @param ap_set the underlying APSet * @param m the APMonom over which we iterate * @return the iterator. */ public static APMonom2APElements begin(APSet ap_set, APMonom m) { return(new APMonom2APElements(ap_set, m)); }