Commit Graph

30 Commits

Author SHA1 Message Date
Edwin Brady
d053a18977 Set fresh name counter on loading Main ttc
Make sure this is the counter from the right namespace, or we might get
name clashes at the REPL
2019-06-27 14:47:47 +01:00
Edwin Brady
7ba57cfc64 Store names in full in ttc
and resolve on reloading. This saves the time for loading the name map,
which can start to get big if there's lots of imports.
2019-06-22 16:09:43 +01:00
Edwin Brady
8f386011b1 Defer erasure/run-time case trees
Don't build these until we've completed the whole clause (that is, don't
do it if we're inside a case block) because we might need to collect
more information to complete checking the case block. e.g. there may be
constraints inside the case block that are resolved outside.
2019-06-14 18:35:31 +01:00
Edwin Brady
9d2067e9a8 Add command line option to invoke yaffle 2019-06-08 11:02:50 +01:00
Edwin Brady
c6a7050d39 Added Idris.Main 2019-06-07 11:29:29 +01:00
Edwin Brady
bf67f5c87c Record mutual type definitions
Also add some tests for totality checker
2019-06-05 17:28:55 +01:00
Edwin Brady
95cc48eeb6 Add termination checking
Still to do: mutual data definitions and proper testing
2019-06-05 15:59:35 +01:00
Edwin Brady
2c6202879e Calculate missing cases via coverage checker 2019-06-02 23:43:21 +01:00
Edwin Brady
109dcf08f9 Add definition generation 2019-06-02 14:28:26 +01:00
Edwin Brady
bf70aa07d2 First attempt at expression search
Not quite there yet because we're not saving all the information about
holes in TTCs but the basics work
2019-06-01 22:34:59 +01:00
Edwin Brady
2b38ce0188 Add Metadata type
Metadata is now propagated through the elaborator, although we're not
using it yet
2019-05-31 05:52:54 +01:00
Edwin Brady
871ca6603c Move options out of Core and into Defs
This is quite a performance win, because there's less thunking (and I
imagine more scope for inlining?)
2019-05-19 23:25:35 +01:00
Edwin Brady
8081b0374a First attempt at linearity checking pass
This slows things down a bit because to find the holes and give them the
right multiplicities, we need to normalise all the arguments which might
have been metavariables. Maybe we should skip this if we're not using
anything linear, for efficiency?

As patterns are handled by deciding which side of the as is considered
'used'. In case blocks, that should be the variable name, but in general
it should be the pattern, so IAs now has a flag to say which one.
2019-05-19 20:24:14 +01:00
Edwin Brady
9bd063bbd5 Check holes are solved after elaboration
Need to record which holes are still to be solved (not counting
elaborations where there are user defined holes) and check at the end
that they are now solved.
2019-05-18 19:08:43 +01:00
Edwin Brady
8d6d0c6847 Add NestedNames argument throughout elaborator
This is for tracking locally defined names, so that we can expand their
applications to the full globally lifted name. At the moment, they don't
do anything, but since it's a change throughout the elaborator it
probably deserves its own commit.
2019-05-12 19:43:01 +01:00
Edwin Brady
46213a903c Store resolved ids in pattern names
It's only for keeping them unique, so this is both more efficient, and
means we can safely write them out using their resolved ids in the name
map
2019-05-11 13:00:12 +01:00
Edwin Brady
664008d046 Add operations on primitives 2019-05-08 10:21:00 +01:00
Edwin Brady
77bf4c7c44 Added test framework (copied from Blodwen) 2019-05-07 10:43:02 +01:00
Edwin Brady
ef36ea1752 Add TTImp.Unelab
This unelaborates things we don't even elaborate yet :). But we'll get
there...
2019-05-06 17:33:08 +01:00
Edwin Brady
bfe78baf07 Add a 'staging area' to contexts
This is for updates we make while branching in an elaborator - we don't
want to update the context immediately, because if the branch fails,
we'll need to revert, so for safety we'll note the updates we're going
to make and only complete the update when we're back at the top level.
2019-05-03 02:43:47 +01:00
Edwin Brady
29a41ed975 Initial implementation of auto implicit search
This only searches for lambdas and locals so far, and doesn't take into
account that it shouldn't search for holes, but it does set up the basic
mechanism.
2019-04-27 20:18:53 +01:00
Edwin Brady
6d473014fd Add simple REPL for TTImp 2019-04-26 10:16:23 +01:00
Edwin Brady
e592f548d1 Add timing logs
Just to allow tracking how long individual parts of processing a file
take!
2019-04-25 23:43:19 +01:00
Edwin Brady
762f6010dd Basic TTC saving and loading now works
Only save the parts of terms and definitions which are needed for
typechecking and evaluation (so, for example, we don't need types for
machine generated metavariables, don't need types on lambdas, etc).
2019-04-25 14:46:36 +01:00
Edwin Brady
a48d90f821 More progress on TTCs
Added Core.Directory (more or less directly from Blodwen) and now
writing out TTCs from the test Main, but it's still not writing out
definitions because we're not yet making a note of the names which need
saving (this will be the defined names and any holes introduced).

Also it's clear from logging that holes/guess/constraints aren't being
cleared so this needs to be fixed next.
2019-04-21 23:20:10 +01:00
Edwin Brady
63da191e03 FOUR!!!1!!!
Er, that is to say, evaluation of a 'main' expression
'plus (S (S Z)) (S (S Z))' is now printing the right answer.
2019-04-20 16:54:09 +01:00
Edwin Brady
9611431260 Refine order of elaboration of arguments
If an argument's type isn't known (i.e. it's still a metavariable) make
a hole for it, and delay its elaboration until the other arguments have
been elaborated.
This is to help type-directed disambiguation (so we know as much as
possible about the target type before elaborating an argument).
2019-04-13 19:37:53 +01:00
Edwin Brady
56c0ec5324 Implement inferLambda
This checks lambdas where the type isn't immediately a pi binder. First
normalises, if that doesn't work, just guesses and unifies with the
expected type.
2019-04-07 17:16:44 +01:00
Edwin Brady
8b98a5cb99 Some unifiation infrastructure 2019-03-28 11:04:18 +09:00
Edwin Brady
0f8d337b27 Add a main program which processes a source file 2019-03-10 18:20:26 +00:00