Esempio n. 1
0
        internal override UserSymbol CloneSymbol(Namespace space, Span span, string renaming)
        {
            var clone = new ConSymb(space, (AST <ConDecl>)CopyCanonicalForm(span, renaming), IsAutoGen);

            clone.IsSubRuleGenerated = IsSubRuleGenerated;
            return(clone);
        }
Esempio n. 2
0
        /// <summary>
        /// Returns a type estimate of F for F ::= sub (...).
        /// </summary>
        public Term MkTypeTerm(ConSymb subSymb)
        {
            Contract.Requires(IsSatisfiable && subSymb.Arity == NPatterns);
            Term intr;
            var  index    = pattern[0].Owner;
            var  typeArgs = new Term[pattern.Length];

            for (int i = 0; i < pattern.Length; ++i)
            {
                if (!index.MkIntersection(pattern[i], matchingUnions[i].MkTypeTerm(index), out intr))
                {
                    Contract.Assert(false);
                    continue;
                }

                typeArgs[i] = intr;
            }

            bool wasAdded;

            return(index.MkApply(subSymb, typeArgs, out wasAdded));
        }