Exemplo n.º 1
0
        /// <summary>
        /// Make a unary predicate
        /// </summary>
        /// <typeparam name="T1">Argument type</typeparam>
        /// <typeparam name="TProp">Type of proposition to return</typeparam>
        /// <param name="name">Name of the predicate</param>
        /// <returns>The predicate object, i.e. a function from arguments to Propositions</returns>
        public static Func <T1, TProp> PredicateOfType <T1, TProp>(string name) where TProp : SpecialProposition, new()
        {
            var problem = Problem.Current;

            return(arg1 => problem.GetSpecialProposition <TProp>(Call.FromArgs(Problem.Current, name, arg1)));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Make a binary predicate
 /// </summary>
 /// <typeparam name="T1">Type for argument 1</typeparam>
 /// <typeparam name="T2">Type for argument 2</typeparam>
 /// <param name="name">Name of the predicate</param>
 /// <returns>The predicate object, i.e. a function from arguments to Propositions</returns>
 public static Func <T1, T2, Proposition> Predicate <T1, T2>(string name)
 {
     return((arg1, arg2) => Proposition.MakeProposition(Call.FromArgs(Problem.Current, name, arg1, arg2)));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Make a binary function in the sense of a term generator
 /// </summary>
 /// <param name="name">Name of the function</param>
 // ReSharper disable once UnusedMember.Global
 public static Func <T1, T2, Call> Function <T1, T2>(string name)
 {
     return((arg1, arg2) => Call.FromArgs(Problem.Current, name, arg1, arg2));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Make a 5-argument function in the sense of a term generator
 /// </summary>
 /// <param name="name">Name of the function</param>
 // ReSharper disable once UnusedMember.Global
 public static Func <T1, T2, T3, T4, T5, Call> Function <T1, T2, T3, T4, T5>(string name)
 {
     return((arg1, arg2, arg3, arg4, arg5) => Call.FromArgs(Problem.Current, name, arg1, arg2, arg3, arg4, arg5));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Make a 5-argument predicate
 /// </summary>
 /// <typeparam name="T1">Type for argument 1</typeparam>
 /// <typeparam name="T2">Type for argument 2</typeparam>
 /// <typeparam name="T3">Type for argument 3</typeparam>
 /// <typeparam name="T4">Type for argument 4</typeparam>
 /// <typeparam name="T5">Type for argument 5</typeparam>
 /// <param name="name">Name of the predicate</param>
 /// <returns>The predicate object, i.e. a function from arguments to Propositions</returns>
 // ReSharper disable once UnusedMember.Global
 public static Func <T1, T2, T3, T4, T5, Proposition> Predicate <T1, T2, T3, T4, T5>(string name)
 {
     return((arg1, arg2, arg3, arg4, arg5) => Proposition.MakeProposition(Call.FromArgs(Problem.Current, name, arg1, arg2, arg3, arg4, arg5)));
 }