clipspy-1.0.0/clips/facts.py
def assert_fact(self, **slots) -> TemplateFact:
        """Assert a new fact with the given slot values.

        Only deftemplates that have been explicitly defined can be asserted
        with this function.

        Equivalent to the CLIPS (assert) function.

        """
        builder = environment_builder(self._env, 'fact')
        ret = lib.FBSetDeftemplate(builder, self._name)
        if ret != lib.FBE_NO_ERROR:
            raise CLIPSError(self._env, code=ret)

        for slot, slot_val in slots.items():
            value = clips.values.clips_value(self._env, value=slot_val)

            ret = lib.FBPutSlot(builder, str(slot).encode(), value)
            if ret != PutSlotError.PSE_NO_ERROR:
                raise PUT_SLOT_ERROR[ret](slot)

        fact = lib.FBAssert(builder)
        if fact != ffi.NULL:
            return TemplateFact(self._env, fact)
        else:
            raise CLIPSError(self._env, code=lib.FBError(self._env))
Assert a new fact with the given slot values.

        Only deftemplates that have been explicitly defined can be asserted
        with this function.

        Equivalent to the CLIPS (assert) function.

        
Assert a new fact with the given slot values.
Only deftemplates that have been explicitly defined can be asserted
with this function.

Equivalent to the CLIPS (assert) function.
Assert a new fact with the given slot values . Only deftemplates that have been explicitly defined can be asserted with this function . Equivalent to the CLIPS ( assert ) function .
def assert_fact(self, **slots) -> TemplateFact:
        builder = environment_builder(self._env, 'fact')
        ret = lib.FBSetDeftemplate(builder, self._name)
        if ret != lib.FBE_NO_ERROR:
            raise CLIPSError(self._env, code=ret)
        for slot, slot_val in slots.items():
            value = clips.values.clips_value(self._env, value=slot_val)
            ret = lib.FBPutSlot(builder, str(slot).encode(), value)
            if ret != PutSlotError.PSE_NO_ERROR:
                raise PUT_SLOT_ERROR[ret](slot)
        fact = lib.FBAssert(builder)
        if fact != ffi.NULL:
            return TemplateFact(self._env, fact)
        else:
            raise CLIPSError(self._env, code=lib.FBError(self._env))
def assert_fact ( self , ** slots ) -> TemplateFact : builder = environment_builder ( self . _env , 'fact' ) ret = lib . FBSetDeftemplate ( builder , self . _name ) if ret != lib . FBE_NO_ERROR : raise CLIPSError ( self . _env , code = ret ) for slot , slot_val in slots . items ( ) : value = clips . values . clips_value ( self . _env , value = slot_val ) ret = lib . FBPutSlot ( builder , str ( slot ) . encode ( ) , value ) if ret != PutSlotError . PSE_NO_ERROR : raise PUT_SLOT_ERROR [ ret ] ( slot ) fact = lib . FBAssert ( builder ) if fact != ffi . NULL : return TemplateFact ( self . _env , fact ) else : raise CLIPSError ( self . _env , code = lib . FBError ( self . _env ) )
Assert a new fact with the given slot values.
Assert a new fact with the given slot values .
"""Assert a new fact with the given slot values.

        Only deftemplates that have been explicitly defined can be asserted
        with this function.

        Equivalent to the CLIPS (assert) function.

        """
self