Exemplo n.º 1
0
        public TermFunction(bool cloneCols, int funcName, Term[] args)
        {
            FunctionName = funcName;

            if (args == null)
            {
                Arguments = EmptyArgs;
                _hasVariables = false;
            }
            else
            {
                // Check if any of the term arguments are variables
                _hasVariables = args.Any(t => t.HasVariables);

                if (cloneCols)
                    Arguments = (Term[])args.Clone();
                else
                    Arguments = args;
            }

            // Compute the total columns needed
            TotalColumns = 1 + Arguments.Sum(t => t.TotalColumns); // 1 for the name
        }