Skip to content

Commit

Permalink
Fix FIXMEs from test MeTTa scenarious
Browse files Browse the repository at this point in the history
  • Loading branch information
vsbogd committed Nov 25, 2024
1 parent ccd0308 commit b2c0d36
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
10 changes: 2 additions & 8 deletions python/tests/scripts/c3_pln_stv.metta
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,9 @@
(Evaluation (Predicate F) (Concept A)))
(stv 0.8 1.0))

; FIXME? `(PA)` and `(PB)` are used because otherwise
; substitution is not invoked (atm of test creation)
(= (PA) (Evaluation (Predicate P) (Concept A)))
(= (PB) (Evaluation (Predicate P) (Concept B)))
(= (FA) (Evaluation (Predicate F) (Concept A)))

; Tests
!(assertEqual (TV (And (PA) (PB))) (stv 0.3 0.8))
!(assertEqual (TV (FA)) (stv 0.4 0.8))
!(assertEqual (TV (And (Evaluation (Predicate P) (Concept A)) (Evaluation (Predicate P) (Concept B)))) (stv 0.3 0.8))
!(assertEqual (TV (Evaluation (Predicate F) (Concept A))) (stv 0.4 0.8))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
6 changes: 4 additions & 2 deletions python/tests/scripts/e2_states.metta
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,7 @@
(let $tnso (new-state 1) $tnso)
(new-state 1))

; FIXME: doesn't work as for 25 May 2023
; !(get-state (let $x (new-state 1) $x))
; New state atom can be instantiated just before calling get-state
!(assertEqual
(get-state (let $x (new-state 1) $x))
1)
8 changes: 5 additions & 3 deletions python/tests/scripts/f1_imports.metta
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@
(let $x (collapse (get-atoms &m)) (contains $x is-space))
True)

; FIXME? Now, it is moduleC space.
; Should it be `stdlib` atom for a separately imported space
; !(let $x (collapse (get-atoms &m)) (car-atom $x))
; FIXME: It is the `stdlib` atom but equality check doesn't work
;!(import! &stdlib top:stdlib)
;!(assertEqual
;(let $x (collapse (get-atoms &m)) (car-atom $x))
;&stdlib)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
6 changes: 1 addition & 5 deletions python/tests/scripts/f1_moduleA.metta
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!(import! &self f1_moduleC)

; FIXME? stdlib space is not available at importing time -
; only tokens / grounded operations work, while symbolic functions
; (like `if`) don't work.
; FIXME? Exceptions are not caught by `importOp`
!(assertEqual (+ 1 2) 3)
; !(assertEqual (if True "S" "F") "S")
!(assertEqual (if True "S" "F") "S")

(= (dup $x) (if (== $x 0) (+ $x 10) (g $x)))

Expand Down

0 comments on commit b2c0d36

Please sign in to comment.