Skip to content

Instantly share code, notes, and snippets.

@kai-qu
Last active July 7, 2018 20:02
Show Gist options
  • Save kai-qu/ffa9bf53d3a1c0850eeea82d6e7eceb2 to your computer and use it in GitHub Desktop.
Save kai-qu/ffa9bf53d3a1c0850eeea82d6e7eceb2 to your computer and use it in GitHub Desktop.
Result of `runpenrose paper-eval/linear-algebra-maps.sub paper-eval/linear-algebra.sty paper-eval/linear-algebra.dsl` on branch `new-style` after commit 40d96a3
{ trMap =
fromList
[ ( Sub "CANVAS"
, fromList
[ ( "height" , FExpr (OptEval (IntLit 400)) )
, ( "width" , FExpr (OptEval (IntLit 200)) )
]
)
, ( Sub "Colors"
, fromList
[ ( "blue"
, FExpr
(OptEval
(CompApp "rgba" [ IntLit 0 , IntLit 0 , IntLit 100 , IntLit 1 ]))
)
, ( "gray"
, FExpr
(OptEval
(CompApp
"rgba" [ IntLit 20 , IntLit 20 , IntLit 20 , AFloat (Fix 0.5) ]))
)
, ( "red"
, FExpr
(OptEval
(CompApp "rgba" [ IntLit 100 , IntLit 0 , IntLit 0 , IntLit 1 ]))
)
]
)
, ( Sub "LineStyles"
, fromList [ ( "curved" , FExpr (OptEval (CompApp "curved" [])) ) ]
)
, ( Sub "U"
, fromList
[ ( "angle"
, GPI
Arc2
(fromList
[ ( "from"
, OptEval (EPath (FieldPath (BSubVar (VarConst "U")) "x_axis"))
)
, ( "to"
, OptEval (EPath (FieldPath (BSubVar (VarConst "U")) "y_axis"))
)
])
)
, ( "labelFn"
, FExpr
(OptEval
(ObjFn
"topLeft"
[ EPath (FieldPath (BSubVar (VarConst "U")) "text")
, EPath (FieldPath (BSubVar (VarConst "U")) "shape")
]))
)
, ( "origin"
, GPI
AnchorPoint
(fromList
[ ( "location"
, OptEval
(CompApp
"intersection"
[ EPath (FieldPath (BSubVar (VarConst "U")) "x_axis")
, EPath (FieldPath (BSubVar (VarConst "U")) "y_axis")
])
)
])
)
, ( "shape"
, GPI
Rectangle
(fromList
[ ( "dim"
, OptEval
(CompApp
"bbox"
[ EPath (FieldPath (BSubVar (VarConst "U")) "x_axis")
, EPath (FieldPath (BSubVar (VarConst "U")) "y_axis")
])
)
])
)
, ( "x_axis"
, GPI
Arrow
(fromList
[ ( "angle" , OptEval (IntLit 0) )
, ( "length"
, OptEval
(BinOp
Multiply
(AFloat (Fix 0.3))
(EPath (FieldPath (BStyVar (StyVar' "CANVAS")) "width")))
)
])
)
, ( "y_axis"
, GPI
Arrow
(fromList
[ ( "angle" , OptEval (IntLit 90) )
, ( "length"
, OptEval
(CompApp
"len" [ EPath (FieldPath (BSubVar (VarConst "U")) "x_axis") ])
)
, ( "pos"
, OptEval
(CompApp
"midpoint"
[ EPath (FieldPath (BSubVar (VarConst "U")) "x_axis") ])
)
])
)
]
)
, ( Sub "V"
, fromList
[ ( "angle"
, GPI
Arc2
(fromList
[ ( "from"
, OptEval (EPath (FieldPath (BSubVar (VarConst "V")) "x_axis"))
)
, ( "to"
, OptEval (EPath (FieldPath (BSubVar (VarConst "V")) "y_axis"))
)
])
)
, ( "labelFn"
, FExpr
(OptEval
(ObjFn
"topLeft"
[ EPath (FieldPath (BSubVar (VarConst "V")) "text")
, EPath (FieldPath (BSubVar (VarConst "V")) "shape")
]))
)
, ( "origin"
, GPI
AnchorPoint
(fromList
[ ( "location"
, OptEval
(CompApp
"intersection"
[ EPath (FieldPath (BSubVar (VarConst "V")) "x_axis")
, EPath (FieldPath (BSubVar (VarConst "V")) "y_axis")
])
)
])
)
, ( "shape"
, GPI
Rectangle
(fromList
[ ( "dim"
, OptEval
(CompApp
"bbox"
[ EPath (FieldPath (BSubVar (VarConst "V")) "x_axis")
, EPath (FieldPath (BSubVar (VarConst "V")) "y_axis")
])
)
])
)
, ( "x_axis"
, GPI
Arrow
(fromList
[ ( "angle" , OptEval (IntLit 0) )
, ( "length"
, OptEval
(BinOp
Multiply
(AFloat (Fix 0.3))
(EPath (FieldPath (BStyVar (StyVar' "CANVAS")) "width")))
)
])
)
, ( "y_axis"
, GPI
Arrow
(fromList
[ ( "angle" , OptEval (IntLit 90) )
, ( "length"
, OptEval
(CompApp
"len" [ EPath (FieldPath (BSubVar (VarConst "V")) "x_axis") ])
)
, ( "pos"
, OptEval
(CompApp
"midpoint"
[ EPath (FieldPath (BSubVar (VarConst "V")) "x_axis") ])
)
])
)
]
)
, ( Sub "W"
, fromList
[ ( "angle"
, GPI
Arc2
(fromList
[ ( "from"
, OptEval (EPath (FieldPath (BSubVar (VarConst "W")) "x_axis"))
)
, ( "to"
, OptEval (EPath (FieldPath (BSubVar (VarConst "W")) "y_axis"))
)
])
)
, ( "labelFn"
, FExpr
(OptEval
(ObjFn
"topLeft"
[ EPath (FieldPath (BSubVar (VarConst "W")) "text")
, EPath (FieldPath (BSubVar (VarConst "W")) "shape")
]))
)
, ( "origin"
, GPI
AnchorPoint
(fromList
[ ( "location"
, OptEval
(CompApp
"intersection"
[ EPath (FieldPath (BSubVar (VarConst "W")) "x_axis")
, EPath (FieldPath (BSubVar (VarConst "W")) "y_axis")
])
)
])
)
, ( "shape"
, GPI
Rectangle
(fromList
[ ( "dim"
, OptEval
(CompApp
"bbox"
[ EPath (FieldPath (BSubVar (VarConst "W")) "x_axis")
, EPath (FieldPath (BSubVar (VarConst "W")) "y_axis")
])
)
])
)
, ( "x_axis"
, GPI
Arrow
(fromList
[ ( "angle" , OptEval (IntLit 0) )
, ( "length"
, OptEval
(BinOp
Multiply
(AFloat (Fix 0.3))
(EPath (FieldPath (BStyVar (StyVar' "CANVAS")) "width")))
)
])
)
, ( "y_axis"
, GPI
Arrow
(fromList
[ ( "angle" , OptEval (IntLit 90) )
, ( "length"
, OptEval
(CompApp
"len" [ EPath (FieldPath (BSubVar (VarConst "W")) "x_axis") ])
)
, ( "pos"
, OptEval
(CompApp
"midpoint"
[ EPath (FieldPath (BSubVar (VarConst "W")) "x_axis") ])
)
])
)
]
)
, ( Sub "X"
, fromList
[ ( "angle"
, GPI
Arc2
(fromList
[ ( "from"
, OptEval (EPath (FieldPath (BSubVar (VarConst "X")) "x_axis"))
)
, ( "to"
, OptEval (EPath (FieldPath (BSubVar (VarConst "X")) "y_axis"))
)
])
)
, ( "labelFn"
, FExpr
(OptEval
(ObjFn
"topLeft"
[ EPath (FieldPath (BSubVar (VarConst "X")) "text")
, EPath (FieldPath (BSubVar (VarConst "X")) "shape")
]))
)
, ( "origin"
, GPI
AnchorPoint
(fromList
[ ( "location"
, OptEval
(CompApp
"intersection"
[ EPath (FieldPath (BSubVar (VarConst "X")) "x_axis")
, EPath (FieldPath (BSubVar (VarConst "X")) "y_axis")
])
)
])
)
, ( "shape"
, GPI
Rectangle
(fromList
[ ( "dim"
, OptEval
(CompApp
"bbox"
[ EPath (FieldPath (BSubVar (VarConst "X")) "x_axis")
, EPath (FieldPath (BSubVar (VarConst "X")) "y_axis")
])
)
])
)
, ( "x_axis"
, GPI
Arrow
(fromList
[ ( "angle" , OptEval (IntLit 0) )
, ( "length"
, OptEval
(BinOp
Multiply
(AFloat (Fix 0.3))
(EPath (FieldPath (BStyVar (StyVar' "CANVAS")) "width")))
)
])
)
, ( "y_axis"
, GPI
Arrow
(fromList
[ ( "angle" , OptEval (IntLit 90) )
, ( "length"
, OptEval
(CompApp
"len" [ EPath (FieldPath (BSubVar (VarConst "X")) "x_axis") ])
)
, ( "pos"
, OptEval
(CompApp
"midpoint"
[ EPath (FieldPath (BSubVar (VarConst "X")) "x_axis") ])
)
])
)
]
)
, ( Sub "a"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"centered"
[ EPath (FieldPath (BSubVar (VarConst "a")) "text")
, EPath (FieldPath (BSubVar (VarConst "a")) "shape")
]))
)
, ( "layering"
, FExpr
(OptEval
(Layering
(LayeringOp
Less
(LayeringOp
Less
(LId (BSubVar (VarConst "U")))
(LId (BSubVar (VarConst "U"))))
(LayeringOp
Less
(LId (BSubVar (VarConst "U")))
(LId (BSubVar (VarConst "U")))))))
)
, ( "shape"
, GPI
Parallel
(fromList
[ ( "opacity" , OptEval (AFloat (Fix 0.5)) )
, ( "side1"
, OptEval (EPath (FieldPath (BSubVar (VarConst "u1")) "shape"))
)
, ( "side2"
, OptEval (EPath (FieldPath (BSubVar (VarConst "u3")) "shape"))
)
])
)
, ( "val"
, FExpr
(OptEval
(CompApp
"determinant"
[ EPath (FieldPath (BSubVar (VarConst "u1")) "val")
, EPath (FieldPath (BSubVar (VarConst "u3")) "val")
]))
)
]
)
, ( Sub "c"
, fromList
[ ( "val" , FExpr (OptEval (CompApp "sampleReal" [])) ) ]
)
, ( Sub "f"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"nearCenter"
[ EPath (FieldPath (BSubVar (VarConst "f")) "text")
, EPath (FieldPath (BSubVar (VarConst "f")) "shape")
]))
)
, ( "posFn"
, FExpr
(OptEval
(ObjFn
"between"
[ EPath (FieldPath (BSubVar (VarConst "f")) "shape")
, EPath (FieldPath (BSubVar (VarConst "U")) "shape")
, EPath (FieldPath (BSubVar (VarConst "V")) "shape")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "from"
, OptEval (EPath (FieldPath (BSubVar (VarConst "U")) "shape"))
)
, ( "style"
, OptEval
(EPath (FieldPath (BStyVar (StyVar' "LineStyles")) "curved"))
)
, ( "to"
, OptEval (EPath (FieldPath (BSubVar (VarConst "V")) "shape"))
)
])
)
, ( "val"
, FExpr (OptEval (CompApp "sampleMatrix" [ IntLit 2 , IntLit 2 ]))
)
]
)
, ( Sub "g"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"nearCenter"
[ EPath (FieldPath (BSubVar (VarConst "g")) "text")
, EPath (FieldPath (BSubVar (VarConst "g")) "shape")
]))
)
, ( "posFn"
, FExpr
(OptEval
(ObjFn
"between"
[ EPath (FieldPath (BSubVar (VarConst "g")) "shape")
, EPath (FieldPath (BSubVar (VarConst "V")) "shape")
, EPath (FieldPath (BSubVar (VarConst "W")) "shape")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "from"
, OptEval (EPath (FieldPath (BSubVar (VarConst "V")) "shape"))
)
, ( "style"
, OptEval
(EPath (FieldPath (BStyVar (StyVar' "LineStyles")) "curved"))
)
, ( "to"
, OptEval (EPath (FieldPath (BSubVar (VarConst "W")) "shape"))
)
])
)
, ( "val"
, FExpr (OptEval (CompApp "sampleMatrix" [ IntLit 2 , IntLit 2 ]))
)
]
)
, ( Sub "h"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"nearCenter"
[ EPath (FieldPath (BSubVar (VarConst "h")) "text")
, EPath (FieldPath (BSubVar (VarConst "h")) "shape")
]))
)
, ( "posFn"
, FExpr
(OptEval
(ObjFn
"between"
[ EPath (FieldPath (BSubVar (VarConst "h")) "shape")
, EPath (FieldPath (BSubVar (VarConst "W")) "shape")
, EPath (FieldPath (BSubVar (VarConst "X")) "shape")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "from"
, OptEval (EPath (FieldPath (BSubVar (VarConst "W")) "shape"))
)
, ( "style"
, OptEval
(EPath (FieldPath (BStyVar (StyVar' "LineStyles")) "curved"))
)
, ( "to"
, OptEval (EPath (FieldPath (BSubVar (VarConst "X")) "shape"))
)
])
)
, ( "val"
, FExpr (OptEval (CompApp "sampleMatrix" [ IntLit 2 , IntLit 2 ]))
)
]
)
, ( Sub "m"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"aligned"
[ EPath (FieldPath (BSubVar (VarConst "m")) "text")
, EPath (FieldPath (BSubVar (VarConst "m")) "shape")
]))
)
, ( "shape"
, GPI
CurlyBrace
(fromList
[ ( "along"
, OptEval (EPath (FieldPath (BSubVar (VarConst "v2")) "shape"))
)
, ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "gray"))
)
])
)
, ( "val"
, FExpr
(OptEval
(CompApp
"len" [ EPath (FieldPath (BSubVar (VarConst "v2")) "shape") ]))
)
]
)
, ( Sub "u1"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"near"
[ EPath (FieldPath (BSubVar (VarConst "u1")) "text")
, EPath (PropertyPath (BSubVar (VarConst "u1")) "shape" "head")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "blue"))
)
, ( "head"
, OptEval (EPath (FieldPath (BSubVar (VarConst "u1")) "val"))
)
, ( "tail"
, OptEval (EPath (FieldPath (BSubVar (VarConst "U")) "origin"))
)
])
)
, ( "val"
, FExpr
(OptEval
(CompApp
"sampleVectorIn"
[ EPath (FieldPath (BSubVar (VarConst "U")) "shape") ]))
)
]
)
, ( Sub "u2"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"near"
[ EPath (FieldPath (BSubVar (VarConst "u2")) "text")
, EPath (PropertyPath (BSubVar (VarConst "u2")) "shape" "head")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "blue"))
)
, ( "head"
, OptEval (EPath (FieldPath (BSubVar (VarConst "u2")) "val"))
)
, ( "tail"
, OptEval (EPath (FieldPath (BSubVar (VarConst "U")) "origin"))
)
])
)
, ( "val"
, FExpr
(OptEval
(CompApp
"sampleVectorIn"
[ EPath (FieldPath (BSubVar (VarConst "U")) "shape") ]))
)
]
)
, ( Sub "u3"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"near"
[ EPath (FieldPath (BSubVar (VarConst "u3")) "text")
, EPath (PropertyPath (BSubVar (VarConst "u3")) "shape" "head")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "blue"))
)
, ( "head"
, OptEval (EPath (FieldPath (BSubVar (VarConst "u3")) "val"))
)
, ( "tail"
, OptEval (EPath (FieldPath (BSubVar (VarConst "U")) "origin"))
)
])
)
, ( "slider_v"
, GPI
Arrow
(fromList
[ ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "gray"))
)
, ( "head"
, OptEval (EPath (FieldPath (BSubVar (VarConst "u3")) "val"))
)
, ( "tail"
, OptEval (EPath (FieldPath (BSubVar (VarConst "u2")) "val"))
)
])
)
, ( "slider_w"
, GPI
Arrow
(fromList
[ ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "gray"))
)
, ( "head"
, OptEval (EPath (FieldPath (BSubVar (VarConst "u3")) "val"))
)
, ( "tail"
, OptEval (EPath (FieldPath (BSubVar (VarConst "u1")) "val"))
)
])
)
, ( "val"
, FExpr
(OptEval
(CompApp
"addV"
[ EPath (FieldPath (BSubVar (VarConst "u1")) "val")
, EPath (FieldPath (BSubVar (VarConst "u2")) "val")
]))
)
]
)
, ( Sub "u4"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"near"
[ EPath (FieldPath (BSubVar (VarConst "u4")) "text")
, EPath (PropertyPath (BSubVar (VarConst "u4")) "shape" "head")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "blue"))
)
, ( "head"
, OptEval (EPath (FieldPath (BSubVar (VarConst "u4")) "val"))
)
, ( "tail"
, OptEval (EPath (FieldPath (BSubVar (VarConst "U")) "origin"))
)
])
)
, ( "val"
, FExpr
(OptEval
(CompApp
"mulV"
[ EPath (FieldPath (BSubVar (VarConst "a")) "val")
, EPath (FieldPath (BSubVar (VarConst "u2")) "val")
]))
)
]
)
, ( Sub "u5"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"near"
[ EPath (FieldPath (BSubVar (VarConst "u5")) "text")
, EPath (PropertyPath (BSubVar (VarConst "u5")) "shape" "head")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "blue"))
)
, ( "head"
, OptEval (EPath (FieldPath (BSubVar (VarConst "u5")) "val"))
)
, ( "tail"
, OptEval (EPath (FieldPath (BSubVar (VarConst "U")) "origin"))
)
])
)
, ( "val"
, FExpr
(OptEval
(CompApp
"sampleVectorIn"
[ EPath (FieldPath (BSubVar (VarConst "U")) "shape") ]))
)
]
)
, ( Sub "v1"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"near"
[ EPath (FieldPath (BSubVar (VarConst "v1")) "text")
, EPath (PropertyPath (BSubVar (VarConst "v1")) "shape" "head")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "blue"))
)
, ( "head"
, OptEval (EPath (FieldPath (BSubVar (VarConst "v1")) "val"))
)
, ( "tail"
, OptEval (EPath (FieldPath (BSubVar (VarConst "V")) "origin"))
)
])
)
, ( "val"
, FExpr
(OptEval
(CompApp
"apply"
[ EPath (FieldPath (BSubVar (VarConst "f")) "val")
, EPath (FieldPath (BSubVar (VarConst "u1")) "val")
]))
)
]
)
, ( Sub "v2"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"near"
[ EPath (FieldPath (BSubVar (VarConst "v2")) "text")
, EPath (PropertyPath (BSubVar (VarConst "v2")) "shape" "head")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "blue"))
)
, ( "head"
, OptEval (EPath (FieldPath (BSubVar (VarConst "v2")) "val"))
)
, ( "tail"
, OptEval (EPath (FieldPath (BSubVar (VarConst "V")) "origin"))
)
])
)
, ( "val"
, FExpr
(OptEval
(CompApp
"apply"
[ EPath (FieldPath (BSubVar (VarConst "f")) "val")
, EPath (FieldPath (BSubVar (VarConst "u2")) "val")
]))
)
]
)
, ( Sub "v3"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"near"
[ EPath (FieldPath (BSubVar (VarConst "v3")) "text")
, EPath (PropertyPath (BSubVar (VarConst "v3")) "shape" "head")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "blue"))
)
, ( "head"
, OptEval (EPath (FieldPath (BSubVar (VarConst "v3")) "val"))
)
, ( "tail"
, OptEval (EPath (FieldPath (BSubVar (VarConst "V")) "origin"))
)
])
)
, ( "val"
, FExpr
(OptEval
(CompApp
"apply"
[ EPath (FieldPath (BSubVar (VarConst "f")) "val")
, EPath (FieldPath (BSubVar (VarConst "u3")) "val")
]))
)
]
)
, ( Sub "w1"
, fromList
[ ( "labelFn"
, FExpr
(OptEval
(ObjFn
"near"
[ EPath (FieldPath (BSubVar (VarConst "w1")) "text")
, EPath (PropertyPath (BSubVar (VarConst "w1")) "shape" "head")
]))
)
, ( "shape"
, GPI
Arrow
(fromList
[ ( "color"
, OptEval (EPath (FieldPath (BStyVar (StyVar' "Colors")) "blue"))
)
, ( "head"
, OptEval (EPath (FieldPath (BSubVar (VarConst "w1")) "val"))
)
, ( "tail"
, OptEval (EPath (FieldPath (BSubVar (VarConst "W")) "origin"))
)
])
)
, ( "val"
, FExpr
(OptEval
(CompApp
"apply"
[ EPath (FieldPath (BSubVar (VarConst "g")) "val")
, EPath (FieldPath (BSubVar (VarConst "v1")) "val")
]))
)
]
)
]
, warnings = []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment