COND_REWR_CONV : ((term -> term -> ((term # term) list # (type # type) list) list) -> thm -> conv)
The first argument to COND_REWR_CONV is expected to be a function which returns a list of matches. Each of these matches is in the form of the value returned by the built-in function match. It is used to search the input term for instances which may be rewritten.
The second argument to COND_REWR_CONV is expected to be an implicative theorem in the following form:
A |- !x1 ... xn. P1 ==> ... Pm ==> (Q[x1,...,xn] = R[x1,...,xn])
The last argument to COND_REWR_CONV is the term to be rewritten.
If fn is a function and th is an implicative theorem of the kind shown above, then COND_REWR_CONV fn th will be a conversion. When applying to a term tm, it will return a theorem
P1', ..., Pm' |- tm = tm[R'/Q']
#LESS_MOD;; Theorem LESS_MOD autoloading from theory `arithmetic` ... LESS_MOD = |- !n k. k < n ==> (k MOD n = k) |- !n k. k < n ==> (k MOD n = k) #search_top_down;; - : (term -> term -> ((term # term) list # (type # type) list) list) #COND_REWR_CONV search_top_down LESS_MOD "2 MOD 3";; 2 < 3 |- 2 MOD 3 = 2