示例#1
0
    def collectSig(self, sig=None):
        """
        Collect function- and predicate symbols into the signature. If
        none exists, create it. Return the signature
        """
        if not sig:
            sig = Signature()

        sig.addPred(termFunc(self.atom), len(self.atom) - 1)
        for s in termArgs(self.atom):
            termCollectSig(s, sig)
        return sig
示例#2
0
    def testCompatibility(self):
        """
        Test that compatibility axioms are generated as expected.
        """
        ax = generateFunCompatAx("f", 3)
        self.assertEqual(len(ax), 4)
        print(ax)

        ax = generatePredCompatAx("p", 5)
        self.assertEqual(len(ax), 7)
        print(ax)

        sig = Signature()
        sig.addFun("f", 2)
        sig.addPred("p", 3)
        sig.addFun("a", 0)

        tmp = generateCompatAxioms(sig)
        # Note: No axiom for a
        self.assertEqual(len(tmp), 2)