I'm new to F* and although the tutorial is well-written I'm missing some good API page for reference.
So I need the precise meaning for the following constructs:
assume val name: type
I'd say this line registers into the solver the name being used?
opaque type name (...) ...
What is the effect of calling a type opaque? What about the lists of parameters it may take?
Please include the references you may have used to give this answer.
The meaning of assume val name : Type
is to assume an axiom inhabiting Type
which can be accessed by name
. Since it is an axiom, it won't have an implementation and can lead to logical inconsistencies if misused (for example by assuming a natural number strictly smaller than 0).
The F* tutorial is not exactly up to date with the multiple changes that happened over the last year and opaque
is an instance of that problem.
From the compiler source (as of writing, in src/tosyntax/FStar.ToSyntax.fs
) :
The 'opaque' qualifier is deprecated since its use was strangely schizophrenic. There were two overloaded uses: (1) Given 'opaque val f : t', the behavior was to exclude the definition of 'f' to the SMT solver. This corresponds roughly to the new 'irreducible' qualifier. (2) Given 'opaque type t = t'', the behavior was to provide the definition of 't' to the SMT solver, but not to inline it, unless absolutely required for unification. This corresponds roughly to the behavior of 'unfoldable' (which is currently the default).