Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Give every node created with anext a label #60

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions brat/Brat/Checker.hs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@
case (?my, ty, tm) of
-- The only SimpleType that checks against a kind is a Nat
(Braty, Left Nat, Num n) -> do
(_, _, [(dangling, _)], _) <- next "" (Const (Num n)) (S0,Some (Zy :* S0))
(_, _, [(dangling, _)], _) <- next "const" (Const (Num n)) (S0,Some (Zy :* S0))
R0 (REx ("value", Nat) R0)
let val = VNum (nConstant (fromIntegral n))
defineSrc dangling val
Expand All @@ -496,7 +496,7 @@
_ -> do
let vty = biType @m ty
throwLeft $ simpleCheck ?my vty tm
(_, _, [(dangling, _)], _) <- anext @m "" (Const tm) (S0,Some (Zy :* S0))
(_, _, [(dangling, _)], _) <- anext @m "const" (Const tm) (S0,Some (Zy :* S0))
R0 (RPr ("value", vty) R0)
wire (dangling, vty, hungry)
pure (((), ()), ((), unders))
Expand Down Expand Up @@ -724,7 +724,7 @@
NoLhs tm -> pure (tm, (fcOf tm, fcOf tm))
Clauses (c :| cs) -> do
fc <- req AskFC
pure $ (WC fc (Lambda c cs), (bimap fcOf fcOf c))

Check warning on line 727 in brat/Brat/Checker.hs

View workflow job for this annotation

GitHub Actions / hlint

Suggestion in checkBody in module Brat.Checker: Redundant $ ▫︎ Found: "pure $ (WC fc (Lambda c cs), (bimap fcOf fcOf c))" ▫︎ Perhaps: "pure (WC fc (Lambda c cs), (bimap fcOf fcOf c))"

Check warning on line 727 in brat/Brat/Checker.hs

View workflow job for this annotation

GitHub Actions / hlint

Suggestion in checkBody in module Brat.Checker: Redundant bracket ▫︎ Found: "(WC fc (Lambda c cs), (bimap fcOf fcOf c))" ▫︎ Perhaps: "(WC fc (Lambda c cs), bimap fcOf fcOf c)"
Undefined -> err (InternalError "Checking undefined clause")
((src, _), _) <- makeBox (fnName ++ ".box") cty $ \conns@(_, unders) -> do
(((), ()), leftovers) <- check tm conns
Expand Down
8 changes: 4 additions & 4 deletions brat/Brat/Checker/Helpers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -250,22 +250,22 @@
getThunks _ [] = pure ([], [], [])
getThunks Braty ((src, Right ty):rest) = do
ty <- eval S0 ty
(src, (ss :->> ts)) <- vectorise Braty (src, ty)

Check warning on line 253 in brat/Brat/Checker/Helpers.hs

View workflow job for this annotation

GitHub Actions / hlint

Suggestion in getThunks in module Brat.Checker.Helpers: Redundant bracket ▫︎ Found: "(src, (ss :->> ts))" ▫︎ Perhaps: "(src, ss :->> ts)"
(node, unders, overs, _) <- let ?my = Braty in
anext "" (Eval (end src)) (S0, Some (Zy :* S0)) ss ts
anext "Eval" (Eval (end src)) (S0, Some (Zy :* S0)) ss ts
(nodes, unders', overs') <- getThunks Braty rest
pure (node:nodes, unders <> unders', overs <> overs')
getThunks Kerny ((src, Right ty):rest) = do
ty <- eval S0 ty
(src, (ss :->> ts)) <- vectorise Kerny (src,ty)

Check warning on line 260 in brat/Brat/Checker/Helpers.hs

View workflow job for this annotation

GitHub Actions / hlint

