aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/rsacomb/RSAAxiom.scala
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2020-08-11 13:07:55 +0100
committerFederico Igne <federico.igne@cs.ox.ac.uk>2020-08-11 13:07:55 +0100
commit09cd0c4b916fb111d586f622ebe57801db5fc36a (patch)
tree3df27964ebb6761fe40335f8d6b46995bb78b70b /src/main/scala/rsacomb/RSAAxiom.scala
parente1e0bf5c2d634c4b2e5350614625996e843e2e9a (diff)
downloadRSAComb-09cd0c4b916fb111d586f622ebe57801db5fc36a.tar.gz
RSAComb-09cd0c4b916fb111d586f622ebe57801db5fc36a.zip
Fix role unsafety check
We now check that the existential expression in the axiom of type T3 is not top.
Diffstat (limited to 'src/main/scala/rsacomb/RSAAxiom.scala')
-rw-r--r--src/main/scala/rsacomb/RSAAxiom.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/scala/rsacomb/RSAAxiom.scala b/src/main/scala/rsacomb/RSAAxiom.scala
index 588c72a..9e9a016 100644
--- a/src/main/scala/rsacomb/RSAAxiom.scala
+++ b/src/main/scala/rsacomb/RSAAxiom.scala
@@ -16,9 +16,10 @@ trait RSAAxiom {
16 */ 16 */
17 private sealed trait RSAAxiomType 17 private sealed trait RSAAxiomType
18 private object RSAAxiomType { 18 private object RSAAxiomType {
19 case object T3 extends RSAAxiomType // ∃R.A ⊑ B 19 case object T3 extends RSAAxiomType // ∃R.A ⊑ B
20 case object T4 extends RSAAxiomType // A ⊑ ≤1R.B 20 case object T3top extends RSAAxiomType // ∃R.⊤ ⊑ B
21 case object T5 extends RSAAxiomType // A ⊑ ∃R.B 21 case object T4 extends RSAAxiomType // A ⊑ ≤1R.B
22 case object T5 extends RSAAxiomType // A ⊑ ∃R.B
22 } 23 }
23 24
24 /* Implements additional features on top of `OWLAxiom` from 25 /* Implements additional features on top of `OWLAxiom` from
@@ -43,6 +44,8 @@ trait RSAAxiom {
43 val sub = axiom.getSubClass().getClassExpressionType() 44 val sub = axiom.getSubClass().getClassExpressionType()
44 val sup = axiom.getSuperClass().getClassExpressionType() 45 val sup = axiom.getSuperClass().getClassExpressionType()
45 t match { 46 t match {
47 case RSAAxiomType.T3top => // ∃R.⊤ ⊑ B
48 axiom.isT5 && axiom.getSubClass().asInstanceOf[OWLObjectSomeValuesFrom].getFiller.isOWLThing
46 case RSAAxiomType.T3 => // ∃R.A ⊑ B 49 case RSAAxiomType.T3 => // ∃R.A ⊑ B
47 sub == ClassExpressionType.OBJECT_SOME_VALUES_FROM && sup == ClassExpressionType.OWL_CLASS 50 sub == ClassExpressionType.OBJECT_SOME_VALUES_FROM && sup == ClassExpressionType.OWL_CLASS
48 case RSAAxiomType.T4 => // A ⊑ ≤1R.B 51 case RSAAxiomType.T4 => // A ⊑ ≤1R.B
@@ -67,6 +70,7 @@ trait RSAAxiom {
67 } 70 }
68 71
69 /* Exposed methods */ 72 /* Exposed methods */
73 def isT3top: Boolean = isOfType(RSAAxiomType.T3top)
70 def isT3: Boolean = isOfType(RSAAxiomType.T3) 74 def isT3: Boolean = isOfType(RSAAxiomType.T3)
71 def isT4: Boolean = isOfType(RSAAxiomType.T4) 75 def isT4: Boolean = isOfType(RSAAxiomType.T4)
72 def isT5: Boolean = isOfType(RSAAxiomType.T5) 76 def isT5: Boolean = isOfType(RSAAxiomType.T5)