Thursday, June 20, 2013

Probabilistic Test Listener / Days 15 & 16

Day 15 -- Tuesday Jun 18
JPF Probabilistic coding. Today was spent with the goal of doing more than just reading and compiling the jpf-probabilistic code that was found online. One of my mentors suggested working on getting the jpf-prism listener to process the test cases (there are three) that jpf-probabilistic included. Of course, getting the listener to work on the code that is supplied in the tutorial, and getting it to work on different code (without directly copying the jpf-probabilistic code) is not the most challenging thing I'll have to do, but it wasn't trivial. Perhaps a better phrasing would be to say that it is exercising all that reading and experimenting I did in the weeks prior to this one. Overriding listener code for the sake see what happens is easy and fun, picking the right ones for the job is the interesting part, and this is the first time that this has been necessary. I got it to replicate a fair bit of the same behavior, but not entirely without cheating (I had to use some of the classes in jpf-probabilistic). Tomorrow I'm going to see if I can lessen this dependence, though I realize that may not be strictly necessary.

Day 16 - Wednesday June 19
Coding continues. I think I realized that somethings are probably going to be very likely okay to borrow from jpf-probabilistic, like the "Choice" class that probabilistic programs will have to use to indicate some sort of randomized choice that our listener will have to look for. And it may very well need to changed, replaced, or supplemented for our needs, but for now I think it's okay if I use this class explicitly. Of course, once this was realized, somethings were sped up to the point where it looks like my listener does process probabilistic programs similar to jpf-probabilistic; that is, it identifies and uses the choice methods in a similar manner and it can also print the Markov chains--but in this sense it is very similar to the existing code, so while it was worth re-coding for my sake, its not technically impressive. What I'm more interested to do tomorrow is to see if I can find other examples on the internet to test this implementation against the existing code (it should do well, it does look very similar) but then also to see if I can get good results by writing different "Choice" (or other dependent) classes. For example, jpf-probabilistic also has a "UniformChoice" class, but maybe I can encode different distributions for probabilities against well-documented (but still relatively quick) examples to make sure I'm really writing good code.
I'll polish the code a bit and then commit them to the repositories after this blog post as well; I'm not yet tired and I want to play around a bit more, then submit once for the last two days. I only say this because it's the last time I'll mention committing code; after tonight I'll do this at least daily, if not hourly or more frequently--like this code (which I'm still only considering experimental) was important. Even if it is only experimental code, I might as well commit in case some of it is useful later.

No comments:

Post a Comment