src/HOL/Decision_Procs/Cooper.thy
changeset 47108 2a1953f0d20d
parent 45740 132a3e1c0fe5
child 47142 d64fa2ca54b8
equal deleted inserted replaced
47107:35807a5d8dc2 47108:2a1953f0d20d
  1881 fun num_of_term vs (t as Free (xn, xT)) = (case AList.lookup (op =) vs t
  1881 fun num_of_term vs (t as Free (xn, xT)) = (case AList.lookup (op =) vs t
  1882      of NONE => error "Variable not found in the list!"
  1882      of NONE => error "Variable not found in the list!"
  1883       | SOME n => @{code Bound} n)
  1883       | SOME n => @{code Bound} n)
  1884   | num_of_term vs @{term "0::int"} = @{code C} 0
  1884   | num_of_term vs @{term "0::int"} = @{code C} 0
  1885   | num_of_term vs @{term "1::int"} = @{code C} 1
  1885   | num_of_term vs @{term "1::int"} = @{code C} 1
  1886   | num_of_term vs (@{term "number_of :: int \<Rightarrow> int"} $ t) = @{code C} (HOLogic.dest_numeral t)
  1886   | num_of_term vs (@{term "numeral :: _ \<Rightarrow> int"} $ t) = @{code C} (HOLogic.dest_num t)
       
  1887   | num_of_term vs (@{term "neg_numeral :: _ \<Rightarrow> int"} $ t) = @{code C} (~(HOLogic.dest_num t))
  1887   | num_of_term vs (Bound i) = @{code Bound} i
  1888   | num_of_term vs (Bound i) = @{code Bound} i
  1888   | num_of_term vs (@{term "uminus :: int \<Rightarrow> int"} $ t') = @{code Neg} (num_of_term vs t')
  1889   | num_of_term vs (@{term "uminus :: int \<Rightarrow> int"} $ t') = @{code Neg} (num_of_term vs t')
  1889   | num_of_term vs (@{term "op + :: int \<Rightarrow> int \<Rightarrow> int"} $ t1 $ t2) =
  1890   | num_of_term vs (@{term "op + :: int \<Rightarrow> int \<Rightarrow> int"} $ t1 $ t2) =
  1890       @{code Add} (num_of_term vs t1, num_of_term vs t2)
  1891       @{code Add} (num_of_term vs t1, num_of_term vs t2)
  1891   | num_of_term vs (@{term "op - :: int \<Rightarrow> int \<Rightarrow> int"} $ t1 $ t2) =
  1892   | num_of_term vs (@{term "op - :: int \<Rightarrow> int \<Rightarrow> int"} $ t1 $ t2) =