Advertisement
Guest User

Untitled

a guest
Jul 27th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 1.03 KB | None | 0 0
  1. [<Test>]
  2. let SmallGraph () =
  3.     let x = new InitialNode()
  4.     let y = new InitialNode()
  5.  
  6.     let terminal = new TerminalNode()
  7.  
  8.     let plus = new AddNode()
  9.     let less = new LtNode()
  10.     let multiplexor = new MultiplexorNode()
  11.  
  12.     let vsfg = new VSFG ([|x; y|], [|terminal|])
  13.     //let f = new NestedVsfgNode (vsfg)
  14.  
  15.     VSFG.AddVerticesAndEdges
  16.         [|
  17.             x :> Node, 0, plus :> Node, 0;
  18.             y :> Node, 0, plus :> Node, 1;
  19.             x :> Node, 0, less :> Node, 0;
  20.             y :> Node, 0, less :> Node, 1;
  21.  
  22.             less :> Node, 0, multiplexor :> Node, 0;
  23.             //f :> Node, 0, multiplexor :> Node, 1;
  24.             plus :> Node, 0, multiplexor :> Node, 1;
  25.             plus :> Node, 0, multiplexor :> Node, 2;
  26.  
  27.             multiplexor :> Node, 0, terminal :> Node, 0;
  28.         |]
  29.  
  30.     checkNeighbours x 0 2
  31.     checkNeighbours y 0 2
  32.     checkNeighbours terminal 1 0
  33.     checkNeighbours plus 2 2
  34.     checkNeighbours less 2 1
  35.     //checkNeighbours f 2 1
  36.     checkNeighbours multiplexor 3 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement