prolog-assert Questions

3

Solved

From reading the manual, I can't seem to find the difference between the two. The manual says: It is advised to use retractall/1 for erasing all clauses of a dynamic predicate. So I chose to ...
Dip asked 27/12, 2015 at 21:19

2

Solved

Can someone please explain the Prolog logical view about assert and retract in details? For example in code below, in the first run Prolog returns true and in subsequent runs returns false. I don...
Estheresthesia asked 23/1, 2015 at 18:18

1

Solved

I am new to Prolog, but I am stuck at this supposedly simple command. I have loaded a knowledge base with no errors, and whenever I try do assert (and even help) I get the following message: uncau...
Monsignor asked 17/11, 2013 at 4:25

2

I often end up writing code in Prolog which involves some arithmetic calculation (or state information important throughout the program), by means of first obtaining the value stored in a predicate...
Sully asked 25/9, 2013 at 12:33

2

Solved

I define an operator as follows: :- op(500, xfx, =>). When I try something like: assert(a => b). Prolog raises an error that says 'No permission to modify static_procedure (=>)/2'. Any...
Whittington asked 23/4, 2012 at 14:3

1

Solved

I wrote the following simple code, and I expect that when I write 'male.', this code ask me once "is it male?" and if i input 'No' it write on screen "she is female". male :- ( print('is it male ...
Luehrmann asked 29/12, 2011 at 14:42

1

Solved

What I have now checks that X(Y) is not an accepted fact in my small DB. Since X(Y) returns false it will attempt to assert it. (I realize this presents problems when X is a rule and not a fact) i...
Insistency asked 25/12, 2011 at 2:17

3

Solved

I'm developing an algorithm in a .pl file, and examining it with queries on the command window. I use dynamic variables and retract/assert predicates. And when I modify the pl file and click on "re...
Somatoplasm asked 7/12, 2011 at 15:5

2

Solved

I am reading http://cs.union.edu/~striegnk/learn-prolog-now/html/node3.html#subsec.l1.kb1, but I am having trouble running the following predicate: SICStus 4.0.1 (x86-win32-nt-4): Tue May 15 21:17...
Vitia asked 6/9, 2011 at 18:44

1

Solved

I'm having trouble inserting facts into an existing Prolog file, without overwriting the original contents. Suppose I have a file test.pl: :- dynamic born/2. born(john,london). born(tim,manche...
Czarina asked 27/5, 2010 at 14:19

1

Solved

I was wondering, I am aware you can use assert to add facts or rules or whatever if you have declared the predicate to be -:dynamic, but this only allows the changes that are made to be kept in tha...
Basel asked 12/3, 2010 at 19:27
1

© 2022 - 2024 — McMap. All rights reserved.