src/HOL/Tools/SMT/z3_interface.ML
changeset 40274 6486c610a549
parent 40162 7f58a9a843c2
child 40516 516a367eb38c
equal deleted inserted replaced
40273:364aa76f7e21 40274:6486c610a549
    63 
    63 
    64 
    64 
    65 (** interface **)
    65 (** interface **)
    66 
    66 
    67 local
    67 local
    68   val {extra_norm, translate} = SMTLIB_Interface.interface
    68   val {translate, ...} = SMTLIB_Interface.interface
    69   val {prefixes, strict, header, builtins, serialize} = translate
    69   val {prefixes, strict, header, builtins, serialize} = translate
    70   val {is_builtin_pred, ...}= the strict
    70   val {is_builtin_pred, ...}= the strict
    71   val {builtin_typ, builtin_num, builtin_fun, ...} = builtins
    71   val {builtin_typ, builtin_num, builtin_fun, ...} = builtins
    72 
    72 
    73   fun is_int_div_mod @{term "op div :: int => _"} = true
    73   fun is_int_div_mod @{term "op div :: int => _"} = true
   187 val nil_term = mk_inst_pair destT1 @{cpat Nil}
   187 val nil_term = mk_inst_pair destT1 @{cpat Nil}
   188 val cons_term = mk_inst_pair destT1 @{cpat Cons}
   188 val cons_term = mk_inst_pair destT1 @{cpat Cons}
   189 fun mk_list cT cts =
   189 fun mk_list cT cts =
   190   fold_rev (Thm.mk_binop (instT cT cons_term)) cts (instT cT nil_term)
   190   fold_rev (Thm.mk_binop (instT cT cons_term)) cts (instT cT nil_term)
   191 
   191 
   192 val distinct = mk_inst_pair (destT1 o destT1) @{cpat distinct}
   192 val distinct = mk_inst_pair (destT1 o destT1) @{cpat SMT.distinct}
   193 fun mk_distinct [] = mk_true
   193 fun mk_distinct [] = mk_true
   194   | mk_distinct (cts as (ct :: _)) =
   194   | mk_distinct (cts as (ct :: _)) =
   195       Thm.capply (instT' ct distinct) (mk_list (Thm.ctyp_of_term ct) cts)
   195       Thm.capply (instT' ct distinct) (mk_list (Thm.ctyp_of_term ct) cts)
   196 
   196 
   197 val access = mk_inst_pair (Thm.dest_ctyp o destT1) @{cpat fun_app}
   197 val access = mk_inst_pair (Thm.dest_ctyp o destT1) @{cpat fun_app}