Exemplo n.º 1
0
        ExistsElement IBuilder <ExistsElement> .Build()
        {
            Validate();
            RuleLeftElement sourceElement = _sourceBuilder.Build();
            var             existsElement = new ExistsElement(Scope.VisibleDeclarations, sourceElement);

            return(existsElement);
        }
Exemplo n.º 2
0
        NotElement IBuilder <NotElement> .Build()
        {
            Validate();
            RuleLeftElement sourceElement = _sourceBuilder.Build();
            var             notElement    = new NotElement(Scope.VisibleDeclarations, sourceElement);

            return(notElement);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates an element that represents a negative existential quantifier.
        /// </summary>
        /// <param name="source">Source element to apply the negative existential quantifier to.</param>
        /// <returns>Created element.</returns>
        public static NotElement Not(RuleLeftElement source)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source), "Source element not provided");
            }

            var element = new NotElement(source);

            return(element);
        }
Exemplo n.º 4
0
        GroupElement IBuilder <GroupElement> .Build()
        {
            var childElements = new List <RuleLeftElement>();

            foreach (var builder in _nestedBuilders)
            {
                RuleLeftElement childElement = builder.Build();
                childElements.Add(childElement);
            }
            var groupElement = Element.Group(_groupType, childElements);

            return(groupElement);
        }
Exemplo n.º 5
0
        private void BuildNotNode(ReteBuilderContext context, RuleLeftElement element)
        {
            var node = context.AlphaSource
                       .Sinks.OfType <NotNode>()
                       .FirstOrDefault(x =>
                                       x.RightSource == context.AlphaSource &&
                                       x.LeftSource == context.BetaSource);

            if (node == null)
            {
                node = new NotNode(context.BetaSource, context.AlphaSource);
            }
            node.NodeInfo.Add(context.Rule, element);
            BuildBetaMemoryNode(context, node);
            context.ResetAlphaSource();
        }
Exemplo n.º 6
0
        internal ExistsElement(RuleLeftElement source)
        {
            Source = source;

            AddImports(source);
        }