SWI-Prolog / issues

Dummy repository for issue tracking
7 stars 3 forks source link

(dynamic)/1 bug in assert/1 #81

Closed Shyam-Has-Your-Anomaly-Mitigated closed 5 years ago

Shyam-Has-Your-Anomaly-Mitigated commented 5 years ago

I am following the official steps.

Step 01.

linux$ swipl -v
SWI-Prolog version 7.6.4 for i386

Step 10.

This is a knowledge base.

#!/usr/bin/env swipl
a(1).

This is the interactor.

?- a(X).
X = 1.

?- retract(a(1)).
ERROR: No permission to modify static procedure `a/1'
ERROR: Defined at /home/edu/Downloads/Prolog/experiments/meta.pl:2
ERROR: In:
ERROR:    [8] retract(a(1))
ERROR:    [7] <user>
?- assert(a(2)).
true.

?- retract(a(1)).
true.

?- a(X).
X = 2.

The query assert(a(1)). performs the same as assert(a(2)).; I just think assert(a(2)). demonstrates the propagation of the bug. This seems to only happen when you assert functors of the same arity in the knowledge base.

JanWielemaker commented 5 years ago

Thanks. Fixed with 5deb1b053f9c6e25c469783fd79858ee783b5c15, which should appear in 8.0.1 and and 8.1.1.