Skip to content

Refactor BasicSymbolic struct to separate metadata from hash consing #704

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

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2ab70b3
Create `BasicSymbolicImpl` struct to separate metadata from hash consing
bowenszhu Feb 13, 2025
17408e8
Rename `BasicSymbolicImpl` field from `impl` to `expr`
bowenszhu Feb 13, 2025
295a1df
Adapt `BasicSymbolic` hash consing constructor
bowenszhu Feb 13, 2025
1fe09e5
Adapt `setproperties` with new `BasicSymbolic` struct
bowenszhu Feb 13, 2025
b4932e6
Call custom constructor of `Mul` in `maybe_intcoeff`
bowenszhu Feb 13, 2025
9da1a9e
Fix: `hash2` of `BasicSymbolic` equals its `BasicSymbolicImpl`
bowenszhu Feb 13, 2025
56c990c
Operate CSE `topological_sort` `dfs` on `BasicSymbolicImpl`
bowenszhu Feb 13, 2025
4fadeab
Add `isexpr` & `iscall` methods for `BasicSymbolicImpl`
bowenszhu Feb 13, 2025
d7737dd
Remove `metadata` from `hash2`
bowenszhu Feb 13, 2025
65cc88f
Change `Base.isequal` for `BasicSymbolicImpl`
bowenszhu Feb 14, 2025
df49641
Modify flyweight factory for `BasicSymbolicImpl`
bowenszhu Feb 14, 2025
db30dc8
Create `MetadataImpl` struct to keep track of metadata tree
bowenszhu Feb 17, 2025
580ad33
Modify `getproperty(::BasicSymbolic)` for metadata
bowenszhu Feb 17, 2025
831f8fc
Add `isequal` method for `MetadataImpl`
bowenszhu Feb 17, 2025
29a6eb4
Modify `isequal_with_metadata` with new `BasicSymbolic` structure
bowenszhu Feb 17, 2025
f8d0e78
Add `getmetadata` methods bc `metadata` kwarg takes outer-scope function
bowenszhu Feb 17, 2025
e9f4ff8
Modify `BasicSymbolic` constructors with new struct structure
bowenszhu Feb 17, 2025
5293e98
Add `metadata_children` function for accessing metadata tree
bowenszhu Feb 17, 2025
4373146
Modify hash consing tests with new `BasicSymbolic` struct
bowenszhu Feb 17, 2025
4a99619
Modify rewrite metadata tests
bowenszhu Feb 17, 2025
440c17b
Refactor `-(::SN, ::SN)` for easier debugging
bowenszhu Feb 20, 2025
4d00726
Make `BasicSymbolicImpl` children `BasicSymbolicImpl`
bowenszhu Feb 20, 2025
2fcac04
Make `getproperty` return `BasicSymbolic` if applicable
bowenszhu Feb 20, 2025
d03e0ef
`arguments` wraps `BasicSymbolicImpl` and `MetadataImpl`
bowenszhu Feb 20, 2025
2eae851
Revert "Add `metadata_children` function for accessing metadata tree"
bowenszhu Feb 20, 2025
cc5e273
Revert "Modify rewrite metadata tests"
bowenszhu Feb 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/code.jl
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,9 @@ function topological_sort(graph)
visited = IdDict()

function dfs(node)
if node isa BasicSymbolic
node = node.expr
end
if haskey(visited, node)
return visited[node]
end
Expand Down
Loading
Loading