Skip to content

Commit

Permalink
Merge pull request #811 from vsbogd/fix-fixmes
Browse files Browse the repository at this point in the history
Fix various FIXME from test MeTTa scenarious
  • Loading branch information
Necr0x0Der authored Dec 2, 2024
2 parents f69a717 + 9f2562a commit 49c4ab0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 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
4 changes: 3 additions & 1 deletion python/tests/test_grounded_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def test_meta_types(self):
myAtom
untyp
'''))
# FIXME: why does it get reduced?
# FIXME: (id_atom (+ 1 1)) gets reduced because after id_atom returns
# (+ 1 1) it is evaluated further and becomes 2. We don't have a manner
# to prevent evaluation in MeTTa.
# self.assertEqual(metta.run("!(id_atom (+ 1 1))"), [metta.parse_all("(+ 1 1)")])
### Polymorphic without unwrapping
# Nothing is done with `$t` on the Grounded side, but we check that:
Expand Down

0 comments on commit 49c4ab0

Please sign in to comment.