blob: 94be2ea4e797a8c0dd2c93669f0b37e2d97cb252 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
object Test {
trait Tree
sealed abstract class Prop
trait Simple extends Prop
case class Atom(tree: Tree) extends Prop with Simple
case class Not(prop: Prop) extends Prop with Simple
def simplify1(prop: Prop): Prop = prop match {
case Atom(tree) => ???
case Not(prop) => ???
case _ => ???
}
def simplify2(prop: Prop): Prop = prop match {
case Not(Atom(tree)) => ???
case Not(Not(prop)) => ???
case _ => ???
}
}
|