enter : term list -> term * 'a -> 'a net -> 'a net
let arithnet = itlist (enter []) [`SUC n`,NUM_SUC_CONV; `m + n:num`,NUM_ADD_CONV; `m - n:num`,NUM_SUB_CONV; `m * n:num`,NUM_MULT_CONV; `m EXP n`,NUM_EXP_CONV; `m DIV n`,NUM_DIV_CONV; `m MOD n`,NUM_MOD_CONV] empty_net;;
let NUM_ARITH_CONV tm = FIRST_CONV (lookup tm arithnet) tm;;
let NUM_ARITH_CONV' = FIRST_CONV [NUM_SUC_CONV; NUM_ADD_CONV; NUM_SUB_CONV; NUM_MULT_CONV; NUM_EXP_CONV; NUM_DIV_CONV; NUM_MOD_CONV];;
# let tm = funpow 5 (fun x -> mk_binop `(*):num->num->num` x x) `12`;; ... time (DEPTH_CONV NUM_ARITH_CONV) term;; CPU time (user): 0.12 ... time (DEPTH_CONV NUM_ARITH_CONV') term;; CPU time (user): 0.22 ...