| … | … | @@ -29,4 +29,23 @@ |
| 29 | 29 | |
| 30 | 30 | (cog-execute! get-all-queries) |
| 31 | 31 | |
| 32 | ||
| 32 | (define get-types | |
| 33 | (Filter | |
| 34 | (Rule | |
| 35 | (TypedVariable (Variable "$atom") (Type 'Atom)) ; vardecl | |
| 36 | (Variable "$atom") ; body - accept everything | |
| 37 | (TypeOf (DontExec (Variable "$atom")))) | |
| 38 | get-all-atoms)) | |
| 39 | ||
| 40 | ; Should work just like `get-all-types` Query above. | |
| 41 | (cog-execute! get-types) | |
| 42 | ||
| 43 | (define count-types | |
| 44 | (Filter | |
| 45 | (Rule | |
| 46 | (TypedVariable (Variable "$typ") (Type 'Type)) ; vardecl | |
| 47 | (Variable "$typ") ; body - accept everything | |
| 48 | (IncrementValue (Variable "$typ") (Predicate "cnt") (Number 0 0 1))) | |
| 49 | get-types)) | |
| 50 | ||
| 51 | (cog-execute! count-types) |