Skip to content

Commit

Permalink
Fix the demo so that it works.
Browse files Browse the repository at this point in the history
Improve the docs for it.
  • Loading branch information
linas committed Jul 24, 2022
1 parent ca19b8d commit 3fa050b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions examples/reaction.scm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
)
; Premise: Functional groups found in some educts
(AndLink
; ------------------------------------------------------
; Look for carboxyl group
(Molecule
(DB (Variable "$carboxyC1") (Variable "$carboxyO2"))
Expand All @@ -56,20 +57,31 @@
; they be distinct.
(Not (Identical (Variable "$carboxyO1") (Variable "carboxy moiety")))

; ------------------------------------------------------
; Look for hydroxyl group
(Molecule
(SB (Variable "$hydroxO1") (Variable "$hydroxH1"))
(SB (Variable "$hydroxO1") (Variable "hydroxy moiety"))
(Glob "rest of hydroxy")
)

; The above will match the OH's in both groups.
; They should be kept distinct.
; As before, the above will happily stuff the hydrogen into
; the moiety slot (thus using it twice). Prevent that by
; insisting these two must differ.
(Not (Identical (Variable "$hydroxH1") (Variable "hydroxy moiety")))

; -----
; And another constraint: the above pattern is so simple, it
; will find hydroxyl groups everywhere. In particular, it will
; find the OH in the carboxyl. So make sure that doesn't happen
; by insisting that the OH's be fiferent from one-another.
; Force them to be distinct.
(Not (Identical (Variable "$carboxyO1") (Variable "$hydroxO1")))
(Not (Identical (Variable "$carboxyH1") (Variable "$hydroxH1")))

; A different way to say the same thing.
; Either above or below is sufficient to disambiguate the OH.
; Either the two Not's above, or the one Not below, is
; sufficient to disambiguate the OH.
(Not (Identical
(SB (Variable "$hydroxO1") (Variable "$hydroxH1"))
(SB (Variable "$carboxyO1") (Variable "$carboxyH1"))))
Expand Down

0 comments on commit 3fa050b

Please sign in to comment.