java.lang.Object
org.assertj.core.api.AbstractAssert<PredicateAssert,edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate>
edu.upc.fib.inlab.imp.kse.logics.logicschema.assertions.PredicateAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<PredicateAssert,edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate>, org.assertj.core.api.Descriptable<PredicateAssert>, org.assertj.core.api.ExtensionPoints<PredicateAssert,edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate>

public class PredicateAssert extends org.assertj.core.api.AbstractAssert<PredicateAssert,edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate>
  • Field Summary

    Fields inherited from class org.assertj.core.api.AbstractAssert

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • Constructor Summary

    Constructors
    Constructor
    Description
    PredicateAssert(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate predicate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    assertThat(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate actual)
     
    void
    checkDerivationRulesEquivalenceWithStrategy(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate expectedPredicate, LogicSchemaAssert.DerivedLiteralStrategy derivedLiteralsStrategy)
     
    containsEquivalentDerivationRule(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.DerivationRule expectedRule)
    Checks whether the actual predicate contains a derivation rule equivalent to expectedRule considering that two derived ordinary literals are equivalent iff their definition rules are equivalent
    containsEquivalentDerivationRule(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.DerivationRule expectedRule, LogicSchemaAssert.DerivedLiteralStrategy derivedLiteralsStrategy)
    Checks whether the actual predicate contains a derivation rule equivalent to expectedRule considering that two derived ordinary literals are equivalent according to the given strategy.
    hasArity(int arity)
     
    hasDerivationRules(int expectedDerivationRulesCount)
     
     
     
    isDerived(boolean expected)
     
    isLogicallyEquivalentTo(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate expectedPredicate)
    Two predicates P and Q are said to be equivalent iff any two atoms P(x) and Q(x), being x any possible list of constants, P(x) and Q(x) evaluates the same on any possible database.

    Methods inherited from class org.assertj.core.api.AbstractAssert

    areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.assertj.core.api.Descriptable

    as, as, as, describedAs
  • Constructor Details

    • PredicateAssert

      public PredicateAssert(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate predicate)
  • Method Details

    • assertThat

      public static PredicateAssert assertThat(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate actual)
    • hasName

      public PredicateAssert hasName(String name)
    • hasArity

      public PredicateAssert hasArity(int arity)
    • isDerived

      public PredicateAssert isDerived()
    • isDerived

      public PredicateAssert isDerived(boolean expected)
    • hasDerivationRules

      public PredicateAssert hasDerivationRules(int expectedDerivationRulesCount)
    • isLogicallyEquivalentTo

      public PredicateAssert isLogicallyEquivalentTo(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate expectedPredicate)
      Two predicates P and Q are said to be equivalent iff any two atoms P(x) and Q(x), being x any possible list of constants, P(x) and Q(x) evaluates the same on any possible database.

      To be equivalent, it is necessary that P and Q have the same name, arity, and both must be base (or both must be derived).

      When both are derived, it is undecidable to know whether they are equivalent, or not. Hence, this assert applies a sound (but incomplete) strategy based on checking whether their derivation rules are homomorphic, where on its turn, two derived literals are considered to be homomorphic iff their terms are homomorphic and their derivation rules are homomorphic too.

    • checkDerivationRulesEquivalenceWithStrategy

      public void checkDerivationRulesEquivalenceWithStrategy(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate expectedPredicate, LogicSchemaAssert.DerivedLiteralStrategy derivedLiteralsStrategy)
    • containsEquivalentDerivationRule

      public PredicateAssert containsEquivalentDerivationRule(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.DerivationRule expectedRule, LogicSchemaAssert.DerivedLiteralStrategy derivedLiteralsStrategy)
      Checks whether the actual predicate contains a derivation rule equivalent to expectedRule considering that two derived ordinary literals are equivalent according to the given strategy.
      Parameters:
      expectedRule - not null
      Returns:
      this assert
    • containsEquivalentDerivationRule

      public PredicateAssert containsEquivalentDerivationRule(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.DerivationRule expectedRule)
      Checks whether the actual predicate contains a derivation rule equivalent to expectedRule considering that two derived ordinary literals are equivalent iff their definition rules are equivalent
      Parameters:
      expectedRule - not null
      Returns:
      this assert