Commit b4ee6a60 authored by thiarichey's avatar thiarichey
Browse files

Some progress on static environment fuzzer discussion.

parent a36083ee
......@@ -246,4 +246,25 @@ Our general approach, then, is this: we generate bindings, which generate expres
```
When we try to look up `y` in our dynamic environment, it's not there, because we have not defined it! This represents an unbound variable error. What are some other types of errors you can think
of coming up in Trefoil V2 programs generated using the grammar fuzzer?
\ No newline at end of file
of coming up in Trefoil V2 programs generated using the grammar fuzzer?
## Static environment fuzzer
Let's go one step further and try to eliminate unbound variable and function errors (like those we just saw!). We'll keep the basic structure of the previous fuzzer, but now we want to keep track of the static environment. On a high level, this means that, whenever we create a variable or function binding, we add information about that binding to the static environment. Then, when generating expressions that involve a variable or function binding (such as a `f` call or a `let` expression), we choose from existing variable or function bindings in the static environment rather than generating random (and statistically, *almost certainly* unbound) ones. We'll talk about this in more detail momentarily, but first...
Let's take a look at the numbers.
```
Paren:0
Abstract:0
Unbound Variables:0
Unbound Functions:0
Other Runtime:810486
StackOverflows:900
Programs:188614
Total:1000000
```
Wow! Valid programs now account for *nearly 20%* of our results, up from 5% using our already pretty "smart" grammar fuzzer. Variable and function binding errors have been eliminated; nearly all of our remaining errors are unspecified runtime errors, but, interestingly, we also have more stack overflow errors. Think about why this might be.
### The generating procedure
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment