public RuleCollection ParseRules() { /** Create a list of rules */ RuleCollection rules = new RuleCollection(); XmlNodeList ruleNode = xmlDoc.GetElementsByTagName("Rule"); foreach (XmlNode r in ruleNode) { /** Conclusion of Rule */ XmlNode conclusionNode = r["Conclusion"]; string attribute = conclusionNode["Attribute"].InnerText; TypeOfValue value = (TypeOfValue)Convert.ToInt32(conclusionNode["Value"].InnerText); Literal conclusion = new Literal(attribute, value); /** Priority of Rule */ decimal priority = decimal.Parse(r["Priority"].InnerText); /** Create a list of conditions */ LiteralCollection conditions = ParseConditions(r); rules.Add(new Rule(rules.Count, conditions, conclusion, priority)); } return(rules); }
public void RetractAllConclusionsGeneratedByTheRule(Rule r, RuleCollection rules) { if (r.IdNextRules != null) { foreach (int id in r.IdNextRules) { Rule nextRule = rules[id] as Rule; int index_nextConclusion = IndexOf(new Fact(nextRule.Conclusion, id)); if (index_nextConclusion != -1) { if (!ContainsWithAnotherRule(r.Conclusion, id)) { RetractAllConclusionsGeneratedByTheRule(rules[id] as Rule, rules); RetractConclusion(index_nextConclusion); } } } } }
public NonMonotonicity(LiteralCollection facts, RuleCollection rules) : base(facts, rules) { }
public Conflict(LiteralCollection facts, RuleCollection rules) { this.Facts = facts; this.Rules = rules; }
public Rebutting(LiteralCollection facts, RuleCollection rules) : base(facts, rules) { }
public Undermining(LiteralCollection facts, RuleCollection rules) : base(facts, rules) { }
public Attack(LiteralCollection facts, RuleCollection rules) { this.Facts = facts; this.Rules = rules; }