예제 #1
0
        /// <summary>
        /// Converts to a HOL string
        /// </summary>
        /// <param name="precision"></param>
        /// <returns></returns>
        public string ToHOLString(int precision, VariableCollection vars)
        {
            StringBuilder str = new StringBuilder();

            str.Append(lhs.ToHOLString(precision, vars));

            switch (type)
            {
                case IneqType.Eq:
                    // An equality becomes an inequality
                    str.Append(" <= ");
                    break;

                case IneqType.Le:
                    str.Append(" <= ");
                    break;

                case IneqType.Ge:
                    str.Append(" >= ");
                    break;
            }

            str.Append(rhs.ToHOLString(precision));
            return str.ToString();
        }
예제 #2
0
 // Marginals
 //        private List<LpNumber> varIneqMarginals;
 /// <summary>
 /// Private constructor
 /// </summary>
 private LP()
 {
     originalIneqs = new List<Inequality>();
     vars = new VariableCollection();
 }
예제 #3
0
        /// <summary>
        /// Converts to a HOL term
        /// </summary>
        /// <param name="precision"></param>
        /// <returns></returns>
        public string ToHOLExplicit(int precision, VariableCollection vars)
        {
            StringBuilder str = new StringBuilder();

            switch (type)
            {
                case IneqType.Eq:
                    // Eq becomes Le
                    str.Append("mk_le_ineq ");
                    break;

                case IneqType.Le:
                    str.Append("mk_le_ineq ");
                    break;

                case IneqType.Ge:
                    str.Append("mk_ge_ineq ");
                    break;
            }

            str.Append(lhs.ToHOLExplicit(precision, vars));
            str.Append(rhs.ToHOLExplicit(precision));

            return str.ToString();
        }
예제 #4
0
 public VarsComparer(VariableCollection vars)
 {
     this.vars = vars;
 }