aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/rsacomb/SkolemStrategy.scala
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2020-07-15 17:48:11 +0100
committerFederico Igne <federico.igne@cs.ox.ac.uk>2020-07-15 17:48:11 +0100
commit0ccecbe8718c90201700897ee33e9082b7bfce50 (patch)
tree04a696141e8a6f5dd5e1e6c681b32dd03995cd41 /src/main/scala/rsacomb/SkolemStrategy.scala
parent58b8d3c11a9deebb40e21c70d0b085d01cada745 (diff)
downloadRSAComb-0ccecbe8718c90201700897ee33e9082b7bfce50.tar.gz
RSAComb-0ccecbe8718c90201700897ee33e9082b7bfce50.zip
Rename source code directory structure
Diffstat (limited to 'src/main/scala/rsacomb/SkolemStrategy.scala')
-rw-r--r--src/main/scala/rsacomb/SkolemStrategy.scala46
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 @@
1package rsacomb
2
3sealed trait SkolemStrategy
4
5object 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