src/Pure/pattern.ML
changeset 28348 4f2406ddd9ea
parent 26939 1035c89b4c02
child 29269 5c25a2012975
equal deleted inserted replaced
28347:3cb64932ac77 28348:4f2406ddd9ea
    20   val eta_long: typ list -> term -> term
    20   val eta_long: typ list -> term -> term
    21   val match: theory -> term * term -> Type.tyenv * Envir.tenv -> Type.tyenv * Envir.tenv
    21   val match: theory -> term * term -> Type.tyenv * Envir.tenv -> Type.tyenv * Envir.tenv
    22   val first_order_match: theory -> term * term
    22   val first_order_match: theory -> term * term
    23     -> Type.tyenv * Envir.tenv -> Type.tyenv * Envir.tenv
    23     -> Type.tyenv * Envir.tenv -> Type.tyenv * Envir.tenv
    24   val matches: theory -> term * term -> bool
    24   val matches: theory -> term * term -> bool
       
    25   val matchess: theory -> term list * term list -> bool
    25   val equiv: theory -> term * term -> bool
    26   val equiv: theory -> term * term -> bool
    26   val matches_subterm: theory -> term * term -> bool
    27   val matches_subterm: theory -> term * term -> bool
    27   val unify: theory -> term * term -> Envir.env -> Envir.env
    28   val unify: theory -> term * term -> Envir.env -> Envir.env
    28   val first_order: term -> bool
    29   val first_order: term -> bool
    29   val pattern: term -> bool
    30   val pattern: term -> bool
   388   val envir' = apfst (typ_match thy (pT, oT)) envir;
   389   val envir' = apfst (typ_match thy (pT, oT)) envir;
   389 in mtch [] po envir' handle Pattern => first_order_match thy po envir' end;
   390 in mtch [] po envir' handle Pattern => first_order_match thy po envir' end;
   390 
   391 
   391 fun matches thy po = (match thy po (Vartab.empty, Vartab.empty); true) handle MATCH => false;
   392 fun matches thy po = (match thy po (Vartab.empty, Vartab.empty); true) handle MATCH => false;
   392 
   393 
       
   394 fun matchess thy pos = (fold (match thy) (op ~~ pos) (Vartab.empty, Vartab.empty); true) handle MATCH => false;
       
   395 
   393 fun equiv thy (t, u) = matches thy (t, u) andalso matches thy (u, t);
   396 fun equiv thy (t, u) = matches thy (t, u) andalso matches thy (u, t);
   394 
   397 
   395 
   398 
   396 (* Does pat match a subterm of obj? *)
   399 (* Does pat match a subterm of obj? *)
   397 fun matches_subterm thy (pat, obj) =
   400 fun matches_subterm thy (pat, obj) =