5485 - promote SubX to top-level
This commit is contained in:
parent
8846a7f85c
commit
6e1eeeebfb
26
.travis.yml
26
.travis.yml
@ -14,30 +14,8 @@ addons:
|
||||
# matrix so we don't time out on Travis
|
||||
matrix:
|
||||
include:
|
||||
# primary prototype
|
||||
- env: COMMAND=./subx/test_layers
|
||||
- env: COMMAND=./subx/test_apps
|
||||
# other directories
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=000 END=040
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=040 END=055
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=055 END=065
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=065 END=070
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=070 END=075
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=075 END=080
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=080 END=085
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=085 END=090
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=090 END=095
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=095 END=999 # overflow; will start timing out if we add too many layers
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=chessboard
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=edit
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=edit2
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=edit3
|
||||
- env: COMMAND=./test_layers CXX=clang++ START=edit4
|
||||
- env: COMMAND=./test_layers CXX=g++ START=one-off # minimal testing for gcc
|
||||
# other build scripts
|
||||
- env: COMMAND=./test_layers BUILD=build0 START=one-off
|
||||
- env: COMMAND=./test_layers BUILD=build1 START=one-off
|
||||
- env: COMMAND=./test_layers BUILD=build2 START=one-off
|
||||
- env: COMMAND=./test_layers
|
||||
- env: COMMAND=./test_apps
|
||||
|
||||
script:
|
||||
- $COMMAND $START $END
|
||||
|
@ -94,7 +94,7 @@
|
||||
// Types
|
||||
// End Types
|
||||
|
||||
// Function prototypes are auto-generated in the 'build*' scripts; define your
|
||||
// Function prototypes are auto-generated in the 'build' script; define your
|
||||
// functions in any order. Just be sure to declare each function header all on
|
||||
// one line, ending with the '{'. Our auto-generation scripts are too minimal
|
||||
// and simple-minded to handle anything else.
|
||||
@ -103,7 +103,7 @@
|
||||
// Globals
|
||||
//
|
||||
// All statements in this section should always define a single variable on a
|
||||
// single line. The 'build*' scripts will simple-mindedly auto-generate extern
|
||||
// single line. The 'build' script will simple-mindedly auto-generate extern
|
||||
// declarations for them. Remember to define (not just declare) constants with
|
||||
// extern linkage in this section, since C++ global constants have internal
|
||||
// linkage by default.
|
||||
@ -112,25 +112,51 @@
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
atexit(reset);
|
||||
// we require a 32-bit little-endian system
|
||||
assert(sizeof(int) == 4);
|
||||
assert(sizeof(float) == 4);
|
||||
assert_little_endian();
|
||||
|
||||
// End One-time Setup
|
||||
|
||||
// Commandline Parsing
|
||||
// End Commandline Parsing
|
||||
|
||||
return 0; // End Main
|
||||
// End Main
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Unit Tests
|
||||
// End Unit Tests
|
||||
|
||||
//: our first directive; insert the following header at the start of the program
|
||||
//: our first directive; insert the following headers at the start of the program
|
||||
:(before "End Includes")
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
//: Without directives or with the :(code) directive, lines get added at the
|
||||
//: end.
|
||||
//:
|
||||
//: Regardless of where functions are defined, we can call them anywhere we
|
||||
//: like as long as we format the function header in a specific way: put it
|
||||
//: all on a single line without indent, end the line with ') {' and no
|
||||
//: trailing whitespace. As long as functions uniformly start this way, our
|
||||
//: 'build' script contains a little command to automatically generate
|
||||
//: declarations for them.
|
||||
:(code)
|
||||
void reset() {
|
||||
// End Reset
|
||||
}
|
||||
|
||||
void assert_little_endian() {
|
||||
const int x = 1;
|
||||
const char* y = reinterpret_cast<const char*>(&x);
|
||||
if (*y != 1) {
|
||||
cerr << "SubX requires a little-endian processor. Do you have Intel (or AMD or Atom) inside?\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
:(before "End Includes")
|
||||
#include<iostream>
|
||||
using std::cerr;
|
||||
|
144
001help.cc
144
001help.cc
@ -5,54 +5,13 @@
|
||||
if (argc <= 1 || is_equal(argv[1], "--help")) {
|
||||
//: this is the functionality later layers will provide
|
||||
// currently no automated tests for commandline arg parsing
|
||||
if (argc <= 1) {
|
||||
cerr << "Please provide a Mu program to run.\n"
|
||||
<< "\n";
|
||||
}
|
||||
cerr << "Usage:\n"
|
||||
<< " mu [options] [test] [files]\n"
|
||||
<< "or:\n"
|
||||
<< " mu [options] [test] [files] -- [ingredients for function/recipe 'main']\n"
|
||||
<< "Square brackets surround optional arguments.\n"
|
||||
<< "\n"
|
||||
<< "Examples:\n"
|
||||
<< " To load files and run 'main':\n"
|
||||
<< " mu file1.mu file2.mu ...\n"
|
||||
<< " To run 'main' and dump a trace of all operations at the end:\n"
|
||||
<< " mu --trace file1.mu file2.mu ...\n"
|
||||
<< " To run all tests:\n"
|
||||
<< " mu test\n"
|
||||
<< " To load files and then run all tests:\n"
|
||||
<< " mu test file1.mu file2.mu ...\n"
|
||||
<< " To run a single Mu scenario:\n"
|
||||
<< " mu test file1.mu file2.mu ... scenario\n"
|
||||
<< " To run a single Mu scenario and dump a trace at the end:\n"
|
||||
<< " mu --trace test file1.mu file2.mu ... scenario\n"
|
||||
<< " To load files and run only the tests in explicitly loaded files (for apps):\n"
|
||||
<< " mu --test-only-app test file1.mu file2.mu ...\n"
|
||||
<< " To load all files with a numeric prefix in a directory:\n"
|
||||
<< " mu directory1 directory2 ...\n"
|
||||
<< " You can test directories just like files.\n"
|
||||
<< " mu test directory1 directory2 ...\n"
|
||||
<< " To pass ingredients to a mu program, provide them after '--':\n"
|
||||
<< " mu file_or_dir1 file_or_dir2 ... -- ingredient1 ingredient2 ...\n"
|
||||
<< " To see where a mu program is spending its time:\n"
|
||||
<< " mu --profile file_or_dir1 file_or_dir2 ...\n"
|
||||
<< " this slices and dices time spent in various profile.* output files\n"
|
||||
<< " To print out the trace to stderr:\n"
|
||||
<< " mu --dump file1.mu file2.mu ...\n"
|
||||
<< " this is handy when you want to see sandboxed traces alongside the main one\n"
|
||||
<< "\n"
|
||||
<< " To browse a trace generated by a previous run:\n"
|
||||
<< " mu browse-trace file\n"
|
||||
;
|
||||
cerr << get(Help, "usage");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//: Support for option parsing.
|
||||
//: Options always begin with '--' and are always the first arguments. An
|
||||
//: option will never follow a non-option.
|
||||
:(before "End Commandline Parsing")
|
||||
char** arg = &argv[1];
|
||||
while (argc > 1 && starts_with(*arg, "--")) {
|
||||
if (false)
|
||||
@ -63,15 +22,76 @@ while (argc > 1 && starts_with(*arg, "--")) {
|
||||
--argc; ++argv; ++arg;
|
||||
}
|
||||
|
||||
//:: Helper function used by the above fragment of code (and later layers too,
|
||||
//:: who knows?).
|
||||
//: The :(code) directive appends function definitions to the end of the
|
||||
//: project. Regardless of where functions are defined, we can call them
|
||||
//: anywhere we like as long as we format the function header in a specific
|
||||
//: way: put it all on a single line without indent, end the line with ') {'
|
||||
//: and no trailing whitespace. As long as functions uniformly start this
|
||||
//: way, our 'build*' scripts contain a little command to automatically
|
||||
//: generate declarations for them.
|
||||
if (is_equal(argv[1], "help")) {
|
||||
if (argc == 2) {
|
||||
cerr << "help on what?\n";
|
||||
help_contents();
|
||||
return 0;
|
||||
}
|
||||
string key(argv[2]);
|
||||
// End Help Special-cases(key)
|
||||
if (contains_key(Help, key)) {
|
||||
cerr << get(Help, key);
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
cerr << "No help found for '" << key << "'\n";
|
||||
help_contents();
|
||||
cerr << "Please check your command for typos.\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
:(code)
|
||||
void help_contents() {
|
||||
cerr << "Available top-level topics:\n";
|
||||
cerr << " usage\n";
|
||||
// End Help Contents
|
||||
}
|
||||
|
||||
:(before "End Globals")
|
||||
map<string, string> Help;
|
||||
:(before "End Includes")
|
||||
#include <map>
|
||||
using std::map;
|
||||
:(before "End One-time Setup")
|
||||
init_help();
|
||||
:(code)
|
||||
void init_help() {
|
||||
put(Help, "usage",
|
||||
"Welcome to SubX, a better way to program in machine code.\n"
|
||||
"SubX uses a subset of the x86 instruction set. SubX programs will run\n"
|
||||
"without modification on Linux computers.\n"
|
||||
"It provides a better experience and better error messages than\n"
|
||||
"programming directly in machine code, but you have to stick to the\n"
|
||||
"instructions it supports.\n"
|
||||
"\n"
|
||||
"== Ways to invoke subx\n"
|
||||
"- Run tests:\n"
|
||||
" subx test\n"
|
||||
"- See this message:\n"
|
||||
" subx --help\n"
|
||||
"- Convert a textual SubX program into a standard ELF binary that you can\n"
|
||||
" run on your computer:\n"
|
||||
" subx translate input1.subx input2.subx ... -o <output ELF binary>\n"
|
||||
"- Run a SubX binary using SubX itself (for better error messages):\n"
|
||||
" subx run <ELF binary>\n"
|
||||
"\n"
|
||||
"== Debugging aids\n"
|
||||
"- Add '--trace' to any of these commands to save a trace.\n"
|
||||
"- Add '--debug' to add information to traces. 'subx --debug translate' will\n"
|
||||
" save metadata to disk that 'subx --debug --trace run' uses to make traces\n"
|
||||
" more informative.\n"
|
||||
"\n"
|
||||
"Options starting with '--' must always come before any other arguments.\n"
|
||||
"\n"
|
||||
"To start learning how to write SubX programs, see Readme.md (particularly\n"
|
||||
"the section on the x86 instruction set) and then run:\n"
|
||||
" subx help\n"
|
||||
);
|
||||
// End Help Texts
|
||||
}
|
||||
|
||||
:(code)
|
||||
bool is_equal(char* s, const char* lit) {
|
||||
return strncmp(s, lit, strlen(lit)) == 0;
|
||||
@ -164,7 +184,7 @@ void dump_and_exit(int sig, siginfo_t* /*unused*/, void* /*unused*/) {
|
||||
switch (sig) {
|
||||
case SIGABRT:
|
||||
#ifndef __APPLE__
|
||||
cerr << "SIGABRT: might be an integer overflow if it wasn't an assert() failure or exception\n";
|
||||
cerr << "SIGABRT: might be an integer overflow if it wasn't an assert() failure\n";
|
||||
_Exit(1);
|
||||
#endif
|
||||
break;
|
||||
@ -213,18 +233,23 @@ int feenableexcept(unsigned int excepts) {
|
||||
// from http://stackoverflow.com/questions/152643/idiomatic-c-for-reading-from-a-const-map
|
||||
template<typename T> typename T::mapped_type& get(T& map, typename T::key_type const& key) {
|
||||
typename T::iterator iter(map.find(key));
|
||||
assert(iter != map.end());
|
||||
if (iter == map.end()) {
|
||||
cerr << "get couldn't find key '" << key << "'\n";
|
||||
assert(iter != map.end());
|
||||
}
|
||||
return iter->second;
|
||||
}
|
||||
template<typename T> typename T::mapped_type const& get(const T& map, typename T::key_type const& key) {
|
||||
typename T::const_iterator iter(map.find(key));
|
||||
assert(iter != map.end());
|
||||
if (iter == map.end()) {
|
||||
cerr << "get couldn't find key '" << key << "'\n";
|
||||
assert(iter != map.end());
|
||||
}
|
||||
return iter->second;
|
||||
}
|
||||
template<typename T> typename T::mapped_type const& put(T& map, typename T::key_type const& key, typename T::mapped_type const& value) {
|
||||
// map[key] requires mapped_type to have a zero-arg (default) constructor
|
||||
map.insert(std::make_pair(key, value)).first->second = value;
|
||||
return value;
|
||||
map[key] = value;
|
||||
return map[key];
|
||||
}
|
||||
template<typename T> bool contains_key(T& map, typename T::key_type const& key) {
|
||||
return map.find(key) != map.end();
|
||||
@ -232,6 +257,11 @@ template<typename T> bool contains_key(T& map, typename T::key_type const& key)
|
||||
template<typename T> typename T::mapped_type& get_or_insert(T& map, typename T::key_type const& key) {
|
||||
return map[key];
|
||||
}
|
||||
template<typename T> typename T::mapped_type const& put_new(T& map, typename T::key_type const& key, typename T::mapped_type const& value) {
|
||||
assert(map.find(key) == map.end());
|
||||
map[key] = value;
|
||||
return map[key];
|
||||
}
|
||||
//: The contract: any container that relies on get_or_insert should never call
|
||||
//: contains_key.
|
||||
|
||||
|
@ -70,6 +70,13 @@ if (Run_tests) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
:(after "End Main")
|
||||
//: Raise other unrecognized sub-commands as errors.
|
||||
//: We couldn't do this until now because we want `./subx test` to always
|
||||
//: succeed, no matter how many layers are included in the build.
|
||||
cerr << "nothing to do\n";
|
||||
return 1;
|
||||
|
||||
:(code)
|
||||
void run_test(size_t i) {
|
||||
if (i >= sizeof(Tests)/sizeof(Tests[0])) {
|
||||
|
65
003trace.cc
65
003trace.cc
@ -129,6 +129,21 @@ struct trace_line {
|
||||
}
|
||||
};
|
||||
|
||||
string unescape_newline(string& s) {
|
||||
std::stringstream ss;
|
||||
for (int i = 0; i < SIZE(s); ++i) {
|
||||
if (s.at(i) == '\n')
|
||||
ss << "\\n";
|
||||
else
|
||||
ss << s.at(i);
|
||||
}
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void dump_trace_line(ostream& s, trace_line& t) {
|
||||
s << std::setw(4) << t.depth << ' ' << t.label << ": " << unescape_newline(t.contents) << '\n';
|
||||
}
|
||||
|
||||
//: Starting a new trace line.
|
||||
:(before "End trace_stream Methods")
|
||||
ostream& stream(string label) {
|
||||
@ -140,6 +155,7 @@ ostream& stream(int depth, string label) {
|
||||
curr_stream = new ostringstream;
|
||||
curr_label = label;
|
||||
curr_depth = depth;
|
||||
(*curr_stream) << std::hex; // printing addresses is the common case
|
||||
return *curr_stream;
|
||||
}
|
||||
|
||||
@ -152,6 +168,15 @@ ostream& operator<<(ostream& os, end /*unused*/) {
|
||||
return os;
|
||||
}
|
||||
|
||||
//: Fatal error.
|
||||
:(before "End Types")
|
||||
struct die {};
|
||||
:(code)
|
||||
ostream& operator<<(ostream& /*unused*/, die /*unused*/) {
|
||||
if (Trace_stream) Trace_stream->newline();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
:(before "End trace_stream Methods")
|
||||
void newline();
|
||||
:(code)
|
||||
@ -163,7 +188,7 @@ void trace_stream::newline() {
|
||||
// maybe incrementally dump trace
|
||||
trace_line& t = past_lines.back();
|
||||
if (should_incrementally_print_trace()) {
|
||||
cerr << std::setw(4) << t.depth << ' ' << t.label << ": " << t.contents << '\n';
|
||||
dump_trace_line(cerr, t);
|
||||
}
|
||||
// End trace Commit
|
||||
}
|
||||
@ -195,21 +220,29 @@ lease_tracer::~lease_tracer() {
|
||||
Trace_stream = NULL;
|
||||
}
|
||||
|
||||
//:: == Errors using traces
|
||||
//:: == Errors and warnings using traces
|
||||
|
||||
:(before "End Includes")
|
||||
#define raise (!Trace_stream ? (scroll_to_bottom_and_close_console(),++Trace_errors,cerr) /*do print*/ : Trace_stream->stream(Error_depth, "error"))
|
||||
#define raise (!Trace_stream ? (++Trace_errors,cerr) /*do print*/ : Trace_stream->stream(Error_depth, "error"))
|
||||
#define warn (!Trace_stream ? (++Trace_errors,cerr) /*do print*/ : Trace_stream->stream(Warn_depth, "warn"))
|
||||
|
||||
//: Print errors to the screen by default.
|
||||
//: Print errors and warnings to the screen by default.
|
||||
:(before "struct trace_stream") // include constants in all cleaved compilation units
|
||||
const int Error_depth = 0;
|
||||
const int Warn_depth = 1;
|
||||
:(before "End Globals")
|
||||
int Hide_errors = false; // if set, don't print errors to screen
|
||||
int Hide_errors = false; // if set, don't print errors or warnings to screen
|
||||
int Hide_warnings = false; // if set, don't print warnings to screen
|
||||
:(before "End Reset")
|
||||
Hide_errors = false;
|
||||
Hide_warnings = false;
|
||||
//: Never dump warnings in tests
|
||||
:(before "End Test Setup")
|
||||
Hide_warnings = true;
|
||||
:(code)
|
||||
bool trace_stream::should_incrementally_print_trace() {
|
||||
if (!Hide_errors && curr_depth == Error_depth) return true;
|
||||
if (!Hide_warnings && !Hide_errors && curr_depth == Warn_depth) return true;
|
||||
// End Incremental Trace Print Conditions
|
||||
return false;
|
||||
}
|
||||
@ -236,20 +269,6 @@ bool trace_contains_errors() {
|
||||
#define assert_for_now assert
|
||||
#define raise_for_now raise
|
||||
|
||||
//: Automatically close the console in some situations.
|
||||
:(before "End One-time Setup")
|
||||
atexit(scroll_to_bottom_and_close_console);
|
||||
:(code)
|
||||
void scroll_to_bottom_and_close_console() {
|
||||
if (!tb_is_active()) return;
|
||||
// leave the screen in a relatively clean state
|
||||
tb_set_cursor(tb_width()-1, tb_height()-1);
|
||||
cout << "\r\n";
|
||||
tb_shutdown();
|
||||
}
|
||||
:(before "End Includes")
|
||||
#include "termbox/termbox.h"
|
||||
|
||||
//:: == Other assertions on traces
|
||||
//: Primitives:
|
||||
//: - CHECK_TRACE_CONTENTS(lines)
|
||||
@ -306,7 +325,8 @@ bool check_trace_contents(string FUNCTION, string FILE, int LINE, string expecte
|
||||
split_label_contents(expected_lines.at(curr_expected_line), &label, &contents);
|
||||
for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) {
|
||||
if (label != p->label) continue;
|
||||
if (contents != trim(p->contents)) continue;
|
||||
string t = trim(p->contents);
|
||||
if (contents != unescape_newline(t)) continue;
|
||||
++curr_expected_line;
|
||||
while (curr_expected_line < SIZE(expected_lines) && expected_lines.at(curr_expected_line).empty())
|
||||
++curr_expected_line;
|
||||
@ -426,7 +446,6 @@ vector<string> split_first(string s, string delim) {
|
||||
ofstream Trace_file;
|
||||
:(before "End Commandline Options(*arg)")
|
||||
else if (is_equal(*arg, "--trace")) {
|
||||
Trace_stream = new trace_stream;
|
||||
cerr << "saving trace to 'last_run'\n";
|
||||
Trace_file.open("last_run");
|
||||
// Add a dummy line up top; otherwise the `browse_trace` tool currently has
|
||||
@ -435,7 +454,7 @@ else if (is_equal(*arg, "--trace")) {
|
||||
}
|
||||
:(before "End trace Commit")
|
||||
if (Trace_file) {
|
||||
Trace_file << std::setw(4) << t.depth << ' ' << t.label << ": " << t.contents << '\n';
|
||||
dump_trace_line(Trace_file, t);
|
||||
}
|
||||
:(before "End One-time Setup")
|
||||
atexit(cleanup_main);
|
||||
@ -452,7 +471,7 @@ string readable_contents(string label) {
|
||||
label = trim(label);
|
||||
for (vector<trace_line>::iterator p = past_lines.begin(); p != past_lines.end(); ++p)
|
||||
if (label.empty() || label == p->label)
|
||||
output << std::setw(4) << p->depth << ' ' << p->label << ": " << p->contents << '\n';
|
||||
dump_trace_line(output, *p);
|
||||
return output.str();
|
||||
}
|
||||
|
||||
|
@ -64,10 +64,17 @@ void test_trace_count_ignores_trailing_whitespace() {
|
||||
CHECK_EQ(trace_count("test layer 1", "foo"), 1);
|
||||
}
|
||||
|
||||
void test_trace_unescapes_newlines() {
|
||||
trace("test layer 1") << "f\no\no\n" << end();
|
||||
CHECK_TRACE_CONTENTS("test layer 1: f\\no\\no");
|
||||
}
|
||||
|
||||
// pending: DUMP tests
|
||||
// pending: readable_contents() adds newline if necessary.
|
||||
// pending: raise also prints to stderr.
|
||||
// pending: raise doesn't print to stderr if Hide_errors is set.
|
||||
// pending: warn doesn't print to stderr if Hide_errors is set.
|
||||
// pending: warn doesn't print to stderr if Hide_warnings is set.
|
||||
// pending: raise doesn't have to be saved if Hide_errors is set, just printed.
|
||||
// pending: raise prints to stderr if Trace_stream is NULL.
|
||||
// pending: raise prints to stderr if Trace_stream is NULL even if Hide_errors is set.
|
||||
|
@ -1,38 +0,0 @@
|
||||
c{0: 0 (((1 integer)) <- ((copy)) ((1 literal))) -- nil
|
||||
c{0: 1 (((2 integer)) <- ((copy)) ((3 literal))) -- nil
|
||||
c{0: 2 (((3 integer)) <- ((add)) ((1 integer)) ((2 integer))) -- nil
|
||||
c{1: 0 ✓ (((1 integer)) <- ((copy)) ((1 literal)))
|
||||
c{1: 1 ✓ (((2 integer)) <- ((copy)) ((3 literal)))
|
||||
c{1: 2 ✓ (((3 integer)) <- ((add)) ((1 integer)) ((2 integer)))
|
||||
cn0: convert-names in main
|
||||
cn0: (((1 integer)) <- ((copy)) ((1 literal))) nil nil
|
||||
cn0: checking arg ((1 literal))
|
||||
cn0: checking oarg ((1 integer))
|
||||
maybe-add: ((1 integer))
|
||||
cn0: (((2 integer)) <- ((copy)) ((3 literal))) nil nil
|
||||
cn0: checking arg ((3 literal))
|
||||
cn0: checking oarg ((2 integer))
|
||||
maybe-add: ((2 integer))
|
||||
cn0: (((3 integer)) <- ((add)) ((1 integer)) ((2 integer))) nil nil
|
||||
cn0: checking arg ((1 integer))
|
||||
maybe-add: ((1 integer))
|
||||
cn0: checking arg ((2 integer))
|
||||
maybe-add: ((2 integer))
|
||||
cn0: checking oarg ((3 integer))
|
||||
maybe-add: ((3 integer))
|
||||
cn1: (((1 integer)) <- ((copy)) ((1 literal)))
|
||||
cn1: (((2 integer)) <- ((copy)) ((3 literal)))
|
||||
cn1: (((3 integer)) <- ((add)) ((1 integer)) ((2 integer)))
|
||||
schedule: main
|
||||
run: main 0: (((1 integer)) <- ((copy)) ((1 literal)))
|
||||
run: main 0: 1 => ((1 integer))
|
||||
mem: ((1 integer)): 1 <= 1
|
||||
run: main 1: (((2 integer)) <- ((copy)) ((3 literal)))
|
||||
run: main 1: 3 => ((2 integer))
|
||||
mem: ((2 integer)): 2 <= 3
|
||||
run: main 2: (((3 integer)) <- ((add)) ((1 integer)) ((2 integer)))
|
||||
mem: ((1 integer)) => 1
|
||||
mem: ((2 integer)) => 3
|
||||
run: main 2: 4 => ((3 integer))
|
||||
mem: ((3 integer)): 3 <= 4
|
||||
schedule: done with routine nil
|
@ -1,14 +0,0 @@
|
||||
c{0: 0 (((1 integer)) <- ((add)) ((2 literal)) ((3 literal))) -- nil
|
||||
c{1: 0 ✓ (((1 integer)) <- ((add)) ((2 literal)) ((3 literal)))
|
||||
cn0: convert-names in main
|
||||
cn0: (((1 integer)) <- ((add)) ((2 literal)) ((3 literal))) nil nil
|
||||
cn0: checking arg ((2 literal))
|
||||
cn0: checking arg ((3 literal))
|
||||
cn0: checking oarg ((1 integer))
|
||||
maybe-add: ((1 integer))
|
||||
cn1: (((1 integer)) <- ((add)) ((2 literal)) ((3 literal)))
|
||||
schedule: main
|
||||
run: main 0: (((1 integer)) <- ((add)) ((2 literal)) ((3 literal)))
|
||||
run: main 0: 5 => ((1 integer))
|
||||
mem: ((1 integer)): 1 <= 5
|
||||
schedule: done with routine nil
|
@ -1,14 +0,0 @@
|
||||
c{0: 0 (((1 boolean)) <- ((and)) ((t literal)) ((nil literal))) -- nil
|
||||
c{1: 0 ✓ (((1 boolean)) <- ((and)) ((t literal)) ((nil literal)))
|
||||
cn0: convert-names in main
|
||||
cn0: (((1 boolean)) <- ((and)) ((t literal)) ((nil literal))) nil nil
|
||||
cn0: checking arg ((t literal))
|
||||
cn0: checking arg ((nil literal))
|
||||
cn0: checking oarg ((1 boolean))
|
||||
maybe-add: ((1 boolean))
|
||||
cn1: (((1 boolean)) <- ((and)) ((t literal)) ((nil literal)))
|
||||
schedule: main
|
||||
run: main 0: (((1 boolean)) <- ((and)) ((t literal)) ((nil literal)))
|
||||
run: main 0: nil => ((1 boolean))
|
||||
mem: ((1 boolean)): 1 <= nil
|
||||
schedule: done with routine nil
|
@ -1,43 +0,0 @@
|
||||
c{0: 0 (((1 integer)) <- ((copy)) ((34 literal))) -- nil
|
||||
c{0: 1 (((2 boolean)) <- ((copy)) ((nil literal))) -- nil
|
||||
c{0: 2 (((test1)) ((1 integer-boolean-pair))) -- nil
|
||||
c{1: 0 ✓ (((1 integer)) <- ((copy)) ((34 literal)))
|
||||
c{1: 1 ✓ (((2 boolean)) <- ((copy)) ((nil literal)))
|
||||
c{1: 2 ✓ (((test1)) ((1 integer-boolean-pair)))
|
||||
c{0: 0 (((4 integer-boolean-pair)) <- ((next-input))) -- nil
|
||||
c{1: 0 ✓ (((4 integer-boolean-pair)) <- ((next-input)))
|
||||
cn0: convert-names in main
|
||||
cn0: (((1 integer)) <- ((copy)) ((34 literal))) nil nil
|
||||
cn0: checking arg ((34 literal))
|
||||
cn0: checking oarg ((1 integer))
|
||||
maybe-add: ((1 integer))
|
||||
cn0: (((2 boolean)) <- ((copy)) ((nil literal))) nil nil
|
||||
cn0: checking arg ((nil literal))
|
||||
cn0: checking oarg ((2 boolean))
|
||||
maybe-add: ((2 boolean))
|
||||
cn0: (((test1)) ((1 integer-boolean-pair))) nil nil
|
||||
cn0: checking arg ((1 integer-boolean-pair))
|
||||
maybe-add: ((1 integer-boolean-pair))
|
||||
cn0: convert-names in test1
|
||||
cn0: (((4 integer-boolean-pair)) <- ((next-input))) nil nil
|
||||
cn0: checking oarg ((4 integer-boolean-pair))
|
||||
maybe-add: ((4 integer-boolean-pair))
|
||||
cn1: (((1 integer)) <- ((copy)) ((34 literal)))
|
||||
cn1: (((2 boolean)) <- ((copy)) ((nil literal)))
|
||||
cn1: (((test1)) ((1 integer-boolean-pair)))
|
||||
cn1: (((4 integer-boolean-pair)) <- ((next-input)))
|
||||
schedule: main
|
||||
run: main 0: (((1 integer)) <- ((copy)) ((34 literal)))
|
||||
run: main 0: 34 => ((1 integer))
|
||||
mem: ((1 integer)): 1 <= 34
|
||||
run: main 1: (((2 boolean)) <- ((copy)) ((nil literal)))
|
||||
run: main 1: nil => ((2 boolean))
|
||||
mem: ((2 boolean)): 2 <= nil
|
||||
run: main 2: (((test1)) ((1 integer-boolean-pair)))
|
||||
mem: ((1 integer-boolean-pair)) => #(tagged record (34 nil . nil))
|
||||
run: test1/main 0: (((4 integer-boolean-pair)) <- ((next-input)))
|
||||
arg: nil 0 (#(tagged record (34 nil . nil)))
|
||||
run: test1/main 0: #(tagged record (34 nil . nil)) => ((4 integer-boolean-pair))
|
||||
mem: ((4 integer-boolean-pair)): 4 <= 34
|
||||
mem: ((4 integer-boolean-pair)): 5 <= nil
|
||||
schedule: done with routine nil
|
@ -1,53 +0,0 @@
|
||||
c{0: 0 (((1 integer)) <- ((copy)) ((34 literal))) -- nil
|
||||
c{0: 1 (((2 boolean)) <- ((copy)) ((nil literal))) -- nil
|
||||
c{0: 2 (((3 integer-boolean-pair-address)) <- ((copy)) ((1 literal))) -- nil
|
||||
c{0: 3 (((test1)) ((3 integer-boolean-pair-address) (deref))) -- nil
|
||||
c{1: 0 ✓ (((1 integer)) <- ((copy)) ((34 literal)))
|
||||
c{1: 1 ✓ (((2 boolean)) <- ((copy)) ((nil literal)))
|
||||
c{1: 2 ✓ (((3 integer-boolean-pair-address)) <- ((copy)) ((1 literal)))
|
||||
c{1: 3 ✓ (((test1)) ((3 integer-boolean-pair-address) (deref)))
|
||||
c{0: 0 (((4 integer-boolean-pair)) <- ((next-input))) -- nil
|
||||
c{1: 0 ✓ (((4 integer-boolean-pair)) <- ((next-input)))
|
||||
cn0: convert-names in main
|
||||
cn0: (((1 integer)) <- ((copy)) ((34 literal))) nil nil
|
||||
cn0: checking arg ((34 literal))
|
||||
cn0: checking oarg ((1 integer))
|
||||
maybe-add: ((1 integer))
|
||||
cn0: (((2 boolean)) <- ((copy)) ((nil literal))) nil nil
|
||||
cn0: checking arg ((nil literal))
|
||||
cn0: checking oarg ((2 boolean))
|
||||
maybe-add: ((2 boolean))
|
||||
cn0: (((3 integer-boolean-pair-address)) <- ((copy)) ((1 literal))) nil nil
|
||||
cn0: checking arg ((1 literal))
|
||||
cn0: checking oarg ((3 integer-boolean-pair-address))
|
||||
maybe-add: ((3 integer-boolean-pair-address))
|
||||
cn0: (((test1)) ((3 integer-boolean-pair-address) (deref))) nil nil
|
||||
cn0: checking arg ((3 integer-boolean-pair-address) (deref))
|
||||
maybe-add: ((3 integer-boolean-pair-address) (deref))
|
||||
cn0: convert-names in test1
|
||||
cn0: (((4 integer-boolean-pair)) <- ((next-input))) nil nil
|
||||
cn0: checking oarg ((4 integer-boolean-pair))
|
||||
maybe-add: ((4 integer-boolean-pair))
|
||||
cn1: (((1 integer)) <- ((copy)) ((34 literal)))
|
||||
cn1: (((2 boolean)) <- ((copy)) ((nil literal)))
|
||||
cn1: (((3 integer-boolean-pair-address)) <- ((copy)) ((1 literal)))
|
||||
cn1: (((test1)) ((3 integer-boolean-pair-address) (deref)))
|
||||
cn1: (((4 integer-boolean-pair)) <- ((next-input)))
|
||||
schedule: main
|
||||
run: main 0: (((1 integer)) <- ((copy)) ((34 literal)))
|
||||
run: main 0: 34 => ((1 integer))
|
||||
mem: ((1 integer)): 1 <= 34
|
||||
run: main 1: (((2 boolean)) <- ((copy)) ((nil literal)))
|
||||
run: main 1: nil => ((2 boolean))
|
||||
mem: ((2 boolean)): 2 <= nil
|
||||
run: main 2: (((3 integer-boolean-pair-address)) <- ((copy)) ((1 literal)))
|
||||
run: main 2: 1 => ((3 integer-boolean-pair-address))
|
||||
mem: ((3 integer-boolean-pair-address)): 3 <= 1
|
||||
run: main 3: (((test1)) ((3 integer-boolean-pair-address) (deref)))
|
||||
mem: ((3 integer-boolean-pair-address) (deref)) => #(tagged record (34 nil . nil))
|
||||
run: test1/main 0: (((4 integer-boolean-pair)) <- ((next-input)))
|
||||
arg: nil 0 (#(tagged record (34 nil . nil)))
|
||||
run: test1/main 0: #(tagged record (34 nil . nil)) => ((4 integer-boolean-pair))
|
||||
mem: ((4 integer-boolean-pair)): 4 <= 34
|
||||
mem: ((4 integer-boolean-pair)): 5 <= nil
|
||||
schedule: done with routine nil
|
@ -1,46 +0,0 @@
|
||||
c{0: 0 (((1 integer)) <- ((copy)) ((2 literal))) -- nil
|
||||
c{0: 1 (((2 integer)) <- ((copy)) ((23 literal))) -- nil
|
||||
c{0: 2 (((3 integer)) <- ((copy)) ((24 literal))) -- nil
|
||||
c{0: 3 (((4 integer)) <- ((index)) ((1 integer-array)) ((2 literal))) -- nil
|
||||
c{1: 0 ✓ (((1 integer)) <- ((copy)) ((2 literal)))
|
||||
c{1: 1 ✓ (((2 integer)) <- ((copy)) ((23 literal)))
|
||||
c{1: 2 ✓ (((3 integer)) <- ((copy)) ((24 literal)))
|
||||
c{1: 3 ✓ (((4 integer)) <- ((index)) ((1 integer-array)) ((2 literal)))
|
||||
cn0: convert-names in main
|
||||
cn0: (((1 integer)) <- ((copy)) ((2 literal))) nil nil
|
||||
cn0: checking arg ((2 literal))
|
||||
cn0: checking oarg ((1 integer))
|
||||
maybe-add: ((1 integer))
|
||||
cn0: (((2 integer)) <- ((copy)) ((23 literal))) nil nil
|
||||
cn0: checking arg ((23 literal))
|
||||
cn0: checking oarg ((2 integer))
|
||||
maybe-add: ((2 integer))
|
||||
cn0: (((3 integer)) <- ((copy)) ((24 literal))) nil nil
|
||||
cn0: checking arg ((24 literal))
|
||||
cn0: checking oarg ((3 integer))
|
||||
maybe-add: ((3 integer))
|
||||
cn0: (((4 integer)) <- ((index)) ((1 integer-array)) ((2 literal))) nil nil
|
||||
cn0: checking arg ((1 integer-array))
|
||||
maybe-add: ((1 integer-array))
|
||||
cn0: checking arg ((2 literal))
|
||||
cn0: checking oarg ((4 integer))
|
||||
maybe-add: ((4 integer))
|
||||
cn1: (((1 integer)) <- ((copy)) ((2 literal)))
|
||||
cn1: (((2 integer)) <- ((copy)) ((23 literal)))
|
||||
cn1: (((3 integer)) <- ((copy)) ((24 literal)))
|
||||
cn1: (((4 integer)) <- ((index)) ((1 integer-array)) ((2 literal)))
|
||||
schedule: main
|
||||
run: main 0: (((1 integer)) <- ((copy)) ((2 literal)))
|
||||
run: main 0: 2 => ((1 integer))
|
||||
mem: ((1 integer)): 1 <= 2
|
||||
run: main 1: (((2 integer)) <- ((copy)) ((23 literal)))
|
||||
run: main 1: 23 => ((2 integer))
|
||||
mem: ((2 integer)): 2 <= 23
|
||||
run: main 2: (((3 integer)) <- ((copy)) ((24 literal)))
|
||||
run: main 2: 24 => ((3 integer))
|
||||
mem: ((3 integer)): 3 <= 24
|
||||
run: main 3: (((4 integer)) <- ((index)) ((1 integer-array)) ((2 literal)))
|
||||
array-len: ((1 integer-array))
|
||||
mem: ((1 integer)) => 2
|
||||
-: die: 2 is out of bounds of array 1integer-array
|
||||
schedule: done with dead routine main
|
@ -1,100 +0,0 @@
|
||||
c{0: 0 (((10 integer)) <- ((copy)) ((30 literal))) -- nil
|
||||
c{0: 1 (((default-space space-address)) <- ((copy)) ((10 literal))) -- nil
|
||||
c{0: 2 (((1 integer)) <- ((copy)) ((2 literal))) -- nil
|
||||
c{0: 3 (((2 integer)) <- ((copy)) ((23 literal))) -- nil
|
||||
c{0: 4 (((3 boolean)) <- ((copy)) ((nil literal))) -- nil
|
||||
c{0: 5 (((4 integer)) <- ((copy)) ((24 literal))) -- nil
|
||||
c{0: 6 (((5 boolean)) <- ((copy)) ((t literal))) -- nil
|
||||
c{0: 7 (((6 integer-boolean-pair-array-address)) <- ((copy)) ((12 literal))) -- nil
|
||||
c{0: 8 (((7 integer-boolean-pair-array)) <- ((copy)) ((6 integer-boolean-pair-array-address) (deref))) -- nil
|
||||
c{1: 0 ✓ (((10 integer)) <- ((copy)) ((30 literal)))
|
||||
c{1: 1 ✓ (((default-space space-address)) <- ((copy)) ((10 literal)))
|
||||
c{1: 2 ✓ (((1 integer)) <- ((copy)) ((2 literal)))
|
||||
c{1: 3 ✓ (((2 integer)) <- ((copy)) ((23 literal)))
|
||||
c{1: 4 ✓ (((3 boolean)) <- ((copy)) ((nil literal)))
|
||||
c{1: 5 ✓ (((4 integer)) <- ((copy)) ((24 literal)))
|
||||
c{1: 6 ✓ (((5 boolean)) <- ((copy)) ((t literal)))
|
||||
c{1: 7 ✓ (((6 integer-boolean-pair-array-address)) <- ((copy)) ((12 literal)))
|
||||
c{1: 8 ✓ (((7 integer-boolean-pair-array)) <- ((copy)) ((6 integer-boolean-pair-array-address) (deref)))
|
||||
cn0: convert-names in main
|
||||
cn0: (((10 integer)) <- ((copy)) ((30 literal))) nil nil
|
||||
cn0: checking arg ((30 literal))
|
||||
cn0: checking oarg ((10 integer))
|
||||
maybe-add: ((10 integer))
|
||||
cn0: (((default-space space-address)) <- ((copy)) ((10 literal))) nil nil
|
||||
cn0: checking arg ((10 literal))
|
||||
cn0: checking oarg ((default-space space-address))
|
||||
maybe-add: ((default-space space-address))
|
||||
cn0: (((1 integer)) <- ((copy)) ((2 literal))) nil nil
|
||||
cn0: checking arg ((2 literal))
|
||||
cn0: checking oarg ((1 integer))
|
||||
maybe-add: ((1 integer))
|
||||
cn0: (((2 integer)) <- ((copy)) ((23 literal))) nil nil
|
||||
cn0: checking arg ((23 literal))
|
||||
cn0: checking oarg ((2 integer))
|
||||
maybe-add: ((2 integer))
|
||||
cn0: (((3 boolean)) <- ((copy)) ((nil literal))) nil nil
|
||||
cn0: checking arg ((nil literal))
|
||||
cn0: checking oarg ((3 boolean))
|
||||
maybe-add: ((3 boolean))
|
||||
cn0: (((4 integer)) <- ((copy)) ((24 literal))) nil nil
|
||||
cn0: checking arg ((24 literal))
|
||||
cn0: checking oarg ((4 integer))
|
||||
maybe-add: ((4 integer))
|
||||
cn0: (((5 boolean)) <- ((copy)) ((t literal))) nil nil
|
||||
cn0: checking arg ((t literal))
|
||||
cn0: checking oarg ((5 boolean))
|
||||
maybe-add: ((5 boolean))
|
||||
cn0: (((6 integer-boolean-pair-array-address)) <- ((copy)) ((12 literal))) nil nil
|
||||
cn0: checking arg ((12 literal))
|
||||
cn0: checking oarg ((6 integer-boolean-pair-array-address))
|
||||
maybe-add: ((6 integer-boolean-pair-array-address))
|
||||
cn0: (((7 integer-boolean-pair-array)) <- ((copy)) ((6 integer-boolean-pair-array-address) (deref))) nil nil
|
||||
cn0: checking arg ((6 integer-boolean-pair-array-address) (deref))
|
||||
maybe-add: ((6 integer-boolean-pair-array-address) (deref))
|
||||
cn0: checking oarg ((7 integer-boolean-pair-array))
|
||||
maybe-add: ((7 integer-boolean-pair-array))
|
||||
cn1: (((10 integer)) <- ((copy)) ((30 literal)))
|
||||
cn1: (((default-space space-address)) <- ((copy)) ((10 literal)))
|
||||
cn1: (((1 integer)) <- ((copy)) ((2 literal)))
|
||||
cn1: (((2 integer)) <- ((copy)) ((23 literal)))
|
||||
cn1: (((3 boolean)) <- ((copy)) ((nil literal)))
|
||||
cn1: (((4 integer)) <- ((copy)) ((24 literal)))
|
||||
cn1: (((5 boolean)) <- ((copy)) ((t literal)))
|
||||
cn1: (((6 integer-boolean-pair-array-address)) <- ((copy)) ((12 literal)))
|
||||
cn1: (((7 integer-boolean-pair-array)) <- ((copy)) ((6 integer-boolean-pair-array-address) (deref)))
|
||||
schedule: main
|
||||
run: main 0: (((10 integer)) <- ((copy)) ((30 literal)))
|
||||
run: main 0: 30 => ((10 integer))
|
||||
mem: ((10 integer)): 10 <= 30
|
||||
run: main 1: (((default-space space-address)) <- ((copy)) ((10 literal)))
|
||||
run: main 1: 10 => ((default-space space-address))
|
||||
run: main 2: (((1 integer)) <- ((copy)) ((2 literal)))
|
||||
run: main 2: 2 => ((1 integer))
|
||||
mem: ((1 integer)): 12 <= 2
|
||||
run: main 3: (((2 integer)) <- ((copy)) ((23 literal)))
|
||||
run: main 3: 23 => ((2 integer))
|
||||
mem: ((2 integer)): 13 <= 23
|
||||
run: main 4: (((3 boolean)) <- ((copy)) ((nil literal)))
|
||||
run: main 4: nil => ((3 boolean))
|
||||
mem: ((3 boolean)): 14 <= nil
|
||||
run: main 5: (((4 integer)) <- ((copy)) ((24 literal)))
|
||||
run: main 5: 24 => ((4 integer))
|
||||
mem: ((4 integer)): 15 <= 24
|
||||
run: main 6: (((5 boolean)) <- ((copy)) ((t literal)))
|
||||
run: main 6: t => ((5 boolean))
|
||||
mem: ((5 boolean)): 16 <= t
|
||||
run: main 7: (((6 integer-boolean-pair-array-address)) <- ((copy)) ((12 literal)))
|
||||
run: main 7: 12 => ((6 integer-boolean-pair-array-address))
|
||||
mem: ((6 integer-boolean-pair-array-address)): 17 <= 12
|
||||
run: main 8: (((7 integer-boolean-pair-array)) <- ((copy)) ((6 integer-boolean-pair-array-address) (deref)))
|
||||
array-len: ((12 integer-boolean-pair-array) (raw))
|
||||
mem: ((12 integer) (raw)) => 2
|
||||
mem: ((6 integer-boolean-pair-array-address) (deref)) => #(tagged record (2 23 nil 24 t . nil))
|
||||
run: main 8: #(tagged record (2 23 nil 24 t . nil)) => ((7 integer-boolean-pair-array))
|
||||
mem: ((7 integer-boolean-pair-array)): 18 <= 2
|
||||
mem: ((7 integer-boolean-pair-array)): 19 <= 23
|
||||
mem: ((7 integer-boolean-pair-array)): 20 <= nil
|
||||
mem: ((7 integer-boolean-pair-array)): 21 <= 24
|
||||
mem: ((7 integer-boolean-pair-array)): 22 <= t
|
||||
schedule: done with routine nil
|
@ -1,10 +0,0 @@
|
||||
c{0: 0 label1 -- ((open 0))
|
||||
c{0: 1 (((1 integer)) <- ((copy)) ((0 literal))) -- ((open 0))
|
||||
c{1: 1 ✓ (((1 integer)) <- ((copy)) ((0 literal)))
|
||||
cn0: convert-names in f1
|
||||
cn0: (((1 integer)) <- ((copy)) ((0 literal))) nil nil
|
||||
cn0: checking arg ((0 literal))
|
||||
cn0: checking oarg ((1 integer))
|
||||
maybe-add: ((1 integer))
|
||||
cn1: label1
|
||||
cn1: (((1 integer)) <- ((copy)) ((0 literal)))
|
@ -1,10 +0,0 @@
|
||||
c{0: 0 label1 -- ((open 0))
|
||||
c{0: 1 (((1 integer)) <- ((copy)) ((0 literal))) -- ((open 0))
|
||||
c{1: 1 ✓ (((1 integer)) <- ((copy)) ((0 literal)))
|
||||
cn0: convert-names in f1
|
||||
cn0: (((1 integer)) <- ((copy)) ((0 literal))) nil nil
|
||||
cn0: checking arg ((0 literal))
|
||||
cn0: checking oarg ((1 integer))
|
||||
maybe-add: ((1 integer))
|
||||
cn1: label1
|
||||
cn1: (((1 integer)) <- ((copy)) ((0 literal)))
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user