| … | … | @@ -49,3 +49,38 @@ |
| 49 | 49 | get-types)) |
| 50 | 50 | |
| 51 | 51 | (cog-execute! count-types) |
| 52 | |
| 53 | ; ------------------------------------------- |
| 54 | (use-modules (opencog)) |
| 55 | |
| 56 | (PipeLink |
| 57 | (Name "get-all-atoms") |
| 58 | (Meet |
| 59 | (Variable "$atom") ; vardecl |
| 60 | (Variable "$atom") ; match anything |
| 61 | )) |
| 62 | |
| 63 | ; (cog-execute! (Name "get-all-atoms")) |
| 64 | |
| 65 | (PipeLink |
| 66 | (Name "get-types") |
| 67 | (Filter |
| 68 | (Rule |
| 69 | (TypedVariable (Variable "$atom") (Type 'Atom)) ; vardecl |
| 70 | (Variable "$atom") ; body - accept everything |
| 71 | (TypeOf (DontExec (Variable "$atom")))) |
| 72 | (Name "get-all-atoms"))) |
| 73 | |
| 74 | ; (cog-execute! (Name "get-types")) |
| 75 | |
| 76 | (Pipe |
| 77 | (Name "count-types") |
| 78 | (Filter |
| 79 | (Rule |
| 80 | (TypedVariable (Variable "$typ") (Type 'Type)) ; vardecl |
| 81 | (Variable "$typ") ; body - accept everything |
| 82 | (IncrementValue (Variable "$typ") (Predicate "cnt") (Number 0 0 1))) |
| 83 | (Name "get-types"))) |
| 84 | |
| 85 | (cog-execute! (Name "count-types")) |
| 86 | |