From f0877b5685b258ed83330189fd881c22f3d27f48 Mon Sep 17 00:00:00 2001 From: Jan-Niclas Loosen Date: Fri, 23 Jan 2026 13:01:50 +0100 Subject: [PATCH] Add generated dot files --- .../cfgdots/argsParamsExample.dot | 23 ++ Project-02-03-04/cfgdots/complex.dot | 127 +++++++++ Project-02-03-04/cfgdots/condition.dot | 27 ++ Project-02-03-04/cfgdots/defSemiExample.dot | 45 +++ Project-02-03-04/cfgdots/example.dot | 69 +++++ Project-02-03-04/cfgdots/factorial.dot | 268 ++++++++++++++++++ Project-02-03-04/cfgdots/faulty_if.dot | 8 + Project-02-03-04/cfgdots/func.dot | 52 ++++ Project-02-03-04/cfgdots/geq.dot | 19 ++ Project-02-03-04/cfgdots/ggT_euclid_rec.dot | 67 +++++ Project-02-03-04/cfgdots/homework.dot | 111 ++++++++ .../multiple-let-with-same-func-name.dot | 36 +++ Project-02-03-04/cfgdots/multiple-let.dot | 46 +++ Project-02-03-04/cfgdots/or.dot | 23 ++ Project-02-03-04/cfgdots/p1.dot | 23 ++ Project-02-03-04/cfgdots/p2.dot | 40 +++ Project-02-03-04/cfgdots/p3.dot | 127 +++++++++ Project-02-03-04/cfgdots/p4.dot | 27 ++ Project-02-03-04/cfgdots/p5.dot | 31 ++ Project-02-03-04/cfgdots/p6.dot | 105 +++++++ Project-02-03-04/cfgdots/side_effect.dot | 42 +++ Project-02-03-04/cfgdots/simpleSequence.dot | 61 ++++ Project-02-03-04/cfgdots/simple_dfa.dot | 23 ++ Project-02-03-04/cfgdots/simple_if.dot | 15 + Project-02-03-04/cfgdots/simple_if_2.dot | 19 ++ Project-02-03-04/cfgdots/simple_if_3.dot | 19 ++ Project-02-03-04/cfgdots/simple_if_4.dot | 19 ++ Project-02-03-04/cfgdots/simple_if_5.dot | 23 ++ Project-02-03-04/cfgdots/simple_if_6.dot | 27 ++ Project-02-03-04/cfgdots/simple_if_7.dot | 23 ++ Project-02-03-04/cfgdots/square.dot | 23 ++ Project-02-03-04/cfgdots/validProgram.dot | 94 ++++++ Project-02-03-04/cfgdots/while.dot | 52 ++++ Project-02-03-04/cfgdots/while_2.dot | 13 + Project-02-03-04/cfgdots/wrapped-ggT.dot | 78 +++++ Project-02-03-04/cfgdots/wrapper.dot | 51 ++++ Project-02-03-04/main.py | 2 +- 37 files changed, 1857 insertions(+), 1 deletion(-) create mode 100644 Project-02-03-04/cfgdots/argsParamsExample.dot create mode 100644 Project-02-03-04/cfgdots/complex.dot create mode 100644 Project-02-03-04/cfgdots/condition.dot create mode 100644 Project-02-03-04/cfgdots/defSemiExample.dot create mode 100644 Project-02-03-04/cfgdots/example.dot create mode 100644 Project-02-03-04/cfgdots/factorial.dot create mode 100644 Project-02-03-04/cfgdots/faulty_if.dot create mode 100644 Project-02-03-04/cfgdots/func.dot create mode 100644 Project-02-03-04/cfgdots/geq.dot create mode 100644 Project-02-03-04/cfgdots/ggT_euclid_rec.dot create mode 100644 Project-02-03-04/cfgdots/homework.dot create mode 100644 Project-02-03-04/cfgdots/multiple-let-with-same-func-name.dot create mode 100644 Project-02-03-04/cfgdots/multiple-let.dot create mode 100644 Project-02-03-04/cfgdots/or.dot create mode 100644 Project-02-03-04/cfgdots/p1.dot create mode 100644 Project-02-03-04/cfgdots/p2.dot create mode 100644 Project-02-03-04/cfgdots/p3.dot create mode 100644 Project-02-03-04/cfgdots/p4.dot create mode 100644 Project-02-03-04/cfgdots/p5.dot create mode 100644 Project-02-03-04/cfgdots/p6.dot create mode 100644 Project-02-03-04/cfgdots/side_effect.dot create mode 100644 Project-02-03-04/cfgdots/simpleSequence.dot create mode 100644 Project-02-03-04/cfgdots/simple_dfa.dot create mode 100644 Project-02-03-04/cfgdots/simple_if.dot create mode 100644 Project-02-03-04/cfgdots/simple_if_2.dot create mode 100644 Project-02-03-04/cfgdots/simple_if_3.dot create mode 100644 Project-02-03-04/cfgdots/simple_if_4.dot create mode 100644 Project-02-03-04/cfgdots/simple_if_5.dot create mode 100644 Project-02-03-04/cfgdots/simple_if_6.dot create mode 100644 Project-02-03-04/cfgdots/simple_if_7.dot create mode 100644 Project-02-03-04/cfgdots/square.dot create mode 100644 Project-02-03-04/cfgdots/validProgram.dot create mode 100644 Project-02-03-04/cfgdots/while.dot create mode 100644 Project-02-03-04/cfgdots/while_2.dot create mode 100644 Project-02-03-04/cfgdots/wrapped-ggT.dot create mode 100644 Project-02-03-04/cfgdots/wrapper.dot diff --git a/Project-02-03-04/cfgdots/argsParamsExample.dot b/Project-02-03-04/cfgdots/argsParamsExample.dot new file mode 100644 index 0000000..108adf6 --- /dev/null +++ b/Project-02-03-04/cfgdots/argsParamsExample.dot @@ -0,0 +1,23 @@ +digraph CFG { + node [fontname="Helvetica"]; + n1 [label="START", shape=ellipse, style=filled, color=gray]; + n1 -> n7; + n7 [label="1", shape=box]; + n7 -> n8; + n8 [label="2", shape=box]; + n8 -> n9; + n9 [label="3", shape=box]; + n9 -> n10; + n10 [label="CALL a", shape=box, style=filled, color=orange]; + n10 -> n3; + n10 -> n12; + n3 [label="START a(x, y, z)", shape=ellipse, style=filled, color=green]; + n3 -> n6; + n6 [label="x", shape=box]; + n6 -> n4; + n4 [label="END a(x, y, z)", shape=ellipse, style=filled, color=green]; + n4 -> n12; + n12 [label="RET a", shape=box, style=filled, color=orange]; + n12 -> n2; + n2 [label="END", shape=ellipse, style=filled, color=gray]; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/complex.dot b/Project-02-03-04/cfgdots/complex.dot new file mode 100644 index 0000000..6c93fa9 --- /dev/null +++ b/Project-02-03-04/cfgdots/complex.dot @@ -0,0 +1,127 @@ +digraph CFG { + node [fontname="Helvetica"]; + n14 [label="START", shape=ellipse, style=filled, color=gray]; + n14 -> n65; + n65 [label="10", shape=box]; + n65 -> n66; + n66 [label="CALL f1", shape=box, style=filled, color=orange]; + n66 -> n16; + n66 -> n68; + n16 [label="START f1(b)", shape=ellipse, style=filled, color=green]; + n16 -> n21; + n21 [label="b", shape=box]; + n21 -> n22; + n22 [label="0", shape=box]; + n22 -> n23; + n23 [label="b == 0", shape=box]; + n23 -> n24; + n24 [label="", shape=diamond]; + n24 -> n28 [label="T"]; + n24 -> n29 [label="F"]; + n28 [label="0", shape=box]; + n28 -> n17; + n17 [label="END f1(b)", shape=ellipse, style=filled, color=green]; + n17 -> n34; + n17 -> n45; + n17 -> n49; + n17 -> n68; + n34 [label="RET f1", shape=box, style=filled, color=orange]; + n34 -> n17; + n45 [label="RET f1", shape=box, style=filled, color=orange]; + n45 -> n58; + n58 [label="a", shape=box]; + n58 -> n59; + n59 [label="b", shape=box]; + n59 -> n60; + n60 [label="a * b", shape=box]; + n60 -> n61; + n61 [label="CALL g", shape=box, style=filled, color=orange]; + n61 -> n50; + n61 -> n63; + n50 [label="START g(c)", shape=ellipse, style=filled, color=green]; + n50 -> n53; + n53 [label="a", shape=box]; + n53 -> n54; + n54 [label="b", shape=box]; + n54 -> n55; + n55 [label="a * b", shape=box]; + n55 -> n56; + n56 [label="c", shape=box]; + n56 -> n57; + n57 [label="(a * b) * c", shape=box]; + n57 -> n51; + n51 [label="END g(c)", shape=ellipse, style=filled, color=green]; + n51 -> n63; + n63 [label="RET g", shape=box, style=filled, color=orange]; + n63 -> n19; + n19 [label="END f2(a, b)", shape=ellipse, style=filled, color=green]; + n19 -> n91; + n91 [label="RET f2", shape=box, style=filled, color=orange]; + n91 -> n15; + n15 [label="END", shape=ellipse, style=filled, color=gray]; + n49 [label="RET f1", shape=box, style=filled, color=orange]; + n49 -> n58; + n68 [label="RET f1", shape=box, style=filled, color=orange]; + n68 -> n70; + n70 [label="10", shape=box]; + n70 -> n83; + n83 [label="20", shape=box]; + n83 -> n84; + n84 [label="30", shape=box]; + n84 -> n85; + n85 [label="CALL max", shape=box, style=filled, color=orange]; + n85 -> n71; + n85 -> n87; + n71 [label="START max(a, b)", shape=ellipse, style=filled, color=green]; + n71 -> n74; + n74 [label="a", shape=box]; + n74 -> n75; + n75 [label="b", shape=box]; + n75 -> n76; + n76 [label="a > b", shape=box]; + n76 -> n77; + n77 [label="", shape=diamond]; + n77 -> n81 [label="T"]; + n77 -> n82 [label="F"]; + n81 [label="a", shape=box]; + n81 -> n72; + n72 [label="END max(a, b)", shape=ellipse, style=filled, color=green]; + n72 -> n87; + n87 [label="RET max", shape=box, style=filled, color=orange]; + n87 -> n89; + n89 [label="CALL f2", shape=box, style=filled, color=orange]; + n89 -> n18; + n89 -> n91; + n18 [label="START f2(a, b)", shape=ellipse, style=filled, color=green]; + n18 -> n35; + n35 [label="a", shape=box]; + n35 -> n36; + n36 [label="b", shape=box]; + n36 -> n37; + n37 [label="a > b", shape=box]; + n37 -> n38; + n38 [label="", shape=diamond]; + n38 -> n42 [label="T"]; + n38 -> n46 [label="F"]; + n42 [label="a", shape=box]; + n42 -> n43; + n43 [label="CALL f1", shape=box, style=filled, color=orange]; + n43 -> n16; + n43 -> n45; + n46 [label="b", shape=box]; + n46 -> n47; + n47 [label="CALL f1", shape=box, style=filled, color=orange]; + n47 -> n16; + n47 -> n49; + n82 [label="b", shape=box]; + n82 -> n72; + n29 [label="b", shape=box]; + n29 -> n30; + n30 [label="1", shape=box]; + n30 -> n31; + n31 [label="b - 1", shape=box]; + n31 -> n32; + n32 [label="CALL f1", shape=box, style=filled, color=orange]; + n32 -> n16; + n32 -> n34; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/condition.dot b/Project-02-03-04/cfgdots/condition.dot new file mode 100644 index 0000000..a24a0d2 --- /dev/null +++ b/Project-02-03-04/cfgdots/condition.dot @@ -0,0 +1,27 @@ +digraph CFG { + node [fontname="Helvetica"]; + n92 [label="START", shape=ellipse, style=filled, color=gray]; + n92 -> n94; + n94 [label="2", shape=box]; + n94 -> n95; + n95 [label="x", shape=box]; + n95 -> n96; + n96 [label="2 < x", shape=box]; + n96 -> n97; + n97 [label="x", shape=box]; + n97 -> n98; + n98 [label="9", shape=box]; + n98 -> n99; + n99 [label="x > 9", shape=box]; + n99 -> n100; + n100 [label="(2 < x) && (x > 9)", shape=box]; + n100 -> n101; + n101 [label="", shape=diamond]; + n101 -> n105 [label="T"]; + n101 -> n106 [label="F"]; + n105 [label="1", shape=box]; + n105 -> n93; + n93 [label="END", shape=ellipse, style=filled, color=gray]; + n106 [label="0", shape=box]; + n106 -> n93; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/defSemiExample.dot b/Project-02-03-04/cfgdots/defSemiExample.dot new file mode 100644 index 0000000..60a5449 --- /dev/null +++ b/Project-02-03-04/cfgdots/defSemiExample.dot @@ -0,0 +1,45 @@ +digraph CFG { + node [fontname="Helvetica"]; + n107 [label="START", shape=ellipse, style=filled, color=gray]; + n107 -> n119; + n119 [label="1", shape=box]; + n119 -> n120; + n120 [label="CALL a", shape=box, style=filled, color=orange]; + n120 -> n109; + n120 -> n122; + n109 [label="START a(x)", shape=ellipse, style=filled, color=green]; + n109 -> n116; + n116 [label="x", shape=box]; + n116 -> n110; + n110 [label="END a(x)", shape=ellipse, style=filled, color=green]; + n110 -> n122; + n122 [label="RET a", shape=box, style=filled, color=orange]; + n122 -> n124; + n124 [label="2", shape=box]; + n124 -> n125; + n125 [label="CALL b", shape=box, style=filled, color=orange]; + n125 -> n111; + n125 -> n127; + n111 [label="START b(y)", shape=ellipse, style=filled, color=green]; + n111 -> n117; + n117 [label="y", shape=box]; + n117 -> n112; + n112 [label="END b(y)", shape=ellipse, style=filled, color=green]; + n112 -> n127; + n127 [label="RET b", shape=box, style=filled, color=orange]; + n127 -> n128; + n128 [label="3", shape=box]; + n128 -> n129; + n129 [label="CALL c", shape=box, style=filled, color=orange]; + n129 -> n113; + n129 -> n131; + n113 [label="START c(z)", shape=ellipse, style=filled, color=green]; + n113 -> n118; + n118 [label="z", shape=box]; + n118 -> n114; + n114 [label="END c(z)", shape=ellipse, style=filled, color=green]; + n114 -> n131; + n131 [label="RET c", shape=box, style=filled, color=orange]; + n131 -> n108; + n108 [label="END", shape=ellipse, style=filled, color=gray]; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/example.dot b/Project-02-03-04/cfgdots/example.dot new file mode 100644 index 0000000..4fff143 --- /dev/null +++ b/Project-02-03-04/cfgdots/example.dot @@ -0,0 +1,69 @@ +digraph CFG { + node [fontname="Helvetica"]; + n132 [label="START", shape=ellipse, style=filled, color=gray]; + n132 -> n167; + n167 [label="2", shape=box]; + n167 -> n168; + n168 [label="3", shape=box]; + n168 -> n169; + n169 [label="CALL f", shape=box, style=filled, color=orange]; + n169 -> n134; + n169 -> n171; + n134 [label="START f(x, y, z)", shape=ellipse, style=filled, color=green]; + n134 -> n137; + n137 [label="2", shape=box]; + n137 -> n138; + n138 [label="y = 2", shape=box]; + n138 -> n139; + n139 [label="3", shape=box]; + n139 -> n140; + n140 [label="z = 3", shape=box]; + n140 -> n160; + n160 [label="x", shape=box]; + n160 -> n161; + n161 [label="CALL g", shape=box, style=filled, color=orange]; + n161 -> n141; + n161 -> n163; + n141 [label="START g(x)", shape=ellipse, style=filled, color=green]; + n141 -> n144; + n144 [label="7", shape=box]; + n144 -> n145; + n145 [label="x = 7", shape=box]; + n145 -> n146; + n146 [label="y", shape=box]; + n146 -> n147; + n147 [label="0", shape=box]; + n147 -> n148; + n148 [label="y > 0", shape=box]; + n148 -> n149; + n149 [label="", shape=diamond]; + n149 -> n153 [label="T"]; + n149 -> n157 [label="F"]; + n153 [label="y", shape=box]; + n153 -> n154; + n154 [label="CALL g", shape=box, style=filled, color=orange]; + n154 -> n141; + n154 -> n156; + n156 [label="RET g", shape=box, style=filled, color=orange]; + n156 -> n159; + n159 [label="x", shape=box]; + n159 -> n142; + n142 [label="END g(x)", shape=ellipse, style=filled, color=green]; + n142 -> n156; + n142 -> n163; + n163 [label="RET g", shape=box, style=filled, color=orange]; + n163 -> n164; + n164 [label="x", shape=box]; + n164 -> n165; + n165 [label="g(x) + x", shape=box]; + n165 -> n135; + n135 [label="END f(x, y, z)", shape=ellipse, style=filled, color=green]; + n135 -> n171; + n171 [label="RET f", shape=box, style=filled, color=orange]; + n171 -> n133; + n133 [label="END", shape=ellipse, style=filled, color=gray]; + n157 [label="8", shape=box]; + n157 -> n158; + n158 [label="x = 8", shape=box]; + n158 -> n159; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/factorial.dot b/Project-02-03-04/cfgdots/factorial.dot new file mode 100644 index 0000000..e39efba --- /dev/null +++ b/Project-02-03-04/cfgdots/factorial.dot @@ -0,0 +1,268 @@ +digraph CFG { + node [fontname="Helvetica"]; + n173 [label="START", shape=ellipse, style=filled, color=gray]; + n173 -> n338; + n338 [label="3", shape=box]; + n338 -> n339; + n339 [label="CALL fac", shape=box, style=filled, color=orange]; + n339 -> n191; + n339 -> n341; + n191 [label="START fac(x)", shape=ellipse, style=filled, color=green]; + n191 -> n194; + n191 -> n210; + n191 -> n226; + n191 -> n242; + n191 -> n258; + n191 -> n274; + n191 -> n290; + n191 -> n306; + n191 -> n322; + n194 [label="x", shape=box]; + n194 -> n195; + n195 [label="1", shape=box]; + n195 -> n196; + n196 [label="x == 1", shape=box]; + n196 -> n197; + n197 [label="", shape=diamond]; + n197 -> n201 [label="T"]; + n197 -> n202 [label="F"]; + n201 [label="1", shape=box]; + n201 -> n192; + n192 [label="END fac(x)", shape=ellipse, style=filled, color=green]; + n192 -> n207; + n192 -> n223; + n192 -> n239; + n192 -> n255; + n192 -> n271; + n192 -> n287; + n192 -> n303; + n192 -> n319; + n192 -> n335; + n192 -> n341; + n207 [label="RET fac", shape=box, style=filled, color=orange]; + n207 -> n208; + n208 [label="x", shape=box]; + n208 -> n209; + n209 [label="fac((x - 1)) * x", shape=box]; + n209 -> n192; + n223 [label="RET fac", shape=box, style=filled, color=orange]; + n223 -> n224; + n224 [label="x", shape=box]; + n224 -> n225; + n225 [label="fac((x - 1)) * x", shape=box]; + n225 -> n192; + n239 [label="RET fac", shape=box, style=filled, color=orange]; + n239 -> n240; + n240 [label="x", shape=box]; + n240 -> n241; + n241 [label="fac((x - 1)) * x", shape=box]; + n241 -> n192; + n255 [label="RET fac", shape=box, style=filled, color=orange]; + n255 -> n256; + n256 [label="x", shape=box]; + n256 -> n257; + n257 [label="fac((x - 1)) * x", shape=box]; + n257 -> n192; + n271 [label="RET fac", shape=box, style=filled, color=orange]; + n271 -> n272; + n272 [label="x", shape=box]; + n272 -> n273; + n273 [label="fac((x - 1)) * x", shape=box]; + n273 -> n192; + n287 [label="RET fac", shape=box, style=filled, color=orange]; + n287 -> n288; + n288 [label="x", shape=box]; + n288 -> n289; + n289 [label="fac((x - 1)) * x", shape=box]; + n289 -> n192; + n303 [label="RET fac", shape=box, style=filled, color=orange]; + n303 -> n304; + n304 [label="x", shape=box]; + n304 -> n305; + n305 [label="fac((x - 1)) * x", shape=box]; + n305 -> n192; + n319 [label="RET fac", shape=box, style=filled, color=orange]; + n319 -> n320; + n320 [label="x", shape=box]; + n320 -> n321; + n321 [label="fac((x - 1)) * x", shape=box]; + n321 -> n192; + n335 [label="RET fac", shape=box, style=filled, color=orange]; + n335 -> n336; + n336 [label="x", shape=box]; + n336 -> n337; + n337 [label="fac((x - 1)) * x", shape=box]; + n337 -> n192; + n341 [label="RET fac", shape=box, style=filled, color=orange]; + n341 -> n174; + n174 [label="END", shape=ellipse, style=filled, color=gray]; + n202 [label="x", shape=box]; + n202 -> n203; + n203 [label="1", shape=box]; + n203 -> n204; + n204 [label="x - 1", shape=box]; + n204 -> n205; + n205 [label="CALL fac", shape=box, style=filled, color=orange]; + n205 -> n191; + n205 -> n207; + n210 [label="x", shape=box]; + n210 -> n211; + n211 [label="1", shape=box]; + n211 -> n212; + n212 [label="x == 1", shape=box]; + n212 -> n213; + n213 [label="", shape=diamond]; + n213 -> n217 [label="T"]; + n213 -> n218 [label="F"]; + n217 [label="1", shape=box]; + n217 -> n192; + n218 [label="x", shape=box]; + n218 -> n219; + n219 [label="1", shape=box]; + n219 -> n220; + n220 [label="x - 1", shape=box]; + n220 -> n221; + n221 [label="CALL fac", shape=box, style=filled, color=orange]; + n221 -> n191; + n221 -> n223; + n226 [label="x", shape=box]; + n226 -> n227; + n227 [label="1", shape=box]; + n227 -> n228; + n228 [label="x == 1", shape=box]; + n228 -> n229; + n229 [label="", shape=diamond]; + n229 -> n233 [label="T"]; + n229 -> n234 [label="F"]; + n233 [label="1", shape=box]; + n233 -> n192; + n234 [label="x", shape=box]; + n234 -> n235; + n235 [label="1", shape=box]; + n235 -> n236; + n236 [label="x - 1", shape=box]; + n236 -> n237; + n237 [label="CALL fac", shape=box, style=filled, color=orange]; + n237 -> n191; + n237 -> n239; + n242 [label="x", shape=box]; + n242 -> n243; + n243 [label="1", shape=box]; + n243 -> n244; + n244 [label="x == 1", shape=box]; + n244 -> n245; + n245 [label="", shape=diamond]; + n245 -> n249 [label="T"]; + n245 -> n250 [label="F"]; + n249 [label="1", shape=box]; + n249 -> n192; + n250 [label="x", shape=box]; + n250 -> n251; + n251 [label="1", shape=box]; + n251 -> n252; + n252 [label="x - 1", shape=box]; + n252 -> n253; + n253 [label="CALL fac", shape=box, style=filled, color=orange]; + n253 -> n191; + n253 -> n255; + n258 [label="x", shape=box]; + n258 -> n259; + n259 [label="1", shape=box]; + n259 -> n260; + n260 [label="x == 1", shape=box]; + n260 -> n261; + n261 [label="", shape=diamond]; + n261 -> n265 [label="T"]; + n261 -> n266 [label="F"]; + n265 [label="1", shape=box]; + n265 -> n192; + n266 [label="x", shape=box]; + n266 -> n267; + n267 [label="1", shape=box]; + n267 -> n268; + n268 [label="x - 1", shape=box]; + n268 -> n269; + n269 [label="CALL fac", shape=box, style=filled, color=orange]; + n269 -> n191; + n269 -> n271; + n274 [label="x", shape=box]; + n274 -> n275; + n275 [label="1", shape=box]; + n275 -> n276; + n276 [label="x == 1", shape=box]; + n276 -> n277; + n277 [label="", shape=diamond]; + n277 -> n281 [label="T"]; + n277 -> n282 [label="F"]; + n281 [label="1", shape=box]; + n281 -> n192; + n282 [label="x", shape=box]; + n282 -> n283; + n283 [label="1", shape=box]; + n283 -> n284; + n284 [label="x - 1", shape=box]; + n284 -> n285; + n285 [label="CALL fac", shape=box, style=filled, color=orange]; + n285 -> n191; + n285 -> n287; + n290 [label="x", shape=box]; + n290 -> n291; + n291 [label="1", shape=box]; + n291 -> n292; + n292 [label="x == 1", shape=box]; + n292 -> n293; + n293 [label="", shape=diamond]; + n293 -> n297 [label="T"]; + n293 -> n298 [label="F"]; + n297 [label="1", shape=box]; + n297 -> n192; + n298 [label="x", shape=box]; + n298 -> n299; + n299 [label="1", shape=box]; + n299 -> n300; + n300 [label="x - 1", shape=box]; + n300 -> n301; + n301 [label="CALL fac", shape=box, style=filled, color=orange]; + n301 -> n191; + n301 -> n303; + n306 [label="x", shape=box]; + n306 -> n307; + n307 [label="1", shape=box]; + n307 -> n308; + n308 [label="x == 1", shape=box]; + n308 -> n309; + n309 [label="", shape=diamond]; + n309 -> n313 [label="T"]; + n309 -> n314 [label="F"]; + n313 [label="1", shape=box]; + n313 -> n192; + n314 [label="x", shape=box]; + n314 -> n315; + n315 [label="1", shape=box]; + n315 -> n316; + n316 [label="x - 1", shape=box]; + n316 -> n317; + n317 [label="CALL fac", shape=box, style=filled, color=orange]; + n317 -> n191; + n317 -> n319; + n322 [label="x", shape=box]; + n322 -> n323; + n323 [label="1", shape=box]; + n323 -> n324; + n324 [label="x == 1", shape=box]; + n324 -> n325; + n325 [label="", shape=diamond]; + n325 -> n329 [label="T"]; + n325 -> n330 [label="F"]; + n329 [label="1", shape=box]; + n329 -> n192; + n330 [label="x", shape=box]; + n330 -> n331; + n331 [label="1", shape=box]; + n331 -> n332; + n332 [label="x - 1", shape=box]; + n332 -> n333; + n333 [label="CALL fac", shape=box, style=filled, color=orange]; + n333 -> n191; + n333 -> n335; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/faulty_if.dot b/Project-02-03-04/cfgdots/faulty_if.dot new file mode 100644 index 0000000..264e592 --- /dev/null +++ b/Project-02-03-04/cfgdots/faulty_if.dot @@ -0,0 +1,8 @@ +digraph CFG { + node [fontname="Helvetica"]; + n356 [label="START", shape=ellipse, style=filled, color=gray]; + n356 -> n358; + n358 [label="0", shape=box]; + n358 -> n357; + n357 [label="END", shape=ellipse, style=filled, color=gray]; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/func.dot b/Project-02-03-04/cfgdots/func.dot new file mode 100644 index 0000000..dab043a --- /dev/null +++ b/Project-02-03-04/cfgdots/func.dot @@ -0,0 +1,52 @@ +digraph CFG { + node [fontname="Helvetica"]; + n359 [label="START", shape=ellipse, style=filled, color=gray]; + n359 -> n382; + n382 [label="10", shape=box]; + n382 -> n383; + n383 [label="8", shape=box]; + n383 -> n384; + n384 [label="CALL func", shape=box, style=filled, color=orange]; + n384 -> n361; + n384 -> n386; + n361 [label="START func(a, b)", shape=ellipse, style=filled, color=green]; + n361 -> n364; + n364 [label="a", shape=box]; + n364 -> n365; + n365 [label="0", shape=box]; + n365 -> n366; + n366 [label="a > 0", shape=box]; + n366 -> n367; + n367 [label="b", shape=box]; + n367 -> n368; + n368 [label="a", shape=box]; + n368 -> n369; + n369 [label="b != a", shape=box]; + n369 -> n370; + n370 [label="(a > 0) && (b != a)", shape=box]; + n370 -> n371; + n371 [label="", shape=diamond]; + n371 -> n362 [label="T"]; + n371 -> n373 [label="F"]; + n362 [label="END func(a, b)", shape=ellipse, style=filled, color=green]; + n362 -> n386; + n386 [label="RET func", shape=box, style=filled, color=orange]; + n386 -> n360; + n360 [label="END", shape=ellipse, style=filled, color=gray]; + n373 [label="b", shape=box]; + n373 -> n374; + n374 [label="1", shape=box]; + n374 -> n375; + n375 [label="b + 1", shape=box]; + n375 -> n376; + n376 [label="b = (b + 1)", shape=box]; + n376 -> n377; + n377 [label="a", shape=box]; + n377 -> n378; + n378 [label="1", shape=box]; + n378 -> n379; + n379 [label="a - 1", shape=box]; + n379 -> n380; + n380 [label="a = (a - 1)", shape=box]; + n380 -> n366; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/geq.dot b/Project-02-03-04/cfgdots/geq.dot new file mode 100644 index 0000000..8f97e71 --- /dev/null +++ b/Project-02-03-04/cfgdots/geq.dot @@ -0,0 +1,19 @@ +digraph CFG { + node [fontname="Helvetica"]; + n388 [label="START", shape=ellipse, style=filled, color=gray]; + n388 -> n390; + n390 [label="1", shape=box]; + n390 -> n391; + n391 [label="0", shape=box]; + n391 -> n392; + n392 [label="1 >= 0", shape=box]; + n392 -> n393; + n393 [label="", shape=diamond]; + n393 -> n397 [label="T"]; + n393 -> n398 [label="F"]; + n397 [label="1", shape=box]; + n397 -> n389; + n389 [label="END", shape=ellipse, style=filled, color=gray]; + n398 [label="0", shape=box]; + n398 -> n389; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/ggT_euclid_rec.dot b/Project-02-03-04/cfgdots/ggT_euclid_rec.dot new file mode 100644 index 0000000..d48632c --- /dev/null +++ b/Project-02-03-04/cfgdots/ggT_euclid_rec.dot @@ -0,0 +1,67 @@ +digraph CFG { + node [fontname="Helvetica"]; + n405 [label="START", shape=ellipse, style=filled, color=gray]; + n405 -> n439; + n439 [label="2", shape=box]; + n439 -> n440; + n440 [label="8", shape=box]; + n440 -> n441; + n441 [label="CALL ggT", shape=box, style=filled, color=orange]; + n441 -> n407; + n441 -> n443; + n407 [label="START ggT(a, b)", shape=ellipse, style=filled, color=green]; + n407 -> n410; + n410 [label="a", shape=box]; + n410 -> n411; + n411 [label="b", shape=box]; + n411 -> n412; + n412 [label="a == b", shape=box]; + n412 -> n413; + n413 [label="", shape=diamond]; + n413 -> n417 [label="T"]; + n413 -> n418 [label="F"]; + n417 [label="a", shape=box]; + n417 -> n408; + n408 [label="END ggT(a, b)", shape=ellipse, style=filled, color=green]; + n408 -> n431; + n408 -> n438; + n408 -> n443; + n431 [label="RET ggT", shape=box, style=filled, color=orange]; + n431 -> n408; + n438 [label="RET ggT", shape=box, style=filled, color=orange]; + n438 -> n408; + n443 [label="RET ggT", shape=box, style=filled, color=orange]; + n443 -> n406; + n406 [label="END", shape=ellipse, style=filled, color=gray]; + n418 [label="a", shape=box]; + n418 -> n419; + n419 [label="b", shape=box]; + n419 -> n420; + n420 [label="a > b", shape=box]; + n420 -> n421; + n421 [label="", shape=diamond]; + n421 -> n425 [label="T"]; + n421 -> n432 [label="F"]; + n425 [label="a", shape=box]; + n425 -> n426; + n426 [label="b", shape=box]; + n426 -> n427; + n427 [label="a - b", shape=box]; + n427 -> n428; + n428 [label="b", shape=box]; + n428 -> n429; + n429 [label="CALL ggT", shape=box, style=filled, color=orange]; + n429 -> n407; + n429 -> n431; + n432 [label="b", shape=box]; + n432 -> n433; + n433 [label="a", shape=box]; + n433 -> n434; + n434 [label="b - a", shape=box]; + n434 -> n435; + n435 [label="a", shape=box]; + n435 -> n436; + n436 [label="CALL ggT", shape=box, style=filled, color=orange]; + n436 -> n407; + n436 -> n438; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/homework.dot b/Project-02-03-04/cfgdots/homework.dot new file mode 100644 index 0000000..a58aa66 --- /dev/null +++ b/Project-02-03-04/cfgdots/homework.dot @@ -0,0 +1,111 @@ +digraph CFG { + node [fontname="Helvetica"]; + n445 [label="START", shape=ellipse, style=filled, color=gray]; + n445 -> n499; + n499 [label="1", shape=box]; + n499 -> n500; + n500 [label="2", shape=box]; + n500 -> n501; + n501 [label="CALL f", shape=box, style=filled, color=orange]; + n501 -> n447; + n501 -> n503; + n447 [label="START f(x, y)", shape=ellipse, style=filled, color=green]; + n447 -> n452; + n452 [label="x", shape=box]; + n452 -> n453; + n453 [label="0", shape=box]; + n453 -> n454; + n454 [label="x == 0", shape=box]; + n454 -> n455; + n455 [label="", shape=diamond]; + n455 -> n467 [label="T"]; + n455 -> n475 [label="F"]; + n467 [label="2", shape=box]; + n467 -> n468; + n468 [label="y", shape=box]; + n468 -> n469; + n469 [label="2 * y", shape=box]; + n469 -> n470; + n470 [label="x", shape=box]; + n470 -> n471; + n471 [label="CALL g", shape=box, style=filled, color=orange]; + n471 -> n459; + n471 -> n473; + n459 [label="START g(x, z)", shape=ellipse, style=filled, color=green]; + n459 -> n462; + n459 -> n478; + n462 [label="x", shape=box]; + n462 -> n463; + n463 [label="y", shape=box]; + n463 -> n464; + n464 [label="x * y", shape=box]; + n464 -> n465; + n465 [label="z", shape=box]; + n465 -> n466; + n466 [label="(x * y) + z", shape=box]; + n466 -> n460; + n460 [label="END g(x, z)", shape=ellipse, style=filled, color=green]; + n460 -> n473; + n460 -> n509; + n473 [label="RET g", shape=box, style=filled, color=orange]; + n473 -> n448; + n448 [label="END f(x, y)", shape=ellipse, style=filled, color=green]; + n448 -> n488; + n448 -> n503; + n488 [label="RET f", shape=box, style=filled, color=orange]; + n488 -> n489; + n489 [label="a * f(a,i)", shape=box]; + n489 -> n490; + n490 [label="a = (a * f(a,i))", shape=box]; + n490 -> n491; + n491 [label="i", shape=box]; + n491 -> n492; + n492 [label="1", shape=box]; + n492 -> n493; + n493 [label="i - 1", shape=box]; + n493 -> n494; + n494 [label="i = (i - 1)", shape=box]; + n494 -> n478; + n478 [label="i", shape=box]; + n478 -> n479; + n479 [label="0", shape=box]; + n479 -> n480; + n480 [label="i > 0", shape=box]; + n480 -> n481; + n481 [label="", shape=diamond]; + n481 -> n483 [label="T"]; + n481 -> n496 [label="F"]; + n483 [label="a", shape=box]; + n483 -> n484; + n484 [label="a", shape=box]; + n484 -> n485; + n485 [label="i", shape=box]; + n485 -> n486; + n486 [label="CALL f", shape=box, style=filled, color=orange]; + n486 -> n447; + n486 -> n488; + n496 [label="a", shape=box]; + n496 -> n497; + n497 [label="42", shape=box]; + n497 -> n498; + n498 [label="a + 42", shape=box]; + n498 -> n460; + n503 [label="RET f", shape=box, style=filled, color=orange]; + n503 -> n505; + n505 [label="3", shape=box]; + n505 -> n506; + n506 [label="3", shape=box]; + n506 -> n507; + n507 [label="CALL g", shape=box, style=filled, color=orange]; + n507 -> n459; + n507 -> n509; + n509 [label="RET g", shape=box, style=filled, color=orange]; + n509 -> n446; + n446 [label="END", shape=ellipse, style=filled, color=gray]; + n475 [label="x", shape=box]; + n475 -> n476; + n476 [label="1", shape=box]; + n476 -> n477; + n477 [label="x + 1", shape=box]; + n477 -> n448; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/multiple-let-with-same-func-name.dot b/Project-02-03-04/cfgdots/multiple-let-with-same-func-name.dot new file mode 100644 index 0000000..20b8adb --- /dev/null +++ b/Project-02-03-04/cfgdots/multiple-let-with-same-func-name.dot @@ -0,0 +1,36 @@ +digraph CFG { + node [fontname="Helvetica"]; + n512 [label="START", shape=ellipse, style=filled, color=gray]; + n512 -> n518; + n518 [label="5", shape=box]; + n518 -> n519; + n519 [label="CALL m", shape=box, style=filled, color=orange]; + n519 -> n514; + n519 -> n521; + n514 [label="START m(a)", shape=ellipse, style=filled, color=green]; + n514 -> n517; + n517 [label="a", shape=box]; + n517 -> n515; + n515 [label="END m(a)", shape=ellipse, style=filled, color=green]; + n515 -> n521; + n521 [label="RET m", shape=box, style=filled, color=orange]; + n521 -> n529; + n529 [label="5", shape=box]; + n529 -> n530; + n530 [label="CALL m", shape=box, style=filled, color=orange]; + n530 -> n523; + n530 -> n532; + n523 [label="START m(b)", shape=ellipse, style=filled, color=green]; + n523 -> n526; + n526 [label="b", shape=box]; + n526 -> n527; + n527 [label="1", shape=box]; + n527 -> n528; + n528 [label="b + 1", shape=box]; + n528 -> n524; + n524 [label="END m(b)", shape=ellipse, style=filled, color=green]; + n524 -> n532; + n532 [label="RET m", shape=box, style=filled, color=orange]; + n532 -> n513; + n513 [label="END", shape=ellipse, style=filled, color=gray]; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/multiple-let.dot b/Project-02-03-04/cfgdots/multiple-let.dot new file mode 100644 index 0000000..f5804a8 --- /dev/null +++ b/Project-02-03-04/cfgdots/multiple-let.dot @@ -0,0 +1,46 @@ +digraph CFG { + node [fontname="Helvetica"]; + n534 [label="START", shape=ellipse, style=filled, color=gray]; + n534 -> n540; + n540 [label="5", shape=box]; + n540 -> n541; + n541 [label="CALL n", shape=box, style=filled, color=orange]; + n541 -> n536; + n541 -> n543; + n536 [label="START n(a)", shape=ellipse, style=filled, color=green]; + n536 -> n539; + n539 [label="a", shape=box]; + n539 -> n537; + n537 [label="END n(a)", shape=ellipse, style=filled, color=green]; + n537 -> n543; + n537 -> n554; + n543 [label="RET n", shape=box, style=filled, color=orange]; + n543 -> n551; + n551 [label="5", shape=box]; + n551 -> n552; + n552 [label="CALL n", shape=box, style=filled, color=orange]; + n552 -> n536; + n552 -> n554; + n554 [label="RET n", shape=box, style=filled, color=orange]; + n554 -> n555; + n555 [label="5", shape=box]; + n555 -> n556; + n556 [label="CALL m", shape=box, style=filled, color=orange]; + n556 -> n545; + n556 -> n558; + n545 [label="START m(a)", shape=ellipse, style=filled, color=green]; + n545 -> n548; + n548 [label="a", shape=box]; + n548 -> n549; + n549 [label="1", shape=box]; + n549 -> n550; + n550 [label="a + 1", shape=box]; + n550 -> n546; + n546 [label="END m(a)", shape=ellipse, style=filled, color=green]; + n546 -> n558; + n558 [label="RET m", shape=box, style=filled, color=orange]; + n558 -> n559; + n559 [label="n(5) + m(5)", shape=box]; + n559 -> n535; + n535 [label="END", shape=ellipse, style=filled, color=gray]; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/or.dot b/Project-02-03-04/cfgdots/or.dot new file mode 100644 index 0000000..c81efa5 --- /dev/null +++ b/Project-02-03-04/cfgdots/or.dot @@ -0,0 +1,23 @@ +digraph CFG { + node [fontname="Helvetica"]; + n561 [label="START", shape=ellipse, style=filled, color=gray]; + n561 -> n563; + n563 [label="True", shape=box]; + n563 -> n564; + n564 [label="True", shape=box]; + n564 -> n565; + n565 [label="True", shape=box]; + n565 -> n566; + n566 [label="True == True", shape=box]; + n566 -> n567; + n567 [label="True || (True == True)", shape=box]; + n567 -> n568; + n568 [label="", shape=diamond]; + n568 -> n572 [label="T"]; + n568 -> n573 [label="F"]; + n572 [label="1", shape=box]; + n572 -> n562; + n562 [label="END", shape=ellipse, style=filled, color=gray]; + n573 [label="0", shape=box]; + n573 -> n562; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/p1.dot b/Project-02-03-04/cfgdots/p1.dot new file mode 100644 index 0000000..c046415 --- /dev/null +++ b/Project-02-03-04/cfgdots/p1.dot @@ -0,0 +1,23 @@ +digraph CFG { + node [fontname="Helvetica"]; + n574 [label="START", shape=ellipse, style=filled, color=gray]; + n574 -> n582; + n582 [label="5", shape=box]; + n582 -> n583; + n583 [label="CALL g", shape=box, style=filled, color=orange]; + n583 -> n576; + n583 -> n585; + n576 [label="START g(a)", shape=ellipse, style=filled, color=green]; + n576 -> n579; + n579 [label="a", shape=box]; + n579 -> n580; + n580 [label="a", shape=box]; + n580 -> n581; + n581 [label="a * a", shape=box]; + n581 -> n577; + n577 [label="END g(a)", shape=ellipse, style=filled, color=green]; + n577 -> n585; + n585 [label="RET g", shape=box, style=filled, color=orange]; + n585 -> n575; + n575 [label="END", shape=ellipse, style=filled, color=gray]; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/p2.dot b/Project-02-03-04/cfgdots/p2.dot new file mode 100644 index 0000000..816237c --- /dev/null +++ b/Project-02-03-04/cfgdots/p2.dot @@ -0,0 +1,40 @@ +digraph CFG { + node [fontname="Helvetica"]; + n587 [label="START", shape=ellipse, style=filled, color=gray]; + n587 -> n606; + n606 [label="10", shape=box]; + n606 -> n607; + n607 [label="CALL f1", shape=box, style=filled, color=orange]; + n607 -> n589; + n607 -> n609; + n589 [label="START f1(b)", shape=ellipse, style=filled, color=green]; + n589 -> n592; + n592 [label="b", shape=box]; + n592 -> n593; + n593 [label="0", shape=box]; + n593 -> n594; + n594 [label="b == 0", shape=box]; + n594 -> n595; + n595 [label="", shape=diamond]; + n595 -> n599 [label="T"]; + n595 -> n600 [label="F"]; + n599 [label="0", shape=box]; + n599 -> n590; + n590 [label="END f1(b)", shape=ellipse, style=filled, color=green]; + n590 -> n605; + n590 -> n609; + n605 [label="RET f1", shape=box, style=filled, color=orange]; + n605 -> n590; + n609 [label="RET f1", shape=box, style=filled, color=orange]; + n609 -> n588; + n588 [label="END", shape=ellipse, style=filled, color=gray]; + n600 [label="b", shape=box]; + n600 -> n601; + n601 [label="1", shape=box]; + n601 -> n602; + n602 [label="b - 1", shape=box]; + n602 -> n603; + n603 [label="CALL f1", shape=box, style=filled, color=orange]; + n603 -> n589; + n603 -> n605; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/p3.dot b/Project-02-03-04/cfgdots/p3.dot new file mode 100644 index 0000000..ff9e988 --- /dev/null +++ b/Project-02-03-04/cfgdots/p3.dot @@ -0,0 +1,127 @@ +digraph CFG { + node [fontname="Helvetica"]; + n611 [label="START", shape=ellipse, style=filled, color=gray]; + n611 -> n662; + n662 [label="10", shape=box]; + n662 -> n663; + n663 [label="CALL f1", shape=box, style=filled, color=orange]; + n663 -> n613; + n663 -> n665; + n613 [label="START f1(b)", shape=ellipse, style=filled, color=green]; + n613 -> n618; + n618 [label="b", shape=box]; + n618 -> n619; + n619 [label="0", shape=box]; + n619 -> n620; + n620 [label="b == 0", shape=box]; + n620 -> n621; + n621 [label="", shape=diamond]; + n621 -> n625 [label="T"]; + n621 -> n626 [label="F"]; + n625 [label="0", shape=box]; + n625 -> n614; + n614 [label="END f1(b)", shape=ellipse, style=filled, color=green]; + n614 -> n631; + n614 -> n642; + n614 -> n646; + n614 -> n665; + n631 [label="RET f1", shape=box, style=filled, color=orange]; + n631 -> n614; + n642 [label="RET f1", shape=box, style=filled, color=orange]; + n642 -> n655; + n655 [label="a", shape=box]; + n655 -> n656; + n656 [label="b", shape=box]; + n656 -> n657; + n657 [label="a * b", shape=box]; + n657 -> n658; + n658 [label="CALL g", shape=box, style=filled, color=orange]; + n658 -> n647; + n658 -> n660; + n647 [label="START g(c)", shape=ellipse, style=filled, color=green]; + n647 -> n650; + n650 [label="a", shape=box]; + n650 -> n651; + n651 [label="b", shape=box]; + n651 -> n652; + n652 [label="a * b", shape=box]; + n652 -> n653; + n653 [label="c", shape=box]; + n653 -> n654; + n654 [label="(a * b) * c", shape=box]; + n654 -> n648; + n648 [label="END g(c)", shape=ellipse, style=filled, color=green]; + n648 -> n660; + n660 [label="RET g", shape=box, style=filled, color=orange]; + n660 -> n616; + n616 [label="END f2(a, b)", shape=ellipse, style=filled, color=green]; + n616 -> n688; + n688 [label="RET f2", shape=box, style=filled, color=orange]; + n688 -> n612; + n612 [label="END", shape=ellipse, style=filled, color=gray]; + n646 [label="RET f1", shape=box, style=filled, color=orange]; + n646 -> n655; + n665 [label="RET f1", shape=box, style=filled, color=orange]; + n665 -> n667; + n667 [label="10", shape=box]; + n667 -> n680; + n680 [label="20", shape=box]; + n680 -> n681; + n681 [label="30", shape=box]; + n681 -> n682; + n682 [label="CALL max", shape=box, style=filled, color=orange]; + n682 -> n668; + n682 -> n684; + n668 [label="START max(a, b)", shape=ellipse, style=filled, color=green]; + n668 -> n671; + n671 [label="a", shape=box]; + n671 -> n672; + n672 [label="b", shape=box]; + n672 -> n673; + n673 [label="a > b", shape=box]; + n673 -> n674; + n674 [label="", shape=diamond]; + n674 -> n678 [label="T"]; + n674 -> n679 [label="F"]; + n678 [label="a", shape=box]; + n678 -> n669; + n669 [label="END max(a, b)", shape=ellipse, style=filled, color=green]; + n669 -> n684; + n684 [label="RET max", shape=box, style=filled, color=orange]; + n684 -> n686; + n686 [label="CALL f2", shape=box, style=filled, color=orange]; + n686 -> n615; + n686 -> n688; + n615 [label="START f2(a, b)", shape=ellipse, style=filled, color=green]; + n615 -> n632; + n632 [label="a", shape=box]; + n632 -> n633; + n633 [label="b", shape=box]; + n633 -> n634; + n634 [label="a > b", shape=box]; + n634 -> n635; + n635 [label="", shape=diamond]; + n635 -> n639 [label="T"]; + n635 -> n643 [label="F"]; + n639 [label="a", shape=box]; + n639 -> n640; + n640 [label="CALL f1", shape=box, style=filled, color=orange]; + n640 -> n613; + n640 -> n642; + n643 [label="b", shape=box]; + n643 -> n644; + n644 [label="CALL f1", shape=box, style=filled, color=orange]; + n644 -> n613; + n644 -> n646; + n679 [label="b", shape=box]; + n679 -> n669; + n626 [label="b", shape=box]; + n626 -> n627; + n627 [label="1", shape=box]; + n627 -> n628; + n628 [label="b - 1", shape=box]; + n628 -> n629; + n629 [label="CALL f1", shape=box, style=filled, color=orange]; + n629 -> n613; + n629 -> n631; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/p4.dot b/Project-02-03-04/cfgdots/p4.dot new file mode 100644 index 0000000..7b98c3a --- /dev/null +++ b/Project-02-03-04/cfgdots/p4.dot @@ -0,0 +1,27 @@ +digraph CFG { + node [fontname="Helvetica"]; + n689 [label="START", shape=ellipse, style=filled, color=gray]; + n689 -> n698; + n698 [label="10", shape=box]; + n698 -> n699; + n699 [label="8", shape=box]; + n699 -> n700; + n700 [label="CALL func", shape=box, style=filled, color=orange]; + n700 -> n691; + n700 -> n702; + n691 [label="START func(a, b)", shape=ellipse, style=filled, color=green]; + n691 -> n694; + n694 [label="b", shape=box]; + n694 -> n695; + n695 [label="1", shape=box]; + n695 -> n696; + n696 [label="b + 1", shape=box]; + n696 -> n697; + n697 [label="a = (b + 1)", shape=box]; + n697 -> n692; + n692 [label="END func(a, b)", shape=ellipse, style=filled, color=green]; + n692 -> n702; + n702 [label="RET func", shape=box, style=filled, color=orange]; + n702 -> n690; + n690 [label="END", shape=ellipse, style=filled, color=gray]; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/p5.dot b/Project-02-03-04/cfgdots/p5.dot new file mode 100644 index 0000000..dbaf5f6 --- /dev/null +++ b/Project-02-03-04/cfgdots/p5.dot @@ -0,0 +1,31 @@ +digraph CFG { + node [fontname="Helvetica"]; + n704 [label="START", shape=ellipse, style=filled, color=gray]; + n704 -> n706; + n706 [label="10", shape=box]; + n706 -> n707; + n707 [label="8", shape=box]; + n707 -> n708; + n708 [label="CALL func", shape=box, style=filled, color=orange]; + n708 -> n691; + n708 -> n710; + n691 [label="START func(a, b)", shape=ellipse, style=filled, color=green]; + n691 -> n694; + n694 [label="b", shape=box]; + n694 -> n695; + n695 [label="1", shape=box]; + n695 -> n696; + n696 [label="b + 1", shape=box]; + n696 -> n697; + n697 [label="a = (b + 1)", shape=box]; + n697 -> n692; + n692 [label="END func(a, b)", shape=ellipse, style=filled, color=green]; + n692 -> n702; + n692 -> n710; + n702 [label="RET func", shape=box, style=filled, color=orange]; + n702 -> n690; + n690 [label="END", shape=ellipse, style=filled, color=gray]; + n710 [label="RET func", shape=box, style=filled, color=orange]; + n710 -> n705; + n705 [label="END", shape=ellipse, style=filled, color=gray]; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/p6.dot b/Project-02-03-04/cfgdots/p6.dot new file mode 100644 index 0000000..589f246 --- /dev/null +++ b/Project-02-03-04/cfgdots/p6.dot @@ -0,0 +1,105 @@ +digraph CFG { + node [fontname="Helvetica"]; + n711 [label="START", shape=ellipse, style=filled, color=gray]; + n711 -> n763; + n763 [label="2", shape=box]; + n763 -> n764; + n764 [label="3", shape=box]; + n764 -> n765; + n765 [label="CALL f", shape=box, style=filled, color=orange]; + n765 -> n713; + n765 -> n767; + n713 [label="START f(a, b)", shape=ellipse, style=filled, color=green]; + n713 -> n718; + n718 [label="a", shape=box]; + n718 -> n719; + n719 [label="0", shape=box]; + n719 -> n720; + n720 [label="a == 0", shape=box]; + n720 -> n721; + n721 [label="", shape=diamond]; + n721 -> n725 [label="T"]; + n721 -> n736 [label="F"]; + n725 [label="2", shape=box]; + n725 -> n726; + n726 [label="b", shape=box]; + n726 -> n727; + n727 [label="2 + b", shape=box]; + n727 -> n714; + n714 [label="END f(a, b)", shape=ellipse, style=filled, color=green]; + n714 -> n761; + n714 -> n767; + n761 [label="RET f", shape=box, style=filled, color=orange]; + n761 -> n762; + n762 [label="c * f((c - 1),d)", shape=box]; + n762 -> n729; + n729 [label="END g(a, c)", shape=ellipse, style=filled, color=green]; + n729 -> n741; + n729 -> n773; + n741 [label="RET g", shape=box, style=filled, color=orange]; + n741 -> n742; + n742 [label="2 + g(a,b)", shape=box]; + n742 -> n714; + n773 [label="RET g", shape=box, style=filled, color=orange]; + n773 -> n712; + n712 [label="END", shape=ellipse, style=filled, color=gray]; + n767 [label="RET f", shape=box, style=filled, color=orange]; + n767 -> n769; + n769 [label="3", shape=box]; + n769 -> n770; + n770 [label="2", shape=box]; + n770 -> n771; + n771 [label="CALL g", shape=box, style=filled, color=orange]; + n771 -> n728; + n771 -> n773; + n728 [label="START g(a, c)", shape=ellipse, style=filled, color=green]; + n728 -> n731; + n728 -> n744; + n731 [label="a", shape=box]; + n731 -> n732; + n732 [label="c", shape=box]; + n732 -> n733; + n733 [label="a + c", shape=box]; + n733 -> n734; + n734 [label="b", shape=box]; + n734 -> n735; + n735 [label="(a + c) + b", shape=box]; + n735 -> n729; + n744 [label="c", shape=box]; + n744 -> n745; + n745 [label="0", shape=box]; + n745 -> n746; + n746 [label="c == 0", shape=box]; + n746 -> n747; + n747 [label="", shape=diamond]; + n747 -> n751 [label="T"]; + n747 -> n754 [label="F"]; + n751 [label="1", shape=box]; + n751 -> n752; + n752 [label="d", shape=box]; + n752 -> n753; + n753 [label="1 + d", shape=box]; + n753 -> n729; + n754 [label="c", shape=box]; + n754 -> n755; + n755 [label="c", shape=box]; + n755 -> n756; + n756 [label="1", shape=box]; + n756 -> n757; + n757 [label="c - 1", shape=box]; + n757 -> n758; + n758 [label="d", shape=box]; + n758 -> n759; + n759 [label="CALL f", shape=box, style=filled, color=orange]; + n759 -> n713; + n759 -> n761; + n736 [label="2", shape=box]; + n736 -> n737; + n737 [label="a", shape=box]; + n737 -> n738; + n738 [label="b", shape=box]; + n738 -> n739; + n739 [label="CALL g", shape=box, style=filled, color=orange]; + n739 -> n728; + n739 -> n741; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/side_effect.dot b/Project-02-03-04/cfgdots/side_effect.dot new file mode 100644 index 0000000..f14290b --- /dev/null +++ b/Project-02-03-04/cfgdots/side_effect.dot @@ -0,0 +1,42 @@ +digraph CFG { + node [fontname="Helvetica"]; + n774 [label="START", shape=ellipse, style=filled, color=gray]; + n774 -> n793; + n793 [label="1", shape=box]; + n793 -> n794; + n794 [label="2", shape=box]; + n794 -> n795; + n795 [label="CALL f", shape=box, style=filled, color=orange]; + n795 -> n776; + n795 -> n797; + n776 [label="START f(x, y)", shape=ellipse, style=filled, color=green]; + n776 -> n786; + n786 [label="5", shape=box]; + n786 -> n787; + n787 [label="CALL g", shape=box, style=filled, color=orange]; + n787 -> n779; + n787 -> n789; + n779 [label="START g(x)", shape=ellipse, style=filled, color=green]; + n779 -> n782; + n782 [label="x", shape=box]; + n782 -> n783; + n783 [label="7", shape=box]; + n783 -> n784; + n784 [label="x + 7", shape=box]; + n784 -> n785; + n785 [label="y = (x + 7)", shape=box]; + n785 -> n780; + n780 [label="END g(x)", shape=ellipse, style=filled, color=green]; + n780 -> n789; + n789 [label="RET g", shape=box, style=filled, color=orange]; + n789 -> n790; + n790 [label="x = g(5)", shape=box]; + n790 -> n792; + n792 [label="y", shape=box]; + n792 -> n777; + n777 [label="END f(x, y)", shape=ellipse, style=filled, color=green]; + n777 -> n797; + n797 [label="RET f", shape=box, style=filled, color=orange]; + n797 -> n775; + n775 [label="END", shape=ellipse, style=filled, color=gray]; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/simpleSequence.dot b/Project-02-03-04/cfgdots/simpleSequence.dot new file mode 100644 index 0000000..e8d0ef7 --- /dev/null +++ b/Project-02-03-04/cfgdots/simpleSequence.dot @@ -0,0 +1,61 @@ +digraph CFG { + node [fontname="Helvetica"]; + n799 [label="START", shape=ellipse, style=filled, color=gray]; + n799 -> n830; + n830 [label="3", shape=box]; + n830 -> n831; + n831 [label="CALL f", shape=box, style=filled, color=orange]; + n831 -> n801; + n831 -> n833; + n801 [label="START f(x)", shape=ellipse, style=filled, color=green]; + n801 -> n804; + n804 [label="2", shape=box]; + n804 -> n805; + n805 [label="x", shape=box]; + n805 -> n806; + n806 [label="2 * x", shape=box]; + n806 -> n807; + n807 [label="x = (2 * x)", shape=box]; + n807 -> n808; + n808 [label="x", shape=box]; + n808 -> n809; + n809 [label="0", shape=box]; + n809 -> n810; + n810 [label="x > 0", shape=box]; + n810 -> n811; + n811 [label="", shape=diamond]; + n811 -> n815 [label="T"]; + n811 -> n819 [label="F"]; + n815 [label="x", shape=box]; + n815 -> n816; + n816 [label="1", shape=box]; + n816 -> n817; + n817 [label="x - 1", shape=box]; + n817 -> n818; + n818 [label="x = (x - 1)", shape=box]; + n818 -> n820; + n820 [label="x", shape=box]; + n820 -> n821; + n821 [label="0", shape=box]; + n821 -> n822; + n822 [label="x > 0", shape=box]; + n822 -> n823; + n823 [label="", shape=diamond]; + n823 -> n802 [label="T"]; + n823 -> n825 [label="F"]; + n802 [label="END f(x)", shape=ellipse, style=filled, color=green]; + n802 -> n833; + n833 [label="RET f", shape=box, style=filled, color=orange]; + n833 -> n800; + n800 [label="END", shape=ellipse, style=filled, color=gray]; + n825 [label="x", shape=box]; + n825 -> n826; + n826 [label="1", shape=box]; + n826 -> n827; + n827 [label="x - 1", shape=box]; + n827 -> n828; + n828 [label="x = (x - 1)", shape=box]; + n828 -> n820; + n819 [label="x", shape=box]; + n819 -> n820; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/simple_dfa.dot b/Project-02-03-04/cfgdots/simple_dfa.dot new file mode 100644 index 0000000..e902c30 --- /dev/null +++ b/Project-02-03-04/cfgdots/simple_dfa.dot @@ -0,0 +1,23 @@ +digraph CFG { + node [fontname="Helvetica"]; + n835 [label="START", shape=ellipse, style=filled, color=gray]; + n835 -> n843; + n843 [label="2", shape=box]; + n843 -> n844; + n844 [label="CALL g", shape=box, style=filled, color=orange]; + n844 -> n837; + n844 -> n846; + n837 [label="START g(x, y)", shape=ellipse, style=filled, color=green]; + n837 -> n840; + n840 [label="3", shape=box]; + n840 -> n841; + n841 [label="y = 3", shape=box]; + n841 -> n842; + n842 [label="x", shape=box]; + n842 -> n838; + n838 [label="END g(x, y)", shape=ellipse, style=filled, color=green]; + n838 -> n846; + n846 [label="RET g", shape=box, style=filled, color=orange]; + n846 -> n836; + n836 [label="END", shape=ellipse, style=filled, color=gray]; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/simple_if.dot b/Project-02-03-04/cfgdots/simple_if.dot new file mode 100644 index 0000000..6f689c5 --- /dev/null +++ b/Project-02-03-04/cfgdots/simple_if.dot @@ -0,0 +1,15 @@ +digraph CFG { + node [fontname="Helvetica"]; + n848 [label="START", shape=ellipse, style=filled, color=gray]; + n848 -> n850; + n850 [label="True", shape=box]; + n850 -> n851; + n851 [label="", shape=diamond]; + n851 -> n855 [label="T"]; + n851 -> n856 [label="F"]; + n855 [label="1", shape=box]; + n855 -> n849; + n849 [label="END", shape=ellipse, style=filled, color=gray]; + n856 [label="0", shape=box]; + n856 -> n849; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/simple_if_2.dot b/Project-02-03-04/cfgdots/simple_if_2.dot new file mode 100644 index 0000000..47cfccf --- /dev/null +++ b/Project-02-03-04/cfgdots/simple_if_2.dot @@ -0,0 +1,19 @@ +digraph CFG { + node [fontname="Helvetica"]; + n857 [label="START", shape=ellipse, style=filled, color=gray]; + n857 -> n859; + n859 [label="True", shape=box]; + n859 -> n860; + n860 [label="False", shape=box]; + n860 -> n861; + n861 [label="True && False", shape=box]; + n861 -> n862; + n862 [label="", shape=diamond]; + n862 -> n866 [label="T"]; + n862 -> n867 [label="F"]; + n866 [label="1", shape=box]; + n866 -> n858; + n858 [label="END", shape=ellipse, style=filled, color=gray]; + n867 [label="0", shape=box]; + n867 -> n858; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/simple_if_3.dot b/Project-02-03-04/cfgdots/simple_if_3.dot new file mode 100644 index 0000000..66956f0 --- /dev/null +++ b/Project-02-03-04/cfgdots/simple_if_3.dot @@ -0,0 +1,19 @@ +digraph CFG { + node [fontname="Helvetica"]; + n868 [label="START", shape=ellipse, style=filled, color=gray]; + n868 -> n870; + n870 [label="True", shape=box]; + n870 -> n871; + n871 [label="False", shape=box]; + n871 -> n872; + n872 [label="True || False", shape=box]; + n872 -> n873; + n873 [label="", shape=diamond]; + n873 -> n877 [label="T"]; + n873 -> n878 [label="F"]; + n877 [label="1", shape=box]; + n877 -> n869; + n869 [label="END", shape=ellipse, style=filled, color=gray]; + n878 [label="0", shape=box]; + n878 -> n869; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/simple_if_4.dot b/Project-02-03-04/cfgdots/simple_if_4.dot new file mode 100644 index 0000000..1d8083f --- /dev/null +++ b/Project-02-03-04/cfgdots/simple_if_4.dot @@ -0,0 +1,19 @@ +digraph CFG { + node [fontname="Helvetica"]; + n879 [label="START", shape=ellipse, style=filled, color=gray]; + n879 -> n881; + n881 [label="1", shape=box]; + n881 -> n882; + n882 [label="2", shape=box]; + n882 -> n883; + n883 [label="1 > 2", shape=box]; + n883 -> n884; + n884 [label="", shape=diamond]; + n884 -> n888 [label="T"]; + n884 -> n889 [label="F"]; + n888 [label="1", shape=box]; + n888 -> n880; + n880 [label="END", shape=ellipse, style=filled, color=gray]; + n889 [label="0", shape=box]; + n889 -> n880; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/simple_if_5.dot b/Project-02-03-04/cfgdots/simple_if_5.dot new file mode 100644 index 0000000..e3e5fc4 --- /dev/null +++ b/Project-02-03-04/cfgdots/simple_if_5.dot @@ -0,0 +1,23 @@ +digraph CFG { + node [fontname="Helvetica"]; + n890 [label="START", shape=ellipse, style=filled, color=gray]; + n890 -> n892; + n892 [label="2", shape=box]; + n892 -> n893; + n893 [label="3", shape=box]; + n893 -> n894; + n894 [label="5", shape=box]; + n894 -> n895; + n895 [label="3 + 5", shape=box]; + n895 -> n896; + n896 [label="2 > (3 + 5)", shape=box]; + n896 -> n897; + n897 [label="", shape=diamond]; + n897 -> n901 [label="T"]; + n897 -> n902 [label="F"]; + n901 [label="1", shape=box]; + n901 -> n891; + n891 [label="END", shape=ellipse, style=filled, color=gray]; + n902 [label="0", shape=box]; + n902 -> n891; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/simple_if_6.dot b/Project-02-03-04/cfgdots/simple_if_6.dot new file mode 100644 index 0000000..e331b38 --- /dev/null +++ b/Project-02-03-04/cfgdots/simple_if_6.dot @@ -0,0 +1,27 @@ +digraph CFG { + node [fontname="Helvetica"]; + n903 [label="START", shape=ellipse, style=filled, color=gray]; + n903 -> n905; + n905 [label="1", shape=box]; + n905 -> n906; + n906 [label="2", shape=box]; + n906 -> n907; + n907 [label="1 > 2", shape=box]; + n907 -> n908; + n908 [label="3", shape=box]; + n908 -> n909; + n909 [label="5", shape=box]; + n909 -> n910; + n910 [label="3 < 5", shape=box]; + n910 -> n911; + n911 [label="(1 > 2) || (3 < 5)", shape=box]; + n911 -> n912; + n912 [label="", shape=diamond]; + n912 -> n916 [label="T"]; + n912 -> n917 [label="F"]; + n916 [label="1", shape=box]; + n916 -> n904; + n904 [label="END", shape=ellipse, style=filled, color=gray]; + n917 [label="0", shape=box]; + n917 -> n904; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/simple_if_7.dot b/Project-02-03-04/cfgdots/simple_if_7.dot new file mode 100644 index 0000000..cb1c6ba --- /dev/null +++ b/Project-02-03-04/cfgdots/simple_if_7.dot @@ -0,0 +1,23 @@ +digraph CFG { + node [fontname="Helvetica"]; + n918 [label="START", shape=ellipse, style=filled, color=gray]; + n918 -> n920; + n920 [label="2", shape=box]; + n920 -> n921; + n921 [label="0", shape=box]; + n921 -> n922; + n922 [label="2 == 0", shape=box]; + n922 -> n923; + n923 [label="False", shape=box]; + n923 -> n924; + n924 [label="(2 == 0) == False", shape=box]; + n924 -> n925; + n925 [label="", shape=diamond]; + n925 -> n929 [label="T"]; + n925 -> n930 [label="F"]; + n929 [label="1", shape=box]; + n929 -> n919; + n919 [label="END", shape=ellipse, style=filled, color=gray]; + n930 [label="0", shape=box]; + n930 -> n919; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/square.dot b/Project-02-03-04/cfgdots/square.dot new file mode 100644 index 0000000..f582949 --- /dev/null +++ b/Project-02-03-04/cfgdots/square.dot @@ -0,0 +1,23 @@ +digraph CFG { + node [fontname="Helvetica"]; + n931 [label="START", shape=ellipse, style=filled, color=gray]; + n931 -> n939; + n939 [label="10", shape=box]; + n939 -> n940; + n940 [label="CALL square", shape=box, style=filled, color=orange]; + n940 -> n933; + n940 -> n942; + n933 [label="START square(x)", shape=ellipse, style=filled, color=green]; + n933 -> n936; + n936 [label="x", shape=box]; + n936 -> n937; + n937 [label="x", shape=box]; + n937 -> n938; + n938 [label="x * x", shape=box]; + n938 -> n934; + n934 [label="END square(x)", shape=ellipse, style=filled, color=green]; + n934 -> n942; + n942 [label="RET square", shape=box, style=filled, color=orange]; + n942 -> n932; + n932 [label="END", shape=ellipse, style=filled, color=gray]; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/validProgram.dot b/Project-02-03-04/cfgdots/validProgram.dot new file mode 100644 index 0000000..fa2078d --- /dev/null +++ b/Project-02-03-04/cfgdots/validProgram.dot @@ -0,0 +1,94 @@ +digraph CFG { + node [fontname="Helvetica"]; + n944 [label="START", shape=ellipse, style=filled, color=gray]; + n944 -> n984; + n984 [label="2", shape=box]; + n984 -> n985; + n985 [label="3", shape=box]; + n985 -> n986; + n986 [label="CALL mult", shape=box, style=filled, color=orange]; + n986 -> n946; + n986 -> n988; + n946 [label="START mult(a, b)", shape=ellipse, style=filled, color=green]; + n946 -> n951; + n951 [label="a", shape=box]; + n951 -> n952; + n952 [label="b", shape=box]; + n952 -> n953; + n953 [label="a * b", shape=box]; + n953 -> n947; + n947 [label="END mult(a, b)", shape=ellipse, style=filled, color=green]; + n947 -> n978; + n947 -> n988; + n978 [label="RET mult", shape=box, style=filled, color=orange]; + n978 -> n955; + n955 [label="END inc(a)", shape=ellipse, style=filled, color=green]; + n955 -> n973; + n955 -> n982; + n973 [label="RET inc", shape=box, style=filled, color=orange]; + n973 -> n955; + n982 [label="RET inc", shape=box, style=filled, color=orange]; + n982 -> n949; + n949 [label="END add(a, b)", shape=ellipse, style=filled, color=green]; + n949 -> n993; + n949 -> n996; + n993 [label="RET add", shape=box, style=filled, color=orange]; + n993 -> n994; + n994 [label="CALL add", shape=box, style=filled, color=orange]; + n994 -> n948; + n994 -> n996; + n948 [label="START add(a, b)", shape=ellipse, style=filled, color=green]; + n948 -> n979; + n979 [label="a", shape=box]; + n979 -> n980; + n980 [label="CALL inc", shape=box, style=filled, color=orange]; + n980 -> n954; + n980 -> n982; + n954 [label="START inc(a)", shape=ellipse, style=filled, color=green]; + n954 -> n957; + n957 [label="b", shape=box]; + n957 -> n958; + n958 [label="0", shape=box]; + n958 -> n959; + n959 [label="b != 0", shape=box]; + n959 -> n960; + n960 [label="", shape=diamond]; + n960 -> n964 [label="T"]; + n960 -> n974 [label="F"]; + n964 [label="b", shape=box]; + n964 -> n965; + n965 [label="1", shape=box]; + n965 -> n966; + n966 [label="b - 1", shape=box]; + n966 -> n967; + n967 [label="b = (b - 1)", shape=box]; + n967 -> n968; + n968 [label="a", shape=box]; + n968 -> n969; + n969 [label="1", shape=box]; + n969 -> n970; + n970 [label="a + 1", shape=box]; + n970 -> n971; + n971 [label="CALL inc", shape=box, style=filled, color=orange]; + n971 -> n954; + n971 -> n973; + n974 [label="a", shape=box]; + n974 -> n975; + n975 [label="1", shape=box]; + n975 -> n976; + n976 [label="CALL mult", shape=box, style=filled, color=orange]; + n976 -> n946; + n976 -> n978; + n996 [label="RET add", shape=box, style=filled, color=orange]; + n996 -> n945; + n945 [label="END", shape=ellipse, style=filled, color=gray]; + n988 [label="RET mult", shape=box, style=filled, color=orange]; + n988 -> n989; + n989 [label="4", shape=box]; + n989 -> n990; + n990 [label="5", shape=box]; + n990 -> n991; + n991 [label="CALL add", shape=box, style=filled, color=orange]; + n991 -> n948; + n991 -> n993; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/while.dot b/Project-02-03-04/cfgdots/while.dot new file mode 100644 index 0000000..6f7198e --- /dev/null +++ b/Project-02-03-04/cfgdots/while.dot @@ -0,0 +1,52 @@ +digraph CFG { + node [fontname="Helvetica"]; + n998 [label="START", shape=ellipse, style=filled, color=gray]; + n998 -> n1021; + n1021 [label="10", shape=box]; + n1021 -> n1022; + n1022 [label="8", shape=box]; + n1022 -> n1023; + n1023 [label="CALL func", shape=box, style=filled, color=orange]; + n1023 -> n1000; + n1023 -> n1025; + n1000 [label="START func(a, b)", shape=ellipse, style=filled, color=green]; + n1000 -> n1003; + n1003 [label="a", shape=box]; + n1003 -> n1004; + n1004 [label="0", shape=box]; + n1004 -> n1005; + n1005 [label="a > 0", shape=box]; + n1005 -> n1006; + n1006 [label="b", shape=box]; + n1006 -> n1007; + n1007 [label="a", shape=box]; + n1007 -> n1008; + n1008 [label="b != a", shape=box]; + n1008 -> n1009; + n1009 [label="(a > 0) && (b != a)", shape=box]; + n1009 -> n1010; + n1010 [label="", shape=diamond]; + n1010 -> n1001 [label="T"]; + n1010 -> n1012 [label="F"]; + n1001 [label="END func(a, b)", shape=ellipse, style=filled, color=green]; + n1001 -> n1025; + n1025 [label="RET func", shape=box, style=filled, color=orange]; + n1025 -> n999; + n999 [label="END", shape=ellipse, style=filled, color=gray]; + n1012 [label="b", shape=box]; + n1012 -> n1013; + n1013 [label="1", shape=box]; + n1013 -> n1014; + n1014 [label="b + 1", shape=box]; + n1014 -> n1015; + n1015 [label="b = (b + 1)", shape=box]; + n1015 -> n1016; + n1016 [label="a", shape=box]; + n1016 -> n1017; + n1017 [label="1", shape=box]; + n1017 -> n1018; + n1018 [label="a - 1", shape=box]; + n1018 -> n1019; + n1019 [label="a = (a - 1)", shape=box]; + n1019 -> n1005; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/while_2.dot b/Project-02-03-04/cfgdots/while_2.dot new file mode 100644 index 0000000..fd1d7e9 --- /dev/null +++ b/Project-02-03-04/cfgdots/while_2.dot @@ -0,0 +1,13 @@ +digraph CFG { + node [fontname="Helvetica"]; + n1027 [label="START", shape=ellipse, style=filled, color=gray]; + n1027 -> n1029; + n1029 [label="True", shape=box]; + n1029 -> n1030; + n1030 [label="", shape=diamond]; + n1030 -> n1028 [label="T"]; + n1030 -> n1032 [label="F"]; + n1028 [label="END", shape=ellipse, style=filled, color=gray]; + n1032 [label="3", shape=box]; + n1032 -> n1027; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/wrapped-ggT.dot b/Project-02-03-04/cfgdots/wrapped-ggT.dot new file mode 100644 index 0000000..84194aa --- /dev/null +++ b/Project-02-03-04/cfgdots/wrapped-ggT.dot @@ -0,0 +1,78 @@ +digraph CFG { + node [fontname="Helvetica"]; + n1034 [label="START", shape=ellipse, style=filled, color=gray]; + n1034 -> n1076; + n1076 [label="21", shape=box]; + n1076 -> n1077; + n1077 [label="49", shape=box]; + n1077 -> n1078; + n1078 [label="CALL wrapper", shape=box, style=filled, color=orange]; + n1078 -> n1036; + n1078 -> n1080; + n1036 [label="START wrapper(a, b)", shape=ellipse, style=filled, color=green]; + n1036 -> n1071; + n1071 [label="0", shape=box]; + n1071 -> n1072; + n1072 [label="CALL ggt", shape=box, style=filled, color=orange]; + n1072 -> n1039; + n1072 -> n1074; + n1039 [label="START ggt(noneSense)", shape=ellipse, style=filled, color=green]; + n1039 -> n1042; + n1042 [label="a", shape=box]; + n1042 -> n1043; + n1043 [label="b", shape=box]; + n1043 -> n1044; + n1044 [label="a == b", shape=box]; + n1044 -> n1045; + n1045 [label="", shape=diamond]; + n1045 -> n1049 [label="T"]; + n1045 -> n1050 [label="F"]; + n1049 [label="a", shape=box]; + n1049 -> n1040; + n1040 [label="END ggt(noneSense)", shape=ellipse, style=filled, color=green]; + n1040 -> n1074; + n1074 [label="RET ggt", shape=box, style=filled, color=orange]; + n1074 -> n1037; + n1037 [label="END wrapper(a, b)", shape=ellipse, style=filled, color=green]; + n1037 -> n1063; + n1037 -> n1070; + n1037 -> n1080; + n1063 [label="RET wrapper", shape=box, style=filled, color=orange]; + n1063 -> n1040; + n1070 [label="RET wrapper", shape=box, style=filled, color=orange]; + n1070 -> n1040; + n1080 [label="RET wrapper", shape=box, style=filled, color=orange]; + n1080 -> n1035; + n1035 [label="END", shape=ellipse, style=filled, color=gray]; + n1050 [label="a", shape=box]; + n1050 -> n1051; + n1051 [label="b", shape=box]; + n1051 -> n1052; + n1052 [label="a > b", shape=box]; + n1052 -> n1053; + n1053 [label="", shape=diamond]; + n1053 -> n1057 [label="T"]; + n1053 -> n1064 [label="F"]; + n1057 [label="a", shape=box]; + n1057 -> n1058; + n1058 [label="b", shape=box]; + n1058 -> n1059; + n1059 [label="a - b", shape=box]; + n1059 -> n1060; + n1060 [label="b", shape=box]; + n1060 -> n1061; + n1061 [label="CALL wrapper", shape=box, style=filled, color=orange]; + n1061 -> n1036; + n1061 -> n1063; + n1064 [label="b", shape=box]; + n1064 -> n1065; + n1065 [label="a", shape=box]; + n1065 -> n1066; + n1066 [label="b - a", shape=box]; + n1066 -> n1067; + n1067 [label="a", shape=box]; + n1067 -> n1068; + n1068 [label="CALL wrapper", shape=box, style=filled, color=orange]; + n1068 -> n1036; + n1068 -> n1070; +} \ No newline at end of file diff --git a/Project-02-03-04/cfgdots/wrapper.dot b/Project-02-03-04/cfgdots/wrapper.dot new file mode 100644 index 0000000..88e2158 --- /dev/null +++ b/Project-02-03-04/cfgdots/wrapper.dot @@ -0,0 +1,51 @@ +digraph CFG { + node [fontname="Helvetica"]; + n1082 [label="START", shape=ellipse, style=filled, color=gray]; + n1082 -> n1108; + n1108 [label="4", shape=box]; + n1108 -> n1109; + n1109 [label="10", shape=box]; + n1109 -> n1110; + n1110 [label="CALL wrapper", shape=box, style=filled, color=orange]; + n1110 -> n1084; + n1110 -> n1112; + n1084 [label="START wrapper(number, threshold)", shape=ellipse, style=filled, color=green]; + n1084 -> n1103; + n1103 [label="number", shape=box]; + n1103 -> n1104; + n1104 [label="CALL square", shape=box, style=filled, color=orange]; + n1104 -> n1087; + n1104 -> n1106; + n1087 [label="START square(x)", shape=ellipse, style=filled, color=green]; + n1087 -> n1090; + n1090 [label="x", shape=box]; + n1090 -> n1091; + n1091 [label="x", shape=box]; + n1091 -> n1092; + n1092 [label="x * x", shape=box]; + n1092 -> n1093; + n1093 [label="threshold", shape=box]; + n1093 -> n1094; + n1094 [label="(x * x) > threshold", shape=box]; + n1094 -> n1095; + n1095 [label="", shape=diamond]; + n1095 -> n1099 [label="T"]; + n1095 -> n1100 [label="F"]; + n1099 [label="x", shape=box]; + n1099 -> n1088; + n1088 [label="END square(x)", shape=ellipse, style=filled, color=green]; + n1088 -> n1106; + n1106 [label="RET square", shape=box, style=filled, color=orange]; + n1106 -> n1085; + n1085 [label="END wrapper(number, threshold)", shape=ellipse, style=filled, color=green]; + n1085 -> n1112; + n1112 [label="RET wrapper", shape=box, style=filled, color=orange]; + n1112 -> n1083; + n1083 [label="END", shape=ellipse, style=filled, color=gray]; + n1100 [label="x", shape=box]; + n1100 -> n1101; + n1101 [label="x", shape=box]; + n1101 -> n1102; + n1102 [label="x * x", shape=box]; + n1102 -> n1088; +} \ No newline at end of file diff --git a/Project-02-03-04/main.py b/Project-02-03-04/main.py index b701381..77de897 100644 --- a/Project-02-03-04/main.py +++ b/Project-02-03-04/main.py @@ -156,7 +156,7 @@ if __name__ == "__main__": if not filename: filename = default - out_path = Path(__file__).parent / filename + out_path = Path(__file__).parent / 'cfgdots' / filename with open(out_path, "w") as f: f.write(dot_str)