- Nov 15, 2013
-
-
Matthew Dawson authored
Since MatlabParser has no reason to have an instance of it managed by a user, just make it use a single static method to access its functionality. Overall it makes code simpler (avoiding the nasty getRootExpression call). git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10847 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Instead of having new instances of VariableParser created, and thus wrapping a Map<String, Variable> in a very inelegant way, simply have a single method that actually does the VariableParser work, and directly returns the Map. Also ensure all tests + Matlab continue to work, and tighten up some extra imports and Matlab output in affected areas. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10846 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
The package name matlab2smt is really ugly, and not really representative of what it really does anymore. Thus create an expression package for the pieces representing an expression, and a parsers package for all parsers, including both the variable and the Matlab parsers. Also make MatlabParserOperatorParseTest not rely on (now) private members. Instead use the toString methods to get a generator independent representation, and test that it matches appropriately. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10845 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Since the java code is turning into entire toolbox for dealing with tabular expressions, move the code to an appropriate package. Even if it doesn't become a full toolbox (for java), it is deeply used by the Matlab toolbox. Thus pull the name from there. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10844 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Add some toString methods to aid debugging the operations setup. It isn't committed centrally as I'm not sure it is a good idea. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10843 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
- Sep 30, 2013
-
-
Matthew Dawson authored
Handle the negative and fractional outputs from SMTLIB. This required extending the SMTLIB output grammar to accept negative and division operations. Currently the support is cheated some, so that only the necessary pieces are actually parsed. Further support for more operations will require extending the support further. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10724 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Since periods are usually a wildcard, make sure to quote it so that it is properly handled as a period, and not any random value. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10723 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
To handle the case when more complicated output is received from SMTLIB, properly parse SMTLIB output. Due to ANTLR trying to consume the full stream, the SMTLIB response is first put in a string. A simple algorithm, using the brackets, is used to find the beginning and end. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10722 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Update antlr to the latest release. Also adjust the Matlab Grammar to continue working. No functional change necessary. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10721 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Update the assembly plugin, used to generate the jar with dependencies, to the latest released (non-beta) version. No functional change. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10720 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
- Sep 27, 2013
-
-
Matthew Dawson authored
CVC3 doesn't allow decimal points to represent rational numbers. Thus simplify things by putting the literal into fractional form. Currently reduction is not attempted, and the simplest form is used. Ex. 4.56 becomes (456/100) (as tested in the accompanying unit test). git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10714 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Since queries is now a Java List, don't use matlab to combine them (it makes an array of Lists). Instead use the Java method addAll to do it. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10713 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
The CVC3 generator originally insured that the TCC numbering was always unqie for a table. Re-add this functionality. Specifically, when building the walker, add a parameter to its constructor to set its starting TCC number. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10712 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Fixed point operations are now all tested. Due to literals automatically casting to reals, it is necessary to push the "x" variable further into the expression. To ensure everything works, add one more condition without x to make sure everything stays stable. Everything works, after adjusting search strings. Also, deal with both signed/unsigned fixed point types. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10711 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
When generating binary operations, the requested type sent down was the output type, not the input type. However, the generator expects the input type to know how to output the operation. Fix that. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10710 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Add a test for CVC3 fixed point support, and get fixed point working again. This implements support for the fixed point marker, and make use of it. The only problem is that literals by default fall down to Reals, so not all operations are tested. This needs to be fixed. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10709 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Now that Matlab parsing is pretty much all done, remove extra output. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10708 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Real operators are now added for CVC3 generation. Fixed point is still left out. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10707 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Implement other operators for SMTLIB. Also implement a test for it. The test is parameterized, so CVC3 support is easy to add. Due to the parameterization, a newer version of JUnit is required, so bump the version in the pom.xml file. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10706 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
When dealing with expressions, and generating output for them, types have to be exactly known. However, when two literals are added together (like: 5+5), the type to use for that is unknown. To fix this issue, type information has to be forced down the pipe. So know the addition operation now knows it needs to produce a particular type (ex Real or Fixed Point), and then tests what the subexpressions can produce (for literals, they can produce either, but a variable can only be what it is). For Real, that is fine. However a fixed point can take an infinite number of different possibilities, and one cannot test for every combination. So instead a type "marker" is introduced. This marker instead identifies that a fixed point type is generally wanted, but specifics are unknown. The system will query for an appropriate type, and requires the specific type is returned, and not a marker. All types are also markers for themselves, so Reals, for instance, don't need anything special. While the marker system sounds good in theory, it currently is fully implemented, so fixed point is currently broken. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10705 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Binary ops now includes: - / >= < <= Unary: - YAY! git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10704 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Test that each operator is parsed in properly. Currently only tests implemented operators, with more to follow. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10703 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
- Sep 19, 2013
-
-
Matthew Dawson authored
The java code now loads into Matlab automatically, but it uses a differnt jar file location now. Things work though. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10668 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Show an option for checking against Z3, and also hook it up to the matlab code for use. Everything should be working now. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10667 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Do to the way the matlab code works, the GenerateMatlabVariableDeclarations is actually useless. Thus, make SampleValues public so that the matlab code can still do what it needs to do. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10666 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
When walking an empty grid, no queries for either complete or disjoint are generated. Disjoint handled this fine, but complete did not. Fix this. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10665 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Due to some copy+paste errors, cvc3 was mentioned in smtlib test code. Rename the references as appropriate. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10664 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Add a CheckerRunner class with a single static method to run z3. It uses the smtlib generators, and the logic can be extended to other smtlib2 compliant smt solvers. It uses the copy of z3 in your path for now. Note that it is very brittle, and if z3 has issue can potentially lock the thread it is running on, as Java has no easy way to add timeouts to reads on the stdout of z3. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10663 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Add a simple class to hold the results of a failed query to a SMT checker. Also, it has a utility function to easily generate a matlab expression for the failed test's counter-model. Also test. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10662 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
The grammar file requires Matlab expressions, it expects the expression to end with a newline. However, lots of generated code doesn't. Thus force this to be always correct. Note that any extra newlines shouldn't cause issues. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10661 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
To stay at least a little consistent, use smtlibchecker for the smtlib package name. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10660 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
The cvc3generator package was moved out of tablularexpression. Matlab code wasn't updated, and thus broke. Fix this mistake. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10659 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Implement a first run (with simple non-exhaustive test) of the SMT-LIB generator for hierarchical tables. This generates the same information as the cvc3 generator, but using the appropriate syntax. Note that the generated script can't be directly run, due to how SMT-LIB verifiers work regarding reading of values, so the queries need to be piped directly across one by one for verification. Also, since SMT-LIB doesn't have an equivalent to CVC3's QUERY command, all queries have a not placed in front. This lead to a few changes to the queries: - Disjoint queries now had a format of: (not (and (not (and e1 e2)))). This can be simplified with De Morgan's law to (or (and e1 e2)) (by removing the (not (and (not to the more simple (or). - Complete queries now have an extra (not in front. No further optimization is possible. - For the parent part of any query, instead of using (not (=> (p e)), which removes the potential disjoint optimization, the not is pushed down so the format is now (and p (not e)). Also, for simplification p is always defined, and is true when no parent cells exist. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10658 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
In SMT-LIB, any real literal *must* have a decimal point, otherwise various parsers may explode. Since I know if a literal is supposed to be real, fix this issue by appending a harmless ".0" to the string of the number. Fix tests to verify this. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10657 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
The system can now generate SMT-LIB code from the parsed Matlab code. It doesn't deal with tables (yet), but that is next. Also use the MatlabParser tests to verify the generated SMT-LIB code. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10656 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Start with the SMTLIBGenerator class. To start with, deal with variable definitions! git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10655 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
GenerateVariableType was an unused function outside of some internal pieces. Thus remove it from the CheckerGenerator interface, as it doesn't need to be exposed. Update a few internal uses of it to use an explicit instance of a CheckerGenerator for when it was used (inside of tests). git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10654 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Some debug output was left in and committed. Remove the extra junk. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10653 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
The cvc3generator package was originally put in tablularexpression while I was fighting with maven. Since it doesn't have to be in the package, remove it to clean up the layout of packages. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10652 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-
Matthew Dawson authored
Now the full contents of the CVC3 file are generated inside of Java, but the actual saving and running of CVC3 still happen inside of matlab. For now. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@10651 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
-