pub fn add_link_coherence(&mut self, link_id: LinkId) -> Result<(), AcesError> {
        let link_lit = Lit::from_atom_id(link_id.into(), true);

        let (tx_port_lit, rx_port_lit) = {
            let ctx = self.context.lock().unwrap();

            if let Some(link) = ctx.get_link(link_id) {
                let tx_port_id = link.get_tx_port_id();
                let rx_port_id = link.get_rx_port_id();

                (
                    Lit::from_atom_id(tx_port_id.into(), false),
                    Lit::from_atom_id(rx_port_id.into(), false),
                )
            } else {
                return Err(AcesErrorKind::LinkMissingForId(link_id).with_context(&self.context))
            }
        };

        let clause = Clause::from_pair(link_lit, tx_port_lit, "link coherence (Tx side)");
        self.add_clause(clause)?;

        let clause = Clause::from_pair(link_lit, rx_port_lit, "link coherence (Rx side)");
        self.add_clause(clause)
    }
/// Adds a _link coherence_ rule to this `Formula`.
///
/// This firing rule consists of two clauses which are added in
/// order to maintain link coherence, so that any firing component
/// of a c-e structure is itself a proper c-e structure.  The
/// `Formula` should contain one such rule for each link of the
/// c-e structure under analysis.
///
/// Returns an error if `link_id` doesn't identify any `Link` in
/// the `Context` of this `Formula`.
Adds a _link coherence_ rule to this `Formula`.
This firing rule consists of two clauses which are added in
order to maintain link coherence, so that any firing component
of a c-e structure is itself a proper c-e structure.  The
`Formula` should contain one such rule for each link of the
c-e structure under analysis.


Adds a _link coherence_ rule to this ` Formula ` . This firing rule consists of two clauses which are added in order to maintain link coherence so that any firing component of a c - e structure is itself a proper c - e structure . The ` Formula ` should contain one such rule for each link of the c - e structure under analysis .
pub fn add_link_coherence(&mut self, link_id: LinkId) -> Result<(), AcesError> {
        let link_lit = Lit::from_atom_id(link_id.into(), true);
        let (tx_port_lit, rx_port_lit) = {
            let ctx = self.context.lock().unwrap();
            if let Some(link) = ctx.get_link(link_id) {
                let tx_port_id = link.get_tx_port_id();
                let rx_port_id = link.get_rx_port_id();
                (
                    Lit::from_atom_id(tx_port_id.into(), false),
                    Lit::from_atom_id(rx_port_id.into(), false),
                )
            } else {
                return Err(AcesErrorKind::LinkMissingForId(link_id).with_context(&self.context))
            }
        };
        let clause = Clause::from_pair(link_lit, tx_port_lit, "link coherence (Tx side)");
        self.add_clause(clause)?;
        let clause = Clause::from_pair(link_lit, rx_port_lit, "link coherence (Rx side)");
        self.add_clause(clause)
    }
pub fn add_link_coherence ( & mut self , link_id : LinkId ) -> Result < ( ) , AcesError > { let link_lit = Lit :: from_atom_id ( link_id . into ( ) , true ) ; let ( tx_port_lit , rx_port_lit ) = { let ctx = self . context . lock ( ) . unwrap ( ) ; if let Some ( link ) = ctx . get_link ( link_id ) { let tx_port_id = link . get_tx_port_id ( ) ; let rx_port_id = link . get_rx_port_id ( ) ; ( Lit :: from_atom_id ( tx_port_id . into ( ) , false ) , Lit :: from_atom_id ( rx_port_id . into ( ) , false ) , ) } else { return Err ( AcesErrorKind :: LinkMissingForId ( link_id ) . with_context ( & self . context ) ) } } ; let clause = Clause :: from_pair ( link_lit , tx_port_lit , " " ) ; self . add_clause ( clause ) ? ; let clause = Clause :: from_pair ( link_lit , rx_port_lit , " " ) ; self . add_clause ( clause ) }
Adds a _link coherence_ rule to this `Formula`.
Adds a _link coherence_ rule to this ` Formula ` .
&mut self
link_id
LinkId
&mut self
link_id
LinkId