-
Notifications
You must be signed in to change notification settings - Fork 4
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
Graph to refer to values, not just addresses #1267
Comments
Directly Relevant:
|
Initial Experiment:
And pushing "reasonable" additional code through the rest of I am currently uncertain as to how much benefit we'd get from making this an existential. When a vertex is associated with an expression (as opposed to a value), we can simply have the Add
|
I've started pushing the
I'm unsure how to deal with this, right now it feels a little odd to make @rolyp do you have any thoughts on whether I should try and figure out how to solve this, or is it worth pushing the Edit: performance wise, it doesn't appear to have an impact because
|
Introducing the new method to the |
Try introducing the new method via a new typeclass |
@JosephBond For replacing the asVal :: VertexData -> Maybe (Val Vertex)
asVal (VertexData e) =
-- use `typeName e` to decide whether `e` contains a value
-- if so then `unsafeCoerce` Then our predicate on vertices will be some other |
Hi @JosephBond. Before continuing with #1279, let’s get this merged into |
We should probably change the graph representation so that it “stores” (or rather points to) values rather than just holding their addresses. Currently there is no representation of the “term graph” (the values/expressions themselves construed as graphs, not the DDG) as an explicit map from vertices to “contents”, so there is no way to go back from an arbitrary graph vertex to the actual value at that address.
So although conceptually there is a forest of values constructed during graph evaluation, they “float free” of the graph and aren’t actually reachable from the graph itself. Under the proposed new design, the graph will “cut across” this forest of values. I think this is necessary if we want to navigate to the values associated with intermediate vertices.
Initial thoughts:
Dict
that maps vertices (strings) to sets of target vertices. The keys currently have to be strings, so the value/expression associated with that key would thus have to be considered part of the entry (along with the set of target vertices). Maybe we could just store theBaseVal
.new
helper for building an edge would have to take theBaseVal
as an argument.See also:
Done/Dropped:
new
to take a constructor and the contents to be placed in aVertexData
to return the constructed value containing the fresh vertex, and to modify theNewtype
wrappers forDictionary
keys, andMatrix
indicesVertices'
instances for theseNewtype
‘sRefactor type ofHyperEdge
fromDVertex × Set Vertex
toDVertex × Set DVertex
Show
constraint with a more appropriate one (e.g.TypeName
, see below)unDVertex
toaddresses
unPack
->unpack
vertices
implementationThe text was updated successfully, but these errors were encountered: