Parse.overload_on : string * term -> unit
When printing, this call causes tm to be seen as the operator name. The string name may prompt further pretty-printing if it is involved in any of the relevant grammar’s rules for concrete syntax.
If tm is an abstraction, then the parser will perform beta-reductions if the term is the function part of a redex position.
- val inter = new_definition("inter", Term`inter p q x = p x /\ q x`);
<<HOL message: inventing new type variable names: 'a.>>
> val inter = |- !p q x. inter p q x = p x /\ q x : thm
- overload_on ("/\\", Term`inter`);
<<HOL message: inventing new type variable names: 'a.>>
> val it = () : unit
- Term`p /\ q`;
<<HOL message: more than one resolution of overloading was possible.>>
<<HOL message: inventing new type variable names: 'a.>>
> val it = `p /\ q` : term
- type_of it;
> val it = `:'a -> bool` : hol_type
- overload_on ("/\\", Term`bool$/\`);
> val it = () : unit
- Term`p /\ q`;
<<HOL message: more than one resolution of overloading was possible.>>
> val it = `p /\ q` : term
- type_of it;
> val it = `:bool` : hol_type
- overload_on ("/\\", Term`/\ :bool->bool->bool`);
> val it = () : unit
- overload_on ("|<", Term`\x y. ~(x < y)`);
> val it = () : unit
- set_fixity "|<" (Infix(NONASSOC, 450));
> val it = () : unit
- val t = Term`p |< q`;
> val t = `p |< q` : term
- dest_neg t;
> Val it = `p < q` : term