Closed ccamel closed 2 weeks ago
This pull request introduces three new feature files for testing Prolog predicates: asserta/1
, assertz/1
, and retract/1
. Each feature file contains multiple scenarios that demonstrate the functionality of these predicates in managing facts within a Prolog database. Additionally, a new Go package named predicate
is added, which implements the corresponding functions for asserting and retracting facts in the database.
File | Change Summary |
---|---|
x/logic/keeper/features/asserta_1.feature |
- New feature: asserta/1 - Scenarios added: Assert a fact, Only dynamic predicates can be asserted, Show that the fact is asserted at the beginning, Shows a simple counter example. |
x/logic/keeper/features/assertz_1.feature |
- New feature: assertz/1 - Scenarios added: Assert a fact, Only dynamic predicates can be asserted, Show that the fact is asserted at the end, Add and remove items in an inventory. |
x/logic/keeper/features/retract_1.feature |
- New feature: retract/1 - Scenarios added: Retract a fact from the database, Only dynamic predicates can be retracted. |
x/logic/predicate/database.go |
- New methods added: Asserta , Assertz , Retract , Abolish for managing clauses in the database. |
assertz/1
predicate, which is closely related to the asserta/1
predicate tested in the main PR, as both deal with asserting facts into a Prolog database and include scenarios that emphasize the differences in their behavior.🐰 In the realm of facts, we hop and play,
Withasserta
andassertz
, we pave the way.
Retracting truths, oh what a sight,
Dynamic predicates dance in the light!
So let’s celebrate with a joyful cheer,
For Prolog’s magic brings us near! ✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 0%
with 8 lines
in your changes missing coverage. Please review.
Files with missing lines | Patch % | Lines |
---|---|---|
x/logic/predicate/database.go | 0.00% | 8 Missing :warning: |
@@ Coverage Diff @@
## main #812 +/- ##
==========================================
- Coverage 42.73% 42.68% -0.06%
==========================================
Files 111 112 +1
Lines 6273 6281 +8
==========================================
Hits 2681 2681
- Misses 3468 3476 +8
Partials 124 124
Files with missing lines | Coverage Δ | |
---|---|---|
x/logic/predicate/database.go | 0.00% <0.00%> (ø) |
@coderabbitai please approve PR. thx
@ccamel: I've approved the PR. Thank you.
Expose the ISO predicates related to “database” management, specifically those used for handling dynamic predicates.
Summary by CodeRabbit
asserta/1
,assertz/1
, andretract/1
predicates in Prolog, with multiple scenarios demonstrating their functionality.