Commit Graph

368 Commits

Author SHA1 Message Date
Fedor Isakov b5ec22be79 Travis to test on Java8 2017-06-07 11:18:40 +02:00
Fedor Isakov 6658214546 Travis CI manifest 2017-06-07 11:13:17 +02:00
Fedor Isakov 90044e69c7 Update the copyright notice with the license. Remove obsolete artefacts and "generated" markings. 2017-06-05 15:16:19 +02:00
Fedor Isakov 7c5274aacb Rename the maven projects and artefacts. 2017-06-05 13:38:31 +02:00
Fedor Isakov 0dcf1ecd81 Rename API interfaces for better readability. 2017-06-05 13:37:56 +02:00
Fedor Isakov 58eea099f1 Readme file. 2017-06-05 10:48:29 +02:00
Fedor Isakov a23c0db226 Integrate unification into the Core module. Remove the unification lib and all its stuff. 2017-06-02 11:19:36 +02:00
Fedor Isakov 8f0ce2aad6 Delete deprecated interface. 2017-06-02 10:53:48 +02:00
Fedor Isakov 77662be281 Auto-changed .iml files. Switch to Kotlin 1.1.2. Switch to Dexx collection 0.7. 2017-06-01 15:11:54 +02:00
Fedor Isakov 89018e7fb6 Updated the javadoc. Removed unused class. 2017-06-01 10:42:41 +02:00
Fedor Isakov c5c198cf8b Refactoring in the reactor API: move invocation/occurrence factory methods to evaluation session, enable access to logical context from an invocation. 2017-03-27 19:01:07 +02:00
Fedor Isakov a70c5f6f02 Ensure the failure is only reported to the trace once. 2017-03-22 10:50:05 +01:00
Fedor Isakov cab0931cc1 Report failure to the trace. 2017-02-27 16:06:32 +01:00
Fedor Isakov 6cac64b6bd Fix and simplify the unification algorithm. Drop support for cyclic terms. Correctly report cycles. 2017-02-25 18:36:56 +01:00
Fedor Isakov c687908e1e Fix copying occurrences from the store view 2017-02-25 18:35:37 +01:00
Fedor Isakov cae150819f Introduce StoreView as a parameter to launching evaluation session. Minor code refactoring/extracting. 2017-01-10 20:19:59 +01:00
Fedor Isakov c68d9a0bd7 Refactoring the reactor API. Extract StoreView. Get rid of obsolete calls to SessionSolver, cleanup the interface. Introduce AbstractSolver. Move instantiation arguments to solver/program. Cleaning up the code. 2017-01-05 17:34:53 +01:00
Fedor Isakov ebfe680aae Refactoring the reactor API. Extract StoreView, get rid of obsolete calls to SessionSolver. Cleaning up the code. 2017-01-04 10:47:23 +01:00
Fedor Isakov 0771504044 Refactoring the reactor API, cleaning up the code. 2017-01-03 12:11:31 +01:00
Fedor Isakov 466c015263 Handlers to have multiple primary constraints. RuleIndex to select handlers with matching primary symbol, if a handler has one. Only "accept-all" handlers process non-primary constraints. 2016-12-28 12:54:19 +01:00
Fedor Isakov 26f12f187d Refactor the evaluation controller to have handlers. RuleIndex to select handlers with matching primary symbol first, then the "accept-all" handlers. Tests. 2016-12-23 16:50:31 +01:00
Fedor Isakov 49a6ee0bd0 New naming convention for test helper classes (prefix Mock-). 2016-12-22 15:56:23 +01:00
Fedor Isakov e80818607c Introduce the Handler API. 2016-12-22 12:39:28 +01:00
Fedor Isakov e6c7ee74f5 Renaming implementation classes to clean up the namespace. 2016-12-22 12:27:34 +01:00
Fedor Isakov b891f0fa47 Optimizing the aux lookup of constraints by moving the constraint symbol to the top of the search term. 2016-12-14 17:07:58 +01:00
Fedor Isakov 3dd42efe32 Include information of the parent activations in the profiling data. 2016-12-14 12:34:18 +01:00
Fedor Isakov 90640f1d3d Bumped up the kotlin version in maven project file. Switch to the latest dexx collections. Drop google collections (unused). Re-imported all maven projects. 2016-12-13 10:31:16 +01:00
Fedor Isakov bdc4701b23 Uptimizing the profiler. Ensure only the top 98% of the durations get reported. 2016-12-12 15:42:06 +01:00
Fedor Isakov cb7dc76aa5 Simplify MatchTrie: no more additional nextSibling calculation, which had caused exponential search (yikes!); code cleanup. 2016-12-06 16:58:21 +01:00
Fedor Isakov 76fa878518 Report profiling results even on evaluation failure. 2016-12-06 16:58:21 +01:00
Fedor Isakov b02f3d727b Fix infinite loop on cyclic terms. Detect term cycles while walking on put/remove/retrieve. 2016-12-06 16:58:15 +01:00
Fedor Isakov 7fe7662873 Fix the failing match if case of the wrong constraints order. Test. 2016-11-23 15:55:45 +01:00
Fedor Isakov b4e9d45f7e Enforce the constraint transparency contract on bound logicals: treat the value as the constraint argument. Remove misbehaving test. 2016-10-13 11:07:27 +02:00
Fedor Isakov 030d474727 Itegrating the reactor API changes from the typechecker project. 2016-08-29 11:21:23 +02:00
Fedor Isakov f1238b4e30 Implement missing methods. 2016-08-29 10:53:44 +02:00
Fedor Isakov 5ed7b207ca Minor optimizations. Avoid calling toString() on symbols.
Avoid notifying on logical's value updated if the value is same.
Avoid calling unification on constraint/occurrence terms.
Some code cleanup.
2016-06-30 09:45:45 +02:00
Fedor Isakov 60cd075bf3 Specifying occurrence arguments to patternPredicates.
Correctly wrapping/unwrapping of arguments when matching rules.
Optimizing MatchTrie: process related occurrences first to avoid quadratic complexity.
2016-06-26 18:19:30 +02:00
Fedor Isakov 71810025e1 Itegrating the reactor API changes from the typechecker project. 2016-06-26 12:52:54 +02:00
Fedor Isakov 735c6b20e8 Switch to using JDK 1.8 for the project. 2016-06-24 14:22:22 +02:00
Fedor Isakov 34dc1208f3 Avoid runnig potentially unsafe code in finally{}, which can mask the original exception. 2016-06-24 14:21:36 +02:00
Fedor Isakov 2ae25c6756 Make use of LogicalOwner interface to avoid creating logicals that have other logical as value. 2016-06-24 14:20:42 +02:00
Fedor Isakov 64f332f5b0 Integrate the reactor API (imported from the typechecker project). 2016-06-24 14:17:54 +02:00
Fedor Isakov 61ef4ff4af Refactor the way logical's parent update are handled in the occurrence store, fix the broken update leading to corrupted store.
Ensure constraint occurrences are alive before reactivating.
2016-06-16 11:48:06 +02:00
Fedor Isakov 0699c7f6ad Move IdHashSet to util. 2016-06-16 11:46:39 +02:00
Fedor Isakov 8300fbb817 Optimization in occurrence store: avoid calling remove on TermTrie: very expensive. Some code cleanup and refactoring. 2016-06-08 11:17:38 +02:00
Fedor Isakov ed2ff61ec4 Reimplemented TermTrie using discrimination trees. 2016-06-06 16:18:49 +02:00
Fedor Isakov 57a76ad43c Fix memory leak 2016-06-02 12:20:00 +02:00
Fedor Isakov ab23988887 Profiling processing of occurrences. 2016-06-02 11:57:12 +02:00
Fedor Isakov 61b488aebd Cleaning up TermTrie code. 2016-06-02 11:56:14 +02:00
Fedor Isakov 8185605e99 Optimizing term trie and rules index. Using bitset to mark value tokens incidental with nodes in the "term superposition" of term trie. 2016-06-02 11:03:19 +02:00
Fedor Isakov 0f7ffd9141 Support for triggering arbitrary predicates on an occurrence match with a head's rule.
Properly handling constraint pattern/occurrence match with values/variables on either side using modal unificaiton.
2016-05-27 20:55:31 +02:00
Fedor Isakov d90c06f600 Unification feature: term wrapper to facilitate modal unification (such as b/w different meta levels). 2016-05-27 20:55:31 +02:00
Fedor Isakov 5c2b1539c9 TermTrie: introduce value tokens; ensure the value can be retrieved iff all the term's leaves match. 2016-05-27 20:55:31 +02:00
Fedor Isakov 1652eacfe3 Integrating TermTrie in the occurrence store. 2016-05-22 17:09:02 +02:00
Fedor Isakov e9969b08b7 Integrating TermTrie in the rules index, tests. 2016-05-22 15:44:35 +02:00
Fedor Isakov 82d5763039 TermTrie: maintaining the order of the values. 2016-05-19 20:31:05 +02:00
Fedor Isakov b42f005c7e TermTrie: supporting term variables. 2016-05-19 16:39:52 +02:00
Fedor Isakov a44366921b TermTrie: building an index of rules/occurrences from term values. Term variables not yet supported. 2016-05-18 15:44:56 +02:00
Fedor Isakov 0b689858b8 Restructure sources for reuse. 2016-05-17 11:51:40 +02:00
Fedor Isakov e1e642deca Optimizing logical observers manipulation: get rid of linear search. 2016-05-10 11:24:06 +02:00
Fedor Isakov 79e920c546 Refactoring utility classes to a separate package 2016-05-10 10:09:18 +02:00
Fedor Isakov b54673b5a8 Matcher optimizations: get rid of sequence and flatMap, re-implement iterating over MatchTrie using primitives, ensure no exponential search is necessary. 2016-05-10 10:04:32 +02:00
Fedor Isakov 261d414039 Fix unification for terms with references to external terms or vars, tests. 2016-04-28 12:13:01 +02:00
Fedor Isakov 22d208ee74 Two more optimizations in MatchTrie: early cutoff of deadend branches; ensure candidate occurrences match constraints. 2016-04-26 17:39:28 +02:00
Fedor Isakov b5f495d6f7 Another major optimization in the matcher: lazily initialize MatchTrie. Update OccurrenceStore on logical value updated. 2016-04-26 13:22:19 +02:00
Fedor Isakov 43e9b35e1e Some more minor optimizations in the match processing. Minor code refactorings. 2016-04-24 17:53:49 +02:00
Fedor Isakov 7095551b7f Minor optimization in the match processing. 2016-04-22 13:25:41 +02:00
Fedor Isakov 2d46cd9542 Rewritten Matcher to not rely on Sequence and flatMap, instead using MatchTrie. OccurrenceIndex interface made clear. Some minor code optimizations. 2016-04-21 20:49:06 +02:00
Fedor Isakov efc293b495 Switch to the latest version of Kotlin. 2016-04-17 15:47:41 +02:00
Fedor Isakov 90e28e7ac3 Major optimization in unifier: introduce InnerTerm, replace expensive calls with direct field access. 2016-04-16 20:50:06 +02:00
Fedor Isakov e2209fa93e Minor optimizations in unifier and matcher. 2016-04-16 19:23:19 +02:00
Fedor Isakov 8cb9c7af57 Minor optimizations and code cleanup in unification, removed dependency on dexx collections. 2016-04-15 15:39:34 +02:00
Fedor Isakov d0bf94fc91 Support body alternation in Handler. Adopt the changes in the API. 2016-04-15 13:59:23 +02:00
Fedor Isakov a290fe3c66 Integrate changes in the API: EvaluationSessionFauilure, alternation in Rule's body. 2016-04-11 15:32:43 +02:00
Fedor Isakov 678ab96773 Introduce HandlerFrame. Building the framework for supporting disjuctions in rule productions. 2016-04-08 16:02:28 +02:00
Fedor Isakov e55108030b Avoid dependency of Handler onto Solver. Access solver via the evaluation session. 2016-04-07 11:40:50 +02:00
Fedor Isakov d7c0060724 Make PropagationHistory persistent (functional). 2016-04-06 16:53:29 +02:00
Fedor Isakov a1a17426b7 Extract PropagationHistory. Code refactoring and cleanup in preparation to switching to persistent OccurrenceStore and Handler. 2016-04-06 13:23:04 +02:00
Fedor Isakov 15630b1582 Integrate changes in the API: EvaluationTrace. Updated the Handler to reflect the changes. 2016-03-17 13:45:50 +01:00
Fedor Isakov 8c103ddbd1 Integrate changes in the API imported from the Logic project. Change the code accordingly. 2016-03-16 16:26:25 +01:00
Fedor Isakov 1b9e919345 Optimizing hasData/getData, avoid calling String.intern() too often. Some API documentation. 2016-03-10 16:07:42 +01:00
Fedor Isakov c8812c139e Adopted the unification lib as part of this project. 2016-03-10 12:14:18 +01:00
Fedor Isakov 851dd6fe69 Imported mps-unification project.
Merge remote-tracking branch 'unification/master'
2016-03-09 16:58:45 +01:00
Fedor Isakov 4b1db276bc Switch to persistent set of IdWrapper. Minor adjustments in the profiling setup. 2016-03-09 16:03:53 +01:00
Fedor Isakov 6089f8c5ff Optimize selection of rules to try based on the values in the constraint arguments 2016-03-09 15:14:51 +01:00
Fedor Isakov 64591e113b Attempting optimizations in the matcher. Minor refactorings. 2016-03-08 11:40:31 +01:00
Fedor Isakov ec6ce31cc2 Propagation history feature, tests. Minor refactorings. 2016-03-07 15:23:57 +01:00
Fedor Isakov 63bb7f578d Ensure the null value is never exposed when merging variable (ground-free) 2016-03-03 16:42:09 +01:00
Fedor Isakov 701a434d69 Reactivate occurrences on union of var arguments. Tests. 2016-03-03 12:58:53 +01:00
Fedor Isakov 286fa4c5e6 Clean profiler data at the end of session run 2016-02-24 14:55:15 +01:00
Fedor Isakov 6cfa569663 Switch to the latest Kotlin RC 1050 2016-02-11 16:49:36 +01:00
Fedor Isakov d38373fc79 No more dumping of activation stack on an error 2016-02-11 16:33:35 +01:00
Fedor Isakov 619337151f Updated API sources from the latest version of Logic. Adapted to the new API. LogicalPattern -> MetaLogical. Renamed all *pattern entities. RuleBuilder for tests. 2016-01-29 14:41:57 +01:00
Fedor Isakov fb65c965c4 Switch to Kotlin 1.0.0 RC 2016-01-25 23:17:59 +01:00
Fedor Isakov 322485c046 Index occurrences by value.
Lookup of occurrences in the store is forced to match value OR logical (probably need both).
2016-01-25 18:00:18 +01:00
Fedor Isakov c557bbab97 Force occurrences matching with free logicals to fail if no occurrences with those logicals.
Fix occurrence store to always take the representative of a logical.
2016-01-25 14:17:38 +01:00
Fedor Isakov ed76bdae73 Optimizing looking up constraint occurrences to complete a match.
Parent observer for logicals, maintaining the logical-to-occurrence index in occurrence store.
Some code refactoring.
2016-01-24 20:45:46 +01:00
Fedor Isakov b8aa435eb4 Introduced Profiler to track bottlenecks. Some obvious optimizations. Refactoring for cleaner code. 2016-01-21 11:44:52 +01:00
Fedor Isakov 1dd3294483 Updated the unification lib to 1.0.2 2016-01-19 12:58:39 +01:00
Fedor Isakov a06502a684 Bumped up the package version to 1.0.2 2016-01-19 12:49:57 +01:00
Fedor Isakov d900284df2 Allow recursive references. Testing var-to-var unification. 2016-01-19 12:05:14 +01:00
Fedor Isakov caf7ba78f9 Make sure logical instances have unique symbols (a unification lib's requirement) 2016-01-19 12:03:55 +01:00
Fedor Isakov 945f1c12f5 Fix logical pattern to logical mapping. Various small fixes. 2016-01-13 23:21:16 +01:00
Fedor Isakov 3cf3f4b21d Updated API sources from the latest version of Logic. Adapted to the new API. Invocation/occurrence arguments. 2016-01-13 23:09:53 +01:00
Fedor Isakov bedb9592a0 Updated API sources from the latest version of Logic. Adapted to the new API. Activation stack. 2016-01-11 16:07:52 +01:00
Fedor Isakov e97b854f4c Updated API sources from the latest version of Logic. Adapted to the new API. 2016-01-09 02:14:10 +01:00
Fedor Isakov 057c4d7c69 Logical value observers. Testing reactivation of constraint occurrences. 2016-01-08 15:11:09 +01:00
Fedor Isakov b90bdc84c4 MemLogicalPattern. Switch to using MemLogical in tests. 2016-01-07 12:56:13 +01:00
Fedor Isakov 8aa6b04c70 Extract away program builder-related stuff: this part is going to be provided by the reactor's client 2016-01-07 12:07:55 +01:00
Fedor Isakov c3bfcc9311 Updated API sources from the latest version of Logic. Adapted to the new API. 2016-01-06 20:30:54 +01:00
Fedor Isakov 2dfe0db180 Ensure evaluation session is cleared on exit 2016-01-05 12:44:00 +01:00
Fedor Isakov 406c8c3af1 Updated the maven artifacts packaging 2015-12-28 10:35:40 +01:00
Fedor Isakov 2f38824ed5 Updated API sources from the latest version of Logic. Adapted to the new API. 2015-12-27 23:42:58 +01:00
Fedor Isakov 4710c85124 Testing the primes generating program. 2015-12-27 00:51:39 +01:00
Fedor Isakov b80da31c1b Testing and fixing the handler semantics. Drop matches with occurrences that are no longer alive. 2015-12-27 00:18:26 +01:00
Fedor Isakov bc7f266997 A test of gcd program. 2015-12-25 13:31:59 +01:00
Fedor Isakov c64bbfb240 Removed superfluous libs 2015-12-25 13:30:56 +01:00
Fedor Isakov 20948a859c First real program working 2015-12-25 10:32:05 +01:00
Fedor Isakov 49ebcab10d Testing EvaluationSession and SessionSolver 2015-12-24 19:15:40 +01:00
Fedor Isakov a58af2c921 Upgraded to the latest Kotlin beta 2015-12-23 16:43:37 +01:00
Fedor Isakov a3346ae57f Adapting to changes in the API. Implemented LogicalContext. Generifying code in tests. Testing LogicalPattern. 2015-12-23 16:26:35 +01:00
Fedor Isakov 53d7398e14 Updated API sources from the latest version of Logic 2015-12-23 16:24:29 +01:00
Fedor Isakov 51bcebfc01 Small refactorings and code cleanup in tests 2015-12-22 18:42:06 +01:00
Fedor Isakov c04ecab6d0 Switched to using LogicalContext for the rule matching, tests 2015-12-22 11:08:00 +01:00
Fedor Isakov 8de8f09325 Updated API sources from the latest version of Logic 2015-12-21 20:27:59 +01:00
Fedor Isakov 03787eb8fe Implemented rule matcher using unification lib.
Refactor the code into handler and matcher.
Tests separation and cleanup.
2015-12-18 22:28:36 +01:00
Fedor Isakov d1604d317f Hardcoded version in pom.xml everywhere, IDEA project structure auto-updated from pom's 2015-12-17 17:35:09 +01:00
Fedor Isakov 3efb0688c9 Updated API sources from the latest version of Logic 2015-12-17 17:28:59 +01:00
Fedor Isakov bf4d41f524 Updated the project structure, renamed build artefacts, current version 1.0.1. 2015-12-15 12:08:32 +01:00
Fedor Isakov ecc640258a Imported unification lib using maven via JitPack.io. Set up build using maven 2015-12-13 17:24:14 +01:00
Fedor Isakov 8f75050b2e Imported unification lib using maven via JitPack.io 2015-12-12 22:50:05 +01:00
Fedor Isakov 94746d4508 Introduce Maven project descriptors 2015-12-11 18:02:32 +01:00
Fedor Isakov 1c9ce1f5f5 Basic guards support. 2015-12-10 23:15:51 +01:00
Fedor Isakov d15f6908d5 Initial support for logicals. Small refactoring in tests. 2015-12-10 14:27:03 +01:00
Fedor Isakov fc372c1420 Initial support for expressions 2015-12-09 17:18:42 +01:00
Fedor Isakov a7708f3974 Adapting to the latest reactor API. RuleHandler and tests (no predicates yet). 2015-12-09 00:26:37 +01:00
Fedor Isakov 1ce311a0bf Update kotlin to the latest beta, make all dependencies on kotlin "compile" 2015-12-09 00:25:24 +01:00
Fedor Isakov fc49da63d8 Updated API sources from the latest version of Logic 2015-12-07 12:46:22 +01:00
Fedor Isakov e07f608b04 Implementing EvaluationSession 2015-12-03 21:55:03 +01:00
Fedor Isakov 50332e1e56 Added dexx library 2015-12-03 21:55:03 +01:00
Fedor Isakov 80b2cd5e4c Planning session implementation. Removed Bridge module 2015-12-03 21:55:03 +01:00
Fedor Isakov db3fc2b069 Updated API sources from the latest version of Logic 2015-12-03 21:55:03 +01:00
Fedor Isakov ff71c6f990 Rules builder using the Kotlin builder pattern 2015-11-22 22:35:54 +01:00
Fedor Isakov 77c827f8cd Started with tests. Switched to kotlin runtime+stdlib from Maven 2015-11-22 18:39:36 +01:00
Fedor Isakov 9632742625 Imported new sources for the API 2015-11-22 15:52:12 +01:00
Fedor Isakov 52c4df14ae Initial import. Kotlin libs 1.0 Beta 1103. Imported abstract constraints API from the Logic project 2015-11-20 14:55:48 +01:00
Fedor Isakov 27a42d9841 Report details if the unification failed 2015-08-12 16:13:27 +02:00
Fedor Isakov 14aa99a727 Terminology updated: children renamed to arguments 2015-08-01 14:17:53 +02:00
Fedor Isakov 5ee965a88d Renamed Node to Term, changed the API accordingly 2015-08-01 12:12:50 +02:00
Fedor Isakov 2fb992ead3 Dropped check for unreconciled refs, adapted the tests 2015-03-27 21:50:15 +01:00
Fedor Isakov 41077453e8 Reporting the cause of failed unification, some code cleanup 2015-03-24 16:20:40 +01:00
Fedor Isakov 80d16b592d Ensure cyclic terms in the solution are fully reconciled, some tests and code cleanup 2015-03-24 11:49:06 +01:00
Fedor Isakov 690e2929bb Ensure the data is associated with nodes using identity, except variables, which are identified by symbol 2015-03-22 15:10:41 +01:00
Fedor Isakov 004480ca70 Now allowing REF nodes to point to variables too, adapted the algorithm, removed obsolete interfaces, created more tests 2015-03-20 12:57:35 +01:00
Fedor Isakov 09e0fd00b7 Fixed variables order, removing usages of the obsolete interface, code cleanup 2015-03-19 17:31:08 +01:00
Fedor Isakov 868d82c1db Made the Node's inner enum explicitly public (MPS wrongly assumes it to be package local) 2015-03-18 11:56:58 +01:00
Fedor Isakov 28387e683b Introduced unification of cyclic terms, redesigned the algorithm, refactored the API, wrote a bunch of tests 2015-03-18 11:21:03 +01:00
Fedor Isakov 83eb1ca827 A couple more tests 2015-03-08 15:13:33 +01:00
Fedor Isakov 4e1abad452 Avoid infinite recursion: replace the variables without calling the method recursively 2015-02-03 18:33:21 +01:00
Fedor Isakov 928f0cb273 Sorting the order of variables in a binding in case of a var->var substitution; some tests 2015-02-03 16:34:39 +01:00
Fedor Isakov db6c89afa2 Ignore list 2014-07-21 16:08:22 +02:00
Fedor Isakov c5da28e059 Slightly better API, changed the tests's package 2014-07-21 16:06:25 +02:00
Fedor Isakov ffedd78988 Unification fails in case two terms' children's sizes are different 2014-07-09 14:34:08 +02:00
Fedor Isakov 1c7fd82419 Testing parsing mutiple nodes 2014-07-09 13:50:12 +02:00
Fedor Isakov 49c96f1526 Better Node API, cleaner code 2014-07-03 19:06:39 +02:00
Fedor Isakov 69f9844b12 Published with https://stackedit.io/ 2014-06-11 10:00:22 -07:00
Fedor Isakov 0003e1c7f3 Published with https://stackedit.io/ 2014-06-11 09:45:47 -07:00
Fedor Isakov 8d8b6ab817 Initial commit 2014-06-11 18:21:31 +02:00