Monday, June 30, 2014

Weekly Log: June 23 - June 29

I continued to implement validation for the arrays package in JSBML. For the past week, I wrote a compiler for ASTNode objects to evaluate an expression. I wrote this compiler so I can determine whether there is any index math that goes out of bounds. I made the compiler accept a map that maps an id to a value. Each pair corresponds to an array dimension for a certain array object you are referencing. I use the map so I can change the value of a certain id to calculate the lower bound and upper bound for a certain array. 

It is important to note that only indices that are statically computable are allowed. This means if an id appears in the math, the object is refers to should be constant. Even with this implication, determining whether an index goes out of bounds is not easy. Right now, I assume that every index math is monotonically increasing. This way I just need to compute the end points for that function. However, this is not always true. A function may have selectors, piecewise function, trigonometric, and etc, so the bounds can be anywhere in between the end points.  This means that all the points must be evaluated.

As of revision 20642, I have done validation for the following rules:

10206, 1207, 1208, 10209, 10210, 20103, 20104, 20107, 20108, 20111, 20112, 20114, 20202, 20204, 20205, 20302, 20305, 20307, 20308.

There are two rules that says Dimension and Index objects can only have attribute arrayDimension set to 0, 1, or 2, but since it is likely this limitation will be removed in a later version, I am not checking for these rules. 

This week, I am going to do more testing for validation. In addition, I need to implement one validation rule that checks that binary and nary operations have arguments that match in number of dimensions (rule 10211). In addition, I am going to start thinking about the pseudocode for the flattening routine.

No comments:

Post a Comment