Search found 14 matches

by dcgreenwood
5 Apr 2021 22:52
Forum: Visual Prolog
Topic: making predicates procedures - single facts?
Replies: 1
Views: 110

making predicates procedures - single facts?

I keep running into the situation where I need a predicate or a stretch of code to be procedural, such as in a "for each do". I have a few databases of facts that are used as lookups (with many members) but then I also am using quite a few facts as ways to hold pieces of changeable informa...
by dcgreenwood
3 Apr 2021 13:43
Forum: Visual Prolog
Topic: How to approach fuzzy match
Replies: 3
Views: 160

Re: How to approach fuzzy match

Thanks, I'll use that!
by dcgreenwood
3 Apr 2021 1:59
Forum: Visual Prolog
Topic: How to approach fuzzy match
Replies: 3
Views: 160

How to approach fuzzy match

Is there a simple way using backtracking to find a match between a set of variables and a database of facts where the match may not be perfect? For example domains myDomain : good; bad ; ok. class facts myFactDB : (myDomain VarA, myDomain VarB, myDomain VarC, myDomain VarD). %assume I have a databas...
by dcgreenwood
1 Apr 2021 13:48
Forum: Visual Prolog
Topic: How to use file::save
Replies: 2
Views: 122

Re: How to use file::save

Thanks!
by dcgreenwood
1 Apr 2021 0:13
Forum: Visual Prolog
Topic: How to use file::save
Replies: 2
Views: 122

How to use file::save

I want to write a series of facts to a file, but I can't find any explanation about how to write facts to a file in any of the documentations. Only a few vague references that you can do it. Here is just a simple example of what I am trying to do class facts testDB : (string Name). class predicates ...
by dcgreenwood
27 Mar 2021 20:40
Forum: Visual Prolog
Topic: writef not printing to Message Window
Replies: 6
Views: 337

Re: writef not printing to Message Window

I now understand what was going on - I was completely wrong about the reason. What I did not realize was that the output to the Message Window is buffered and then written to the window only after the set of clauses terminates and returns to the window monitoring. I knew the clauses were executing (...
by dcgreenwood
27 Mar 2021 20:37
Forum: Visual Prolog
Topic: Predicate called from menu must be a procedure (?)?
Replies: 3
Views: 208

Re: Predicate called from menu must be a procedure (?)?

Thanks. The first option was perfect. I had not seen the use of OR this way before, I'm sure I will use one or all of these sequences again.
by dcgreenwood
27 Mar 2021 16:17
Forum: Visual Prolog
Topic: Predicate called from menu must be a procedure (?)?
Replies: 3
Views: 208

Predicate called from menu must be a procedure (?)?

I have a predicate runExperiment() being called from a menu. It seems that a predicate called from a menu item must be a procedure - anything else causes an error that I have not been able to resolve? Is this so? The predicates that start my program are (runExperiment is declared in main.cl as predi...
by dcgreenwood
24 Mar 2021 12:59
Forum: Visual Prolog
Topic: writef not printing to Message Window
Replies: 6
Views: 337

Re: writef not printing to Message Window

I figured out the problem, though I don't understand why it is a problem. Here is the problematic part class predicates checkFactionStatus : (faction Faction) nondeterm. startExperiment : () multi. checkIfExperimentOver : () multi. clauses % Experiment over is triggered by CheckIfExperimentOver fail...
by dcgreenwood
24 Mar 2021 2:33
Forum: Visual Prolog
Topic: writef not printing to Message Window
Replies: 6
Views: 337

writef not printing to Message Window

I'm running a gui program, with menu items calling clauses in Main. Two menu items trigger stdio::write that writes as normal to the Message Window. But another is supposed to, but its messages never appear. I've debugged it, and each write is being executed. It seems like maybe they are being direc...
by dcgreenwood
22 Mar 2021 16:21
Forum: Visual Prolog
Topic: Beginner question - declare class facts across packages
Replies: 2
Views: 189

Re: Beginner question - declare class facts across packages

Thanks, that answers my question. Now to move some code...
by dcgreenwood
21 Mar 2021 14:54
Forum: Visual Prolog
Topic: Beginner question - declare class facts across packages
Replies: 2
Views: 189

Beginner question - declare class facts across packages

I am a beginner and am building main with a large number of fact databases that are used by many clauses. For organization purposes I would like to put all the assert clauses that build the databases into a different package, but I can't figure out how to make them visible to main. Is there a way to...
by dcgreenwood
17 Jan 2021 0:35
Forum: Visual Prolog
Topic: What does [out] mean?
Replies: 3
Views: 602

Re: What does [out] mean?

Thanks. Since most examples in the fundementals don't include it and allow a term to be either input or output, I assume it is and optional declaration.
by dcgreenwood
16 Jan 2021 1:37
Forum: Visual Prolog
Topic: What does [out] mean?
Replies: 3
Views: 602

What does [out] mean?

I am learning prolog, going though the fundamentals, but I cannot find any description of what the [out] parameter is that I see in some of the example predicates.