Skip to content

Commit

Permalink
comment about Net
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Aug 16, 2023
1 parent 2826dd6 commit b1d6df7
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions src/lang/net/Net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ import { Port } from "../port"
import { Sign } from "../sign"
import { Value } from "../value"

export type Connection = {
edge: Edge
port: Port
}
/*
export type PortEntry = {
name: string
sign: Sign
t: Value
isPrincipal: boolean
connection?: Connection
}
A net is an undirected graph where each edge
must be connected through ports.
export type PortRecord = Record<string, PortEntry>
We implement a net like adjacency list,
but the list of nodes is replaced by a record of ports.
*/

export type Net = {
edges: Array<Edge>
activeEdges: Array<Edge>
nodeEntries: Map<string, NodeEntry>
}

export type NodeEntry = {
id: string
Expand All @@ -25,8 +26,17 @@ export type NodeEntry = {
ports: PortRecord
}

export type Net = {
edges: Array<Edge>
activeEdges: Array<Edge>
nodeEntries: Map<string, NodeEntry>
export type PortRecord = Record<string, PortEntry>

export type PortEntry = {
name: string
sign: Sign
t: Value
isPrincipal: boolean
connection?: Connection
}

export type Connection = {
edge: Edge
port: Port
}

0 comments on commit b1d6df7

Please sign in to comment.