Skip to content
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

:type tells me a Cryptol type instead of a SAW type #187

Closed
TomMD opened this issue Apr 14, 2017 · 1 comment
Closed

:type tells me a Cryptol type instead of a SAW type #187

TomMD opened this issue Apr 14, 2017 · 1 comment

Comments

@TomMD
Copy link
Contributor

TomMD commented Apr 14, 2017

Consider:

m <- llvm_load_module "f.bc"
f <- llvm_extract m "f" llvm_pure
:type f

Given the type of llvm_extract one would expect to anticipate the type printed, but no! The type printed actually depends on the type of f and is not always Term. I'm not against there being a convenient way to inspect Term values but shouldn't the type honestly say Term? What black magic is this?

@brianhuffman
Copy link
Contributor

Originally (dc9c858) the :type REPL command behaved exactly like the Cryptol REPL one (its code was a cut-and-paste job). It parsed the rest of the input with the Cryptol parser, and printed its Cryptol type.

Later (3f5e493) @atomb changed its behavior. Apparently, if the input consists of the name of a saw-script primitive, then :t will print its saw-script type. Otherwise, the input is parsed as a Cryptol expression and its Cryptol type is printed. I agree that this combination of behaviors is ridiculous.

By the way, there is already another way to inspect the types of Term values: The primitive type : Term -> Type. For example:

sawscript> :t 5+3
5+3 : {a} (fin a, a >= 3) => [a]
sawscript> type {{ 5+3 }}
{a} (fin a, a >= 3) => [a]

So the Cryptol-type functionality of :t is redundant with type, and should be removed. We should also make :t parse arbitrary saw-script expressions and print their saw-script types.

brianhuffman pushed a commit that referenced this issue Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants