main
graph.sats
1staload "types.sats"
2staload "parse.sats"
3
4(* abstract type *)
5abst@ype node_id = usize
6abst@ype action_id = usize
7
8absvt@ype graph = @{
9 nodes = ptr,
10 actions = ptr,
11 paths = ptr
12}
13
14vtypedef node = @{
15 path = Strptr1,
16 producer = Option(action_id),
17 consumers = List0_vt(action_id)
18}
19
20vtypedef action = @{
21 inp = List0_vt(node_id), (* fucking reserved keywords *)
22 out = List1_vt(node_id), (* every action must produce atleast 1 thing *)
23 rule = Strptr1,
24 bindings = List0_vt(binding)
25}
26
27fun mkgraph(): graph
28fun graph_free(g: graph): void
29fun mkedges(g: &graph, edges: List0_vt(edge)): void
30fun dot(g: &graph): void