(* ========================================================================== *) (* Formal verification of nonlinear inequalities in HOL Light *) (* *) (* Copyright (c) 2012 Alexey Solovyev *) (* *) (* This file is distributed under the terms of the MIT licence *) (* ========================================================================== *) (* -------------------------------------------------------------------------- *) (* Formal natural number arithmetic *) (* -------------------------------------------------------------------------- *) (* Dependencies *) needs "Formal_ineqs/arith_options.hl";; needs "Formal_ineqs/arith/arith_cache.hl";; module Arith_nat = struct open Arith_options;; (* mk *) let mk_small_numeral_array = Arith_num.mk_small_numeral_array;; let mk_numeral_array = Arith_num.mk_numeral_array;; let NUMERAL_TO_NUM_CONV = Arith_num.NUMERAL_TO_NUM_CONV;; let NUM_TO_NUMERAL_CONV = Arith_num.NUM_TO_NUMERAL_CONV;; (* dest *) let raw_dest_hash = Arith_num.raw_dest_hash;; (* SUC *) let raw_suc_conv_hash = if !cached then Arith_cache.raw_suc_conv_hash else Arith_num.raw_suc_conv_hash;; let NUM_SUC_HASH_CONV = Arith_num.NUM_SUC_HASH_CONV;; (* x = 0 *) let raw_eq0_hash_conv = if !cached then Arith_cache.raw_eq0_hash_conv else Arith_num.raw_eq0_hash_conv;; let NUM_EQ0_HASH_CONV = Arith_num.NUM_EQ0_HASH_CONV;; (* PRE *) let raw_pre_hash_conv = if !cached then Arith_cache.raw_pre_hash_conv else Arith_num.raw_pre_hash_conv;; let NUM_PRE_HASH_CONV = Arith_num.NUM_PRE_HASH_CONV;; (* x > 0 *) let raw_gt0_hash_conv = if !cached then Arith_cache.raw_gt0_hash_conv else Arith_num.raw_gt0_hash_conv;; let NUM_GT0_HASH_CONV = Arith_num.NUM_GT0_HASH_CONV;; (* x = y *) let raw_eq_hash_conv = Arith_num.raw_eq_hash_conv;; let NUM_EQ_HASH_CONV = Arith_num.NUM_EQ_HASH_CONV;; (* x < y, x <= y *) let raw_lt_hash_conv = if !cached then Arith_cache.raw_lt_hash_conv else Arith_num.raw_lt_hash_conv;; let raw_le_hash_conv = if !cached then Arith_cache.raw_le_hash_conv else Arith_num.raw_le_hash_conv;; let NUM_LT_HASH_CONV = Arith_num.NUM_LT_HASH_CONV;; let NUM_LE_HASH_CONV = Arith_num.NUM_LE_HASH_CONV;; (* x + y *) let raw_add_conv_hash = if !cached then Arith_cache.raw_add_conv_hash else Arith_num.raw_add_conv_hash;; let NUM_ADD_HASH_CONV = Arith_num.NUM_ADD_HASH_CONV;; (* x - y *) let raw_sub_hash_conv = if !cached then Arith_cache.raw_sub_hash_conv else Arith_num.raw_sub_hash_conv;; let raw_sub_and_le_hash_conv = if !cached then Arith_cache.raw_sub_and_le_hash_conv else Arith_num.raw_sub_and_le_hash_conv;; let NUM_SUB_HASH_CONV = Arith_num.NUM_SUB_HASH_CONV;; (* x * y *) let raw_mul_conv_hash = if !cached then Arith_cache.raw_mul_conv_hash else Arith_num.raw_mul_conv_hash;; let NUM_MULT_HASH_CONV = Arith_num.NUM_MULT_HASH_CONV;; (* x / y *) let raw_div_hash_conv = if !cached then Arith_cache.raw_div_hash_conv else Arith_num.raw_div_hash_conv;; let NUM_DIV_HASH_CONV = Arith_num.NUM_DIV_HASH_CONV;; (* EVEN, ODD *) let raw_even_hash_conv = if !cached then Arith_cache.raw_even_hash_conv else Arith_num.raw_even_hash_conv;; let raw_odd_hash_conv = if !cached then Arith_cache.raw_odd_hash_conv else Arith_num.raw_odd_hash_conv;; let NUM_EVEN_HASH_CONV = Arith_num.NUM_EVEN_HASH_CONV;; let NUM_ODD_HASH_CONV = Arith_num.NUM_ODD_HASH_CONV;; let NUMERALS_TO_NUM = PURE_REWRITE_RULE[Arith_num.NUM_THM] o CONV_RULE (DEPTH_CONV NUMERAL_TO_NUM_CONV);; end;;