HOL icon indicating copy to clipboard operation
HOL copied to clipboard

Binder-like syntax for {PROD,SUM}_IMAGE

Open mn200 opened this issue 13 years ago • 1 comments

Πx ∈ s. x + 1 should parse to PROD_IMAGE (λx. x + 1) s. This is very similar to the transformation done in handling restricted quantifiers (which should also have their syntax extended to allow for as well as ::).

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

mn200 avatar Jan 11 '12 03:01 mn200

It's possible to almost get there already with the following:

new_constant("sigma", ``:'a -> num``);
set_fixity "sigma" Binder;
associate_restriction ("sigma", "rsigma");
overload_on ("rsigma", ``\s f. SUM_IMAGE f s``)

You can then write sigma n::s. n * 2 and get back the term SUM_IMAGE (\n. n * 2) s. Unfortunately, the pretty-printer dies, but the parser does the right thing.

The sigma constant is entirely fake and unnecessary. It's possible that the new_constant line could be entirely omitted.

mn200 avatar Jan 27 '16 04:01 mn200