Last active
October 15, 2020 09:40
-
-
Save okram/ec1fd7d07f375a4c2a5a61fae34a1f77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mmlang> :[model,pg_2] // load property graph demo model #2 | |
==>_ | |
mmlang> 4 ~~> int // what is the path from 4 to int? simply int. | |
==>((int))<=4[walk,int] | |
mmlang> 4 ~~> str // what is the path from 4 to str? this is none. no ".toString()" | |
==>( ) | |
mmlang> :[model,pg_2][define,str<=int] // lets define ".toString()" | |
==>_[define,str<=int] | |
mmlang> 4 ~~> str // what is the path from 4 to str? int then str | |
==>((int;str))<=4[walk,str] | |
mmlang> 4 ~~> vertex // what is the path from 4 to vertex? split the 4 across a vertex record | |
==>((int;[split,('id'->int)];vertex))<=4[walk,vertex] | |
// new lines (\n) below I added manually to ease readability. | |
mmlang> (5;6) ~~> (vertex;vertex) // what about a pair of ints to a pair of vertices? | |
==>(((int;int);(vertex;vertex); | |
[combine,(vertex<=int[split,('id'->int)];vertex<=int[split,('id'->int)])];(vertex;vertex))) | |
<=(5;6)[walk,(vertex;vertex)] | |
mmlang> (5;6) ~~> edge // how about a pair of ints to an edge (which is a type referent to a rec product -- ismorphism of products) | |
==>(((int;int);(vertex;vertex); | |
[combine,(vertex<=int[split,('id'->int)];vertex<=int[split,('id'->int)])]; | |
[split,('outV'->vertex<=(vertex;vertex)[get,0,_],'inV'->vertex<=(vertex;vertex)[get,1,_])];edge)) | |
<=(5;6)[walk,edge] | |
mmlang> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I wake up, I'll demo the abelian group which are
,-lst
polys
… They represent branches in a path. Together, apoly
structure of the form((;;),(;;),(;;))
monoid ring — or, when only containing types (no instructions), its a classic polynomial w/ coefficients.https://www.mm-adt.org/vm/#_poly_controls