Suggestion in getThunks in module Brat.Checker.Helpers: Redundant bracket ▫︎ Found: "(src, (ss :->> ts))" ▫︎ Perhaps: "(src, ss :->> ts)"
(node, unders, overs, _) <- let ?my = Kerny in anext "" (Splice (end src)) (S0, Some (Zy :* S0)) ss ts
(node, unders, overs, _) <- let ?my = Kerny in anext "Splice" (Splice (end src)) (S0, Some (Zy :* S0)) ss ts
(nodes, unders', overs') <- getThunks Kerny rest
pure (node:nodes, unders <> unders', overs <> overs')
getThunks Braty ((src, Left (Star args)):rest) = do
(node, unders, overs) <- case bwdStack (B0 <>< args) of
Some (_ :* stk) -> do
let (ri,ro) = kindArgRows stk
(node, unders, overs, _) <- next "" (Eval (end src)) (S0, Some (Zy :* S0)) ri ro
(node, unders, overs, _) <- next "Eval" (Eval (end src)) (S0, Some (Zy :* S0)) ri ro
pure (node, unders, overs)
(nodes, unders', overs') <- getThunks Braty rest
pure (node:nodes, unders <> unders', overs <> overs')
Expand Down Expand Up @@ -310,7 +310,7 @@
pure src

mkMono :: Monotone (VVar Z) -> Checking Src
mkMono (Linear (VPar (ExEnd e))) = pure (NamedPort e "mono")

Check warning on line 313 in brat/Brat/Checker/Helpers.hs

View workflow job for this annotation

GitHub Actions / build

Pattern match(es) are non-exhaustive

Check warning on line 313 in brat/Brat/Checker/Helpers.hs

View workflow job for this annotation

GitHub Actions / build

Pattern match(es) are non-exhaustive
mkMono (Full sm) = do
(_, [], [(twoSrc,_)], _) <- next "2" (Const (Num 2)) (S0, Some (Zy :* S0)) R0 (RPr ("value", TNat) R0)
(_, [(lhs,_),(rhs,_)], [(powSrc,_)], _) <- next "2^" (ArithNode Pow) (S0, Some (Zy :* S0))
Expand All @@ -337,10 +337,10 @@
-> (Src, CTy m Z) -- The input to this level of mapfun
-> Checking (Src, CTy m Z)
mkMapFun (lenSrc, len) (valSrc, cty) = do
let weak1 = changeVar (Thinning (ThDrop ThNull))

Check warning on line 340 in brat/Brat/Checker/Helpers.hs

View workflow job for this annotation

GitHub Actions / build

• The Monomorphism Restriction applies to the binding for ‘weak1’

Check warning on line 340 in brat/Brat/Checker/Helpers.hs

View workflow job for this annotation

GitHub Actions / build

