-
Notifications
You must be signed in to change notification settings - Fork 2
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
Symbolic Compositional Resource Sharers #136
Conversation
I like the approach here to supporting namespaced variables, but I really think that people will get confused by the name Package not referring to a package of code. Can we use Namespace or Names instead of package? |
Agreed on the name. I think it's too confusing. |
I'm happy not calling it Package, but I don't like namespace. The point is that |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #136 +/- ##
==========================================
- Coverage 93.85% 92.14% -1.71%
==========================================
Files 38 42 +4
Lines 2229 2802 +573
==========================================
+ Hits 2092 2582 +490
- Misses 137 220 +83 ☔ View full report in Codecov by Sentry. |
…y definition, but a test in models is now broken
…what cleaned up after my debugging.
…being created but it needs clean up and review.
…gSort} type issue when reidenting MethodResolver
named tuple types sketch of road to dynamical systems updated roadmap resource sharers sketch ENH: basic @algebraic macro In order to make symbolic ODEs, we first have to have symbolic functions. This commit is the first step towards that, introducing the `@algebraic` macro which makes a DSL for introducing symbolic functions. These hook into the Julia scope system, so they can conveniently call other symbolic functions which happen to be in scope. BUG: return the closure not the method from @algebraic This is a very small change to the previous commit. We still need to write some extensive tests for `@algebraic` rhizome composition initiated ocompose is written, but we have to make an easy way of writing down rhizomes before we can test it in any serious way. Along the way, several useful utilities to work with Tries have been added. rhizome macro oapply for resource sharers works on the happy path! added docs for resource sharers started nonemptytrie refactor more principled approach to empty tries We want a trie to be uniquely determined by the set of valid TrieVars that it supports. If we allow there to be empty branches, i.e. corresponding to the named tuple `(a::(b::()))`, then this has no valid paths in it, but is different from `()`. To solve this, we make two types: `Trie` and `NonEmptyTrie`. The recursive case is `NonEmptyTrie`: a `Trie` is just a wrapper around `Union{Nothing, NonEmptyTrie{A}}`. This was inspired by the way yuujinchou works. Also new in this commit is the use of MLStyle active patterns to make pattern matching on tries cleaner. This is a huge upgrade to the previous way we were doing things, and I think that we should use more active patterns in the future throughout GATlab, for pattern matching on unityped data. See the active patterns Leaf, Node, Empty, Root, Nested in src/syntax/Tries.jl for more information. fixup: make more things work for the trie refactor fixup: add tests and docs for Trie methods fix: wrapped dot accessor in quotenode The code `a.b` is represented as a Julia expression by `Expr(:(.), :a, QuoteNode(:b))`, not `Expr(:(.), :a, :b)`. The former will produce a undefined variable error because it tries to look up `b`. fix: move tries to util and include tries tests fixup: added resource sharers to nonstdlib tests test: addressed missing coverage for Tries.jl fix: can't use keys as a variable name at the top level fix: added orderedcollections to test env doc+test
This PR is for the draft of symbolic, compositional resource sharers, and also includes a new namespacing mechanism via Tries.