The implementation of the totality checker can be split into a few smaller, separate tasks/PRs for smoother transition and easier testing.
The goal of the MVP is to add:
- positivity check: data type declarations should be strictly positive, i.e., in every constructor argument, the data type to be defined is not allowed to occur in a function domain or in an application.
- pattern matching coverage check: for function declaration patterns should cover all cases.
- termination check: functions should terminate.
Currently, the type checker only has terms
or expressions. We will need to add
a few more expressions, data
type declarations, pattern matching, and function declarations. (Declarations
contain expressions.)
At the end of this stage, all the above are defined, and expressions are checked. Signatures are stored in a state monad.
let
declarations can also be added if desired.
Tests can be written for expressions.
Add type checking of data declarations, which includes type checking of constructor, which includes strict positivity checks.
Tests can be written for data declarations.
Add type checking of function declarations, which includes type checking of patterns and clauses of functions.
Tests can be written for function declarations.
Add check to make sure that function declarations cover all cases, following thesis describing Agda (section 2.2).
Tests can be written to make sure the pattern matching coverage checks are valid.
Follow section 4 of a very early version of miniAgda.
Tests for the check.
Follow section 5 of a very early version of miniAgda.
Tests for the check.