Open antalsz opened 6 years ago
@sweirich Well, at a minimum, translate
is a much better name than unaxiomatize
🙂 The logic does make sense. The only design question I see is that going from skip module X
to skip module X
+ translate X.y
will go from producing no X.v
file at all to producing an X.v
file containing a y
.
Eventually, we may want a translate module
edit too, if we want to move away from Makefile hackery.
So the design structure is:
Per-definition rules take precedence over the by-module rules.
We leave skip method
separate, and continue to have skip
ping a class have the behavior of skipping its instances. A skipped module is entirely absent unless at least one of its definitions is overridden; skipping every definition in a module will produce an empty module. This is fine; similarly, axiomatizing a module is more aggressive than axiomatizing every definition (failing to translate types/lookup class info is just ignored when the whole module is being axiomatized).
Other related issues:
Should we teach skip Mod.methodName
to have the same effect as skip method Mod.className Mod.methodName
?
Should we add some form of axiomatize type Mod.TypeName
? Unfortunately we need to specify the parameter types in that case.
Sounds good.
WRT related issues
redefine
a Definition
as an Axiom
? We have axiomatize definition
working – is that what you mean?
Does axiomatize definition
not work for axiomatize type Mod.TypeName
?
No – mostly because we don't check, although also because we don't have kind signatures that we can fill in.
The redefine I propose above would require the full type (which could be anything).
If we have
data Tree a = Empty | Node a (Tree a) (Tree a)
then I propose that the edit
redefine Axiom Mod.Tree : Type -> Type
would replace the inductive datatype of Tree with the axiom.
Oh, I see – regardless of whether Mod.Tree
was an inductive type or a definition? Seems reasonable!
OK, e9c47a7 adds support for redefine Axiom
, since I wanted that for TrieMap
:-)
@sweirich in a comment on commit 4cd6596, about
unaxiomatize definition
: