Skip to content

Refactor Module.hs DFS logic - #190

Open
langfield wants to merge 9 commits into
aemartinez/assert-testsfrom
langfield/module-refactor-redux
Open

Refactor Module.hs DFS logic#190
langfield wants to merge 9 commits into
aemartinez/assert-testsfrom
langfield/module-refactor-redux

Conversation

@langfield

@langfield langfield commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

We're doing DFS, so let's try to make it look more like a standard DFS implementation. This PR removes the entire ModuleL free monad and eDSL.

@langfield
langfield force-pushed the langfield/module-refactor-redux branch 8 times, most recently from bb5db53 to 91d3c08 Compare March 26, 2023 12:33
@langfield

langfield commented Mar 26, 2023

Copy link
Copy Markdown
Contributor Author

This needs a test where we have multiple @assert annotations.

A test like this has been written in #153. Thus the merge base should be changed.

@langfield
langfield force-pushed the langfield/module-refactor-redux branch 2 times, most recently from bb5db53 to 1db64b9 Compare March 28, 2023 15:36
@langfield
langfield changed the base branch from master to aemartinez/assert-tests March 29, 2023 14:19
* `m_prog` -> `m_instrs`
* `branchesByCallStackAndIfPc` -> `ifThenElseOutcomes`
* `IfThenElseBranchMap` -> `IfThenElseOutcomeMap`
* Don't use explicit import lists for qualified imports
* Refactor some docstrings
* Rearrange functions in `Module.hs`
* Replace `visitArcs` with `visitArc`
* Remove `visitLoop` and `visitLinear` and `extractPlainBuilder`.
* Make `gatherModules` return `ModuleL [Module]`
@langfield
langfield force-pushed the langfield/module-refactor-redux branch from 1db64b9 to cd01fff Compare March 29, 2023 14:29
@langfield

Copy link
Copy Markdown
Contributor Author

DO NOT MERGE!

@langfield
langfield force-pushed the langfield/module-refactor-redux branch 6 times, most recently from fcf7e87 to 35dcf11 Compare March 30, 2023 12:19
This commit restructures the control flow of the `visit` function in
`Module.hs`, reducing the number of cases.

* Remove `IfThenElseOutcomeMap` from `VertexContext` in `Module.hs`
* Rename some variables in `visit` function in `Module.hs`
* Use `&&` instead of `,` in guard within `Module.hs`
* Rename `acc` -> `insts` in `visit`
* Rename `test` -> `arcCond'`
* Make `visitArcs` unary.
Rename some stuff:
* `preOfPrevVertex` -> `pre`
@langfield
langfield force-pushed the langfield/module-refactor-redux branch from 35dcf11 to c3e9bef Compare March 30, 2023 12:43
Change structure of sources:
* `(Function, ScopedName, FuncSpec)` -> `(ScopedFunction, FuncSpec)`

We also get rid of `gatherModules`, replaced with `gatherModulesForF`,
which is only for a single function.

* Remove `Module/Runner.hs` from `horus-check.cabal`
@langfield

Copy link
Copy Markdown
Contributor Author

DO NOT MERGE! 💢 ☠️

@langfield
langfield force-pushed the langfield/module-refactor-redux branch from c3e9bef to 2cc3ee4 Compare March 30, 2023 15:01
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.

1 participant