Created
February 24, 2011 18:59
-
-
Save rhz/842663 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defprotocol AKappaExpression | |
"Kappa expression" | |
(agents [e] "get all agents in this expression") | |
(complexes [e] "get all complexes in this expression") | |
(subexpr [e ids] "get a subexpression for the given agent ids") | |
(merge [e1 e2] "merge two expressions") | |
(count-automorphisms [e] "count the number of automorphisms") | |
(expression? [e] "predicate for AKappaExpression") | |
(match [e1 e2] "returns a map from agent ids in e1 to their matching agent ids in e2") | |
;; should this methods be part of AKappaAgent? | |
(complex [e id] "get the complex to which agent id belongs") | |
(new-id [e id] "give a new id to agent id")) | |
(deftype Expression [as cs] | |
AKappaExpression | |
(agents [_] as) | |
(complexes [_] cs) | |
(subexpr [e ids] (zipmap ids (map e ids))) | |
(merge [e1 e2] (...)) | |
(count-automorphisms [e] ...) | |
(expression? [_] true) | |
(match [e1 e2] (match-expr e1 e2))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment