Exemplo n.º 1
0
        public BoundFunctor(ILiteral name, IEnumerable <ILiteral> parameters)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            _parameters = parameters.ToArray();
            _unbound    = new UnboundFunctor(name, _parameters.Length);
        }
Exemplo n.º 2
0
        public BoundFunctor(UnboundFunctor unbound, IEnumerable <ILiteral> parameters)
        {
            if (unbound == null)
            {
                throw new ArgumentNullException("unbound");
            }
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            _unbound    = unbound;
            _parameters = parameters.ToArray();

            if (_parameters.Length != _unbound.NumParameters)
            {
                throw new ArgumentException("Incorrect number of parameters for functor", "parameters");
            }
        }
Exemplo n.º 3
0
 public BoundFunctor(params ILiteral[] parameters)
 {
     _parameters = parameters;
     _unbound    = new UnboundFunctor(_parameters.Length);
 }