diff --git a/docs/beta/code/Alhazen.py b/docs/beta/code/Alhazen.py index 3c029382..17b46a42 100755 --- a/docs/beta/code/Alhazen.py +++ b/docs/beta/code/Alhazen.py @@ -3,7 +3,7 @@ # "Learning from Failures" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Alhazen.html -# Last change: 2025-01-07 11:04:38+01:00 +# Last change: 2025-01-07 11:35:49+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -66,7 +66,10 @@ If the predicate evaluates to `True`, follow the left path; if it evaluates to `False`, follow the right path. A leaf node (no children) will give you the final decision `class = BUG` or `class = NO_BUG`. -So if the predicate states ` == 'sqrt' <= 0.5`, this means that if the function is _not_ `sqrt`, follow the left (`True`) path. If it is `sqrt`, follow the right (`False`) path. +So if the predicate states ` == 'sqrt' <= 0.5`, this means that + +* If the function is _not_ `sqrt` (the predicate ` == 'sqrt'` is negative, see above, and hence less than 0.5), follow the left (`True`) path. +* If the function _is_ `sqrt` (the predicate ` == 'sqrt'` is positive), follow the right (`False`) path. The `samples` field shows the number of sample inputs that contributed to this decision. The `gini` field (aka Gini impurity) indicates how many samples fall into the displayed class (`BUG` or `NO_BUG`). @@ -77,9 +80,9 @@ >>> print(alhazen.friendly_decision_tree()) if <= 4.5000: - if <= 42.1500: - if == 'sqrt': - if <= -11.9137: + if == 'sqrt': + if <= 42.2000: + if <= -11.8470: BUG else: NO_BUG @@ -336,6 +339,13 @@ def execute_samples(sample_list): +### Internal and "Friendly" Feature Names + +if __name__ == '__main__': + print('\n### Internal and "Friendly" Feature Names') + + + ### Implementing Feature Classes if __name__ == '__main__': diff --git a/docs/beta/code/Tours.py b/docs/beta/code/Tours.py index b3f5c224..dd145c1d 100755 --- a/docs/beta/code/Tours.py +++ b/docs/beta/code/Tours.py @@ -3,7 +3,7 @@ # "Tours through the Book" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Tours.html -# Last change: 2025-01-07 11:01:55+01:00 +# Last change: 2025-01-07 11:33:11+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/beta/dist/debuggingbook-1.2.4.tar.gz b/docs/beta/dist/debuggingbook-1.2.4.tar.gz index d03aab39..1b548ce0 100644 Binary files a/docs/beta/dist/debuggingbook-1.2.4.tar.gz and b/docs/beta/dist/debuggingbook-1.2.4.tar.gz differ diff --git a/docs/beta/dist/debuggingbook-code.zip b/docs/beta/dist/debuggingbook-code.zip index 6498747c..7c15b085 100644 Binary files a/docs/beta/dist/debuggingbook-code.zip and b/docs/beta/dist/debuggingbook-code.zip differ diff --git a/docs/beta/dist/debuggingbook-notebooks.zip b/docs/beta/dist/debuggingbook-notebooks.zip index 3bb6fbda..4d934884 100644 Binary files a/docs/beta/dist/debuggingbook-notebooks.zip and b/docs/beta/dist/debuggingbook-notebooks.zip differ diff --git a/docs/beta/html/00_Index.html b/docs/beta/html/00_Index.html index 0fe67985..bb068324 100644 --- a/docs/beta/html/00_Index.html +++ b/docs/beta/html/00_Index.html @@ -12120,7 +12120,7 @@

C

diff --git a/docs/beta/html/Alhazen.html b/docs/beta/html/Alhazen.html index 475f42d9..380c66a5 100644 --- a/docs/beta/html/Alhazen.html +++ b/docs/beta/html/Alhazen.html @@ -11927,7 +11927,8 @@
  • Structure of this Chapter
  •  •   Inputs and Grammars
  •  •   Step 1: Extracting Features -

    If the predicate evaluates to True, follow the left path; if it evaluates to False, follow the right path. A leaf node (no children) will give you the final decision class = BUG or class = NO_BUG.

    -

    So if the predicate states <function> == 'sqrt' <= 0.5, this means that if the function is not sqrt, follow the left (True) path. If it is sqrt, follow the right (False) path.

    +

    So if the predicate states <function> == 'sqrt' <= 0.5, this means that

    +

    The samples field shows the number of sample inputs that contributed to this decision. The gini field (aka Gini impurity) indicates how many samples fall into the displayed class (BUG or NO_BUG). A gini value of 0.0 means purity - all samples fall into the displayed class. @@ -12747,9 +12735,9 @@

    Synopsis

    if <lead-digit> <= 4.5000:
    -  if <value> <= 42.1500:
    -    if <function> == 'sqrt':
    -      if <term> <= -11.9137:
    +  if <function> == 'sqrt':
    +    if <value> <= 42.2000:
    +      if <term> <= -11.8470:
             BUG
           else:
             NO_BUG
    diff --git a/notebooks/PICS/Alhazen-synopsis-1.png b/notebooks/PICS/Alhazen-synopsis-1.png
    index a961e7c6..8b1b92f6 100644
    Binary files a/notebooks/PICS/Alhazen-synopsis-1.png and b/notebooks/PICS/Alhazen-synopsis-1.png differ
    diff --git a/notebooks/PICS/Alhazen-synopsis-1.svg b/notebooks/PICS/Alhazen-synopsis-1.svg
    index fbe42e3c..d465a060 100644
    --- a/notebooks/PICS/Alhazen-synopsis-1.svg
    +++ b/notebooks/PICS/Alhazen-synopsis-1.svg
    @@ -4,145 +4,145 @@
     
     
    -
    +
     
     Tree
    -
    +
     
     
     0
    -
    -<lead-digit> <= 4.5
    -gini = 0.5
    -samples = 1270
    -value = [1.0, 1.0]
    -class = NO_BUG
    +
    +<lead-digit> <= 4.5
    +gini = 0.5
    +samples = 1807
    +value = [1.0, 1.0]
    +class = NO_BUG
     
     
     
     1
    -
    -<value> <= 42.15
    -gini = 0.341
    -samples = 391
    -value = [1.0, 0.278]
    -class = BUG
    +
    +<function> == 'sqrt' <= 0.5
    +gini = 0.33
    +samples = 514
    +value = [1.0, 0.263]
    +class = BUG
     
     
     
     0->1
    -
    -
    -True
    +
    +
    +True
     
    -
    +
     
    -12
    -
    -gini = -0.0
    -samples = 879
    -value = [0.0, 0.722]
    -class = NO_BUG
    -
    -
    +10
    +
    +gini = -0.0
    +samples = 1293
    +value = [0.0, 0.737]
    +class = NO_BUG
    +
    +
     
    -0->12
    -
    -
    -False
    +0->10
    +
    +
    +False
     
     
     
     2
    -
    -<function> == 'sqrt' <= 0.5
    -gini = 0.179
    -samples = 186
    -value = [1.0, 0.11]
    -class = BUG
    +
    +gini = -0.0
    +samples = 291
    +value = [0.0, 0.166]
    +class = NO_BUG
     
     
     
     1->2
    -
    -
    -
    -
    -
    -9
    -
    -gini = 0.0
    -samples = 205
    -value = [0.0, 0.168]
    -class = NO_BUG
    -
    -
    -
    -1->9
    -
    -
    +
    +
     
     
     
     3
    -
    -gini = -0.0
    -samples = 97
    -value = [0.0, 0.08]
    -class = NO_BUG
    -
    -
    +
    +<value> <= 42.2
    +gini = 0.162
    +samples = 223
    +value = [1.0, 0.097]
    +class = BUG
    +
    +
     
    -2->3
    -
    -
    +1->3
    +
    +
     
     
     
     4
    -
    -<term> <= -11.914
    -gini = 0.057
    -samples = 89
    -value = [1.0, 0.03]
    -class = BUG
    -
    -
    +
    +<term> <= -11.847
    +gini = 0.06
    +samples = 108
    +value = [1.0, 0.032]
    +class = BUG
    +
    +
     
    -2->4
    -
    -
    +3->4
    +
    +
    +
    +
    +
    +9
    +
    +gini = -0.0
    +samples = 115
    +value = [0.0, 0.066]
    +class = NO_BUG
    +
    +
    +
    +3->9
    +
    +
     
     
     
     5
    -
    -gini = 0.0
    -samples = 52
    -value = [1.0, 0.0]
    -class = BUG
    +
    +gini = 0.0
    +samples = 52
    +value = [1.0, 0.0]
    +class = BUG
     
     
     
     4->5
    -
    -
    +
    +
     
    -
    +
     
    -8
    -
    -gini = -0.0
    -samples = 37
    -value = [0.0, 0.03]
    -class = NO_BUG
    -
    -
    +6
    +
    +gini = 0.0
    +samples = 56
    +value = [0.0, 0.032]
    +class = NO_BUG
    +
    +
     
    -4->8
    -
    -
    +4->6
    +
    +