diff options
Diffstat (limited to 'src/main/scala/rsacomb/SkolemStrategy.scala')
-rw-r--r-- | src/main/scala/rsacomb/SkolemStrategy.scala | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/main/scala/rsacomb/SkolemStrategy.scala b/src/main/scala/rsacomb/SkolemStrategy.scala new file mode 100644 index 0000000..9df167f --- /dev/null +++ b/src/main/scala/rsacomb/SkolemStrategy.scala | |||
@@ -0,0 +1,46 @@ | |||
1 | package rsacomb | ||
2 | |||
3 | sealed trait SkolemStrategy | ||
4 | |||
5 | object SkolemStrategy { | ||
6 | // TODO: might want to use something else other than `hashCode` as a | ||
7 | // function to generate a fresh function/constant | ||
8 | |||
9 | /* No skolemization at all. | ||
10 | * | ||
11 | * From | ||
12 | * ∃R.A ⊑ B | ||
13 | * to | ||
14 | * R(x,y), B(y) -> B(x) | ||
15 | */ | ||
16 | case object None extends SkolemStrategy | ||
17 | |||
18 | /* Functional skolemization | ||
19 | * | ||
20 | * From | ||
21 | * A ⊑ ∃R.B | ||
22 | * to | ||
23 | * A(y) -> R(x,f(x)), B(f(x)) | ||
24 | * for f, fresh function associated with the input axiom | ||
25 | */ | ||
26 | case class Standard(func : String) extends SkolemStrategy | ||
27 | object Standard { | ||
28 | def apply(axiom : String) = new Standard(genFunctionString(axiom)) | ||
29 | def genFunctionString(str : String) = "f_" ++ str.hashCode.toString | ||
30 | } | ||
31 | |||
32 | /* Functional skolemization | ||
33 | * | ||
34 | * From | ||
35 | * A ⊑ ∃R.B | ||
36 | * to | ||
37 | * A(y) -> R(x,c), B(c) | ||
38 | * for c, fresh constant associated with the input axiom | ||
39 | */ | ||
40 | case class Constant(const : String) extends SkolemStrategy | ||
41 | object Constant { | ||
42 | def apply(axiom : String) = new Constant(genConstantString(axiom)) | ||
43 | def genConstantString(str : String) = "internal:c_" ++ str.hashCode.toString | ||
44 | } | ||
45 | } | ||
46 | |||