Open brianhuffman opened 3 years ago
The print_term
function is implemented using scShowTerm
, which runs in the IO
monad and uses a SharedContext
to obtain naming information.
https://github.com/GaloisInc/saw-script/blob/7b8c134a1a2fad07620af1f17b246d3012744e80/src/SAWScript/Builtins.hs#L397-L404
However, when a value is written by itself on the REPL, it is printed by function processStmtBind
, which calls showsPrecValue
on the computed value.
https://github.com/GaloisInc/saw-script/blob/7b8c134a1a2fad07620af1f17b246d3012744e80/src/SAWScript/Interpreter.hs#L316-L320
To fix the problem, we'll have to replace or modify showsPrecValue
so that it takes a SharedContext
argument and can run in the IO
monad.
We might just try removing the Show
instance for the saw-script Value type and see what breaks.
See also #1608.
Some progress has been made on this in #1689
And see #747. Arguably, this is a duplicate...
PR GaloisInc/saw-core#126 implemented a namespace-aware prettyprinter for saw-core, which uses the shortest unambiguous form of names, so we don't have to see fully-qualified names everywhere.
The
print_goal
proof command uses the namespace-aware prettyprinter, as does theprint_term
command.However, if a term is just written directly on the REPL, it is printed with all qualified names:
We should always be using the namespace-aware prettyprinter.