• The Monomorphism Restriction applies to the binding for ‘weak1’
vecFun <- vectorisedFun len my cty
(_, [(lenTgt,_), (valTgt, _)], [(vectorSrc, Right (VFun my' cty))], _) <-
next "" MapFun (S0, Some (Zy :* S0))
next "MapFun" MapFun (S0, Some (Zy :* S0))
(REx ("len", Nat) (RPr ("value", weak1 ty) R0))
(RPr ("vector", weak1 vecFun) R0)
defineTgt lenTgt (VNum len)
Expand Down
8 changes: 4 additions & 4 deletions brat/test/golden/graph/addN.brat.graph
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Nodes:
(check_defs_1_addN_addN.box_2_lambda_11,BratNode (PatternMatch ((TestMatchData Braty (MatchSequence {matchInputs = [(NamedPort {end = Ex check_defs_1_addN_addN.box_2_lambda.0_setup/in_3 0, portName = "inp"},Int)], matchTests = [], matchOutputs = [(NamedPort {end = Ex check_defs_1_addN_addN.box_2_lambda.0_setup/in_3 0, portName = "inp"},Int)]}),check_defs_1_addN_addN.box_2_lambda.0_rhs_thunk_10) :| [])) [("inp",Int)] [("out",Int)])
(check_defs_1_addN_addN.box_2_lambda.0_rhs_9_,BratNode (Eval (Ex globals_prim_8_add 0)) [("a",Int),("b",Int)] [("c",Int)])
(check_defs_1_addN_addN.box_2_lambda.0_rhs_9_Eval,BratNode (Eval (Ex globals_prim_8_add 0)) [("a",Int),("b",Int)] [("c",Int)])
(check_defs_1_addN_addN.box_2_lambda.0_rhs/in_7,BratNode Source [] [("n",Int)])
(check_defs_1_addN_addN.box_2_lambda.0_rhs/out_8,BratNode Target [("out",Int)] [])
(check_defs_1_addN_addN.box_2_lambda.0_rhs_thunk_10,BratNode (Box (fromList []) check_defs_1_addN_addN.box_2_lambda.0_rhs/in_7 check_defs_1_addN_addN.box_2_lambda.0_rhs/out_8) [] [("thunk",{ (n :: Int) -> (out :: Int) })])
Expand All @@ -22,8 +22,8 @@ Nodes:

Wires:
(Ex check_defs_1_addN_addN.box/in 0,Int,In check_defs_1_addN_addN.box_2_lambda_11 0)
(Ex check_defs_1_addN_addN.box_2_lambda.0_rhs/in_7 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs_9_ 0)
(Ex check_defs_1_addN_addN.box_2_lambda.0_rhs_9_ 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs/out_8 0)
(Ex check_defs_1_addN_addN.box_2_lambda.0_rhs/in_7 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs_9_Eval 0)
(Ex check_defs_1_addN_addN.box_2_lambda.0_rhs_9_Eval 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs/out_8 0)
(Ex check_defs_1_addN_addN.box_2_lambda_11 0,Int,In check_defs_1_addN_addN.box/out_1 0)
(Ex check_defs_1_addN_addN.box_thunk_3 0,{ (inp :: Int) -> (out :: Int) },In globals_decl_13_addN 0)
(Ex globals_Int_1 0,[],In globals___kcr_N 0)
Expand All @@ -32,4 +32,4 @@ Wires:
(Ex globals_Int_5 0,[],In globals___kcc_4 0)
(Ex globals_Int_6 0,[],In globals___kcc_4 1)
(Ex globals_Int_7 0,[],In globals___kcc_4 2)
(Ex globals_prim_2_N 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs_9_ 1)
(Ex globals_prim_2_N 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs_9_Eval 1)
8 changes: 4 additions & 4 deletions brat/test/golden/graph/addN2.brat.graph
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Nodes:
(check_defs_1_addN_addN.box_2_lambda_11,BratNode (PatternMatch ((TestMatchData Braty (MatchSequence {matchInputs = [(NamedPort {end = Ex check_defs_1_addN_addN.box_2_lambda.0_setup/in_3 0, portName = "inp"},Int)], matchTests = [], matchOutputs = [(NamedPort {end = Ex check_defs_1_addN_addN.box_2_lambda.0_setup/in_3 0, portName = "inp"},Int)]}),check_defs_1_addN_addN.box_2_lambda.0_rhs_thunk_10) :| [])) [("inp",Int)] [("out",Int)])
(check_defs_1_addN_addN.box_2_lambda.0_rhs_9_,BratNode (Eval (Ex globals_prim_8_add 0)) [("a",Int),("b",Int)] [("c",Int)])
(check_defs_1_addN_addN.box_2_lambda.0_rhs_9_Eval,BratNode (Eval (Ex globals_prim_8_add 0)) [("a",Int),("b",Int)] [("c",Int)])
(check_defs_1_addN_addN.box_2_lambda.0_rhs/in_7,BratNode Source [] [("n",Int)])
(check_defs_1_addN_addN.box_2_lambda.0_rhs/out_8,BratNode Target [("out",Int)] [])
(check_defs_1_addN_addN.box_2_lambda.0_rhs_thunk_10,BratNode (Box (fromList []) check_defs_1_addN_addN.box_2_lambda.0_rhs/in_7 check_defs_1_addN_addN.box_2_lambda.0_rhs/out_8) [] [("thunk",{ (n :: Int) -> (out :: Int) })])
Expand All @@ -22,8 +22,8 @@ Nodes:

Wires:
(Ex check_defs_1_addN_addN.box/in 0,Int,In check_defs_1_addN_addN.box_2_lambda_11 0)
(Ex check_defs_1_addN_addN.box_2_lambda.0_rhs/in_7 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs_9_ 0)
(Ex check_defs_1_addN_addN.box_2_lambda.0_rhs_9_ 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs/out_8 0)
(Ex check_defs_1_addN_addN.box_2_lambda.0_rhs/in_7 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs_9_Eval 0)
(Ex check_defs_1_addN_addN.box_2_lambda.0_rhs_9_Eval 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs/out_8 0)
(Ex check_defs_1_addN_addN.box_2_lambda_11 0,Int,In check_defs_1_addN_addN.box/out_1 0)
(Ex check_defs_1_addN_addN.box_thunk_3 0,{ (inp :: Int) -> (out :: Int) },In globals_decl_13_addN 0)
(Ex globals_Int_1 0,[],In globals___kcr_N 0)
Expand All @@ -32,4 +32,4 @@ Wires:
(Ex globals_Int_5 0,[],In globals___kcc_4 0)
(Ex globals_Int_6 0,[],In globals___kcc_4 1)
(Ex globals_Int_7 0,[],In globals___kcc_4 2)
(Ex globals_prim_2_N 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs_9_ 1)
(Ex globals_prim_2_N 0,Int,In check_defs_1_addN_addN.box_2_lambda.0_rhs_9_Eval 1)
12 changes: 6 additions & 6 deletions brat/test/golden/graph/cons.brat.graph
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Nodes:
(check_defs_1_three_1__1,BratNode (Const 0) [] [("value",Int)])
(check_defs_1_three_1_cons,BratNode (Constructor cons) [("head",Int),("tail",Vec(Int, 2))] [("value",Vec(Int, 3))])
(check_defs_1_two__1,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_two__3,BratNode (Const 2) [] [("value",Int)])
(check_defs_1_three_1_const_1,BratNode (Const 0) [] [("value",Int)])
(check_defs_1_two_cons,BratNode (Constructor cons) [("head",Int),("tail",Vec(Int, 1))] [("value",Vec(Int, 2))])
(check_defs_1_two_cons_2,BratNode (Constructor cons) [("head",Int),("tail",Vec(Int, 0))] [("value",Vec(Int, 1))])
(check_defs_1_two_const_1,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_two_const_3,BratNode (Const 2) [] [("value",Int)])
(check_defs_1_two_nil_4,BratNode (Constructor nil) [] [("value",Vec(Int, 0))])
(globals__3,BratNode (Const 2) [] [("value",Nat)])
(globals__8,BratNode (Const 3) [] [("value",Nat)])
Expand All @@ -16,12 +16,12 @@ Nodes:
(globals_decl_9_three,BratNode Id [("a1",Vec(Int, 3))] [("a1",Vec(Int, 3))])

Wires:
(Ex check_defs_1_three_1__1 0,Int,In check_defs_1_three_1_cons 0)
(Ex check_defs_1_three_1_cons 0,Vec(Int, 3),In globals_decl_9_three 0)
(Ex check_defs_1_two__1 0,Int,In check_defs_1_two_cons 0)
(Ex check_defs_1_two__3 0,Int,In check_defs_1_two_cons_2 0)
(Ex check_defs_1_three_1_const_1 0,Int,In check_defs_1_three_1_cons 0)
(Ex check_defs_1_two_cons 0,Vec(Int, 2),In globals_decl_4_two 0)
(Ex check_defs_1_two_cons_2 0,Vec(Int, 1),In check_defs_1_two_cons 1)
(Ex check_defs_1_two_const_1 0,Int,In check_defs_1_two_cons 0)
(Ex check_defs_1_two_const_3 0,Int,In check_defs_1_two_cons_2 0)
(Ex check_defs_1_two_nil_4 0,Vec(Int, 0),In check_defs_1_two_cons_2 1)
(Ex globals_Int_2 0,[],In globals_Vec_1 0)
(Ex globals_Int_7 0,[],In globals_Vec_6 0)
Expand Down
12 changes: 6 additions & 6 deletions brat/test/golden/graph/list.brat.graph
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Nodes:
(check_defs_1_xs__1,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_xs__3,BratNode (Const 2) [] [("value",Int)])
(check_defs_1_xs__5,BratNode (Const 3) [] [("value",Int)])
(check_defs_1_xs_cons,BratNode (Constructor cons) [("head",Int),("tail",List(Int))] [("value",List(Int))])
(check_defs_1_xs_cons_2,BratNode (Constructor cons) [("head",Int),("tail",List(Int))] [("value",List(Int))])
(check_defs_1_xs_cons_4,BratNode (Constructor cons) [("head",Int),("tail",List(Int))] [("value",List(Int))])
(check_defs_1_xs_const_1,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_xs_const_3,BratNode (Const 2) [] [("value",Int)])
(check_defs_1_xs_const_5,BratNode (Const 3) [] [("value",Int)])
(check_defs_1_xs_nil_6,BratNode (Constructor nil) [] [("value",List(Int))])
(globals_Int_2,BratNode (Constructor Int) [] [("value",[])])
(globals_List_1,BratNode (Constructor List) [("listValue",[])] [("value",[])])
(globals_decl_3_xs,BratNode Id [("a1",List(Int))] [("a1",List(Int))])

Wires:
(Ex check_defs_1_xs__1 0,Int,In check_defs_1_xs_cons 0)
(Ex check_defs_1_xs__3 0,Int,In check_defs_1_xs_cons_2 0)
(Ex check_defs_1_xs__5 0,Int,In check_defs_1_xs_cons_4 0)
(Ex check_defs_1_xs_cons 0,List(Int),In globals_decl_3_xs 0)
(Ex check_defs_1_xs_cons_2 0,List(Int),In check_defs_1_xs_cons 1)
(Ex check_defs_1_xs_cons_4 0,List(Int),In check_defs_1_xs_cons_2 1)
(Ex check_defs_1_xs_const_1 0,Int,In check_defs_1_xs_cons 0)
(Ex check_defs_1_xs_const_3 0,Int,In check_defs_1_xs_cons_2 0)
(Ex check_defs_1_xs_const_5 0,Int,In check_defs_1_xs_cons_4 0)
(Ex check_defs_1_xs_nil_6 0,List(Int),In check_defs_1_xs_cons_4 1)
(Ex globals_Int_2 0,[],In globals_List_1 0)
(Ex globals_List_1 0,[],In globals___kca_xs 0)
8 changes: 4 additions & 4 deletions brat/test/golden/graph/num.brat.graph
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Nodes:
(check_defs_1_m_1__1,BratNode (Const -3) [] [("value",Int)])
(check_defs_1_m_1_const_1,BratNode (Const -3) [] [("value",Int)])
(check_defs_1_m_1_doub,BratNode (Constructor doub) [("value",Int)] [("value",Int)])
(check_defs_1_n__1,BratNode (Const 2) [] [("value",Nat)])
(check_defs_1_n_const_1,BratNode (Const 2) [] [("value",Nat)])
(check_defs_1_n_succ,BratNode (Constructor succ) [("value",Nat)] [("value",Nat)])
(globals_Int_4,BratNode (Constructor Int) [] [("value",[])])
(globals_Nat_1,BratNode (Constructor Nat) [] [("value",[])])
(globals_decl_2_n,BratNode Id [("a1",Nat)] [("a1",Nat)])
(globals_decl_5_m,BratNode Id [("a1",Int)] [("a1",Int)])

Wires:
(Ex check_defs_1_m_1__1 0,Int,In check_defs_1_m_1_doub 0)
(Ex check_defs_1_m_1_const_1 0,Int,In check_defs_1_m_1_doub 0)
(Ex check_defs_1_m_1_doub 0,Int,In globals_decl_5_m 0)
(Ex check_defs_1_n__1 0,Nat,In check_defs_1_n_succ 0)
(Ex check_defs_1_n_const_1 0,Nat,In check_defs_1_n_succ 0)
(Ex check_defs_1_n_succ 0,Nat,In globals_decl_2_n 0)
(Ex globals_Int_4 0,[],In globals___kca_m_3 0)
(Ex globals_Nat_1 0,[],In globals___kca_n 0)
4 changes: 2 additions & 2 deletions brat/test/golden/graph/one.brat.graph
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Nodes:
(check_defs_1_one_,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_one_const,BratNode (Const 1) [] [("value",Int)])
(globals_Int_1,BratNode (Constructor Int) [] [("value",[])])
(globals_decl_2_one,BratNode Id [("n",Int)] [("n",Int)])

Wires:
(Ex check_defs_1_one_ 0,Int,In globals_decl_2_one 0)
(Ex check_defs_1_one_const 0,Int,In globals_decl_2_one 0)
(Ex globals_Int_1 0,[],In globals___kca_one 0)
4 changes: 2 additions & 2 deletions brat/test/golden/graph/pair.brat.graph
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Nodes:
(check_defs_1_xs__1,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_xs_cons,BratNode (Constructor cons) [("head",Int),("tail",[Bool])] [("value",[Int,Bool])])
(check_defs_1_xs_cons_2,BratNode (Constructor cons) [("head",Bool),("tail",[])] [("value",[Bool])])
(check_defs_1_xs_const_1,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_xs_nil_4,BratNode (Constructor nil) [] [("value",[])])
(check_defs_1_xs_true_3,BratNode (Constructor true) [] [("value",Bool)])
(globals_Bool_4,BratNode (Constructor Bool) [] [("value",[])])
Expand All @@ -12,9 +12,9 @@ Nodes:
(globals_nil_5,BratNode (Constructor nil) [] [("value",[])])

Wires:
(Ex check_defs_1_xs__1 0,Int,In check_defs_1_xs_cons 0)
(Ex check_defs_1_xs_cons 0,[Int,Bool],In globals_decl_6_xs 0)
(Ex check_defs_1_xs_cons_2 0,[Bool],In check_defs_1_xs_cons 1)
(Ex check_defs_1_xs_const_1 0,Int,In check_defs_1_xs_cons 0)
(Ex check_defs_1_xs_nil_4 0,[],In check_defs_1_xs_cons_2 1)
(Ex check_defs_1_xs_true_3 0,Bool,In check_defs_1_xs_cons_2 0)
(Ex globals_Bool_4 0,[],In globals_cons_3 0)
Expand Down
26 changes: 13 additions & 13 deletions brat/test/golden/graph/rx.brat.graph
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Nodes:
(check_defs_1_main_2_thunk_3_lambda_11,KernelNode (PatternMatch ((TestMatchData Kerny (MatchSequence {matchInputs = [(NamedPort {end = Ex check_defs_1_main_2_thunk_3_lambda.0_setup/in_3 0, portName = "a"},Qubit)], matchTests = [], matchOutputs = [(NamedPort {end = Ex check_defs_1_main_2_thunk_3_lambda.0_setup/in_3 0, portName = "a"},Qubit)]}),check_defs_1_main_2_thunk_3_lambda.0_rhs_thunk_9) :| [])) [("a",Qubit)] [("b",Qubit)])
(check_defs_1_main_2_thunk_3_lambda.0_rhs_10_,KernelNode (Splice (Ex globals_decl_18_xish 0)) [("rxa",Qubit)] [("rxb",Qubit)])
(check_defs_1_main_2_thunk_3_lambda.0_rhs_10_Splice,KernelNode (Splice (Ex globals_decl_18_xish 0)) [("rxa",Qubit)] [("rxb",Qubit)])
(check_defs_1_main_2_thunk_3_lambda.0_rhs/in_7,KernelNode Source [] [("q",Qubit)])
(check_defs_1_main_2_thunk_3_lambda.0_rhs/out_8,KernelNode Target [("b",Qubit)] [])
(check_defs_1_main_2_thunk_3_lambda.0_rhs_thunk_9,BratNode (Box (fromList []) check_defs_1_main_2_thunk_3_lambda.0_rhs/in_7 check_defs_1_main_2_thunk_3_lambda.0_rhs/out_8) [] [("thunk",{ (q :: Qubit) -o (b :: Qubit) })])
Expand All @@ -10,11 +10,11 @@ Nodes:
(check_defs_1_main_2_thunk/in,KernelNode Source [] [("a",Qubit)])
(check_defs_1_main_2_thunk/out_1,KernelNode Target [("b",Qubit)] [])
(check_defs_1_main_2_thunk_thunk_2,BratNode (Box (fromList []) check_defs_1_main_2_thunk/in check_defs_1_main_2_thunk/out_1) [] [("thunk",{ (a :: Qubit) -o (b :: Qubit) })])
(check_defs_1_nums_,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_nums__1,BratNode (Const 2) [] [("value",Int)])
(check_defs_1_nums__2,BratNode (Const 3) [] [("value",Int)])
(check_defs_1_xish_1_,BratNode (Eval (Ex globals_prim_7_Rx 0)) [("th",Float)] [("a1",{ (rxa :: Qubit) -o (rxb :: Qubit) })])
(check_defs_1_xish_1__1,BratNode (Const 30.0) [] [("value",Float)])
(check_defs_1_nums_const,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_nums_const_1,BratNode (Const 2) [] [("value",Int)])
(check_defs_1_nums_const_2,BratNode (Const 3) [] [("value",Int)])
(check_defs_1_xish_1_Eval,BratNode (Eval (Ex globals_prim_7_Rx 0)) [("th",Float)] [("a1",{ (rxa :: Qubit) -o (rxb :: Qubit) })])
(check_defs_1_xish_1_const_1,BratNode (Const 30.0) [] [("value",Float)])
(globals_Float_2,BratNode (Constructor Float) [] [("value",[])])
(globals_Int_9,BratNode (Constructor Int) [] [("value",[])])
(globals_Int_10,BratNode (Constructor Int) [] [("value",[])])
Expand All @@ -32,15 +32,15 @@ Nodes:

Wires:
(Ex check_defs_1_main_2_thunk/in 0,Qubit,In check_defs_1_main_2_thunk_3_lambda_11 0)
(Ex check_defs_1_main_2_thunk_3_lambda.0_rhs/in_7 0,Qubit,In check_defs_1_main_2_thunk_3_lambda.0_rhs_10_ 0)
(Ex check_defs_1_main_2_thunk_3_lambda.0_rhs_10_ 0,Qubit,In check_defs_1_main_2_thunk_3_lambda.0_rhs/out_8 0)
(Ex check_defs_1_main_2_thunk_3_lambda.0_rhs/in_7 0,Qubit,In check_defs_1_main_2_thunk_3_lambda.0_rhs_10_Splice 0)
(Ex check_defs_1_main_2_thunk_3_lambda.0_rhs_10_Splice 0,Qubit,In check_defs_1_main_2_thunk_3_lambda.0_rhs/out_8 0)
(Ex check_defs_1_main_2_thunk_3_lambda_11 0,Qubit,In check_defs_1_main_2_thunk/out_1 0)
(Ex check_defs_1_main_2_thunk_thunk_2 0,{ (a :: Qubit) -o (b :: Qubit) },In globals_decl_24_main 0)
(Ex check_defs_1_nums_ 0,Int,In globals_decl_12_nums 0)
(Ex check_defs_1_nums__1 0,Int,In globals_decl_12_nums 1)
(Ex check_defs_1_nums__2 0,Int,In globals_decl_12_nums 2)
(Ex check_defs_1_xish_1_ 0,{ (rxa :: Qubit) -o (rxb :: Qubit) },In globals_decl_18_xish 0)
(Ex check_defs_1_xish_1__1 0,Float,In check_defs_1_xish_1_ 0)
(Ex check_defs_1_nums_const 0,Int,In globals_decl_12_nums 0)
(Ex check_defs_1_nums_const_1 0,Int,In globals_decl_12_nums 1)
(Ex check_defs_1_nums_const_2 0,Int,In globals_decl_12_nums 2)
(Ex check_defs_1_xish_1_Eval 0,{ (rxa :: Qubit) -o (rxb :: Qubit) },In globals_decl_18_xish 0)
(Ex check_defs_1_xish_1_const_1 0,Float,In check_defs_1_xish_1_Eval 0)
(Ex globals_Float_2 0,[],In globals___kcc_1 0)
(Ex globals_Int_10 0,[],In globals___kca_nums_8 1)
(Ex globals_Int_11 0,[],In globals___kca_nums_8 2)
Expand Down
14 changes: 7 additions & 7 deletions brat/test/golden/graph/two.brat.graph
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Nodes:
(check_defs_1_one_,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_two_1_,BratNode (Eval (Ex globals_prim_5_add 0)) [("a",Int),("b",Int)] [("c",Int)])
(check_defs_1_two_1__1,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_one_const,BratNode (Const 1) [] [("value",Int)])
(check_defs_1_two_1_Eval,BratNode (Eval (Ex globals_prim_5_add 0)) [("a",Int),("b",Int)] [("c",Int)])
(check_defs_1_two_1_const_1,BratNode (Const 1) [] [("value",Int)])
(globals_Int_2,BratNode (Constructor Int) [] [("value",[])])
(globals_Int_3,BratNode (Constructor Int) [] [("value",[])])
(globals_Int_4,BratNode (Constructor Int) [] [("value",[])])
Expand All @@ -12,12 +12,12 @@ Nodes:
(globals_prim_5_add,BratNode (Prim ("","add")) [] [("thunk",{ (a :: Int), (b :: Int) -> (c :: Int) })])

Wires:
(Ex check_defs_1_one_ 0,Int,In globals_decl_8_one 0)
(Ex check_defs_1_two_1_ 0,Int,In globals_decl_11_two 0)
(Ex check_defs_1_two_1__1 0,Int,In check_defs_1_two_1_ 0)
(Ex check_defs_1_one_const 0,Int,In globals_decl_8_one 0)
(Ex check_defs_1_two_1_Eval 0,Int,In globals_decl_11_two 0)
(Ex check_defs_1_two_1_const_1 0,Int,In check_defs_1_two_1_Eval 0)
(Ex globals_Int_10 0,[],In globals___kca_two_9 0)
(Ex globals_Int_2 0,[],In globals___kcc_1 0)
(Ex globals_Int_3 0,[],In globals___kcc_1 1)
(Ex globals_Int_4 0,[],In globals___kcc_1 2)
(Ex globals_Int_7 0,[],In globals___kca_one_6 0)
(Ex globals_decl_8_one 0,Int,In check_defs_1_two_1_ 1)
(Ex globals_decl_8_one 0,Int,In check_defs_1_two_1_Eval 1)
Loading
Loading