associate_restriction : ((string * string) -> unit)
associate_restriction("B", "RES_B")will cause the parser and pretty-printer to support:
---- parse ----> Bv::P. B RES_B P (\v. B) <---- print ----Anything can be written between the binder and `::` that could be written between the binder and `.` in the old notation. See the examples below.
Associations between user defined binders and their restrictions are not stored in the theory, so they have to be set up for each hol session (e.g. with a hol-init.ml file).
The flag `#restrict(Globals.pp_flags)` has default true, but if set to false will disable the pretty printing. This is useful for seeing what the semantics of particular restricted abstractions are.
The following associations are predefined:
\v::P. B <----> RES_ABSTRACT P (\v. B)
!v::P. B <----> RES_FORALL P (\v. B)
?v::P. B <----> RES_EXISTS P (\v. B)
@v::P. B <----> RES_SELECT P (\v. B)
Where the constants RES_ABSTRACT, RES_FORALL, RES_EXISTS and
RES_SELECT are defined in the theory `restr_binder` by:
|- RES_ABSTRACT P B = \x:'a. (P x => B x | ARB:'b)
|- RES_FORALL P B = !x:'a. P x ==> B x
|- RES_EXISTS P B = ?x:'a. P x /\ B x
|- RES_SELECT P B = @x:'a. P x /\ B x
where ARB is defined in the theory `restr_binder` by:
|- ARB = @x:'a. T
- new_binder_definition("DURING", --`DURING(p:num#num->bool) = $!p`--); |- !p. $DURING p = $! p - --`DURING x::(m,n). p x`--; Exception raised at Parse_support.restr_binder: no restriction associated with "DURING" - new_definition("RES_DURING", --`RES_DURING(m,n)p = !x. m<=x /\ x<=n ==> p x`--); |- !m n p. RES_DURING (m,n) p = (!x. m <= x /\ x <= n ==> p x) : thm - associate_restriction("DURING","RES_DURING"); () : unit - --`DURING x::(m,n). p x`--; (--`DURING x ::(m,n). p x`--) : term - Globals.show_restrict := false; () : unit - --`DURING x::(m,n). p x`--; (--`RES_DURING (m,n) (\x. p x)`--) : term