Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATL transformation optimization #1

Open
wants to merge 426 commits into
base: master
Choose a base branch
from

Conversation

saahilh
Copy link

@saahilh saahilh commented Sep 18, 2019

Reworked version of the code where all test cases except RemainingTestCases should produce the correct outputs.

Removed it as I feel readability is better without it.
This update adds in some code from a more recent version of Turn2Urn.
There are a few changes in how beliefs are handled here.
Reworked tUCMmap logic to use a global variable rather than passing in
tUCMmap as an argument to almost every rule. Fixed a typo where tUCMmap
was passed as an argument to createTimer twice.
Removed processNode as it was only being called in one location and no
longer encapsulated very much logic.
handleNode: removed some variables to increase readability. handleConnectNode - replaced some tUCMmap.get calls with retrieveNode calls
Removed the processNode rule as it had little logic and was only being used once after
the most recent reduction so I moved that logic directly into place.
Removed some conditions after testing to see if the branches impacted the code
in any manner as I suspected that there may have been equivalencies in
calls to -> select vs. calls to -> any. Modified a conditional in UCMmap2UCMmap to
make a pathnodes existence check explicit
Removed a lot of logic that seemed to be doing nothing (unnecessary
arguments, unneeded conditionals). Cleaned up processFirstNode so that the argument "path" only contains
Turn!PathBodyNodes as arguments rather than at times containing a
Turn!Path as in the previous implementation.
Removed processTimer logic from retrieveNode as a getter method should
not be modifying the state of the system. Made more calls to
retrieveNode and discovered a bug caused by attempting to get items with
null names from the tUCMmap by name. This is now resolved in some cases
by adding those calls to retrieveNode. Added comment explaining the else
case of retrieveNode,
Made calls to retrieveNode wherever it did not change the output of the
system to streamline getting nodes. Calls are now made in place of
tUCMmap.getNode in all places where it does not imapct the output. Some
resolveTemps have also been replaced with such calls. Commeneted out
some code that didn't seem to be changing the output of the system in
any tests.
Cleaned up some formatting in Turn2Urn, made a few more calls to
retrieveNode, wrote the processBinding method to modularize some code in
InBinding2InBinding and OutBinding2OutBinding, though at present I'm not sure this
section of code actually impacts the system.
Cleaned up some formatting. Remove createOrForkNodeConnection rule as it is clearer to just use createNodeConnection and assign
the condition afterwards - the rule was a special case with an argument,
but this argument was only being used in two of four cases anyhow.
Updated processOrFork accordingly.
Attempting to find repeated sections of code to remove conditionals
where not required. Some of these have appeared after my adding
retrieveNode calls. Also commeneted out some code that didn't seem to be
doing anything.
Moved around a rule, commented out more lines that didn't seem to affect
the final output produced. Removed some lines. Refactored two more cases
to use retrieveNode. Changed an ORFORK/TIMER conditional to remove the
AndFork case as this casued incorrect handling of some adding of predecessors.
Rework so that predecessors are no longer passed in as an argument.
Having to declare them explicitly elsewhere will make reading the code
more easy. Also replaced another resolveTemp for a retrieveNode and
commented out more code that didn't seem to modify the state of the
system in any test.
Fixes to logic in processAndFork, processOrFork, and processStub by
rearranging some statements. Reworked a little logic in processStub for
readability.
Moved some logic in handleFirstNode to centralize a case in one conditional.
Commented out some logic in both handleNode and handleRegularEnds as it wasn't changing the outputs produced.
Reworked by creating getNodeTarget rule. This was necessary because
retrieveNode was slowing build times due to the large number of
conditions it had. Spreading this logic out was necessary.
OrForks and Stubs are now added to their UCMmap at the start of their process methods rather than at the end.
This corrects some logical errors that were occurring when producing their outputs.
Wrote connectNodesAfterFork to encapsulate some functionality in
processAndFork and processOrFork.
Uncommented an addPred line to fix some logic.
Modularized retrieval of elements used for conditions to increase readability.
@saahilh saahilh self-assigned this Feb 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant