Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
astroseger committed Jan 29, 2024
1 parent a4b0571 commit f580941
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions python/sandbox/bhv_binding/01_example_majority.metta
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
!(bind! &b (bhv-new))
!(bind! &c (bhv-new))

(= (abc) (bhv-majority &a &b &c ))
!(bind! &abc (bhv-majority &a &b &c ))

!(bhv-std-apart-relative &a (abc))
!(bhv-is-related &a (abc))
!(bhv-std-apart-relative &a &abc)
!(bhv-is-related &a &abc)


6 changes: 3 additions & 3 deletions python/sandbox/bhv_binding/02_example_perm.metta
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
!(bind! &perm1 (bhv-new-perm))
(= (perm1 $x) (bhv-apply-perm &perm1 $x))

(= (ab) (bhv-majority &a &b ))
!(bind! ab (bhv-majority &a &b ))

; Should return False since a is permuted but ab is not permuted
!(bhv-is-related (perm1 &a) (ab))
!(bhv-is-related (perm1 &a) ab)

;Should return True
!(bhv-is-related (perm1 &a) (perm1 (ab)))
!(bhv-is-related (perm1 &a) (perm1 ab))



Expand Down
8 changes: 4 additions & 4 deletions python/sandbox/bhv_binding/03_example_dict.metta
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
!(bind! &k3 (bhv-new))


(= (dict) (bhv-majority (bhv-bind &v1 &k1) (bhv-bind &v2 &k2) (bhv-bind &v3 &k3) ))
(= (v1_retrived) (bhv-bind &k1 (dict)))
!(bind! dict (bhv-majority (bhv-bind &v1 &k1) (bhv-bind &v2 &k2) (bhv-bind &v3 &k3) ))
!(bind! v1_retrived (bhv-bind &k1 dict))

!(bhv-std-apart-relative (v1_retrived) &v1)
!(bhv-is-related (v1_retrived) &v1)
!(bhv-std-apart-relative v1_retrived &v1)
!(bhv-is-related v1_retrived &v1)


12 changes: 6 additions & 6 deletions python/sandbox/bhv_binding/04_example_dollar_of_mexico.metta
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
!(bind! &peso (bhv-new))


(= (USA) (bhv-majority (bhv-bind &name &united_states) (bhv-bind &capital_city &washington_dc) (bhv-bind &money &dollar) ))
(= (MEX) (bhv-majority (bhv-bind &name &mexico) (bhv-bind &capital_city &mexico_city) (bhv-bind &money &peso) ))
!(bind! USA (bhv-majority (bhv-bind &name &united_states) (bhv-bind &capital_city &washington_dc) (bhv-bind &money &dollar) ))
!(bind! MEX (bhv-majority (bhv-bind &name &mexico) (bhv-bind &capital_city &mexico_city) (bhv-bind &money &peso) ))

(= (Pair) (bhv-bind (USA) (MEX)))
!(bind! Pair (bhv-bind USA MEX))

; should return True here
!(bhv-is-related (bhv-bind (USA) &money) &dollar)
!(bhv-is-related (bhv-bind USA &money) &dollar)


(= (dollar_of_mexico) (bhv-bind &dollar (Pair)))
!(bind! dollar_of_mexico (bhv-bind &dollar Pair))

; should return True here. "Dollar of mexico" is peso
!(bhv-is-related (dollar_of_mexico) &peso)
!(bhv-is-related dollar_of_mexico &peso)



Expand Down

0 comments on commit f580941

Please sign in to comment.