fn query_for_predicate(&mut self, predicate: Call) -> PolarResult<()> {
        assert!(predicate.kwargs.is_none());
        let goals = match self.kb.read().unwrap().rules.get(&predicate.name) {
            None => vec![Goal::Backtrack],
            Some(generic_rule) => {
                assert_eq!(generic_rule.name, predicate.name);

                // Pre-filter rules.
                let args = predicate.args.iter().map(|t| self.deep_deref(t)).collect();
                let pre_filter = generic_rule.get_applicable_rules(&args);

                self.polar_log_mute = true;

                // Filter rules by applicability.
                vec![
                    Goal::TraceStackPush,
                    Goal::FilterRules {
                        applicable_rules: vec![],
                        unfiltered_rules: pre_filter,
                        args: predicate.args,
                    },
                    Goal::TraceStackPop,
                ]
            }
        };
        self.append_goals(goals)
    }
/// Select applicable rules for predicate.
/// Sort applicable rules by specificity.
/// Create a choice over the applicable rules.
Select applicable rules for predicate.
Sort applicable rules by specificity.
Create a choice over the applicable rules.
Select applicable rules for predicate . Sort applicable rules by specificity . Create a choice over the applicable rules .
fn query_for_predicate(&mut self, predicate: Call) -> PolarResult<()> {
        assert!(predicate.kwargs.is_none());
        let goals = match self.kb.read().unwrap().rules.get(&predicate.name) {
            None => vec![Goal::Backtrack],
            Some(generic_rule) => {
                assert_eq!(generic_rule.name, predicate.name);
                // Pre-filter rules.
                let args = predicate.args.iter().map(|t| self.deep_deref(t)).collect();
                let pre_filter = generic_rule.get_applicable_rules(&args);
                self.polar_log_mute = true;
                // Filter rules by applicability.
                vec![
                    Goal::TraceStackPush,
                    Goal::FilterRules {
                        applicable_rules: vec![],
                        unfiltered_rules: pre_filter,
                        args: predicate.args,
                    },
                    Goal::TraceStackPop,
                ]
            }
        };
        self.append_goals(goals)
    }
fn query_for_predicate ( & mut self , predicate : Call ) -> PolarResult < ( ) > { assert ! ( predicate kwargs is_none ( ) ) ; let goals = match self . kb . read ( ) . unwrap ( ) . rules . get ( & predicate . name ) { None => vec ! [ Goal Backtrack ] , Some ( generic_rule ) => { assert_eq ! ( generic_rule name predicate name ) ; // Pre-filter rules. let args = predicate . args . iter ( ) . map ( | t | self . deep_deref ( t ) ) . collect ( ) ; let pre_filter = generic_rule . get_applicable_rules ( & args ) ; self . polar_log_mute = true ; // Filter rules by applicability. vec ! [ Goal TraceStackPush Goal FilterRules { applicable_rules vec [ ] unfiltered_rules pre_filter args predicate args } Goal TraceStackPop ] } } ; self . append_goals ( goals ) }
Select applicable rules for predicate.
Select applicable rules for predicate .
&mut self
predicate
Call