示例#1
0
        /// <summary>
        /// Schedule the execution of sets to try to create the passed object ID in the rule context (backward chaining).
        /// </summary>
        /// <param name="objectId">The ID to resolve.</param>
        /// <returns>The value of the object ID to resolve, or null if the resolution was not possible.</returns>
        public object Resolve(string objectId)
        {
            if (backwardChainer == null)
            {
                backwardChainer = new BackwardChainer(this);
            }

            return(backwardChainer.Resolve(objectId));
        }
示例#2
0
        public void CircularityDetection()
        {
            flowEngine = new BREImpl();
            flowEngine.Init(new XBusinessRulesFileDriver(ruleFilesFolder + "/circularity.xbre"));
            backwardChainer = new BackwardChainer(flowEngine);

            Stack <string> resolutionPath = new Stack <string>();

            Assert.IsNull(backwardChainer.Resolve("A", resolutionPath));
            Assert.IsTrue(resolutionPath.Contains("{Circularity}"));
        }
示例#3
0
 public void ResolveAlreadyAssertedObject()
 {
     flowEngine.RuleContext.SetObject("flowEngine", flowEngine);
     Assert.AreSame(flowEngine, backwardChainer.Resolve("flowEngine"));
 }