refactor: Creation of composite nodes

This commit is contained in:
jstoobysmith 2024-10-22 07:11:44 +00:00
parent 8fa8a51367
commit ccb9623bd6
6 changed files with 43 additions and 70 deletions

View file

@ -20,20 +20,6 @@ namespace TensorTree
def dotString (m : ) (nt : ) : ∀ {n : } {c : Fin n → S.C}, TensorTree S c → String := fun
| tensorNode _ =>
" node" ++ toString m ++ " [label=\"T" ++ toString nt ++ "\"];\n"
| vecNode T =>
" node" ++ toString m ++ " [label=\"vec " ++ toString nt ++ "\"];\n"
| twoNode T =>
" node" ++ toString m ++ " [label=\"vec2\", shape=box];\n"
| threeNode T =>
" node" ++ toString m ++ " [label=\"vec3\", shape=box];\n"
| constNode T =>
" node" ++ toString m ++ " [label=\"const " ++ toString nt ++ "\"];\n"
| constVecNode T =>
" node" ++ toString m ++ " [label=\"constVec " ++ toString nt ++ "\"];\n"
| constTwoNode T =>
" node" ++ toString m ++ " [label=\"constVec2\", shape=box];\n"
| constThreeNode T =>
" node" ++ toString m ++ " [label=\"constVec3\", shape=box];\n"
| add t1 t2 =>
let addNode := " node" ++ toString m ++ " [label=\"+\", shape=box];\n"
let edge1 := " node" ++ toString m ++ " -> node" ++ toString (m + 1) ++ ";\n"