module CanvasStatesWithBuses

open CommonTypes
open CanvasStates

/// Two inputs connected to a MergeWires component. No other connections.
let stateBus1 : CanvasState =
    [
        {H=50;W=40; Id = "08de9671-756c-44e0-905c-cde5b9a98aa9";Type = Input 1;Label = "a";InputPorts = [];OutputPorts = [{Id = "528c3ccc-9554-6a5b-129f-c88e55478ae2";PortNumber = Some 0;PortType = PortType.Output;HostId = "08de9671-756c-44e0-905c-cde5b9a98aa9"}];X = 100;Y = 100};
        {H=50;W=40; Id = "0b7b0ae5-dcca-f0af-3ba6-68231fdf80fc";Type = Input 1;Label = "b";InputPorts = [];OutputPorts = [{Id = "9de10edf-96be-beb0-2926-45f98b5dccb2";PortNumber = Some 0;PortType = PortType.Output;HostId = "0b7b0ae5-dcca-f0af-3ba6-68231fdf80fc"}];X = 100;Y = 169};
        {H=50;W=40; Id = "8caa65e2-97eb-ed9c-cd34-220b1fde3add";Type = MergeWires;Label = "";InputPorts = [{Id = "6d525499-76f1-001b-3cca-726c4aa9b2ee";PortNumber = Some 0;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}; {Id = "0d6f9b2f-d511-c08b-3b72-4c23975adeda";PortNumber = Some 1;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];OutputPorts = [{Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = Some 0;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];X = 230;Y = 138}
    ], 
    [    
        {Id = "conn0";Source = {Id = "528c3ccc-9554-6a5b-129f-c88e55478ae2";PortNumber = None;PortType = PortType.Output;HostId = "08de9671-756c-44e0-905c-cde5b9a98aa9"};Target = {Id = "6d525499-76f1-001b-3cca-726c4aa9b2ee";PortNumber = None;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Vertices = [130.0,110.0; 180.0,110.0; 180.0,138.0; 230.0,138.0]};
        {Id = "conn1";Source = {Id = "9de10edf-96be-beb0-2926-45f98b5dccb2";PortNumber = None;PortType = PortType.Output;HostId = "0b7b0ae5-dcca-f0af-3ba6-68231fdf80fc"};Target = {Id = "0d6f9b2f-d511-c08b-3b72-4c23975adeda";PortNumber = None;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Vertices = [130.0,179.0; 180.0,179.0; 180.0,158.0; 230.0,158.0]}
    ]

/// A MergeWires connected to a SplitWire 1.
let stateBus2 : CanvasState =
    [
        {H=50;W=40; Id = "8caa65e2-97eb-ed9c-cd34-220b1fde3add";Type = MergeWires;Label = "";InputPorts = [{Id = "6d525499-76f1-001b-3cca-726c4aa9b2ee";PortNumber = Some 0;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}; {Id = "0d6f9b2f-d511-c08b-3b72-4c23975adeda";PortNumber = Some 1;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];OutputPorts = [{Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = Some 0;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];X = 230;Y = 138};
        {H=50;W=40; Id = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2";Type = SplitWire 1;Label = "";InputPorts = [{Id = "ba539631-cbee-1c40-e2ad-755e3c4893ab";PortNumber = Some 0;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"}];OutputPorts = [{Id = "9f93cb8f-ad50-a556-57fb-3f1ec4cbdaba";PortNumber = Some 0;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"}; {Id = "58dc5768-a64d-e6d6-36cc-fecdd57b57d7";PortNumber = Some 1;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"}];X = 336;Y = 138}
    ],
    [
        {Id = "conn0";Source = {Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = None;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Target = {Id = "ba539631-cbee-1c40-e2ad-755e3c4893ab";PortNumber = None;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"};Vertices = [270.0,148.0; 336.0,148.0]}
    ]

/// A MergeWires connected to a SplitWire 1.
// let stateBus2' : CanvasState =
//     [
//         {H=50;W=40; Id = "8caa65e2-97eb-ed9c-cd34-220b1fde3add";Type = MergeWires;Label = "";InputPorts = [{Id = "6d525499-76f1-001b-3cca-726c4aa9b2ee";PortNumber = Some 0;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}; {Id = "0d6f9b2f-d511-c08b-3b72-4c23975adeda";PortNumber = Some 1;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];OutputPorts = [{Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = Some 0;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];X = 230;Y = 138};
//         {H=50;W=40; Id = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3";Type = ExtractWire 1;Label = "";InputPorts = [{Id = "ba539631-cbee-1c40-e2ad-755e3c4893ac";PortNumber = Some 0;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"}];OutputPorts = [{Id = "9f93cb8f-ad50-a556-57fb-3f1ec4cbdabb";PortNumber = Some 0;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"}; {Id = "58dc5768-a64d-e6d6-36cc-fecdd57b57d8";PortNumber = Some 1;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"}];X = 336;Y = 138}
//     ],
//     [
//         {Id = "conn0";Source = {Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = None;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Target = {Id = "ba539631-cbee-1c40-e2ad-755e3c4893ac";PortNumber = None;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"};Vertices = [270.0,148.0; 336.0,148.0]}
//     ]

/// A MergeWires connected to a SplitWire 1 and a single-bit output node.
let stateBus3 : CanvasState =
    [
        {H=50;W=40; Id = "8caa65e2-97eb-ed9c-cd34-220b1fde3add";Type = MergeWires;Label = "";InputPorts = [{Id = "6d525499-76f1-001b-3cca-726c4aa9b2ee";PortNumber = Some 0;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}; {Id = "0d6f9b2f-d511-c08b-3b72-4c23975adeda";PortNumber = Some 1;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];OutputPorts = [{Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = Some 0;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];X = 230;Y = 138};
        {H=50;W=40; Id = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2";Type = SplitWire 1;Label = "";InputPorts = [{Id = "ba539631-cbee-1c40-e2ad-755e3c4893ab";PortNumber = Some 0;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"}];OutputPorts = [{Id = "9f93cb8f-ad50-a556-57fb-3f1ec4cbdaba";PortNumber = Some 0;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"}; {Id = "58dc5768-a64d-e6d6-36cc-fecdd57b57d7";PortNumber = Some 1;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"}];X = 336;Y = 138}
        {H=50;W=40; Id = "7af6a475-990d-015f-e9e0-4a680cc84173";Type = Output 1;Label = "a";InputPorts = [{Id = "cefbb411-481e-d04d-c5a0-02f3921e423f";PortNumber = Some 0;PortType = PortType.Input;HostId = "7af6a475-990d-015f-e9e0-4a680cc84173"}];OutputPorts = [];X = 346;Y = 63}
    ],
    [
        {Id = "conn0";Source = {Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = None;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Target = {Id = "ba539631-cbee-1c40-e2ad-755e3c4893ab";PortNumber = None;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"};Vertices = [270.0,148.0; 336.0,148.0]}
        {Id = "conn1";Source = {Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = None;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Target = {Id = "cefbb411-481e-d04d-c5a0-02f3921e423f";PortNumber = None;PortType = PortType.Input;HostId = "7af6a475-990d-015f-e9e0-4a680cc84173"};Vertices = [270.0,148.0; 308.0,148.0; 308.0,73.0; 346.0,73.0]}
    ]

/// A MergeWires connected to a SplitWire 1 and a single-bit output node.
// let stateBus3' : CanvasState =
//     [
//         {H=50;W=40; Id = "8caa65e2-97eb-ed9c-cd34-220b1fde3add";Type = MergeWires;Label = "";InputPorts = [{Id = "6d525499-76f1-001b-3cca-726c4aa9b2ee";PortNumber = Some 0;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}; {Id = "0d6f9b2f-d511-c08b-3b72-4c23975adeda";PortNumber = Some 1;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];OutputPorts = [{Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = Some 0;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];X = 230;Y = 138};
//         {H=50;W=40; Id = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3";Type = ExtractWire 1;Label = "";InputPorts = [{Id = "ba539631-cbee-1c40-e2ad-755e3c4893ac";PortNumber = Some 0;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"}];OutputPorts = [{Id = "9f93cb8f-ad50-a556-57fb-3f1ec4cbdabb";PortNumber = Some 0;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"}; {Id = "58dc5768-a64d-e6d6-36cc-fecdd57b57d8";PortNumber = Some 1;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"}];X = 336;Y = 138}
//         {H=50;W=40; Id = "7af6a475-990d-015f-e9e0-4a680cc84173";Type = Output 1;Label = "a";InputPorts = [{Id = "cefbb411-481e-d04d-c5a0-02f3921e423f";PortNumber = Some 0;PortType = PortType.Input;HostId = "7af6a475-990d-015f-e9e0-4a680cc84173"}];OutputPorts = [];X = 346;Y = 63}
//     ],
//     [
//         {Id = "conn0";Source = {Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = None;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Target = {Id = "ba539631-cbee-1c40-e2ad-755e3c4893ac";PortNumber = None;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"};Vertices = [270.0,148.0; 336.0,148.0]}
//         {Id = "conn1";Source = {Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = None;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Target = {Id = "cefbb411-481e-d04d-c5a0-02f3921e423f";PortNumber = None;PortType = PortType.Input;HostId = "7af6a475-990d-015f-e9e0-4a680cc84173"};Vertices = [270.0,148.0; 308.0,148.0; 308.0,73.0; 346.0,73.0]}
//     ]

/// Like stateBus2 but with a loop.
let stateBus4 : CanvasState =
    [
        {H=50;W=40; Id = "8caa65e2-97eb-ed9c-cd34-220b1fde3add";Type = MergeWires;Label = "";InputPorts = [{Id = "6d525499-76f1-001b-3cca-726c4aa9b2ee";PortNumber = Some 0;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}; {Id = "0d6f9b2f-d511-c08b-3b72-4c23975adeda";PortNumber = Some 1;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];OutputPorts = [{Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = Some 0;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];X = 230;Y = 138};
        {H=50;W=40; Id = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2";Type = SplitWire 1;Label = "";InputPorts = [{Id = "ba539631-cbee-1c40-e2ad-755e3c4893ab";PortNumber = Some 0;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"}];OutputPorts = [{Id = "9f93cb8f-ad50-a556-57fb-3f1ec4cbdaba";PortNumber = Some 0;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"}; {Id = "58dc5768-a64d-e6d6-36cc-fecdd57b57d7";PortNumber = Some 1;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"}];X = 336;Y = 138}

    ],
    [
        {Id = "conn0";Source = {Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = None;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Target = {Id = "ba539631-cbee-1c40-e2ad-755e3c4893ab";PortNumber = None;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"};Vertices = [270.0,148.0; 336.0,148.0]}
        {Id = "conn1";Source = {Id = "9f93cb8f-ad50-a556-57fb-3f1ec4cbdaba";PortNumber = None;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b2"};Target = {Id = "6d525499-76f1-001b-3cca-726c4aa9b2ee";PortNumber = None;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Vertices = [376.0,138.0; 396.0,138.0; 396.0,138.0; 210.0,138.0; 210.0,138.0; 230.0,138.0]}
    ]

/// Like stateBus2 but with a loop.
// let stateBus4' : CanvasState =
//     [
//         {H=50;W=40; Id = "8caa65e2-97eb-ed9c-cd34-220b1fde3add";Type = MergeWires;Label = "";InputPorts = [{Id = "6d525499-76f1-001b-3cca-726c4aa9b2ee";PortNumber = Some 0;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}; {Id = "0d6f9b2f-d511-c08b-3b72-4c23975adeda";PortNumber = Some 1;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];OutputPorts = [{Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = Some 0;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"}];X = 230;Y = 138};
//         {H=50;W=40; Id = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3";Type = ExtractWire 1;Label = "";InputPorts = [{Id = "ba539631-cbee-1c40-e2ad-755e3c4893ac";PortNumber = Some 0;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"}];OutputPorts = [{Id = "9f93cb8f-ad50-a556-57fb-3f1ec4cbdabb";PortNumber = Some 0;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"}; {Id = "58dc5768-a64d-e6d6-36cc-fecdd57b57d8";PortNumber = Some 1;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"}];X = 336;Y = 138}

//     ],
//     [
//         {Id = "conn0";Source = {Id = "f8a73708-ed54-cc87-d4d5-0a72745e82c7";PortNumber = None;PortType = PortType.Output;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Target = {Id = "ba539631-cbee-1c40-e2ad-755e3c4893ac";PortNumber = None;PortType = PortType.Input;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"};Vertices = [270.0,148.0; 336.0,148.0]}
//         {Id = "conn1";Source = {Id = "9f93cb8f-ad50-a556-57fb-3f1ec4cbdabb";PortNumber = None;PortType = PortType.Output;HostId = "6060cff2-0e4f-d3ac-a8f2-40557eca62b3"};Target = {Id = "6d525499-76f1-001b-3cca-726c4aa9b2ee";PortNumber = None;PortType = PortType.Input;HostId = "8caa65e2-97eb-ed9c-cd34-220b1fde3add"};Vertices = [376.0,138.0; 396.0,138.0; 396.0,138.0; 210.0,138.0; 210.0,138.0; 230.0,138.0]}
//     ]

/// All the bus components in series, properly connected. No other components.
let stateBus6 : CanvasState =
    [
        {H=50;W=40; Id = "52a4b421-c919-6177-c66c-ec2a77379373";Type = SplitWire 1;Label = "";InputPorts = [{Id = "07e65ee3-58a7-a5e0-724a-0f56f2e528c5";PortNumber = Some 0;PortType = PortType.Input;HostId = "52a4b421-c919-6177-c66c-ec2a77379373"}];OutputPorts = [{Id = "8e27936c-75e6-5ad1-777e-6aa111b2d584";PortNumber = Some 0;PortType = PortType.Output;HostId = "52a4b421-c919-6177-c66c-ec2a77379373"}; {Id = "1385e5ca-c8e7-b209-402f-b85c42023bdb";PortNumber = Some 1;PortType = PortType.Output;HostId = "52a4b421-c919-6177-c66c-ec2a77379373"}];X = 614;Y = 258};
        {H=50;W=40; Id = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d";Type = MergeWires;Label = "";InputPorts = [{Id = "94d62be4-60ae-4e5f-add7-3715341617aa";PortNumber = Some 0;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}; {Id = "c8e1b3ee-d1c7-e576-6e8e-eca93bb33fce";PortNumber = Some 1;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}];OutputPorts = [{Id = "cabe29d9-74ea-06b9-8421-8547090727f9";PortNumber = Some 0;PortType = PortType.Output;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}];X = 241;Y = 248};
        {H=50;W=40; Id = "66dd284a-9199-fda1-867b-4e6b837a7ae5";Type = MergeWires;Label = "";InputPorts = [{Id = "2ee75313-e4e3-4ab8-9e36-a5089e49278d";PortNumber = Some 0;PortType = PortType.Input;HostId = "66dd284a-9199-fda1-867b-4e6b837a7ae5"}; {Id = "a5d69516-6a23-a363-e86f-2fe2a062e722";PortNumber = Some 1;PortType = PortType.Input;HostId = "66dd284a-9199-fda1-867b-4e6b837a7ae5"}];OutputPorts = [{Id = "caf8086a-b657-bc0a-5684-a25556b95845";PortNumber = Some 0;PortType = PortType.Output;HostId = "66dd284a-9199-fda1-867b-4e6b837a7ae5"}];X = 153;Y = 258};
        {H=50;W=40; Id = "02e33421-bea8-657b-1e17-6e0df31696d5";Type = SplitWire 2;Label = "";InputPorts = [{Id = "ed9727f2-373b-9f23-9293-dacea5a5476b";PortNumber = Some 0;PortType = PortType.Input;HostId = "02e33421-bea8-657b-1e17-6e0df31696d5"}];OutputPorts = [{Id = "7beda885-b4f4-f5be-ada5-476643c2cec3";PortNumber = Some 0;PortType = PortType.Output;HostId = "02e33421-bea8-657b-1e17-6e0df31696d5"}; {Id = "853f0e05-b301-db44-d437-d50abef0065b";PortNumber = Some 1;PortType = PortType.Output;HostId = "02e33421-bea8-657b-1e17-6e0df31696d5"}];X = 531;Y = 248};
        {H=50;W=40; Id = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67";Type = MergeWires;Label = "";InputPorts = [{Id = "b87776d8-4588-4dc1-3251-342683ee4ba8";PortNumber = Some 0;PortType = PortType.Input;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"}; {Id = "b26122bb-0ce1-8e3e-1021-a9aec7c4c0ca";PortNumber = Some 1;PortType = PortType.Input;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"}];OutputPorts = [{Id = "211fd204-86fe-e959-b4fa-129d1b4accb4";PortNumber = Some 0;PortType = PortType.Output;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"}];X = 329;Y = 258};
        {H=50;W=40; Id = "a7db69d3-5a34-e5d2-46d1-19fe8879b625";Type = SplitWire 1;Label = "";InputPorts = [{Id = "075ab754-bff4-ce21-0384-1f46f1ae986a";PortNumber = Some 0;PortType = PortType.Input;HostId = "a7db69d3-5a34-e5d2-46d1-19fe8879b625"}];OutputPorts = [{Id = "673c4ac0-9c68-6f3c-dfd4-6b129b956357";PortNumber = Some 0;PortType = PortType.Output;HostId = "a7db69d3-5a34-e5d2-46d1-19fe8879b625"}; {Id = "3a314510-a373-0c2c-50c1-ac3ce9d5f4f7";PortNumber = Some 1;PortType = PortType.Output;HostId = "a7db69d3-5a34-e5d2-46d1-19fe8879b625"}];X = 438;Y = 258}
    ],
    [
        {Id = "conn0";Source = {Id = "caf8086a-b657-bc0a-5684-a25556b95845";PortNumber = None;PortType = PortType.Output;HostId = "66dd284a-9199-fda1-867b-4e6b837a7ae5"};Target = {Id = "c8e1b3ee-d1c7-e576-6e8e-eca93bb33fce";PortNumber = None;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"};Vertices = [193.0,268.0; 230.0,268.0; 230.0,268.0; 241.0,268.0]};
        {Id = "conn1";Source = {Id = "cabe29d9-74ea-06b9-8421-8547090727f9";PortNumber = None;PortType = PortType.Output;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"};Target = {Id = "b87776d8-4588-4dc1-3251-342683ee4ba8";PortNumber = None;PortType = PortType.Input;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"};Vertices = [281.0,258.0; 329.0,258.0]}
        {Id = "conn2";Source = {Id = "211fd204-86fe-e959-b4fa-129d1b4accb4";PortNumber = None;PortType = PortType.Output;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"};Target = {Id = "075ab754-bff4-ce21-0384-1f46f1ae986a";PortNumber = None;PortType = PortType.Input;HostId = "a7db69d3-5a34-e5d2-46d1-19fe8879b625"};Vertices = [369.0,268.0; 438.0,268.0]};
        {Id = "conn3";Source = {Id = "673c4ac0-9c68-6f3c-dfd4-6b129b956357";PortNumber = None;PortType = PortType.Output;HostId = "a7db69d3-5a34-e5d2-46d1-19fe8879b625"};Target = {Id = "ed9727f2-373b-9f23-9293-dacea5a5476b";PortNumber = None;PortType = PortType.Input;HostId = "02e33421-bea8-657b-1e17-6e0df31696d5"};Vertices = [478.0,258.0; 531.0,258.0]};
        {Id = "conn4";Source = {Id = "853f0e05-b301-db44-d437-d50abef0065b";PortNumber = None;PortType = PortType.Output;HostId = "02e33421-bea8-657b-1e17-6e0df31696d5"};Target = {Id = "07e65ee3-58a7-a5e0-724a-0f56f2e528c5";PortNumber = None;PortType = PortType.Input;HostId = "52a4b421-c919-6177-c66c-ec2a77379373"};Vertices = [571.0,268.0; 614.0,268.0]};
    ]

/// All the bus components in series, properly connected. No other components.
// let stateBus6' : CanvasState =
//     [
//         {H=50;W=40; Id = "52a4b421-c919-6177-c66c-ec2a77379373";Type = ExtractWire 1;Label = "";InputPorts = [{Id = "07e65ee3-58a7-a5e0-724a-0f56f2e528c5";PortNumber = Some 0;PortType = PortType.Input;HostId = "52a4b421-c919-6177-c66c-ec2a77379373"}];OutputPorts = [{Id = "8e27936c-75e6-5ad1-777e-6aa111b2d584";PortNumber = Some 0;PortType = PortType.Output;HostId = "52a4b421-c919-6177-c66c-ec2a77379373"}; {Id = "1385e5ca-c8e7-b209-402f-b85c42023bdb";PortNumber = Some 1;PortType = PortType.Output;HostId = "52a4b421-c919-6177-c66c-ec2a77379373"}];X = 614;Y = 258};
//         {H=50;W=40; Id = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d";Type = MergeWires;Label = "";InputPorts = [{Id = "94d62be4-60ae-4e5f-add7-3715341617aa";PortNumber = Some 0;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}; {Id = "c8e1b3ee-d1c7-e576-6e8e-eca93bb33fce";PortNumber = Some 1;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}];OutputPorts = [{Id = "cabe29d9-74ea-06b9-8421-8547090727f9";PortNumber = Some 0;PortType = PortType.Output;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}];X = 241;Y = 248};
//         {H=50;W=40; Id = "66dd284a-9199-fda1-867b-4e6b837a7ae5";Type = MergeWires;Label = "";InputPorts = [{Id = "2ee75313-e4e3-4ab8-9e36-a5089e49278d";PortNumber = Some 0;PortType = PortType.Input;HostId = "66dd284a-9199-fda1-867b-4e6b837a7ae5"}; {Id = "a5d69516-6a23-a363-e86f-2fe2a062e722";PortNumber = Some 1;PortType = PortType.Input;HostId = "66dd284a-9199-fda1-867b-4e6b837a7ae5"}];OutputPorts = [{Id = "caf8086a-b657-bc0a-5684-a25556b95845";PortNumber = Some 0;PortType = PortType.Output;HostId = "66dd284a-9199-fda1-867b-4e6b837a7ae5"}];X = 153;Y = 258};
//         {H=50;W=40; Id = "02e33421-bea8-657b-1e17-6e0df31696d5";Type = ExtractWire 2;Label = "";InputPorts = [{Id = "ed9727f2-373b-9f23-9293-dacea5a5476b";PortNumber = Some 0;PortType = PortType.Input;HostId = "02e33421-bea8-657b-1e17-6e0df31696d5"}];OutputPorts = [{Id = "7beda885-b4f4-f5be-ada5-476643c2cec3";PortNumber = Some 0;PortType = PortType.Output;HostId = "02e33421-bea8-657b-1e17-6e0df31696d5"}; {Id = "853f0e05-b301-db44-d437-d50abef0065b";PortNumber = Some 1;PortType = PortType.Output;HostId = "02e33421-bea8-657b-1e17-6e0df31696d5"}];X = 531;Y = 248};
//         {H=50;W=40; Id = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67";Type = MergeWires;Label = "";InputPorts = [{Id = "b87776d8-4588-4dc1-3251-342683ee4ba8";PortNumber = Some 0;PortType = PortType.Input;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"}; {Id = "b26122bb-0ce1-8e3e-1021-a9aec7c4c0ca";PortNumber = Some 1;PortType = PortType.Input;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"}];OutputPorts = [{Id = "211fd204-86fe-e959-b4fa-129d1b4accb4";PortNumber = Some 0;PortType = PortType.Output;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"}];X = 329;Y = 258};
//         {H=50;W=40; Id = "a7db69d3-5a34-e5d2-46d1-19fe8879b625";Type = ExtractWire 1;Label = "";InputPorts = [{Id = "075ab754-bff4-ce21-0384-1f46f1ae986a";PortNumber = Some 0;PortType = PortType.Input;HostId = "a7db69d3-5a34-e5d2-46d1-19fe8879b625"}];OutputPorts = [{Id = "673c4ac0-9c68-6f3c-dfd4-6b129b956357";PortNumber = Some 0;PortType = PortType.Output;HostId = "a7db69d3-5a34-e5d2-46d1-19fe8879b625"}; {Id = "3a314510-a373-0c2c-50c1-ac3ce9d5f4f7";PortNumber = Some 1;PortType = PortType.Output;HostId = "a7db69d3-5a34-e5d2-46d1-19fe8879b625"}];X = 438;Y = 258}
//     ],
//     [
//         {Id = "conn0";Source = {Id = "caf8086a-b657-bc0a-5684-a25556b95845";PortNumber = None;PortType = PortType.Output;HostId = "66dd284a-9199-fda1-867b-4e6b837a7ae5"};Target = {Id = "c8e1b3ee-d1c7-e576-6e8e-eca93bb33fce";PortNumber = None;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"};Vertices = [193.0,268.0; 230.0,268.0; 230.0,268.0; 241.0,268.0]};
//         {Id = "conn1";Source = {Id = "cabe29d9-74ea-06b9-8421-8547090727f9";PortNumber = None;PortType = PortType.Output;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"};Target = {Id = "b87776d8-4588-4dc1-3251-342683ee4ba8";PortNumber = None;PortType = PortType.Input;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"};Vertices = [281.0,258.0; 329.0,258.0]}
//         {Id = "conn2";Source = {Id = "211fd204-86fe-e959-b4fa-129d1b4accb4";PortNumber = None;PortType = PortType.Output;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"};Target = {Id = "075ab754-bff4-ce21-0384-1f46f1ae986a";PortNumber = None;PortType = PortType.Input;HostId = "a7db69d3-5a34-e5d2-46d1-19fe8879b625"};Vertices = [369.0,268.0; 438.0,268.0]};
//         {Id = "conn3";Source = {Id = "673c4ac0-9c68-6f3c-dfd4-6b129b956357";PortNumber = None;PortType = PortType.Output;HostId = "a7db69d3-5a34-e5d2-46d1-19fe8879b625"};Target = {Id = "ed9727f2-373b-9f23-9293-dacea5a5476b";PortNumber = None;PortType = PortType.Input;HostId = "02e33421-bea8-657b-1e17-6e0df31696d5"};Vertices = [478.0,258.0; 531.0,258.0]};
//         {Id = "conn4";Source = {Id = "853f0e05-b301-db44-d437-d50abef0065b";PortNumber = None;PortType = PortType.Output;HostId = "02e33421-bea8-657b-1e17-6e0df31696d5"};Target = {Id = "07e65ee3-58a7-a5e0-724a-0f56f2e528c5";PortNumber = None;PortType = PortType.Input;HostId = "52a4b421-c919-6177-c66c-ec2a77379373"};Vertices = [571.0,268.0; 614.0,268.0]};
//     ]

/// Non-inferrable loop: MergeWires connected to MergeWires and loop back.
let stateBus7 : CanvasState =
    [
        {H=50;W=40; Id = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d";Type = MergeWires;Label = "";InputPorts = [{Id = "94d62be4-60ae-4e5f-add7-3715341617aa";PortNumber = Some 0;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}; {Id = "c8e1b3ee-d1c7-e576-6e8e-eca93bb33fce";PortNumber = Some 1;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}];OutputPorts = [{Id = "cabe29d9-74ea-06b9-8421-8547090727f9";PortNumber = Some 0;PortType = PortType.Output;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}];X = 241;Y = 248};
        {H=50;W=40; Id = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67";Type = MergeWires;Label = "";InputPorts = [{Id = "b87776d8-4588-4dc1-3251-342683ee4ba8";PortNumber = Some 0;PortType = PortType.Input;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"}; {Id = "b26122bb-0ce1-8e3e-1021-a9aec7c4c0ca";PortNumber = Some 1;PortType = PortType.Input;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"}];OutputPorts = [{Id = "211fd204-86fe-e959-b4fa-129d1b4accb4";PortNumber = Some 0;PortType = PortType.Output;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"}];X = 325;Y = 258}
    ],
    [
        {Id = "conn0";Source = {Id = "211fd204-86fe-e959-b4fa-129d1b4accb4";PortNumber = None;PortType = PortType.Output;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"};Target = {Id = "c8e1b3ee-d1c7-e576-6e8e-eca93bb33fce";PortNumber = None;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"};Vertices = [365.0,268.0; 385.0,268.0; 385.0,307.0; 221.0,307.0; 221.0,268.0; 241.0,268.0]};
        {Id = "conn1";Source = {Id = "cabe29d9-74ea-06b9-8421-8547090727f9";PortNumber = None;PortType = PortType.Output;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"};Target = {Id = "b87776d8-4588-4dc1-3251-342683ee4ba8";PortNumber = None;PortType = PortType.Input;HostId = "eb13d9a8-162b-3ffc-a1d8-e6666edf7a67"};Vertices = [281.0,258.0; 325.0,258.0]}
    ]

/// Mux connected to two PushBusFirst. Width not inferrable.
let stateBus8 : CanvasState =
    [
        {H=50;W=40; Id = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d";Type = MergeWires;Label = "";InputPorts = [{Id = "94d62be4-60ae-4e5f-add7-3715341617aa";PortNumber = Some 0;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}; {Id = "c8e1b3ee-d1c7-e576-6e8e-eca93bb33fce";PortNumber = Some 1;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}];OutputPorts = [{Id = "cabe29d9-74ea-06b9-8421-8547090727f9";PortNumber = Some 0;PortType = PortType.Output;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"}];X = 241;Y = 248};
        {H=50;W=40; Id = "3875f58b-8744-291d-1f4f-bca5b1a1eda5";Type = Mux2;Label = "mux2";InputPorts = [{Id = "6758d0e5-2618-afe4-473b-43c5002abf74";PortNumber = Some 0;PortType = PortType.Input;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"}; {Id = "401a0856-683d-6ed2-c193-53d1761ad7a4";PortNumber = Some 1;PortType = PortType.Input;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"}; {Id = "cf514335-b50d-eb19-c6f5-18303cda0b13";PortNumber = Some 2;PortType = PortType.Input;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"}];OutputPorts = [{Id = "6bf59da3-ea8a-30c3-163d-37dbefd821bc";PortNumber = Some 0;PortType = PortType.Output;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"}];X = 145;Y = 190};
        {H=50;W=40; Id = "536f5ede-5b98-ce3f-db3e-e96de247a89b";Type = MergeWires;Label = "";InputPorts = [{Id = "b871e19d-2bec-0cc1-8c71-0fbee278bf51";PortNumber = Some 0;PortType = PortType.Input;HostId = "536f5ede-5b98-ce3f-db3e-e96de247a89b"}; {Id = "69b5caec-1da0-9ecb-d7fc-fbd9af66fc23";PortNumber = Some 1;PortType = PortType.Input;HostId = "536f5ede-5b98-ce3f-db3e-e96de247a89b"}];OutputPorts = [{Id = "6b2d64d3-7697-a97f-ed51-f0991d77b6b9";PortNumber = Some 0;PortType = PortType.Output;HostId = "536f5ede-5b98-ce3f-db3e-e96de247a89b"}];X = 336;Y = 237}
    ],
    [
        {Id = "conn0";Source = {Id = "6bf59da3-ea8a-30c3-163d-37dbefd821bc";PortNumber = None;PortType = PortType.Output;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"};Target = {Id = "94d62be4-60ae-4e5f-add7-3715341617aa";PortNumber = None;PortType = PortType.Input;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"};Vertices = [175.0,215.0; 208.0,215.0; 208.0,248.0; 241.0,248.0]};
        {Id = "conn1";Source = {Id = "cabe29d9-74ea-06b9-8421-8547090727f9";PortNumber = None;PortType = PortType.Output;HostId = "37dd0853-0d7e-ab38-82e7-4e5d6d43ee9d"};Target = {Id = "69b5caec-1da0-9ecb-d7fc-fbd9af66fc23";PortNumber = None;PortType = PortType.Input;HostId = "536f5ede-5b98-ce3f-db3e-e96de247a89b"};Vertices = [281.0,258.0; 308.5,258.0; 308.5,257.0; 336.0,257.0]}
    ]

/// And connected to a SplitWire 1.
let stateBus9 : CanvasState =
    [
        {H=50;W=40; Id = "3875f58b-8744-291d-1f4f-bca5b1a1eda5";Type = And;Label = "and";InputPorts = [{Id = "6758d0e5-2618-afe4-473b-43c5002abf74";PortNumber = Some 0;PortType = PortType.Input;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"}; {Id = "401a0856-683d-6ed2-c193-53d1761ad7a4";PortNumber = Some 1;PortType = PortType.Input;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"}];OutputPorts = [{Id = "6bf59da3-ea8a-30c3-163d-37dbefd821bc";PortNumber = Some 0;PortType = PortType.Output;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"}];X = 145;Y = 190};
        {H=50;W=40; Id = "772307ab-2941-3343-28a2-faacaa0efc96";Type = SplitWire 1;Label = "";InputPorts = [{Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = Some 0;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];OutputPorts = [{Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = Some 0;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}; {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = Some 1;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];X = 262;Y = 205}
    ],
    [
        {Id = "conn0";Source = {Id = "6bf59da3-ea8a-30c3-163d-37dbefd821bc";PortNumber = None;PortType = PortType.Output;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"};Target = {Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = None;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Vertices = [175.0,215.0; 262.0,215.0]}
    ]

/// And connected to a SplitWire 1.
// let stateBus9' : CanvasState =
//     [
//         {H=50;W=40; Id = "3875f58b-8744-291d-1f4f-bca5b1a1eda5";Type = And;Label = "and";InputPorts = [{Id = "6758d0e5-2618-afe4-473b-43c5002abf74";PortNumber = Some 0;PortType = PortType.Input;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"}; {Id = "401a0856-683d-6ed2-c193-53d1761ad7a4";PortNumber = Some 1;PortType = PortType.Input;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"}];OutputPorts = [{Id = "6bf59da3-ea8a-30c3-163d-37dbefd821bc";PortNumber = Some 0;PortType = PortType.Output;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"}];X = 145;Y = 190};
//         {H=50;W=40; Id = "772307ab-2941-3343-28a2-faacaa0efc96";Type = ExtractWire 1;Label = "";InputPorts = [{Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = Some 0;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];OutputPorts = [{Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = Some 0;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}; {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = Some 1;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];X = 262;Y = 205}
//     ],
//     [
//         {Id = "conn0";Source = {Id = "6bf59da3-ea8a-30c3-163d-37dbefd821bc";PortNumber = None;PortType = PortType.Output;HostId = "3875f58b-8744-291d-1f4f-bca5b1a1eda5"};Target = {Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = None;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Vertices = [175.0,215.0; 262.0,215.0]}
//     ]

/// Two inputs, packed into a bus, unpacked into two outputs.
let stateBus10 : CanvasState =
    [
        {H=50;W=40; Id = "772307ab-2941-3343-28a2-faacaa0efc96";Type = SplitWire 1;Label = "";InputPorts = [{Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = Some 0;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];OutputPorts = [{Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = Some 0;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}; {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = Some 1;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];X = 336;Y = 205};
        {H=50;W=40; Id = "74dcc790-927f-ae61-fd63-577c3387de0e";Type = MergeWires;Label = "";InputPorts = [{Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = Some 0;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}; {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = Some 1;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];OutputPorts = [{Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = Some 0;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];X = 235;Y = 205};
        {H=50;W=40; Id = "a91be585-2d3b-d872-be0f-b416c8eb03d2";Type = Input 1;Label = "a";InputPorts = [];OutputPorts = [{Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = Some 0;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"}];X = 110;Y = 175};
        {H=50;W=40; Id = "9985ebc6-1cd5-8863-1341-1d543d236d38";Type = Input 1;Label = "b";InputPorts = [];OutputPorts = [{Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = Some 0;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"}];X = 110;Y = 245};
        {H=50;W=40; Id = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a";Type = Output 1;Label = "a-out";InputPorts = [{Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = Some 0;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"}];OutputPorts = [];X = 449;Y = 178};
        {H=50;W=40; Id = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"; Type = Output 1; Label = "b-out"; InputPorts = [{Id = "a0194620-020c-8897-0207-9d7e9ee2a538"; PortNumber = Some 0; PortType = PortType.Input; HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"}]; OutputPorts = []; X = 443; Y = 234}
    ],
    [
        {Id = "cfaa960d-99c2-0f40-4ac7-335f6a238e2b";Source = {Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = None;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"};Target = {Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,185.0; 187.5,185.0; 187.5,205.0; 235.0,205.0]};
        {Id = "78ceafbf-cfb8-4442-a6bb-62ed6a1893cd";Source = {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "a0194620-020c-8897-0207-9d7e9ee2a538";PortNumber = None;PortType = PortType.Input;HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"};Vertices = [376.0,225.0; 409.5,225.0; 409.5,244.0; 443.0,244.0]};
        {Id = "221f1ae2-9beb-5099-bc4c-a3f6c86214d4";Source = {Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = None;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"};Vertices = [376.0,205.0; 412.5,205.0; 412.5,188.0; 449.0,188.0]};
        {Id = "1287faef-e07d-cca5-83c7-3aa3b1265cd8";Source = {Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = None;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"};Target = {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,255.0; 187.5,255.0; 187.5,225.0; 235.0,225.0]};
        {Id = "35d2c879-dda4-f719-836f-f6daf9803c85";Source = {Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = None;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Target = {Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = None;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Vertices = [275.0,215.0; 336.0,215.0]}
    ]

/// Two inputs, packed into a bus, unpacked into two outputs.
let stateBus10 : CanvasState =
    [
        {H=50;W=40; Id = "772307ab-2941-3343-28a2-faacaa0efc96";Type = ExtractWire 1;Label = "";InputPorts = [{Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = Some 0;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];OutputPorts = [{Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = Some 0;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}; {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = Some 1;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];X = 336;Y = 205};
        {H=50;W=40; Id = "74dcc790-927f-ae61-fd63-577c3387de0e";Type = MergeWires;Label = "";InputPorts = [{Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = Some 0;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}; {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = Some 1;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];OutputPorts = [{Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = Some 0;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];X = 235;Y = 205};
        {H=50;W=40; Id = "a91be585-2d3b-d872-be0f-b416c8eb03d2";Type = Input 1;Label = "a";InputPorts = [];OutputPorts = [{Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = Some 0;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"}];X = 110;Y = 175};
        {H=50;W=40; Id = "9985ebc6-1cd5-8863-1341-1d543d236d38";Type = Input 1;Label = "b";InputPorts = [];OutputPorts = [{Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = Some 0;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"}];X = 110;Y = 245};
        {H=50;W=40; Id = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a";Type = Output 1;Label = "a-out";InputPorts = [{Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = Some 0;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"}];OutputPorts = [];X = 449;Y = 178};
        {H=50;W=40; Id = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"; Type = Output 1; Label = "b-out"; InputPorts = [{Id = "a0194620-020c-8897-0207-9d7e9ee2a538"; PortNumber = Some 0; PortType = PortType.Input; HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"}]; OutputPorts = []; X = 443; Y = 234}
    ],
    [
        {Id = "cfaa960d-99c2-0f40-4ac7-335f6a238e2b";Source = {Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = None;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"};Target = {Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,185.0; 187.5,185.0; 187.5,205.0; 235.0,205.0]};
        {Id = "78ceafbf-cfb8-4442-a6bb-62ed6a1893cd";Source = {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "a0194620-020c-8897-0207-9d7e9ee2a538";PortNumber = None;PortType = PortType.Input;HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"};Vertices = [376.0,225.0; 409.5,225.0; 409.5,244.0; 443.0,244.0]};
        {Id = "221f1ae2-9beb-5099-bc4c-a3f6c86214d4";Source = {Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = None;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"};Vertices = [376.0,205.0; 412.5,205.0; 412.5,188.0; 449.0,188.0]};
        {Id = "1287faef-e07d-cca5-83c7-3aa3b1265cd8";Source = {Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = None;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"};Target = {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,255.0; 187.5,255.0; 187.5,225.0; 235.0,225.0]};
        {Id = "35d2c879-dda4-f719-836f-f6daf9803c85";Source = {Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = None;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Target = {Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = None;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Vertices = [275.0,215.0; 336.0,215.0]}
    ]

/// Two inputs make a bus2, then Push input a to bus, then try to split into 2 single bits (fail).
let stateBus11 : CanvasState =
    [
        {H=50;W=40; Id = "772307ab-2941-3343-28a2-faacaa0efc96";Type = SplitWire 1;Label = "";InputPorts = [{Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = Some 0;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];OutputPorts = [{Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = Some 0;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}; {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = Some 1;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];X = 410;Y = 200};
        {H=50;W=40; Id = "74dcc790-927f-ae61-fd63-577c3387de0e";Type = MergeWires;Label = "";InputPorts = [{Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = Some 0;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}; {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = Some 1;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];OutputPorts = [{Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = Some 0;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];X = 235;Y = 205};
        {H=50;W=40; Id = "a91be585-2d3b-d872-be0f-b416c8eb03d2";Type = Input 1;Label = "a";InputPorts = [];OutputPorts = [{Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = Some 0;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"}];X = 110;Y = 175};
        {H=50;W=40; Id = "9985ebc6-1cd5-8863-1341-1d543d236d38";Type = Input 1;Label = "b";InputPorts = [];OutputPorts = [{Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = Some 0;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"}];X = 110;Y = 245};
        {H=50;W=40; Id = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a";Type = Output 1;Label = "a-out";InputPorts = [{Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = Some 0;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"}];OutputPorts = [];X = 523;Y = 173};
        {H=50;W=40; Id = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b";Type = Output 1;Label = "b-out";InputPorts = [{Id = "a0194620-020c-8897-0207-9d7e9ee2a538";PortNumber = Some 0;PortType = PortType.Input;HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"}];OutputPorts = [];X = 517;Y = 229};
        {H=50;W=40; Id = "94efe8d3-413b-9390-b627-be7bc91ae2d1";Type = MergeWires;Label = "";InputPorts = [{Id = "4a1da488-0834-1835-9649-6f4d5c172579";PortNumber = Some 0;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}; {Id = "4f58042b-383e-7557-fa72-8b149ba177a2";PortNumber = Some 1;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}];OutputPorts = [{Id = "3fbb97a2-aab1-b94d-c4cf-d52f8421f3b8";PortNumber = Some 0;PortType = PortType.Output;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}];X = 317;Y = 196}
    ],
    [
        {Id = "conn";Source = {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "a0194620-020c-8897-0207-9d7e9ee2a538";PortNumber = None;PortType = PortType.Input;HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"};Vertices = [450.0,220.0; 483.5,220.0; 483.5,239.0; 517.0,239.0]};
        {Id = "221f1ae2-9beb-5099-bc4c-a3f6c86214d4";Source = {Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = None;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"};Vertices = [450.0,200.0; 503.0,200.0; 503.0,183.0; 523.0,183.0]};
        {Id = "conn1";Source = {Id = "3fbb97a2-aab1-b94d-c4cf-d52f8421f3b8";PortNumber = None;PortType = PortType.Output;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Target = {Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = None;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Vertices = [357.0,206.0; 383.5,206.0; 383.5,210.0; 410.0,210.0]};
        {Id = "1287faef-e07d-cca5-83c7-3aa3b1265cd8";Source = {Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = None;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"};Target = {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,255.0; 187.5,255.0; 187.5,225.0; 235.0,225.0]};
        {Id = "3fd09a23-18c1-0edd-b7cb-a70a4b8d42ef";Source = {Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = None;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Target = {Id = "4f58042b-383e-7557-fa72-8b149ba177a2";PortNumber = None;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Vertices = [275.0,215.0; 296.0,215.0; 296.0,216.0; 317.0,216.0]};
        {Id = "d429c2f2-d60c-0dc9-2279-7022dc127783";Source = {Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = None;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"};Target = {Id = "4a1da488-0834-1835-9649-6f4d5c172579";PortNumber = None;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Vertices = [140.0,185.0; 187.5,185.0; 187.5,196.0; 317.0,196.0]};
        {Id = "cfaa960d-99c2-0f40-4ac7-335f6a238e2b";Source = {Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = None;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"};Target = {Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,185.0; 187.5,185.0; 187.5,205.0; 235.0,205.0]}
    ]

/// Two inputs make a bus2, then Push input a to bus, then try to split into 2 single bits (fail).
// let stateBus11' : CanvasState =
//     [
//         {H=50;W=40; Id = "772307ab-2941-3343-28a2-faacaa0efc96";Type = ExtractWire 1;Label = "";InputPorts = [{Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = Some 0;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];OutputPorts = [{Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = Some 0;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}; {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = Some 1;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];X = 410;Y = 200};
//         {H=50;W=40; Id = "74dcc790-927f-ae61-fd63-577c3387de0e";Type = MergeWires;Label = "";InputPorts = [{Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = Some 0;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}; {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = Some 1;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];OutputPorts = [{Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = Some 0;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];X = 235;Y = 205};
//         {H=50;W=40; Id = "a91be585-2d3b-d872-be0f-b416c8eb03d2";Type = Input 1;Label = "a";InputPorts = [];OutputPorts = [{Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = Some 0;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"}];X = 110;Y = 175};
//         {H=50;W=40; Id = "9985ebc6-1cd5-8863-1341-1d543d236d38";Type = Input 1;Label = "b";InputPorts = [];OutputPorts = [{Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = Some 0;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"}];X = 110;Y = 245};
//         {H=50;W=40; Id = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a";Type = Output 1;Label = "a-out";InputPorts = [{Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = Some 0;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"}];OutputPorts = [];X = 523;Y = 173};
//         {H=50;W=40; Id = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b";Type = Output 1;Label = "b-out";InputPorts = [{Id = "a0194620-020c-8897-0207-9d7e9ee2a538";PortNumber = Some 0;PortType = PortType.Input;HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"}];OutputPorts = [];X = 517;Y = 229};
//         {H=50;W=40; Id = "94efe8d3-413b-9390-b627-be7bc91ae2d1";Type = MergeWires;Label = "";InputPorts = [{Id = "4a1da488-0834-1835-9649-6f4d5c172579";PortNumber = Some 0;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}; {Id = "4f58042b-383e-7557-fa72-8b149ba177a2";PortNumber = Some 1;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}];OutputPorts = [{Id = "3fbb97a2-aab1-b94d-c4cf-d52f8421f3b8";PortNumber = Some 0;PortType = PortType.Output;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}];X = 317;Y = 196}
//     ],
//     [
//         {Id = "conn";Source = {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "a0194620-020c-8897-0207-9d7e9ee2a538";PortNumber = None;PortType = PortType.Input;HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"};Vertices = [450.0,220.0; 483.5,220.0; 483.5,239.0; 517.0,239.0]};
//         {Id = "221f1ae2-9beb-5099-bc4c-a3f6c86214d4";Source = {Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = None;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"};Vertices = [450.0,200.0; 503.0,200.0; 503.0,183.0; 523.0,183.0]};
//         {Id = "conn1";Source = {Id = "3fbb97a2-aab1-b94d-c4cf-d52f8421f3b8";PortNumber = None;PortType = PortType.Output;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Target = {Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = None;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Vertices = [357.0,206.0; 383.5,206.0; 383.5,210.0; 410.0,210.0]};
//         {Id = "1287faef-e07d-cca5-83c7-3aa3b1265cd8";Source = {Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = None;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"};Target = {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,255.0; 187.5,255.0; 187.5,225.0; 235.0,225.0]};
//         {Id = "3fd09a23-18c1-0edd-b7cb-a70a4b8d42ef";Source = {Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = None;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Target = {Id = "4f58042b-383e-7557-fa72-8b149ba177a2";PortNumber = None;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Vertices = [275.0,215.0; 296.0,215.0; 296.0,216.0; 317.0,216.0]};
//         {Id = "d429c2f2-d60c-0dc9-2279-7022dc127783";Source = {Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = None;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"};Target = {Id = "4a1da488-0834-1835-9649-6f4d5c172579";PortNumber = None;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Vertices = [140.0,185.0; 187.5,185.0; 187.5,196.0; 317.0,196.0]};
//         {Id = "cfaa960d-99c2-0f40-4ac7-335f6a238e2b";Source = {Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = None;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"};Target = {Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,185.0; 187.5,185.0; 187.5,205.0; 235.0,205.0]}
//     ]

/// Pack 4 bits into a bus, then extract them.
let stateBus12 : CanvasState =
    [
        {H=50;W=40; Id = "772307ab-2941-3343-28a2-faacaa0efc96";Type = SplitWire 1;Label = "";InputPorts = [{Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = Some 0;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];OutputPorts = [{Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = Some 0;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}; {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = Some 1;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];X = 627;Y = 205};
        {H=50;W=40; Id = "74dcc790-927f-ae61-fd63-577c3387de0e";Type = MergeWires;Label = "";InputPorts = [{Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = Some 0;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}; {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = Some 1;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];OutputPorts = [{Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = Some 0;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];X = 235;Y = 205};
        {H=50;W=40; Id = "94efe8d3-413b-9390-b627-be7bc91ae2d1";Type = MergeWires;Label = "";InputPorts = [{Id = "4a1da488-0834-1835-9649-6f4d5c172579";PortNumber = Some 0;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}; {Id = "4f58042b-383e-7557-fa72-8b149ba177a2";PortNumber = Some 1;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}];OutputPorts = [{Id = "3fbb97a2-aab1-b94d-c4cf-d52f8421f3b8";PortNumber = Some 0;PortType = PortType.Output;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}];X = 299;Y = 195};
        {H=50;W=40; Id = "76de964a-124b-5c16-6de1-6158626344ac";Type = Input 1;Label = "a";InputPorts = [];OutputPorts = [{Id = "9dc8cfaa-c989-276a-6703-11196c5c7974";PortNumber = Some 0;PortType = PortType.Output;HostId = "76de964a-124b-5c16-6de1-6158626344ac"}];X = 110;Y = 111};
        {H=50;W=40; Id = "a91be585-2d3b-d872-be0f-b416c8eb03d2";Type = Input 1;Label = "b";InputPorts = [];OutputPorts = [{Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = Some 0;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"}];X = 110;Y = 175};
        {H=50;W=40; Id = "9985ebc6-1cd5-8863-1341-1d543d236d38";Type = Input 1;Label = "c";InputPorts = [];OutputPorts = [{Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = Some 0;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"}];X = 110;Y = 245};
        {H=50;W=40; Id = "9824ceb8-e999-8e48-9a56-7a4349e495b1";Type = Input 1;Label = "d";InputPorts = [];OutputPorts = [{Id = "712999dd-e970-51b3-f38f-aee70ff42d2d";PortNumber = Some 0;PortType = PortType.Output;HostId = "9824ceb8-e999-8e48-9a56-7a4349e495b1"}];X = 110;Y = 326};
        {H=50;W=40; Id = "c16668ed-ec17-3a14-8a4b-dec6c40335b5";Type = MergeWires;Label = "";InputPorts = [{Id = "38d99b30-a219-c37e-df55-04b7240a599e";PortNumber = Some 0;PortType = PortType.Input;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"}; {Id = "2f0c6067-124f-233b-1077-db88900c31cc";PortNumber = Some 1;PortType = PortType.Input;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"}];OutputPorts = [{Id = "6c5a63af-db72-1ece-495d-7a04c88fd1f0";PortNumber = Some 0;PortType = PortType.Output;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"}];X = 364;Y = 205};
        {H=50;W=40; Id = "59b45f9c-192c-98ce-da25-a94db45a5790";Type = Output 1;Label = "a-out";InputPorts = [{Id = "e62e040a-bcd2-58f6-39d5-24548811b784";PortNumber = Some 0;PortType = PortType.Input;HostId = "59b45f9c-192c-98ce-da25-a94db45a5790"}];OutputPorts = [];X = 746;Y = 111};
        {H=50;W=40; Id = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a";Type = Output 1;Label = "b-out";InputPorts = [{Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = Some 0;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"}];OutputPorts = [];X = 743;Y = 174};
        {H=50;W=40; Id = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b";Type = Output 1;Label = "c-out";InputPorts = [{Id = "a0194620-020c-8897-0207-9d7e9ee2a538";PortNumber = Some 0;PortType = PortType.Input;HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"}];OutputPorts = [];X = 743;Y = 230};
        {H=50;W=40; Id = "214620f0-51f6-59fe-1558-ed47fd2c680a";Type = Output 1;Label = "d-out";InputPorts = [{Id = "b6e25648-a9a1-9c9c-935d-5f50a26c6c2b";PortNumber = Some 0;PortType = PortType.Input;HostId = "214620f0-51f6-59fe-1558-ed47fd2c680a"}];OutputPorts = [];X = 743;Y = 315};
        {H=50;W=40; Id = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf";Type = SplitWire 1;Label = "";InputPorts = [{Id = "2a6d1069-81da-f185-ad82-3c524819f56a";PortNumber = Some 0;PortType = PortType.Input;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"}];OutputPorts = [{Id = "f72513fe-f696-dbae-133b-6c864c7075a2";PortNumber = Some 0;PortType = PortType.Output;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"}; {Id = "8333c9b0-911e-aab3-b7fd-026d97b4a412";PortNumber = Some 1;PortType = PortType.Output;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"}];X = 546;Y = 195};
        {H=50;W=40; Id = "156b43f1-5e54-b058-c716-c5623c5f6e37";Type = SplitWire 3;Label = "";InputPorts = [{Id = "67424fbf-f200-6690-a8e6-450e951d9411";PortNumber = Some 0;PortType = PortType.Input;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"}];OutputPorts = [{Id = "58405846-6427-732c-c901-f72f1162b36e";PortNumber = Some 0;PortType = PortType.Output;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"}; {Id = "d40a1df5-6b29-5b4d-486f-925a2d16a615";PortNumber = Some 1;PortType = PortType.Output;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"}];X = 442;Y = 205}
    ],
    [
        {Id = "5a9d111c-acec-3973-01ea-d0590e547b89";Source = {Id = "d40a1df5-6b29-5b4d-486f-925a2d16a615";PortNumber = None;PortType = PortType.Output;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"};Target = {Id = "b6e25648-a9a1-9c9c-935d-5f50a26c6c2b";PortNumber = None;PortType = PortType.Input;HostId = "214620f0-51f6-59fe-1558-ed47fd2c680a"};Vertices = [482.0,225.0; 510.5,225.0; 510.5,325.0; 743.0,325.0]};
        {Id = "8f3205ca-5911-5a36-68da-4e8ca384c4a2";Source = {Id = "f72513fe-f696-dbae-133b-6c864c7075a2";PortNumber = None;PortType = PortType.Output;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"};Target = {Id = "e62e040a-bcd2-58f6-39d5-24548811b784";PortNumber = None;PortType = PortType.Input;HostId = "59b45f9c-192c-98ce-da25-a94db45a5790"};Vertices = [586.0,195.0; 666.0,195.0; 666.0,121.0; 746.0,121.0]};
        {Id = "1287faef-e07d-cca5-83c7-3aa3b1265cd8";Source = {Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = None;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"};Target = {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,255.0; 187.5,255.0; 187.5,225.0; 235.0,225.0]};
        {Id = "cfaa960d-99c2-0f40-4ac7-335f6a238e2b";Source = {Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = None;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"};Target = {Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,185.0; 187.5,185.0; 187.5,205.0; 235.0,205.0]};
        {Id = "56e8c89b-bcbf-e674-a49d-72d06c20a563";Source = {Id = "712999dd-e970-51b3-f38f-aee70ff42d2d";PortNumber = None;PortType = PortType.Output;HostId = "9824ceb8-e999-8e48-9a56-7a4349e495b1"};Target = {Id = "2f0c6067-124f-233b-1077-db88900c31cc";PortNumber = None;PortType = PortType.Input;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"};Vertices = [140.0,336.0; 344.0,336.0; 344.0,225.0; 364.0,225.0]};
        {Id = "221f1ae2-9beb-5099-bc4c-a3f6c86214d4";Source = {Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = None;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"};Vertices = [667.0,205.0; 723.0,205.0; 723.0,184.0; 743.0,184.0]};
        {Id = "78ceafbf-cfb8-4442-a6bb-62ed6a1893cd";Source = {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "a0194620-020c-8897-0207-9d7e9ee2a538";PortNumber = None;PortType = PortType.Input;HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"};Vertices = [667.0,225.0; 703.5,225.0; 703.5,240.0; 743.0,240.0]};
        {Id = "edc53e8b-8c1e-340f-aaec-7eecf337a9a8";Source = {Id = "9dc8cfaa-c989-276a-6703-11196c5c7974";PortNumber = None;PortType = PortType.Output;HostId = "76de964a-124b-5c16-6de1-6158626344ac"};Target = {Id = "4a1da488-0834-1835-9649-6f4d5c172579";PortNumber = None;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Vertices = [140.0,121.0; 279.5,121.0; 279.5,195.0; 299.5,195.0]};
        {Id = "3fd09a23-18c1-0edd-b7cb-a70a4b8d42ef";Source = {Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = None;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Target = {Id = "4f58042b-383e-7557-fa72-8b149ba177a2";PortNumber = None;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Vertices = [275.0,215.0; 299.5,215.0]};
        {Id = "7aaafe2c-9648-bb9d-95cb-7ed8c8309150";Source = {Id = "3fbb97a2-aab1-b94d-c4cf-d52f8421f3b8";PortNumber = None;PortType = PortType.Output;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Target = {Id = "38d99b30-a219-c37e-df55-04b7240a599e";PortNumber = None;PortType = PortType.Input;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"};Vertices = [339.5,205.0; 364.0,205.0]};
        {Id = "4852ec1c-5960-6696-b8c1-650b9517cb56";Source = {Id = "8333c9b0-911e-aab3-b7fd-026d97b4a412";PortNumber = None;PortType = PortType.Output;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"};Target = {Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = None;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Vertices = [586.0,215.0; 627.0,215.0]};
        {Id = "960e38bd-dd14-5109-ac25-8c701249f48b";Source = {Id = "6c5a63af-db72-1ece-495d-7a04c88fd1f0";PortNumber = None;PortType = PortType.Output;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"};Target = {Id = "67424fbf-f200-6690-a8e6-450e951d9411";PortNumber = None;PortType = PortType.Input;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"};Vertices = [404.0,215.0; 442.0,215.0]};
        {Id = "6d0843df-f606-4fb5-0349-ae90260e6c28";Source = {Id = "58405846-6427-732c-c901-f72f1162b36e";PortNumber = None;PortType = PortType.Output;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"};Target = {Id = "2a6d1069-81da-f185-ad82-3c524819f56a";PortNumber = None;PortType = PortType.Input;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"};Vertices = [482.0,205.0; 546.0,205.0]}
    ]

/// Pack 4 bits into a bus, then extract them.
// let stateBus12' : CanvasState =
//     [
//         {H=50;W=40; Id = "772307ab-2941-3343-28a2-faacaa0efc96";Type = ExtractWire 1;Label = "";InputPorts = [{Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = Some 0;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];OutputPorts = [{Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = Some 0;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}; {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = Some 1;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"}];X = 627;Y = 205};
//         {H=50;W=40; Id = "74dcc790-927f-ae61-fd63-577c3387de0e";Type = MergeWires;Label = "";InputPorts = [{Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = Some 0;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}; {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = Some 1;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];OutputPorts = [{Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = Some 0;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"}];X = 235;Y = 205};
//         {H=50;W=40; Id = "94efe8d3-413b-9390-b627-be7bc91ae2d1";Type = MergeWires;Label = "";InputPorts = [{Id = "4a1da488-0834-1835-9649-6f4d5c172579";PortNumber = Some 0;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}; {Id = "4f58042b-383e-7557-fa72-8b149ba177a2";PortNumber = Some 1;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}];OutputPorts = [{Id = "3fbb97a2-aab1-b94d-c4cf-d52f8421f3b8";PortNumber = Some 0;PortType = PortType.Output;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"}];X = 299;Y = 195};
//         {H=50;W=40; Id = "76de964a-124b-5c16-6de1-6158626344ac";Type = Input 1;Label = "a";InputPorts = [];OutputPorts = [{Id = "9dc8cfaa-c989-276a-6703-11196c5c7974";PortNumber = Some 0;PortType = PortType.Output;HostId = "76de964a-124b-5c16-6de1-6158626344ac"}];X = 110;Y = 111};
//         {H=50;W=40; Id = "a91be585-2d3b-d872-be0f-b416c8eb03d2";Type = Input 1;Label = "b";InputPorts = [];OutputPorts = [{Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = Some 0;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"}];X = 110;Y = 175};
//         {H=50;W=40; Id = "9985ebc6-1cd5-8863-1341-1d543d236d38";Type = Input 1;Label = "c";InputPorts = [];OutputPorts = [{Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = Some 0;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"}];X = 110;Y = 245};
//         {H=50;W=40; Id = "9824ceb8-e999-8e48-9a56-7a4349e495b1";Type = Input 1;Label = "d";InputPorts = [];OutputPorts = [{Id = "712999dd-e970-51b3-f38f-aee70ff42d2d";PortNumber = Some 0;PortType = PortType.Output;HostId = "9824ceb8-e999-8e48-9a56-7a4349e495b1"}];X = 110;Y = 326};
//         {H=50;W=40; Id = "c16668ed-ec17-3a14-8a4b-dec6c40335b5";Type = MergeWires;Label = "";InputPorts = [{Id = "38d99b30-a219-c37e-df55-04b7240a599e";PortNumber = Some 0;PortType = PortType.Input;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"}; {Id = "2f0c6067-124f-233b-1077-db88900c31cc";PortNumber = Some 1;PortType = PortType.Input;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"}];OutputPorts = [{Id = "6c5a63af-db72-1ece-495d-7a04c88fd1f0";PortNumber = Some 0;PortType = PortType.Output;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"}];X = 364;Y = 205};
//         {H=50;W=40; Id = "59b45f9c-192c-98ce-da25-a94db45a5790";Type = Output 1;Label = "a-out";InputPorts = [{Id = "e62e040a-bcd2-58f6-39d5-24548811b784";PortNumber = Some 0;PortType = PortType.Input;HostId = "59b45f9c-192c-98ce-da25-a94db45a5790"}];OutputPorts = [];X = 746;Y = 111};
//         {H=50;W=40; Id = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a";Type = Output 1;Label = "b-out";InputPorts = [{Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = Some 0;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"}];OutputPorts = [];X = 743;Y = 174};
//         {H=50;W=40; Id = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b";Type = Output 1;Label = "c-out";InputPorts = [{Id = "a0194620-020c-8897-0207-9d7e9ee2a538";PortNumber = Some 0;PortType = PortType.Input;HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"}];OutputPorts = [];X = 743;Y = 230};
//         {H=50;W=40; Id = "214620f0-51f6-59fe-1558-ed47fd2c680a";Type = Output 1;Label = "d-out";InputPorts = [{Id = "b6e25648-a9a1-9c9c-935d-5f50a26c6c2b";PortNumber = Some 0;PortType = PortType.Input;HostId = "214620f0-51f6-59fe-1558-ed47fd2c680a"}];OutputPorts = [];X = 743;Y = 315};
//         {H=50;W=40; Id = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf";Type = ExtractWire 1;Label = "";InputPorts = [{Id = "2a6d1069-81da-f185-ad82-3c524819f56a";PortNumber = Some 0;PortType = PortType.Input;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"}];OutputPorts = [{Id = "f72513fe-f696-dbae-133b-6c864c7075a2";PortNumber = Some 0;PortType = PortType.Output;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"}; {Id = "8333c9b0-911e-aab3-b7fd-026d97b4a412";PortNumber = Some 1;PortType = PortType.Output;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"}];X = 546;Y = 195};
//         {H=50;W=40; Id = "156b43f1-5e54-b058-c716-c5623c5f6e37";Type = ExtractWire 3;Label = "";InputPorts = [{Id = "67424fbf-f200-6690-a8e6-450e951d9411";PortNumber = Some 0;PortType = PortType.Input;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"}];OutputPorts = [{Id = "58405846-6427-732c-c901-f72f1162b36e";PortNumber = Some 0;PortType = PortType.Output;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"}; {Id = "d40a1df5-6b29-5b4d-486f-925a2d16a615";PortNumber = Some 1;PortType = PortType.Output;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"}];X = 442;Y = 205}
//     ],
//     [
//         {Id = "5a9d111c-acec-3973-01ea-d0590e547b89";Source = {Id = "d40a1df5-6b29-5b4d-486f-925a2d16a615";PortNumber = None;PortType = PortType.Output;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"};Target = {Id = "b6e25648-a9a1-9c9c-935d-5f50a26c6c2b";PortNumber = None;PortType = PortType.Input;HostId = "214620f0-51f6-59fe-1558-ed47fd2c680a"};Vertices = [482.0,225.0; 510.5,225.0; 510.5,325.0; 743.0,325.0]};
//         {Id = "8f3205ca-5911-5a36-68da-4e8ca384c4a2";Source = {Id = "f72513fe-f696-dbae-133b-6c864c7075a2";PortNumber = None;PortType = PortType.Output;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"};Target = {Id = "e62e040a-bcd2-58f6-39d5-24548811b784";PortNumber = None;PortType = PortType.Input;HostId = "59b45f9c-192c-98ce-da25-a94db45a5790"};Vertices = [586.0,195.0; 666.0,195.0; 666.0,121.0; 746.0,121.0]};
//         {Id = "1287faef-e07d-cca5-83c7-3aa3b1265cd8";Source = {Id = "3d87edd9-9572-df33-f8f8-9b77fbdd6bc5";PortNumber = None;PortType = PortType.Output;HostId = "9985ebc6-1cd5-8863-1341-1d543d236d38"};Target = {Id = "edd76daa-336d-7c68-8d94-7bbe30539724";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,255.0; 187.5,255.0; 187.5,225.0; 235.0,225.0]};
//         {Id = "cfaa960d-99c2-0f40-4ac7-335f6a238e2b";Source = {Id = "7a9bee0a-7ecc-13b6-ed3e-942f32d3c5fb";PortNumber = None;PortType = PortType.Output;HostId = "a91be585-2d3b-d872-be0f-b416c8eb03d2"};Target = {Id = "f4b2f416-0af3-8345-185a-d01b69fdda46";PortNumber = None;PortType = PortType.Input;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Vertices = [140.0,185.0; 187.5,185.0; 187.5,205.0; 235.0,205.0]};
//         {Id = "56e8c89b-bcbf-e674-a49d-72d06c20a563";Source = {Id = "712999dd-e970-51b3-f38f-aee70ff42d2d";PortNumber = None;PortType = PortType.Output;HostId = "9824ceb8-e999-8e48-9a56-7a4349e495b1"};Target = {Id = "2f0c6067-124f-233b-1077-db88900c31cc";PortNumber = None;PortType = PortType.Input;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"};Vertices = [140.0,336.0; 344.0,336.0; 344.0,225.0; 364.0,225.0]};
//         {Id = "221f1ae2-9beb-5099-bc4c-a3f6c86214d4";Source = {Id = "6df8212b-0639-3d53-61cd-297e74d6bbad";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "ee1bc94e-a726-8868-f25a-25b5fc44b60a";PortNumber = None;PortType = PortType.Input;HostId = "8a9392fc-493b-7e96-72ec-b6f5f11ded8a"};Vertices = [667.0,205.0; 723.0,205.0; 723.0,184.0; 743.0,184.0]};
//         {Id = "78ceafbf-cfb8-4442-a6bb-62ed6a1893cd";Source = {Id = "5a95b665-510e-848c-c178-e0356b48940a";PortNumber = None;PortType = PortType.Output;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Target = {Id = "a0194620-020c-8897-0207-9d7e9ee2a538";PortNumber = None;PortType = PortType.Input;HostId = "dfcf6cff-fbac-e54f-7a9d-7059d17e3a0b"};Vertices = [667.0,225.0; 703.5,225.0; 703.5,240.0; 743.0,240.0]};
//         {Id = "edc53e8b-8c1e-340f-aaec-7eecf337a9a8";Source = {Id = "9dc8cfaa-c989-276a-6703-11196c5c7974";PortNumber = None;PortType = PortType.Output;HostId = "76de964a-124b-5c16-6de1-6158626344ac"};Target = {Id = "4a1da488-0834-1835-9649-6f4d5c172579";PortNumber = None;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Vertices = [140.0,121.0; 279.5,121.0; 279.5,195.0; 299.5,195.0]};
//         {Id = "3fd09a23-18c1-0edd-b7cb-a70a4b8d42ef";Source = {Id = "6e7f6dfb-770b-1451-a569-1d20cc0785b6";PortNumber = None;PortType = PortType.Output;HostId = "74dcc790-927f-ae61-fd63-577c3387de0e"};Target = {Id = "4f58042b-383e-7557-fa72-8b149ba177a2";PortNumber = None;PortType = PortType.Input;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Vertices = [275.0,215.0; 299.5,215.0]};
//         {Id = "7aaafe2c-9648-bb9d-95cb-7ed8c8309150";Source = {Id = "3fbb97a2-aab1-b94d-c4cf-d52f8421f3b8";PortNumber = None;PortType = PortType.Output;HostId = "94efe8d3-413b-9390-b627-be7bc91ae2d1"};Target = {Id = "38d99b30-a219-c37e-df55-04b7240a599e";PortNumber = None;PortType = PortType.Input;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"};Vertices = [339.5,205.0; 364.0,205.0]};
//         {Id = "4852ec1c-5960-6696-b8c1-650b9517cb56";Source = {Id = "8333c9b0-911e-aab3-b7fd-026d97b4a412";PortNumber = None;PortType = PortType.Output;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"};Target = {Id = "2332109c-b48a-be65-70fd-662fc00cd0c7";PortNumber = None;PortType = PortType.Input;HostId = "772307ab-2941-3343-28a2-faacaa0efc96"};Vertices = [586.0,215.0; 627.0,215.0]};
//         {Id = "960e38bd-dd14-5109-ac25-8c701249f48b";Source = {Id = "6c5a63af-db72-1ece-495d-7a04c88fd1f0";PortNumber = None;PortType = PortType.Output;HostId = "c16668ed-ec17-3a14-8a4b-dec6c40335b5"};Target = {Id = "67424fbf-f200-6690-a8e6-450e951d9411";PortNumber = None;PortType = PortType.Input;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"};Vertices = [404.0,215.0; 442.0,215.0]};
//         {Id = "6d0843df-f606-4fb5-0349-ae90260e6c28";Source = {Id = "58405846-6427-732c-c901-f72f1162b36e";PortNumber = None;PortType = PortType.Output;HostId = "156b43f1-5e54-b058-c716-c5623c5f6e37"};Target = {Id = "2a6d1069-81da-f185-ad82-3c524819f56a";PortNumber = None;PortType = PortType.Input;HostId = "a3b6ec22-f265-2ec6-fad0-a4259ec4b3cf"};Vertices = [482.0,205.0; 546.0,205.0]}
//     ]

/// A 4 bit input connected to a 4 bit output.
let stateBus13 : CanvasState =
    [
        {H=50;W=40; Id = "9bcba47e-deae-0b3f-2079-a1b124526b00";Type = Input 4;Label = "a";InputPorts = [];OutputPorts = [{Id = "f9f6284f-1663-ec81-5c5c-0a6660d1d524";PortNumber = Some 0;PortType = PortType.Output;HostId = "9bcba47e-deae-0b3f-2079-a1b124526b00"}];X = 100;Y = 100};
        {H=50;W=40; Id = "ad2ef0c3-537e-9d2e-0064-ac6b952e4b97";Type = Output 4;Label = "b";InputPorts = [{Id = "ba682a02-30db-a03f-db83-8f3ab1afc6e0";PortNumber = Some 0;PortType = PortType.Input;HostId = "ad2ef0c3-537e-9d2e-0064-ac6b952e4b97"}];OutputPorts = [];X = 193;Y = 100}
    ],
    [
        {Id = "conn";Source = {Id = "f9f6284f-1663-ec81-5c5c-0a6660d1d524";PortNumber = None;PortType = PortType.Output;HostId = "9bcba47e-deae-0b3f-2079-a1b124526b00"};Target = {Id = "ba682a02-30db-a03f-db83-8f3ab1afc6e0";PortNumber = None;PortType = PortType.Input;HostId = "ad2ef0c3-537e-9d2e-0064-ac6b952e4b97"};Vertices = [130.0,110.0; 193.0,110.0]}
    ]

/// A 4 bit input connected to a 3 bit output.
let stateBus14 : CanvasState =
    [
        {H=50;W=40; Id = "9bcba47e-deae-0b3f-2079-a1b124526b00";Type = Input 4;Label = "a";InputPorts = [];OutputPorts = [{Id = "f9f6284f-1663-ec81-5c5c-0a6660d1d524";PortNumber = Some 0;PortType = PortType.Output;HostId = "9bcba47e-deae-0b3f-2079-a1b124526b00"}];X = 100;Y = 100};
        {H=50;W=40; Id = "ad2ef0c3-537e-9d2e-0064-ac6b952e4b97";Type = Output 3;Label = "b";InputPorts = [{Id = "ba682a02-30db-a03f-db83-8f3ab1afc6e0";PortNumber = Some 0;PortType = PortType.Input;HostId = "ad2ef0c3-537e-9d2e-0064-ac6b952e4b97"}];OutputPorts = [];X = 193;Y = 100}
    ],
    [
        {Id = "conn";Source = {Id = "f9f6284f-1663-ec81-5c5c-0a6660d1d524";PortNumber = None;PortType = PortType.Output;HostId = "9bcba47e-deae-0b3f-2079-a1b124526b00"};Target = {Id = "ba682a02-30db-a03f-db83-8f3ab1afc6e0";PortNumber = None;PortType = PortType.Input;HostId = "ad2ef0c3-537e-9d2e-0064-ac6b952e4b97"};Vertices = [130.0,110.0; 193.0,110.0]}
    ]

/// A 3 bit input connected to a 4 bit output.
let stateBus15 : CanvasState =
    [
        {H=50;W=40; Id = "9bcba47e-deae-0b3f-2079-a1b124526b00";Type = Input 3;Label = "a";InputPorts = [];OutputPorts = [{Id = "f9f6284f-1663-ec81-5c5c-0a6660d1d524";PortNumber = Some 0;PortType = PortType.Output;HostId = "9bcba47e-deae-0b3f-2079-a1b124526b00"}];X = 100;Y = 100};
        {H=50;W=40; Id = "ad2ef0c3-537e-9d2e-0064-ac6b952e4b97";Type = Output 4;Label = "b";InputPorts = [{Id = "ba682a02-30db-a03f-db83-8f3ab1afc6e0";PortNumber = Some 0;PortType = PortType.Input;HostId = "ad2ef0c3-537e-9d2e-0064-ac6b952e4b97"}];OutputPorts = [];X = 193;Y = 100}
    ],
    [
        {Id = "conn";Source = {Id = "f9f6284f-1663-ec81-5c5c-0a6660d1d524";PortNumber = None;PortType = PortType.Output;HostId = "9bcba47e-deae-0b3f-2079-a1b124526b00"};Target = {Id = "ba682a02-30db-a03f-db83-8f3ab1afc6e0";PortNumber = None;PortType = PortType.Input;HostId = "ad2ef0c3-537e-9d2e-0064-ac6b952e4b97"};Vertices = [130.0,110.0; 193.0,110.0]}
    ]

/// A 2 bit input split into 2 single bit outputs.
let stateBus16 : CanvasState =
    [
        {H=50;W=40; Id = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5";Type = SplitWire 1;Label = "";InputPorts = [{Id = "a5977d59-b944-6651-bf91-3f3700bca60b";PortNumber = Some 0;PortType = PortType.Input;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"}];OutputPorts = [{Id = "de1e9d70-4ce1-c6d9-cb87-30f632c9e1d1";PortNumber = Some 0;PortType = PortType.Output;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"}; {Id = "dc05cdf8-5ef7-c605-6c5b-bb8842c49089";PortNumber = Some 1;PortType = PortType.Output;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"}];X = 202;Y = 112};
        {H=50;W=40; Id = "c6f000db-310f-d8ad-ff5e-938d7c2aaa7c";Type = Input 2;Label = "a";InputPorts = [];OutputPorts = [{Id = "28047c34-2af2-867e-9130-6eb128769eef";PortNumber = Some 0;PortType = PortType.Output;HostId = "c6f000db-310f-d8ad-ff5e-938d7c2aaa7c"}];X = 102;Y = 112};
        {H=50;W=40; Id = "60e2df66-bb8c-53f1-832d-e154c30cf9dd";Type = Output 1;Label = "b";InputPorts = [{Id = "24e75289-91d1-30e7-0ec5-409eb73f9ad3";PortNumber = Some 0;PortType = PortType.Input;HostId = "60e2df66-bb8c-53f1-832d-e154c30cf9dd"}];OutputPorts = [];X = 324;Y = 88};
        {H=50;W=40; Id = "85e19389-c087-8b30-6c0a-02f7cc753695";Type = Output 1;Label = "c";InputPorts = [{Id = "99c1d8ae-5e85-fbbf-892d-48acb0fdff82";PortNumber = Some 0;PortType = PortType.Input;HostId = "85e19389-c087-8b30-6c0a-02f7cc753695"}];OutputPorts = [];X = 324;Y = 152}
    ],
    [
        {Id = "conn0";Source = {Id = "28047c34-2af2-867e-9130-6eb128769eef";PortNumber = None;PortType = PortType.Output;HostId = "c6f000db-310f-d8ad-ff5e-938d7c2aaa7c"};Target = {Id = "a5977d59-b944-6651-bf91-3f3700bca60b";PortNumber = None;PortType = PortType.Input;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"};Vertices = [132.0,122.0; 202.0,122.0]};
        {Id = "conn1";Source = {Id = "dc05cdf8-5ef7-c605-6c5b-bb8842c49089";PortNumber = None;PortType = PortType.Output;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"};Target = {Id = "99c1d8ae-5e85-fbbf-892d-48acb0fdff82";PortNumber = None;PortType = PortType.Input;HostId = "85e19389-c087-8b30-6c0a-02f7cc753695"};Vertices = [242.0,132.0; 283.0,132.0; 283.0,162.0; 324.0,162.0]};
        {Id = "conn2";Source = {Id = "de1e9d70-4ce1-c6d9-cb87-30f632c9e1d1";PortNumber = None;PortType = PortType.Output;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"};Target = {Id = "24e75289-91d1-30e7-0ec5-409eb73f9ad3";PortNumber = None;PortType = PortType.Input;HostId = "60e2df66-bb8c-53f1-832d-e154c30cf9dd"};Vertices = [242.0,112.0; 283.0,112.0; 283.0,98.0; 324.0,98.0]}
    ]

/// A 2 bit input split into 2 single bit outputs.
// let stateBus16' : CanvasState =
//     [
//         {H=50;W=40; Id = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5";Type = ExtractWire 1;Label = "";InputPorts = [{Id = "a5977d59-b944-6651-bf91-3f3700bca60b";PortNumber = Some 0;PortType = PortType.Input;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"}];OutputPorts = [{Id = "de1e9d70-4ce1-c6d9-cb87-30f632c9e1d1";PortNumber = Some 0;PortType = PortType.Output;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"}; {Id = "dc05cdf8-5ef7-c605-6c5b-bb8842c49089";PortNumber = Some 1;PortType = PortType.Output;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"}];X = 202;Y = 112};
//         {H=50;W=40; Id = "c6f000db-310f-d8ad-ff5e-938d7c2aaa7c";Type = Input 2;Label = "a";InputPorts = [];OutputPorts = [{Id = "28047c34-2af2-867e-9130-6eb128769eef";PortNumber = Some 0;PortType = PortType.Output;HostId = "c6f000db-310f-d8ad-ff5e-938d7c2aaa7c"}];X = 102;Y = 112};
//         {H=50;W=40; Id = "60e2df66-bb8c-53f1-832d-e154c30cf9dd";Type = Output 1;Label = "b";InputPorts = [{Id = "24e75289-91d1-30e7-0ec5-409eb73f9ad3";PortNumber = Some 0;PortType = PortType.Input;HostId = "60e2df66-bb8c-53f1-832d-e154c30cf9dd"}];OutputPorts = [];X = 324;Y = 88};
//         {H=50;W=40; Id = "85e19389-c087-8b30-6c0a-02f7cc753695";Type = Output 1;Label = "c";InputPorts = [{Id = "99c1d8ae-5e85-fbbf-892d-48acb0fdff82";PortNumber = Some 0;PortType = PortType.Input;HostId = "85e19389-c087-8b30-6c0a-02f7cc753695"}];OutputPorts = [];X = 324;Y = 152}
//     ],
//     [
//         {Id = "conn0";Source = {Id = "28047c34-2af2-867e-9130-6eb128769eef";PortNumber = None;PortType = PortType.Output;HostId = "c6f000db-310f-d8ad-ff5e-938d7c2aaa7c"};Target = {Id = "a5977d59-b944-6651-bf91-3f3700bca60b";PortNumber = None;PortType = PortType.Input;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"};Vertices = [132.0,122.0; 202.0,122.0]};
//         {Id = "conn1";Source = {Id = "dc05cdf8-5ef7-c605-6c5b-bb8842c49089";PortNumber = None;PortType = PortType.Output;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"};Target = {Id = "99c1d8ae-5e85-fbbf-892d-48acb0fdff82";PortNumber = None;PortType = PortType.Input;HostId = "85e19389-c087-8b30-6c0a-02f7cc753695"};Vertices = [242.0,132.0; 283.0,132.0; 283.0,162.0; 324.0,162.0]};
//         {Id = "conn2";Source = {Id = "de1e9d70-4ce1-c6d9-cb87-30f632c9e1d1";PortNumber = None;PortType = PortType.Output;HostId = "96b167b2-2c40-34e7-d4fc-4a7016c7ddf5"};Target = {Id = "24e75289-91d1-30e7-0ec5-409eb73f9ad3";PortNumber = None;PortType = PortType.Input;HostId = "60e2df66-bb8c-53f1-832d-e154c30cf9dd"};Vertices = [242.0,112.0; 283.0,112.0; 283.0,98.0; 324.0,98.0]}
//     ]

/// 3 bit input merged with 4 bit input, then split in the same way.
let stateBus17 : CanvasState =
    [
        {H=50;W=40; Id = "6bcdc74a-9d71-3304-537d-1a17f02924eb";Type = Input 3;Label = "in3";InputPorts = [];OutputPorts = [{Id = "9e8b16ba-d450-c228-e64c-d5323cd4ca0a";PortNumber = Some 0;PortType = PortType.Output;HostId = "6bcdc74a-9d71-3304-537d-1a17f02924eb"}];X = 100;Y = 100};
        {H=50;W=40; Id = "97c4b56d-4f8c-2b00-fb61-a08cdd01dd76";Type = Input 4;Label = "in4";InputPorts = [];OutputPorts = [{Id = "2cf62d71-2b34-ab11-9007-19409fe13b77";PortNumber = Some 0;PortType = PortType.Output;HostId = "97c4b56d-4f8c-2b00-fb61-a08cdd01dd76"}];X = 100;Y = 183};
        {H=50;W=40; Id = "71d66801-50d5-4316-eb79-9e99a43cdfe4";Type = MergeWires;Label = "";InputPorts = [{Id = "6714352e-6a15-a388-3f3f-27c7cb0e6fc7";PortNumber = Some 0;PortType = PortType.Input;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"}; {Id = "32c34b03-b0f0-16f5-345a-fca3626f16c3";PortNumber = Some 1;PortType = PortType.Input;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"}];OutputPorts = [{Id = "85cc42dd-5ea8-0f62-a421-74d844f4de83";PortNumber = Some 0;PortType = PortType.Output;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"}];X = 190;Y = 138};
        {H=50;W=40; Id = "1a6e1bb4-cfe0-77f9-a207-f409168ef210";Type = Output 3;Label = "out3";InputPorts = [{Id = "ca111545-dbcd-e812-b81d-af6e51769f0e";PortNumber = Some 0;PortType = PortType.Input;HostId = "1a6e1bb4-cfe0-77f9-a207-f409168ef210"}];OutputPorts = [];X = 375;Y = 89};
        {H=50;W=40; Id = "d2676492-2302-24d9-52eb-6e69e7971339";Type = Output 4;Label = "out4";InputPorts = [{Id = "819cf4ff-57a7-4743-075b-0c07a983a866";PortNumber = Some 0;PortType = PortType.Input;HostId = "d2676492-2302-24d9-52eb-6e69e7971339"}];OutputPorts = [];X = 369;Y = 216};
        {H=50;W=40; Id = "bb51f8c6-2c82-5206-eb25-492e15849e81";Type = SplitWire 3;Label = "";InputPorts = [{Id = "4a440c75-75c5-1a5c-93d9-97ca3993683f";PortNumber = Some 0;PortType = PortType.Input;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"}];OutputPorts = [{Id = "68ca1398-18c8-cea1-c6c2-61393fb33e08";PortNumber = Some 0;PortType = PortType.Output;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"}; {Id = "be6c9827-eba7-6c19-ca75-7fcb1ac30dc9";PortNumber = Some 1;PortType = PortType.Output;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"}];X = 254;Y = 138}
    ],
    [
        {Id = "9df32195-00b4-9795-3dc1-78fb70d453f2";Source = {Id = "68ca1398-18c8-cea1-c6c2-61393fb33e08";PortNumber = None;PortType = PortType.Output;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"};Target = {Id = "ca111545-dbcd-e812-b81d-af6e51769f0e";PortNumber = None;PortType = PortType.Input;HostId = "1a6e1bb4-cfe0-77f9-a207-f409168ef210"};Vertices = [294.0,138.0; 334.5,138.0; 334.5,99.0; 375.0,99.0]};
        {Id = "82cc4ce9-7b15-40ac-0226-98a7f8e2fb9a";Source = {Id = "be6c9827-eba7-6c19-ca75-7fcb1ac30dc9";PortNumber = None;PortType = PortType.Output;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"};Target = {Id = "819cf4ff-57a7-4743-075b-0c07a983a866";PortNumber = None;PortType = PortType.Input;HostId = "d2676492-2302-24d9-52eb-6e69e7971339"};Vertices = [294.0,158.0; 331.5,158.0; 331.5,226.0; 369.0,226.0]};
        {Id = "cd13c70f-6037-0cf4-1295-5795e92d745c";Source = {Id = "9e8b16ba-d450-c228-e64c-d5323cd4ca0a";PortNumber = None;PortType = PortType.Output;HostId = "6bcdc74a-9d71-3304-537d-1a17f02924eb"};Target = {Id = "6714352e-6a15-a388-3f3f-27c7cb0e6fc7";PortNumber = None;PortType = PortType.Input;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"};Vertices = [130.0,110.0; 160.0,110.0; 160.0,138.0; 190.0,138.0]};
        {Id = "7438de0c-bbaf-c1f6-0307-42ece66c6c00";Source = {Id = "2cf62d71-2b34-ab11-9007-19409fe13b77";PortNumber = None;PortType = PortType.Output;HostId = "97c4b56d-4f8c-2b00-fb61-a08cdd01dd76"};Target = {Id = "32c34b03-b0f0-16f5-345a-fca3626f16c3";PortNumber = None;PortType = PortType.Input;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"};Vertices = [130.0,193.0; 160.0,193.0; 160.0,158.0; 190.0,158.0]};
        {Id = "678ffa07-0ed7-7b6f-ba9b-b14839c08a71";Source = {Id = "85cc42dd-5ea8-0f62-a421-74d844f4de83";PortNumber = None;PortType = PortType.Output;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"};Target = {Id = "4a440c75-75c5-1a5c-93d9-97ca3993683f";PortNumber = None;PortType = PortType.Input;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"};Vertices = [230.0,148.0; 254.0,148.0]}
]

/// 3 bit input merged with 4 bit input, then split in the same way.
// let stateBus17' : CanvasState =
//     [
//         {H=50;W=40; Id = "6bcdc74a-9d71-3304-537d-1a17f02924eb";Type = Input 3;Label = "in3";InputPorts = [];OutputPorts = [{Id = "9e8b16ba-d450-c228-e64c-d5323cd4ca0a";PortNumber = Some 0;PortType = PortType.Output;HostId = "6bcdc74a-9d71-3304-537d-1a17f02924eb"}];X = 100;Y = 100};
//         {H=50;W=40; Id = "97c4b56d-4f8c-2b00-fb61-a08cdd01dd76";Type = Input 4;Label = "in4";InputPorts = [];OutputPorts = [{Id = "2cf62d71-2b34-ab11-9007-19409fe13b77";PortNumber = Some 0;PortType = PortType.Output;HostId = "97c4b56d-4f8c-2b00-fb61-a08cdd01dd76"}];X = 100;Y = 183};
//         {H=50;W=40; Id = "71d66801-50d5-4316-eb79-9e99a43cdfe4";Type = MergeWires;Label = "";InputPorts = [{Id = "6714352e-6a15-a388-3f3f-27c7cb0e6fc7";PortNumber = Some 0;PortType = PortType.Input;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"}; {Id = "32c34b03-b0f0-16f5-345a-fca3626f16c3";PortNumber = Some 1;PortType = PortType.Input;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"}];OutputPorts = [{Id = "85cc42dd-5ea8-0f62-a421-74d844f4de83";PortNumber = Some 0;PortType = PortType.Output;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"}];X = 190;Y = 138};
//         {H=50;W=40; Id = "1a6e1bb4-cfe0-77f9-a207-f409168ef210";Type = Output 3;Label = "out3";InputPorts = [{Id = "ca111545-dbcd-e812-b81d-af6e51769f0e";PortNumber = Some 0;PortType = PortType.Input;HostId = "1a6e1bb4-cfe0-77f9-a207-f409168ef210"}];OutputPorts = [];X = 375;Y = 89};
//         {H=50;W=40; Id = "d2676492-2302-24d9-52eb-6e69e7971339";Type = Output 4;Label = "out4";InputPorts = [{Id = "819cf4ff-57a7-4743-075b-0c07a983a866";PortNumber = Some 0;PortType = PortType.Input;HostId = "d2676492-2302-24d9-52eb-6e69e7971339"}];OutputPorts = [];X = 369;Y = 216};
//         {H=50;W=40; Id = "bb51f8c6-2c82-5206-eb25-492e15849e81";Type = ExtractWire 3;Label = "";InputPorts = [{Id = "4a440c75-75c5-1a5c-93d9-97ca3993683f";PortNumber = Some 0;PortType = PortType.Input;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"}];OutputPorts = [{Id = "68ca1398-18c8-cea1-c6c2-61393fb33e08";PortNumber = Some 0;PortType = PortType.Output;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"}; {Id = "be6c9827-eba7-6c19-ca75-7fcb1ac30dc9";PortNumber = Some 1;PortType = PortType.Output;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"}];X = 254;Y = 138}
//     ],
//     [
//         {Id = "9df32195-00b4-9795-3dc1-78fb70d453f2";Source = {Id = "68ca1398-18c8-cea1-c6c2-61393fb33e08";PortNumber = None;PortType = PortType.Output;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"};Target = {Id = "ca111545-dbcd-e812-b81d-af6e51769f0e";PortNumber = None;PortType = PortType.Input;HostId = "1a6e1bb4-cfe0-77f9-a207-f409168ef210"};Vertices = [294.0,138.0; 334.5,138.0; 334.5,99.0; 375.0,99.0]};
//         {Id = "82cc4ce9-7b15-40ac-0226-98a7f8e2fb9a";Source = {Id = "be6c9827-eba7-6c19-ca75-7fcb1ac30dc9";PortNumber = None;PortType = PortType.Output;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"};Target = {Id = "819cf4ff-57a7-4743-075b-0c07a983a866";PortNumber = None;PortType = PortType.Input;HostId = "d2676492-2302-24d9-52eb-6e69e7971339"};Vertices = [294.0,158.0; 331.5,158.0; 331.5,226.0; 369.0,226.0]};
//         {Id = "cd13c70f-6037-0cf4-1295-5795e92d745c";Source = {Id = "9e8b16ba-d450-c228-e64c-d5323cd4ca0a";PortNumber = None;PortType = PortType.Output;HostId = "6bcdc74a-9d71-3304-537d-1a17f02924eb"};Target = {Id = "6714352e-6a15-a388-3f3f-27c7cb0e6fc7";PortNumber = None;PortType = PortType.Input;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"};Vertices = [130.0,110.0; 160.0,110.0; 160.0,138.0; 190.0,138.0]};
//         {Id = "7438de0c-bbaf-c1f6-0307-42ece66c6c00";Source = {Id = "2cf62d71-2b34-ab11-9007-19409fe13b77";PortNumber = None;PortType = PortType.Output;HostId = "97c4b56d-4f8c-2b00-fb61-a08cdd01dd76"};Target = {Id = "32c34b03-b0f0-16f5-345a-fca3626f16c3";PortNumber = None;PortType = PortType.Input;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"};Vertices = [130.0,193.0; 160.0,193.0; 160.0,158.0; 190.0,158.0]};
//         {Id = "678ffa07-0ed7-7b6f-ba9b-b14839c08a71";Source = {Id = "85cc42dd-5ea8-0f62-a421-74d844f4de83";PortNumber = None;PortType = PortType.Output;HostId = "71d66801-50d5-4316-eb79-9e99a43cdfe4"};Target = {Id = "4a440c75-75c5-1a5c-93d9-97ca3993683f";PortNumber = None;PortType = PortType.Input;HostId = "bb51f8c6-2c82-5206-eb25-492e15849e81"};Vertices = [230.0,148.0; 254.0,148.0]}
// ]

/// Partially connected Mux2. Top input (2 bits), select (1 bit) anc connection
/// to output (2 bits).
let stateBus18 : CanvasState =
    [
        {H=50;W=40; Id = "8078a917-236f-5a40-18a6-8e2d6a1458f5";Type = Input 2;Label = "a";InputPorts = [];OutputPorts = [{Id = "cc7c6510-d49b-28d9-e0bc-d5350a2c76a8";PortNumber = Some 0;PortType = PortType.Output;HostId = "8078a917-236f-5a40-18a6-8e2d6a1458f5"}];X = 122;Y = 125};
        {H=50;W=40; Id = "ed12b5d8-556b-515a-cc9d-873960690380";Type = Input 1;Label = "b";InputPorts = [];OutputPorts = [{Id = "a6010bcb-ba2b-e57f-ca50-39f3d094e3b8";PortNumber = Some 0;PortType = PortType.Output;HostId = "ed12b5d8-556b-515a-cc9d-873960690380"}];X = 122;Y = 204};
        {H=50;W=40; Id = "d7028a8f-83be-0d81-6f0f-19b384caddae";Type = Mux2;Label = "";InputPorts = [{Id = "108ea909-b27f-24ba-22ea-2faeb061a926";PortNumber = Some 0;PortType = PortType.Input;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"}; {Id = "38c8c934-d55e-2aff-e61b-5fbf7d7eed91";PortNumber = Some 1;PortType = PortType.Input;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"}; {Id = "f283db84-a1f0-d006-be39-f17be6f8490c";PortNumber = Some 2;PortType = PortType.Input;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"}];OutputPorts = [{Id = "5b651087-9b95-3a80-4f99-014f85f0dfdd";PortNumber = Some 0;PortType = PortType.Output;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"}];X = 244;Y = 156};
        {H=50;W=40; Id = "00661085-7d05-4185-09ef-4138ac918ad2";Type = Output 2;Label = "aa";InputPorts = [{Id = "7bbfa7d3-4718-e6fe-e7e9-8c00e5257f45";PortNumber = Some 0;PortType = PortType.Input;HostId = "00661085-7d05-4185-09ef-4138ac918ad2"}];OutputPorts = [];X = 373;Y = 171}
    ],
    [
        {Id = "conn-sel";Source = {Id = "a6010bcb-ba2b-e57f-ca50-39f3d094e3b8";PortNumber = None;PortType = PortType.Output;HostId = "ed12b5d8-556b-515a-cc9d-873960690380"};Target = {Id = "f283db84-a1f0-d006-be39-f17be6f8490c";PortNumber = None;PortType = PortType.Input;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"};Vertices = [152.0,214.0; 259.0,214.0; 259.0,201.0]};
        {Id = "conn-top-input";Source = {Id = "cc7c6510-d49b-28d9-e0bc-d5350a2c76a8";PortNumber = None;PortType = PortType.Output;HostId = "8078a917-236f-5a40-18a6-8e2d6a1458f5"};Target = {Id = "108ea909-b27f-24ba-22ea-2faeb061a926";PortNumber = None;PortType = PortType.Input;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"};Vertices = [152.0,135.0; 198.0,135.0; 198.0,172.0; 244.0,172.6]};
        {Id = "conn-to-output";Source = {Id = "5b651087-9b95-3a80-4f99-014f85f0dfdd";PortNumber = None;PortType = PortType.Output;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"};Target = {Id = "7bbfa7d3-4718-e6fe-e7e9-8c00e5257f45";PortNumber = None;PortType = PortType.Input;HostId = "00661085-7d05-4185-09ef-4138ac918ad2"};Vertices = [274.0,181.0; 373.0,181.0]}
    ]

/// Fully connected Mux, but two inputs have different widths. Similar to
/// stateBus18.
let stateBus19 : CanvasState =
    [
        {H=50;W=40; Id = "8078a917-236f-5a40-18a6-8e2d6a1458f5";Type = Input 2;Label = "a";InputPorts = [];OutputPorts = [{Id = "cc7c6510-d49b-28d9-e0bc-d5350a2c76a8";PortNumber = Some 0;PortType = PortType.Output;HostId = "8078a917-236f-5a40-18a6-8e2d6a1458f5"}];X = 122;Y = 125};
        {H=50;W=40; Id = "ed12b5d8-556b-515a-cc9d-873960690380";Type = Input 1;Label = "b";InputPorts = [];OutputPorts = [{Id = "a6010bcb-ba2b-e57f-ca50-39f3d094e3b8";PortNumber = Some 0;PortType = PortType.Output;HostId = "ed12b5d8-556b-515a-cc9d-873960690380"}];X = 122;Y = 204};
        {H=50;W=40; Id = "d7028a8f-83be-0d81-6f0f-19b384caddae";Type = Mux2;Label = "";InputPorts = [{Id = "108ea909-b27f-24ba-22ea-2faeb061a926";PortNumber = Some 0;PortType = PortType.Input;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"}; {Id = "38c8c934-d55e-2aff-e61b-5fbf7d7eed91";PortNumber = Some 1;PortType = PortType.Input;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"}; {Id = "f283db84-a1f0-d006-be39-f17be6f8490c";PortNumber = Some 2;PortType = PortType.Input;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"}];OutputPorts = [{Id = "5b651087-9b95-3a80-4f99-014f85f0dfdd";PortNumber = Some 0;PortType = PortType.Output;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"}];X = 244;Y = 156};
        {H=50;W=40; Id = "00661085-7d05-4185-09ef-4138ac918ad2";Type = Output 2;Label = "aa";InputPorts = [{Id = "7bbfa7d3-4718-e6fe-e7e9-8c00e5257f45";PortNumber = Some 0;PortType = PortType.Input;HostId = "00661085-7d05-4185-09ef-4138ac918ad2"}];OutputPorts = [];X = 373;Y = 171}
    ],
    [
        {Id = "conn-sel";Source = {Id = "a6010bcb-ba2b-e57f-ca50-39f3d094e3b8";PortNumber = None;PortType = PortType.Output;HostId = "ed12b5d8-556b-515a-cc9d-873960690380"};Target = {Id = "f283db84-a1f0-d006-be39-f17be6f8490c";PortNumber = None;PortType = PortType.Input;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"};Vertices = [152.0,214.0; 259.0,214.0; 259.0,201.0]};
        {Id = "conn-top-input";Source = {Id = "cc7c6510-d49b-28d9-e0bc-d5350a2c76a8";PortNumber = None;PortType = PortType.Output;HostId = "8078a917-236f-5a40-18a6-8e2d6a1458f5"};Target = {Id = "108ea909-b27f-24ba-22ea-2faeb061a926";PortNumber = None;PortType = PortType.Input;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"};Vertices = [152.0,135.0; 198.0,135.0; 198.0,172.0; 244.0,172.6]};
        {Id = "conn-to-output";Source = {Id = "5b651087-9b95-3a80-4f99-014f85f0dfdd";PortNumber = None;PortType = PortType.Output;HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"};Target = {Id = "7bbfa7d3-4718-e6fe-e7e9-8c00e5257f45";PortNumber = None;PortType = PortType.Input;HostId = "00661085-7d05-4185-09ef-4138ac918ad2"};Vertices = [274.0,181.0; 373.0,181.0]}
        {Id = "conn-bottom-input"; Source = {Id = "a6010bcb-ba2b-e57f-ca50-39f3d094e3b8"; PortNumber = None; PortType = PortType.Output; HostId = "ed12b5d8-556b-515a-cc9d-873960690380"}; Target = {Id = "38c8c934-d55e-2aff-e61b-5fbf7d7eed91"; PortNumber = None; PortType = PortType.Input; HostId = "d7028a8f-83be-0d81-6f0f-19b384caddae"}; Vertices = [152.0,258.0; 198.0,258.0; 198.0,189.33333333333334; 244.0,189.33333333333334]}
    ]

/// Partially connected Demux. A 2-bit input, Mux, a 2-bit output.
let stateBus20 : CanvasState =
    [
        {H=50;W=40; Id = "8078a917-236f-5a40-18a6-8e2d6a1458f5";Type = Input 2;Label = "a";InputPorts = [];OutputPorts = [{Id = "cc7c6510-d49b-28d9-e0bc-d5350a2c76a8";PortNumber = Some 0;PortType = PortType.Output;HostId = "8078a917-236f-5a40-18a6-8e2d6a1458f5"}];X = 122;Y = 125};
        {H=50;W=40; Id = "fbfb4202-9816-f214-0401-da18caddeb0f";Type = Demux2;Label = "";InputPorts = [{Id = "2b224026-609a-5eae-6885-ff9820dbae5f";PortNumber = Some 0;PortType = PortType.Input;HostId = "fbfb4202-9816-f214-0401-da18caddeb0f"}; {Id = "68043f9b-47e7-793f-fed2-943a7d7336dc";PortNumber = Some 1;PortType = PortType.Input;HostId = "fbfb4202-9816-f214-0401-da18caddeb0f"}];OutputPorts = [{Id = "57070484-347e-4701-8c36-f510c2ef150c";PortNumber = Some 0;PortType = PortType.Output;HostId = "fbfb4202-9816-f214-0401-da18caddeb0f"}; {Id = "123463bf-7868-9a87-6fb1-36627a3c9bad";PortNumber = Some 1;PortType = PortType.Output;HostId = "fbfb4202-9816-f214-0401-da18caddeb0f"}];X = 254;Y = 110};
        {H=50;W=40; Id = "00661085-7d05-4185-09ef-4138ac918ad2";Type = Output 2;Label = "aa";InputPorts = [{Id = "7bbfa7d3-4718-e6fe-e7e9-8c00e5257f45";PortNumber = Some 0;PortType = PortType.Input;HostId = "00661085-7d05-4185-09ef-4138ac918ad2"}];OutputPorts = [];X = 401;Y = 117}
    ],
    [
        {Id = "conn-to-output";Source = {Id = "57070484-347e-4701-8c36-f510c2ef150c";PortNumber = None;PortType = PortType.Output;HostId = "fbfb4202-9816-f214-0401-da18caddeb0f"};Target = {Id = "7bbfa7d3-4718-e6fe-e7e9-8c00e5257f45";PortNumber = None;PortType = PortType.Input;HostId = "00661085-7d05-4185-09ef-4138ac918ad2"};Vertices = [284.0,126.66666666666667; 343.5,126.66666666666667; 343.5,127.0; 401.0,127.0]};
        {Id = "conn-to-input";Source = {Id = "cc7c6510-d49b-28d9-e0bc-d5350a2c76a8";PortNumber = None;PortType = PortType.Output;HostId = "8078a917-236f-5a40-18a6-8e2d6a1458f5"};Target = {Id = "2b224026-609a-5eae-6885-ff9820dbae5f";PortNumber = None;PortType = PortType.Input;HostId = "fbfb4202-9816-f214-0401-da18caddeb0f"};Vertices = [152.0,135.0; 254.0,135.0]}
    ]
