Skip to content

Instantly share code, notes, and snippets.

@brosenan
Created May 19, 2020 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brosenan/f234e4fd36e329b256a817deb3e0d60b to your computer and use it in GitHub Desktop.
Save brosenan/f234e4fd36e329b256a817deb3e0d60b to your computer and use it in GitHub Desktop.
(defpred forte [type]
(forte-val [type] int))
(defrule (forte ())
(forte-val [_] 0))
(defrule (forte ('O & rest))
[(forte rest)]
(forte-val [(_ & rest)]
(* (forte-val rest) 2)))
(defrule (forte ('I & rest))
[(forte rest)]
(forte-val [(_ & rest)]
(+ (* (forte-val rest) 2) 1)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment