Search found 298 matches

by Martin Meyer
3 Jun 2015 9:31
Forum: Visual Prolog
Topic: Deterministic Error
Replies: 7
Views: 6290

Yes, Peter's solution should work out. Moreover (since VIP 7.5 ) the condition in an if-then-else statement is followed by an implicit cut. Thus in current VIP the ,! in Peter's code can be omitted. Regarding my prior message, more exact is: Stating the predicate mode of onDiagnosisClick/1-> is actu...
by Martin Meyer
3 Jun 2015 1:43
Forum: Visual Prolog
Topic: Deterministic Error
Replies: 7
Views: 6290

Hello Frank, the retract/1 predicate is nondeterm. A call to a nondeterm predicate can fail or can succeed and leave a backtrack point. Appending a cut to a call to a nondeterm predicate, as in your code in retract(text1(Title)), !, results in a code fragment, which can fail or succeed without leavi...
by Martin Meyer
22 May 2015 0:16
Forum: Visual Prolog
Topic: Callback Actions for Exceptions and Failure
Replies: 13
Views: 10291

The idea to find exactly those unifications, which have to be undone, is: When I perform a binding, I push the current backtrack-stack position along with the action to undo the binding, on a stack. When a fail occurs, the fail-callback predicate will be executed. In the callback predicate I look at...
by Martin Meyer
21 May 2015 14:56
Forum: Visual Prolog
Topic: Callback Actions for Exceptions and Failure
Replies: 13
Views: 10291

Callback Actions for Exceptions and Failure

Hello Thomas, for some purposes it could be very beneficial, if callback predicates could be set, which are called a) whenever an exception occurs, b) whenever something has failed, i.e. each time backtracking has been performed. The purpose, for which I would like to use the callback predicates, is...
by Martin Meyer
18 May 2015 8:35
Forum: Visual Prolog
Topic: Conflicting support instances
Replies: 8
Views: 5509

Hello Thomas,

your counter example is greatly enlightening the subtyping thing, thanx!

Best regards
Martin
by Martin Meyer
15 May 2015 23:09
Forum: Visual Prolog
Topic: Conflicting support instances
Replies: 8
Views: 5509

Despite object being a supertype of range , user_defined{object} is no supertype of user_defined{range} , and hence the compiler throws that type incompatibility error. I wonder whether this behavior of the compiler has an inherent reason or could be changed in a future VIP version. Below variant of...
by Martin Meyer
15 May 2015 11:25
Forum: Visual Prolog
Topic: Conflicting support instances
Replies: 8
Views: 5509

Hi Peter, I suppose the conflicting support instances error is correct behavior of the compiler. The compiler throws it, because for example interface range (directly) supports expression{range} and (indirectly) also supports expression{user_defined} . Thus in one way it's stated, that in the interf...
by Martin Meyer
27 Feb 2015 11:44
Forum: Visual Prolog
Topic: Debug File Flag
Replies: 6
Views: 4809

Yes Thomas, I am used to define a constant debug in main.cl to toggle my self-made debug configuration on/off. The program sections, I am conditionally switching on/off in compilation via the constant, contain predicates, which output the contents of structures (for example collections) through stdI...
by Martin Meyer
26 Feb 2015 14:27
Forum: Visual Prolog
Topic: Debug File Flag
Replies: 6
Views: 4809

Thx for the info, Thomas!

Maybe you could introduce a new build-in constant in a future release to make the flag available at compile time?

Many regards
Martin
by Martin Meyer
26 Feb 2015 10:22
Forum: Visual Prolog
Topic: Debug File Flag
Replies: 6
Views: 4809

Debug File Flag

Hi Thomas and all,

in Project Settings in the Version Information tab in line File Flags the first flag is named Debug. How to query the flag in a program? I would like to use it in the way:

Code: Select all

#if debug = true #then     ... my add-on code for debugging purposes ... #endif
Regards
Martin
by Martin Meyer
19 Feb 2015 17:52
Forum: Visual Prolog
Topic: Definition of property as a predicate
Replies: 4
Views: 4175

I suppose, such syntax cannot be allowed, because that leads to semantic ambiguity: When a fact, which has a function type, could be declared in the way facts optimum : (real*) -> real. then it should work in the same way to declare a fact having a predicate type by facts optimum : (real*). The late...
by Martin Meyer
16 Feb 2015 10:20
Forum: Visual Prolog
Topic: Free parameter error
Replies: 1
Views: 2927

Free parameter error

Hello Thomas, please have a look at below construct. It does not compile (in build 7501). Regards Martin interface obj1{@Type1} properties value : @Type1. end interface obj1 %--- interface obj2{@Type2} properties from obj1{@Type2} value end interface obj2 %--- interface obj3{@Type3} properties from ...
by Martin Meyer
14 Feb 2015 17:59
Forum: Visual Prolog
Topic: Generic predicates
Replies: 6
Views: 5451

I am trying to answer your first two questions. Thomas may correct me, when am wrong: to 1) object and X (in the place you used it) have different meanings: Tutorial http://wiki.visual-prolog.com/index.php?title=Introduction_to_Classes_and_Objects says >> object is an implicitly defined interface th...
by Martin Meyer
13 Feb 2015 20:46
Forum: Visual Prolog
Topic: Compiler warning/Calling from a parent class to a child class
Replies: 7
Views: 5633

So, applying the (perfectly explained!) support pattern to Peter's example, the code would look like below. Correct? Regards Martin interface reproduction predicates perform : (). properties type : string. end interface reproduction /****************************************************************/ ...
by Martin Meyer
11 Feb 2015 21:16
Forum: Visual Prolog
Topic: Compiler warning/Calling from a parent class to a child class
Replies: 7
Views: 5633

Hi Peter, in below code the compiler will throw errors, when implementing the property type in class reproduction is forgotten. Regards, Martin interface reproduction_support predicates perform:(). end interface reproduction_support class reproduction_support:reproduction_support end class implement...