Search found 147 matches

by Peter Muraya
16 Sep 2015 17:40
Forum: Visual Prolog
Topic: Nested foreach
Replies: 8
Views: 4368

Hi Frank and Martin, I'm not sure how to interpret the number of backtracking points metric, i.e., whether the more the better or vice versa. I was not even aware of of the predicate programControl::getBackTrackPoints() In my case, Im often guided by whether there is further processing I need to do ...
by Peter Muraya
16 Sep 2015 17:15
Forum: Visual Prolog
Topic: Universal Quantification
Replies: 21
Views: 11626

Martin,
I was motivated by the comment from Paul about programming when foreach/do and if/then/else were not available in Prolog. I could not figure out how you would write the forall() without using the dynamic cut.
by Peter Muraya
16 Sep 2015 7:15
Forum: Visual Prolog
Topic: Universal Quantification
Replies: 21
Views: 11626

Hi all, Frank's bodyless foreach construct, used as follows, .. ..., foreach gen(X), determ_body(X) do end foreach, ..., ... is equivalent to the following usage... ..., foreach_(), %Note the leadig underbar to avoid the keyword ..., ... where foreach_() predicate is defined and implemented using tr...
by Peter Muraya
14 Sep 2015 18:37
Forum: Visual Prolog
Topic: Universal Quantification
Replies: 21
Views: 11626

Hi Martin and Thomas,
How about...

Code: Select all

foreach Gen do  DetermBody end foreach
- keeping the same syntax as the present;
- checking to ensure that the body is deterministic
- documenting that the whole foreach construct fails if the body fails.
by Peter Muraya
11 Sep 2015 5:36
Forum: Visual Prolog
Topic: Breakpoint properties and conditions
Replies: 9
Views: 5365

Breakpoint properties and conditions

Hi, I was looking for a way of specifying a condition for stopping at a breakpoint when I opened its properties. I found 2 fields: comment and action . The comment is the text that appears when you hover over the breakpoint marker; has anybody found this to be useful? What about action? What is it i...
by Peter Muraya
11 Sep 2015 5:18
Forum: Visual Prolog
Topic: Position marker color change during debugging
Replies: 2
Views: 3127

Hi Thomas, I guess my confusion came about because the pointer seemed to remain at the same position as the color changed. I can now see it is because of the iterative nature of my get_labels predicate. In this case, what construct failed -- the line ChildXp in caller:children or clause get_labels()...
by Peter Muraya
11 Sep 2015 5:03
Forum: Visual Prolog
Topic: Universal Quantification
Replies: 21
Views: 11626

Martin,
Its clear. Now to clarify your request .... so you want a (special) construct that is similar to the current version

Code: Select all

foreach X=f1() do f2(X) end foreach,
but one which can fail if f2(X) fails, in which case f2(X) has to be deterministic? That sounds reasonable to me.
by Peter Muraya
10 Sep 2015 18:21
Forum: Visual Prolog
Topic: Position marker color change during debugging
Replies: 2
Views: 3127

Position marker color change during debugging

Hi,
When debugging code, sometimes, the position marker changes from blue to pink. What is this telling me?
by Peter Muraya
10 Sep 2015 18:02
Forum: Visual Prolog
Topic: Need More sample and logic
Replies: 6
Views: 4135

Hi Andro, I agree with Harrison that:- As a first step, think carefully about how you will model the facts (collections of observations) which permit diagnosis of various diseases Martin has done an excellent job of translating the code you provided to the correct visual prolog dialect. The data is ...
by Peter Muraya
10 Sep 2015 17:51
Forum: Visual Prolog
Topic: Universal Quantification
Replies: 21
Views: 11626

Hi Martin,
It was not clear to me (from Wikipedia) what universal quantification is? Could could you explain it in layman's terms, and why it is important?
by Peter Muraya
9 Sep 2015 18:00
Forum: Visual Prolog
Topic: Compiler options for endless loops and stack overflow
Replies: 7
Views: 3872

Thomas, You are right, repeat is not endless. I have changed my example to the following to illustrate what I meant by use of keyword to support warnings for endless loops; but I now appreciate that the problem is much bigger than I thought. predicates test:() endless. clauses test():- foreach repea...
by Peter Muraya
9 Sep 2015 16:55
Forum: Visual Prolog
Topic: Compiler options for endless loops and stack overflow
Replies: 7
Views: 3872

Hi Martin,
Thanks for the link to the Halting Problem; I was not aware that this issue is as old as computers and that it has been classified as undecidable.
by Peter Muraya
9 Sep 2015 7:41
Forum: Visual Prolog
Topic: Compiler options for endless loops and stack overflow
Replies: 7
Views: 3872

Hello Paul, I admit that the logic for detecting these situations is not trivial but it may be helped by addition of new keywords to assist the compiler weed out the potentially frivolous cases. Take the case of the repeat predicate below. predicates repeat:() nondeterm. clauses repeat. repeat:-repe...
by Peter Muraya
8 Sep 2015 18:00
Forum: Visual Prolog
Topic: Compiler options for endless loops and stack overflow
Replies: 7
Views: 3872

Compiler options for endless loops and stack overflow

Hi, The Visual Prolog compiler has an array of warnings that point to potential flaws in the logic of a program -- an extremely useful feature indeed. Two other runtime conditions, Endless loops and Stack overflows, are pointers to some problem with the logic. Is it feasible for future versions of P...
by Peter Muraya
21 Aug 2015 6:53
Forum: Visual Prolog
Topic: Opening an XML document from the IDE
Replies: 1
Views: 2567

Hi, I was wrong, even version 7.4 did not do it properly. I have found a way round this, but first let me explain why it is a big deal for my project which I run in two modes: debug and production. In debug mode, the project generates a huge XML document (over 10,000 lines) which I need to study. So...