| Age | Commit message (Collapse) | Author |
|
|
|
We now store the location where type variables were bound, so we can
use this information when printing error messages.
Factor type errors out into type_error.ml. This means that
Type_check.check is now Type_error.check, as it previously it handled
wrapping the type_errors into reporting_basic
errors. Type_check.check' has therefore been renamed to
Type_check.check.
|
|
|
|
|
|
|
|
|
|
|
|
The pattern types may be subtypes, using those caused it to try rewriting
int parameters and failing
|
|
|
|
Adds return type to pattern so that the original function body is still
type checked, rather than switching to type inference which may fail.
|
|
+ add additional lexp
+ update aarch64 mono demo source
- still needs support for tyvars from assignments in dependency analysis
|
|
mono rewrites
|
|
|
|
|
|
|
|
|
|
|
|
(previously the typechecker did this for all literal patterns, but now
it's only necessary for the rewritten arguments)
|
|
(when they're not relevant)
|
|
|
|
|
|
Now it just returns the actual arguments and a separate function
calculates the start index when required.
|
|
|
|
Turn on complex nexp rewriting for mono by default
(NB: solving is currently quite slow, will optimise)
|
|
(also reorder the phases a little)
|
|
|
|
|
|
(for monomorphisation, off for now because the analysis needs extended).
Also tighten up orig_nexp, make Lem backend replace # in type variables.
|
|
|
|
Doesn't remove them from function bodies because that can produce
more work for the sizeof rewriting.
|
|
|
|
|
|
Previously union types could have no-argument constructors, for
example the option type was previously:
union option ('a : Type) = {
Some : 'a,
None
}
Now every union constructor must have a type, so option becomes:
union option ('a : Type) = {
Some : 'a,
None : unit
}
The reason for this is because previously these two different types of
constructors where very different in the AST, constructors with
arguments were used the E_app AST node, and no-argument constructors
used the E_id node. This was particularly awkward, because it meant
that E_id nodes could have polymorphic types, i.e. every E_id node
that was also a union constructor had to be annotated with a type
quantifier, in constrast with all other identifiers that have
unquantified types. This became an issue when monomorphising types,
because the machinery for figuring out function instantiations can't
be applied to identifier nodes. The same story occurs in patterns,
where previously unions were split across P_id and P_app nodes - now
the P_app node alone is used solely for unions.
This is a breaking change because it changes the syntax for union
constructors - where as previously option was matched as:
function is_none opt = match opt {
Some(_) => false,
None => true
}
it is now matched as
function is_none opt = match opt {
Some(_) => false,
None() => true
}
note that constructor() is syntactic sugar for constructor(()), i.e. a
one argument constructor with unit as it's value. This is exactly the
same as for functions where a unit-function can be called as f() and
not as f(()). (This commit also makes exit() work consistently in the
same way) An attempt to pattern match a variable with the same name as
a union-constructor now gives an error as a way to guard against
mistakes made because of this change.
There is probably an argument for supporting the old syntax via some
syntactic sugar, as it is slightly prettier that way, but for now I
have chosen to keep the implementation as simple as possible.
The RISCV spec, ARM spec, and tests have been updated to account for
this change. Furthermore the option type can now be included from
$SAIL_DIR/lib/ using
$include <option.sail>
|
|
|
|
(plus some adjustments for the test case)
|
|
|
|
const progagation.
Needed to avoid negative bitvector sizes on aarch64
Also propagate values found from "if var = const ...", which is needed in
aarch64
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Useful for feature functions, e.g. HaveFP16Ext
|
|
(still some work to do in AtomToItself rewrite, but should work despite
error messages)
|
|
to help Lem go from a general type `bits('n)` to a specific type `bits(16)`
at a case split, and the other way around for a returned value.
Doesn't handle function clause patterns yet
|
|
|
|
|
|
|
|
if necessary
|