Created
December 9, 2013 17:33
-
-
Save joshcough/7876464 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
def smPrimitives(c: CharacteristicRule): List[DataItemID] = c match { | |
case Not(r) => smPrimitives(r) | |
case And(r1, r2) => smPrimitives(r1) ++ smPrimitives(r2) | |
case Orr(r1, r2) => smPrimitives(r1) ++ smPrimitives(r2) | |
case SimpleCharacteristicRule(ce) => ce match { | |
case GroupComparison(lhs, _, rhs) => List(lhs) | |
case _ => Nil | |
} | |
} | |
case def smPrimitives(c: CharacteristicRule): List[DataItemID] = { | |
Not(r) => smPrimitives(r) | |
And(r1, r2) => smPrimitives(r1) ++ smPrimitives(r2) | |
Orr(r1, r2) => smPrimitives(r1) ++ smPrimitives(r2) | |
SimpleCharacteristicRule(ce) => ce match { | |
case GroupComparison(lhs, _, rhs) => List(lhs) | |
case _ => Nil | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment