| … | … | @@ -52,12 +52,12 @@ |
| 52 | 52 | (test-equal 3 (length (gsc 'right-stars (Word "c")))) |
| 53 | 53 | |
| 54 | 54 | ; Get the total count on all Sections |
| 55 | | (define totcnt (fold + 0 (map (lambda (atm) (gsc 'get-count atm)) (cog-get-atoms 'Section)))) |
| 55 | (define totcnt (fold + 0 (map cog-count (cog-get-atoms 'Section)))) |
| 56 | 56 | |
| 57 | 57 | ; Create CrossSections and verify that they got created |
| 58 | 58 | (gsc 'explode-sections) |
| 59 | 59 | (test-equal 19 (length (cog-get-atoms 'CrossSection))) |
| 60 | | (define totcross (fold + 0 (map (lambda (atm) (gsc 'get-count atm)) (cog-get-atoms 'CrossSection)))) |
| 60 | (define totcross (fold + 0 (map cog-count (cog-get-atoms 'CrossSection)))) |
| 61 | 61 | |
| 62 | 62 | ; Verify that direct-sum object is accessing shapes correctly |
| 63 | 63 | ; i.e. the 'explode should have created some CrossSections |
| … | … | @@ -95,7 +95,7 @@ |
| 95 | 95 | ; -------------- |
| 96 | 96 | ; Validate counts. |
| 97 | 97 | (define tot-ab |
| 98 | | (fold (lambda (atm cnt) (+ cnt (gsc 'get-count atm))) 0 |
| 98 | (fold (lambda (atm cnt) (+ cnt (cog-count atm))) 0 |
| 99 | 99 | (gsc 'right-stars WC-AB))) |
| 100 | 100 | (define epsilon 1.0e-8) |
| 101 | 101 | (test-approximate |
| … | … | @@ -106,17 +106,17 @@ |
| 106 | 106 | ; To gain access to the counts, load them by name. |
| 107 | 107 | (expected-aba-sections WC-AB) |
| 108 | 108 | |
| 109 | | (test-approximate (+ cnt-a-gh cnt-b-gh) (gsc 'get-count sec-ab-gh) epsilon) |
| 109 | (test-approximate (+ cnt-a-gh cnt-b-gh) (cog-count sec-ab-gh) epsilon) |
| 110 | 110 | |
| 111 | 111 | (define cnt-c-tot (+ cnt-c-aaa cnt-c-aab cnt-c-aba)) |
| 112 | | (test-approximate cnt-c-tot (gsc 'get-count sec-c-aaa) epsilon) |
| 112 | (test-approximate cnt-c-tot (cog-count sec-c-aaa) epsilon) |
| 113 | 113 | |
| 114 | 114 | ; Validate counts on CrossSections... |
| 115 | | (test-approximate cnt-c-tot (gsc 'get-count xes-k-c-vaaam) epsilon) |
| 116 | | (test-approximate cnt-c-tot (gsc 'get-count xes-a-c-kvaam) epsilon) |
| 117 | | (test-approximate cnt-c-tot (gsc 'get-count xes-a-c-kavam) epsilon) |
| 118 | | (test-approximate cnt-c-tot (gsc 'get-count xes-a-c-kaavm) epsilon) |
| 119 | | (test-approximate cnt-c-tot (gsc 'get-count xes-m-c-kaaav) epsilon) |
| 115 | (test-approximate cnt-c-tot (cog-count xes-k-c-vaaam) epsilon) |
| 116 | (test-approximate cnt-c-tot (cog-count xes-a-c-kvaam) epsilon) |
| 117 | (test-approximate cnt-c-tot (cog-count xes-a-c-kavam) epsilon) |
| 118 | (test-approximate cnt-c-tot (cog-count xes-a-c-kaavm) epsilon) |
| 119 | (test-approximate cnt-c-tot (cog-count xes-m-c-kaaav) epsilon) |
| 120 | 120 | |
| 121 | 121 | ; ----------------------- |
| 122 | 122 | ; Verify detailed balance |
| … | … | @@ -125,9 +125,9 @@ |
| 125 | 125 | (test-assert (check-shapes gsc epsilon)) |
| 126 | 126 | |
| 127 | 127 | ; Verify no change in totals |
| 128 | | (test-approximate totcnt (fold + 0 (map (lambda (atm) (gsc 'get-count atm)) (cog-get-atoms 'Section))) |
| 128 | (test-approximate totcnt (fold + 0 (map cog-count (cog-get-atoms 'Section))) |
| 129 | 129 | epsilon) |
| 130 | | (test-approximate totcross (fold + 0 (map (lambda (atm) (gsc 'get-count atm)) (cog-get-atoms 'CrossSection))) |
| 130 | (test-approximate totcross (fold + 0 (map cog-count (cog-get-atoms 'CrossSection))) |
| 131 | 131 | epsilon) |
| 132 | 132 | ) |
| 133 | 133 | |