summaryrefslogtreecommitdiff
path: root/src/lem_interp/interp_lib.lem
AgeCommit message (Collapse)Author
2014-06-12Interpret when an unknown is inserted into the program by interp_exhaustiveKathy Gray
Short version of below; ready to hook interp_exhaustive up to something to test, but haven't yet. If an unknown value influences a pattern match within an expression, each passing pattern is found and the bodies strung together into a block with let expressions to bind the variables. In a function call, the cases are all collected but the support is not in place at the moment to evaluate them. If an unknown is the result of the cond expression in an if, the then and else case become a block. Unknowns within the interpreter propagate to more Unknowns; also for some but not all library functions yet.
2014-06-11Equality between range and bit vectorGabriel Kerneis
The type-constraints are inspired from those for (+). They seem to work but I am not sure they make sense. The vector is interpreted as unsigned.
2014-06-11Improve error message for missing library functionsGabriel Kerneis
2014-06-09Merge branch 'for-dagstuhl' into masterGabriel Kerneis
Conflicts: src/lem_interp/interp_lib.lem src/lem_interp/run_interp.ml Remove "to_vec_safe" work-around
2014-06-07Add optional overloading on expected return type to fix bug in constraint ↵Kathy Gray
solving; get test_power running again by supporting the correct operations and bit operations
2014-06-07exts returns bit[64] instead of natGabriel Kerneis
Update power.sail to new, pretty-printer-based version
2014-06-06Improve work-aroundGabriel Kerneis
Default to 64 bit for vec + range
2014-06-05Refactor to_vec and add work-around to avoid truncationGabriel Kerneis
2014-06-04Fixup type coercions and overloadingKathy Gray
Reduce the number of implicit coercions we're doing, expanding overloading and fixing up types of functions. Warning: test_power does not run as not all overloaded funcitons are implemented Warning: vector concatenation does not pretty print to sail source yet
2014-05-06Begin tie to ppcmem style actions/outcomesKathy Gray
Change type of + on vectors to (bit vector,bit vector) -> bit vector
2014-05-01Make an overloading type decision (all + operations return ranges, never ↵Kathy Gray
vectors) and make the test suite pass again
2014-04-30More support for overloading functions; primarily focusing on +Kathy Gray
WARNING: vector test breaks due to not having implemented the full range of different + functions In general, we need to decide whether vector + vector, vector + range and range + vector should all return ranges, vectors or a mixture
2014-04-03Implement some arithmetic operationsGabriel Kerneis
2014-04-03Implement bitwise library operationsGabriel Kerneis
2014-04-03Typeclass Eq for valuesGabriel Kerneis
Again, this is necessary to compare big_int
2014-04-02Solve more constraints; fix up test suite bugs uncovered by solving more ↵Kathy Gray
constraints. Clean up Lem output a little for readability while debugging.
2014-04-02eq and neq return bit, not boolGabriel Kerneis
2014-04-02Fix EXTS and signedness of to_numGabriel Kerneis
2014-04-01Allow negative "nat" internallyGabriel Kerneis
to_num and to_vec probably still need to be fixed
2014-03-20Remove work-around from interpreter, move it to power.sailGabriel Kerneis
Two bugs are worked-around here: - missing cast to nat when a vector is wrapped in exts (exts is a no-op currently anyway, so we are discarding it) - missing cast (due to limited type-inference) in one if branch: type given explicitly.
2014-03-20Workaround missing casts for external callsGabriel Kerneis
This patch should be reverted when the interpreter is fixed. The first instruction of main.bin is now executed. The second one fails, seemingly because of a similar missing cast issue (external function add receives register GPR1 as value).
2014-03-11More work on interpreter and Power modelGabriel Kerneis
2014-03-11Confusion between first index and vector lengthGabriel Kerneis
2014-03-04More polymorphism for additionGabriel Kerneis
2014-02-28Fix endiannessGabriel Kerneis
In fact, increasing order is big-endian, not little-endian. This is good news for us, because it means we do not need any switch for the POWER spec.
2014-02-28Fetch-decode POWER interpreterGabriel Kerneis
Many limitations and bugs currently, but loads binary and decodes opcodes correctly (using endianness hacks). Disabled in the default test suite (but still compiled), run "make test_power" to try it.
2014-02-27Partial fix for to_vec_inc/to_vec_decGabriel Kerneis
Lem's word library does some dark magic because of its assumption that words represent signed integers. Therefore, it is unreliable to truncate words, as well as to use the internal representation. boolListFrombitSeq seems safe for our purposes, though (provided the bitseq has been created with an infinite length from a positive integer).
2014-02-21Add type annotations to lem grammar, including printing out the annotated ↵Kathy Gray
ast, and extending the interpreter to expect annotations. Annotations and locations are still not used by the interpreter.
2014-02-18Remove spurious add infixGabriel Kerneis
2014-02-12More library functions for interpreterGabriel Kerneis
There is now enough stuff to decode and execute a very basic Branch instruction (encoding everything as little-endian rather than big- endian among many other work-arounds).
2014-02-07Fix a few stupid bugsGabriel Kerneis
2014-02-07Implement is_oneGabriel Kerneis
2014-02-05Replace symbolic link by actual fileGabriel Kerneis
2014-02-05First bit of Power specGabriel Kerneis
Only chapter about branches (except system calls because of sail typechecking issue). Decoding seems to work. Execution typechecks currently, but is pretty surely broken otherwise.
2013-11-12Define and test addition in libraryGabriel Kerneis
Notice the need for double parentheses in test/test3.sail, because the interpreter does not perform curryfication automatically (only the first parameter in kept with List_extra.head): add ((1, 3)) (* works *) add (1, 3) (* fails, equivalent to: add (1) *) Fortunately enough, infix functions work correctly by default. A dirty quickfix would be easy, but I'm not sure at which level this should be addressed properly (interpreter? typing? etc.).
2013-11-11Remove workaround for a bug fixed in LemGabriel Kerneis
2013-11-07Port L2 to new LemGabriel Kerneis
Tests compile and run properly. There is a lot of hackery going on to workaround the rough edges of new Lem. Use at your own risk (you need the "library-format" branch of lem).
2013-11-07Stub for external callsGabriel Kerneis