Predicate called from menu must be a procedure (?)?
Posted: 27 Mar 2021 16:17
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
predicate
runExperiment: ().
)
With this, Build gives an error message that startExperiment must be determ. But if I change it to determ, I get an error message that runExperiment must be determ. If I change that, I get an error message that the Task Window predicate that calls runExperiment must be determ, and if I change that I get an error message pointing into the gui code that I don't understand.
What do I need to change in order to ensure that runExperiment() is a procedure? Or am I wrong, and the predicate called by the menu item does not need to be a procedure?
The predicates that start my program are
(runExperiment is declared in main.cl as
predicate
runExperiment: ().
)
Code: Select all
class predicates
startExperiment : ().
checkIfExperimentOver : (flag Over [out]) determ.
advanceCounter : () nondeterm.
clauses
runExperiment() :-
startExperiment().
startExperiment() :-
assert(turnCounter(0)),
assert(objectiveStatus(b2, no, "anonymous")),
!,
checkIfExperimentOver(Over),
if Over = no then
executeTurn(),
startExperiment()
else
stdio::write("\nExperiment Concluded.\n\n")
end if.
checkIfExperimentOver(Over) :-
stdio::write("Checking to see if Experiment is Over.\n"),
!,
turnCounter(Counter),
if Counter > 100 then
% or Obj = yes then
Over = yes
else
Over = no
end if,
!.
checkIfExperimentOver(yes).
What do I need to change in order to ensure that runExperiment() is a procedure? Or am I wrong, and the predicate called by the menu item does not need to be a procedure?