New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide good indication of all constants’ real names and types #39

Closed
mn200 opened this Issue Oct 11, 2011 · 1 comment

Comments

Projects
None yet
1 participant
@mn200
Copy link
Member

mn200 commented Oct 11, 2011

show_types works tolerably well for indicating the types of variables and some constants. But when a constant is involved in a special syntactic form (typically an infix) or is overloaded polymorphically, the user gets nothing back at all. For example,

- load "integerTheory";
- show_types := true;
- ``x + y``;
> val it = ``(x: int) + (y:int)`` : term

No indication that + is really int$+, though it's easy enough (given knowledge about the theories) to see that this is so. With show_types on,

- ``LENGTH``;
> val it = ``(LENGTH : α list -> num)`` : term

(good). But also:

- Define`SUC (n:int) = n + 1`;
> val it = |- ∀(n :int). SUC n = n + (1 :int) : thm

(bad) and

- ``SUC``;
<<HOL message: more than one resolution of overloading was possible>>
> val it = ``SUC`` : term

(also bad).

For the last example, I'd like to see

``SUC : int -> int``

as this case isn't.

Worse, I'm not sure what the output should be in the following scenario. Just annotating the SUC with its type is not sufficient:

- Define`SUC (n:num) = n - 1`;
Definition has been stored under "SUC_def"
> val it =
   |- ∀(n :num). SUC n = n − (1 :num) : thm

- ``SUC x``;
<<HOL message: more than one resolution of overloading was possible>>
> val it = ``SUC (x :num)`` : term

- dest_term (rator it);
> val it =
   CONST
    {Ty = ``:num -> num``,
     Thy = "scratch", Name = "SUC"} : lambda

@mn200 mn200 added this to the Kananaskis-10 Release milestone Oct 23, 2014

@mn200

This comment has been minimized.

Copy link
Member

mn200 commented Nov 2, 2014

My feeling now is that it's impossible to get this information printed only when it's needed.

So, instead, my attitude is that the information can be provided for all constants through backend annotations. Unfortunately, this means that people using less capable backends (raw or vt100 as opposed to emacs) will not see this solution.

@mn200 mn200 closed this in d2d3cc4 Nov 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment