From 870e1040ae9bdd32dbd9cee23f5b1ee9ca18205e Mon Sep 17 00:00:00 2001 From: Craig Roy Date: Thu, 28 Nov 2024 09:26:25 +0000 Subject: [PATCH] feat: Give every node created with `anext` a label (#60) --- brat/Brat/Checker.hs | 4 ++-- brat/Brat/Checker/Helpers.hs | 8 ++++---- brat/test/golden/graph/addN.brat.graph | 8 ++++---- brat/test/golden/graph/addN2.brat.graph | 8 ++++---- brat/test/golden/graph/cons.brat.graph | 12 ++++++------ brat/test/golden/graph/list.brat.graph | 12 ++++++------ brat/test/golden/graph/num.brat.graph | 8 ++++---- brat/test/golden/graph/one.brat.graph | 4 ++-- brat/test/golden/graph/pair.brat.graph | 4 ++-- brat/test/golden/graph/rx.brat.graph | 26 ++++++++++++------------- brat/test/golden/graph/two.brat.graph | 14 ++++++------- brat/test/golden/graph/vec.brat.graph | 12 ++++++------ 12 files changed, 60 insertions(+), 60 deletions(-) diff --git a/brat/Brat/Checker.hs b/brat/Brat/Checker.hs index 43524983..a3bc9bea 100644 --- a/brat/Brat/Checker.hs +++ b/brat/Brat/Checker.hs @@ -485,7 +485,7 @@ check' (Simple tm) ((), (hungry, ty):unders) = do 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 @@ -496,7 +496,7 @@ check' (Simple tm) ((), (hungry, ty):unders) = do _ -> 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)) diff --git a/brat/Brat/Checker/Helpers.hs b/brat/Brat/Checker/Helpers.hs index e5aa5747..b31d2457 100644 --- a/brat/Brat/Checker/Helpers.hs +++ b/brat/Brat/Checker/Helpers.hs @@ -252,20 +252,20 @@ getThunks Braty ((src, Right ty):rest) = do ty <- eval S0 ty (src, (ss :->> ts)) <- vectorise Braty (src, ty) (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) - (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') @@ -340,7 +340,7 @@ vectorise my (src, ty) = do let weak1 = changeVar (Thinning (ThDrop ThNull)) 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) diff --git a/brat/test/golden/graph/addN.brat.graph b/brat/test/golden/graph/addN.brat.graph index b653f383..31b411ac 100644 --- a/brat/test/golden/graph/addN.brat.graph +++ b/brat/test/golden/graph/addN.brat.graph @@ -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) })]) @@ -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) @@ -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) diff --git a/brat/test/golden/graph/addN2.brat.graph b/brat/test/golden/graph/addN2.brat.graph index 70642c12..e23d7824 100644 --- a/brat/test/golden/graph/addN2.brat.graph +++ b/brat/test/golden/graph/addN2.brat.graph @@ -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) })]) @@ -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) @@ -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) diff --git a/brat/test/golden/graph/cons.brat.graph b/brat/test/golden/graph/cons.brat.graph index 3da7e8a1..a9dcaf65 100644 --- a/brat/test/golden/graph/cons.brat.graph +++ b/brat/test/golden/graph/cons.brat.graph @@ -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)]) @@ -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) diff --git a/brat/test/golden/graph/list.brat.graph b/brat/test/golden/graph/list.brat.graph index 255e1de0..de1910c1 100644 --- a/brat/test/golden/graph/list.brat.graph +++ b/brat/test/golden/graph/list.brat.graph @@ -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) diff --git a/brat/test/golden/graph/num.brat.graph b/brat/test/golden/graph/num.brat.graph index 27521a96..e9645cc6 100644 --- a/brat/test/golden/graph/num.brat.graph +++ b/brat/test/golden/graph/num.brat.graph @@ -1,7 +1,7 @@ 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",[])]) @@ -9,9 +9,9 @@ Nodes: (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) diff --git a/brat/test/golden/graph/one.brat.graph b/brat/test/golden/graph/one.brat.graph index 0e93fcd8..2a7e1081 100644 --- a/brat/test/golden/graph/one.brat.graph +++ b/brat/test/golden/graph/one.brat.graph @@ -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) diff --git a/brat/test/golden/graph/pair.brat.graph b/brat/test/golden/graph/pair.brat.graph index 42192ce4..ef826479 100644 --- a/brat/test/golden/graph/pair.brat.graph +++ b/brat/test/golden/graph/pair.brat.graph @@ -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",[])]) @@ -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) diff --git a/brat/test/golden/graph/rx.brat.graph b/brat/test/golden/graph/rx.brat.graph index 5f241723..14afc93b 100644 --- a/brat/test/golden/graph/rx.brat.graph +++ b/brat/test/golden/graph/rx.brat.graph @@ -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) })]) @@ -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",[])]) @@ -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) diff --git a/brat/test/golden/graph/two.brat.graph b/brat/test/golden/graph/two.brat.graph index a85f418b..cdb6a0c8 100644 --- a/brat/test/golden/graph/two.brat.graph +++ b/brat/test/golden/graph/two.brat.graph @@ -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",[])]) @@ -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) diff --git a/brat/test/golden/graph/vec.brat.graph b/brat/test/golden/graph/vec.brat.graph index 100f9489..137a9bf8 100644 --- a/brat/test/golden/graph/vec.brat.graph +++ b/brat/test/golden/graph/vec.brat.graph @@ -1,10 +1,10 @@ Nodes: -(check_defs_1_xs__1,BratNode (Const 0) [] [("value",Int)]) -(check_defs_1_xs__3,BratNode (Const 1) [] [("value",Int)]) -(check_defs_1_xs__5,BratNode (Const 2) [] [("value",Int)]) (check_defs_1_xs_cons,BratNode (Constructor cons) [("head",Int),("tail",Vec(Int, 2))] [("value",Vec(Int, 3))]) (check_defs_1_xs_cons_2,BratNode (Constructor cons) [("head",Int),("tail",Vec(Int, 1))] [("value",Vec(Int, 2))]) (check_defs_1_xs_cons_4,BratNode (Constructor cons) [("head",Int),("tail",Vec(Int, 0))] [("value",Vec(Int, 1))]) +(check_defs_1_xs_const_1,BratNode (Const 0) [] [("value",Int)]) +(check_defs_1_xs_const_3,BratNode (Const 1) [] [("value",Int)]) +(check_defs_1_xs_const_5,BratNode (Const 2) [] [("value",Int)]) (check_defs_1_xs_nil_6,BratNode (Constructor nil) [] [("value",Vec(Int, 0))]) (globals__3,BratNode (Const 3) [] [("value",Nat)]) (globals_Int_2,BratNode (Constructor Int) [] [("value",[])]) @@ -12,12 +12,12 @@ Nodes: (globals_decl_4_xs,BratNode Id [("a1",Vec(Int, 3))] [("a1",Vec(Int, 3))]) 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,Vec(Int, 3),In globals_decl_4_xs 0) (Ex check_defs_1_xs_cons_2 0,Vec(Int, 2),In check_defs_1_xs_cons 1) (Ex check_defs_1_xs_cons_4 0,Vec(Int, 1),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,Vec(Int, 0),In check_defs_1_xs_cons_4 1) (Ex globals_Int_2 0,[],In globals_Vec_1 0) (Ex globals_Vec_1 0,[],In globals___kca_xs 0)