pub fn check_proof<'a, R, N: Analysis<L>>(&mut self, rules: R)
    where
        R: IntoIterator<Item = &'a Rewrite<L, N>>,
        L: 'a,
        N: 'a,
    {
        let rules: Vec<&Rewrite<L, N>> = rules.into_iter().collect();
        let rule_table = Explain::make_rule_table(rules.as_slice());
        self.make_flat_explanation();
        let flat_explanation = self.flat_explanation.as_ref().unwrap();
        assert!(!flat_explanation[0].has_rewrite_forward());
        assert!(!flat_explanation[0].has_rewrite_backward());
        for i in 0..flat_explanation.len() - 1 {
            let current = &flat_explanation[i];
            let next = &flat_explanation[i + 1];

            let has_forward = next.has_rewrite_forward();
            let has_backward = next.has_rewrite_backward();
            assert!(has_forward ^ has_backward);

            if has_forward {
                assert!(self.check_rewrite_at(current, next, &rule_table, true));
            } else {
                assert!(self.check_rewrite_at(current, next, &rule_table, false));
            }
        }
    }
/// Check the validity of the explanation with respect to the given rules.
/// This only is able to check rule applications when the rules are implement `get_pattern_ast`.
Check the validity of the explanation with respect to the given rules.
This only is able to check rule applications when the rules are implement `get_pattern_ast`.
Check the validity of the explanation with respect to the given rules . This only is able to check rule applications when the rules are implement ` get_pattern_ast ` .
pub fn check_proof<'a, R, N: Analysis<L>>(&mut self, rules: R)
    where
        R: IntoIterator<Item = &'a Rewrite<L, N>>,
        L: 'a,
        N: 'a,
    {
        let rules: Vec<&Rewrite<L, N>> = rules.into_iter().collect();
        let rule_table = Explain::make_rule_table(rules.as_slice());
        self.make_flat_explanation();
        let flat_explanation = self.flat_explanation.as_ref().unwrap();
        assert!(!flat_explanation[0].has_rewrite_forward());
        assert!(!flat_explanation[0].has_rewrite_backward());
        for i in 0..flat_explanation.len() - 1 {
            let current = &flat_explanation[i];
            let next = &flat_explanation[i + 1];
            let has_forward = next.has_rewrite_forward();
            let has_backward = next.has_rewrite_backward();
            assert!(has_forward ^ has_backward);
            if has_forward {
                assert!(self.check_rewrite_at(current, next, &rule_table, true));
            } else {
                assert!(self.check_rewrite_at(current, next, &rule_table, false));
            }
        }
    }
pub fn check_proof < ' a , R , N : Analysis < L > > ( & mut self , rules : R ) where R : IntoIterator < Item = & ' a Rewrite < L , N > > , L : ' a , N : ' a , { let rules : Vec < & Rewrite < L , N > > = rules . into_iter ( ) . collect ( ) ; let rule_table = Explain :: make_rule_table ( rules . as_slice ( ) ) ; self . make_flat_explanation ( ) ; let flat_explanation = self . flat_explanation . as_ref ( ) . unwrap ( ) ; assert ! ( flat_explanation [ 0 ] has_rewrite_forward ( ) ) ; assert ! ( flat_explanation [ 0 ] has_rewrite_backward ( ) ) ; for i in 0 .. flat_explanation . len ( ) - 1 { let current = & flat_explanation [ i ] ; let next = & flat_explanation [ i + 1 ] ; let has_forward = next . has_rewrite_forward ( ) ; let has_backward = next . has_rewrite_backward ( ) ; assert ! ( has_forward has_backward ) ; if has_forward { assert ! ( self check_rewrite_at ( current next rule_table true ) ) ; } else { assert ! ( self check_rewrite_at ( current next rule_table false ) ) ; } } }
Check the validity of the explanation with respect to the given rules.
Check the validity of the explanation with respect to the given rules .
&mut self
rules
R
&mut self
rules
R