Search found 279 matches

by Martin Meyer
5 Aug 2019 19:21
Forum: Visual Prolog
Topic: Otherwise operator with erroneous predicate
Replies: 2
Views: 182

Re: Otherwise operator with erroneous predicate

Yes. Thank you for the detailed explanation.
by Martin Meyer
3 Aug 2019 12:19
Forum: Visual Prolog
Topic: Otherwise operator with erroneous predicate
Replies: 2
Views: 182

Otherwise operator with erroneous predicate

Hello Thomas, please check this code (in build 902). The compiler refuses it (unintentionally?). But it compiles when the indicated line is outcommented: open core, exception constants myException : exception = exception(class_name(), constant_name(), "Error"). class predicates raise_myException : (...
by Martin Meyer
20 Jul 2019 14:29
Forum: Visual Prolog
Topic: Compiled clauses
Replies: 10
Views: 395

Re: Compiled clauses

Yes, there are save and consult predicates in VIP. They are not first language constructs but part of the PFC ("Prolog Foundation Classes"). The PFC comes with a help file. If you have installed Visual Prolog to folder "C:\Program Files (x86)\Visual Prolog 9 PE\" then the help file will be "C:\Progr...
by Martin Meyer
19 Jul 2019 15:24
Forum: Visual Prolog
Topic: Compiled clauses
Replies: 10
Views: 395

Re: Compiled clauses

Hi Rangarajan, short answer is: It depends on whether they are fact or predicate clauses. A longer answer: A strength of Visual Prolog compared to other Prolog systems is speed. The main reason, why VIP programs are running fast, is, that VIP compiles the program code to executable machine instructi...
by Martin Meyer
1 Jul 2019 22:45
Forum: Visual Prolog
Topic: presenter::mkExpand
Replies: 8
Views: 580

Re: presenter::mkExpand

Yes, it's all consistent now. Thank you.
by Martin Meyer
30 Jun 2019 9:26
Forum: Visual Prolog
Topic: presenter::mkExpand
Replies: 8
Views: 580

Re: presenter::mkExpand

But why does below wrapper object not expand (in non-native view)? interface obj [presenter] end interface obj class obj : obj end class obj implement obj open presenter clauses presenter() = mkPresenter_fixed( fp_string("I am an obj"), presenter::mkFP_childOnly_term("I am the expansion of an obj", ...
by Martin Meyer
28 Jun 2019 9:49
Forum: Visual Prolog
Topic: Inheriting a presenter
Replies: 1
Views: 194

Inheriting a presenter

Hello Thomas, please have a look at below code example. In my try it has output <childObj 00853FE0> (in build 902). But when changing the order of the interfaces in the supports qualification, it outputs This is an objA . interface objA [presenter] end interface objA class objA : objA end class objA...
by Martin Meyer
27 Jun 2019 17:03
Forum: Visual Prolog
Topic: presenter::mkExpand
Replies: 8
Views: 580

Re: presenter::mkExpand

Ahhh :shock: OK, I got it. And reading the wiki more carefully I see that is also documented well. Thank you!
by Martin Meyer
26 Jun 2019 0:25
Forum: Visual Prolog
Topic: presenter::mkExpand
Replies: 8
Views: 580

presenter::mkExpand

Hello Thomas, when setting a breakpoint in below code at the indicated line and running it in the debugger (in build 902), a line for variable Num is displayed in the "Variables in the Current Clause" window. However (with "Native View" not checked on) the line cannot be expanded by mouse click. I s...
by Martin Meyer
4 Jun 2019 1:09
Forum: Visual Prolog
Topic: Problem picking a predicate of certain arity
Replies: 2
Views: 335

Re: Problem picking a predicate of certain arity

Thank you, I followed your advice.
by Martin Meyer
3 Jun 2019 0:20
Forum: Visual Prolog
Topic: Problem picking a predicate of certain arity
Replies: 2
Views: 335

Problem picking a predicate of certain arity

Hello Thomas, just a minor issue: In below code the compiler (build 902) preferes wrong predicate getRule_nd/1-> over the correct getRule_nd/0-> which comes through an interface delegation. I am not absolutely sure, but I suppose that it is not intended. interface rule end interface rule %=== interf...
by Martin Meyer
1 Jun 2019 12:38
Forum: Visual Prolog
Topic: Interface level bounded polymorphism problem
Replies: 1
Views: 304

Interface level bounded polymorphism problem

Hello Thomas, am sorry to bother again with bounded polymorphism, but please have a look on below case (in build 902): interface rule properties name : string (o). end interface rule %=== interface grammar{@RuleSite} %properties % ruleList : @RuleSite*. predicates getRule_nd : () -> @RuleSite nondet...
by Martin Meyer
30 May 2019 13:52
Forum: Visual Prolog
Topic: Bounded polymorphism problem
Replies: 6
Views: 688

Re: Bounded polymorphism problem

I said " The result of contravariance in an output argument is that bounded polymorphism is not applicable to output parameters at all. " But now I realized, that is wrong because it works this way: class predicates pInOut : (Dom, Dom [out]) where Dom supports integer. clauses pInOut(X, X). Thus my ...
by Martin Meyer
29 May 2019 18:58
Forum: Visual Prolog
Topic: Bounded polymorphism problem
Replies: 6
Views: 688

Re: Bounded polymorphism problem

Yes, covariant/contravariant is a very good hint. I had not known these terms. You are always a great source of information. Like you said, a predicate type is covariant in the type of its output arguments. It seems however that by the semantics " a predicate which given any subtype Dom of integer r...
by Martin Meyer
29 May 2019 0:17
Forum: Visual Prolog
Topic: Bounded polymorphism problem
Replies: 6
Views: 688

Re: Bounded polymorphism problem

Analogous p1 could be proofed correct by: class main domains dom = integer [2..10]. predicates p : () -> dom. end class main %== implement main clauses p() = 1. end implement main I think when type checking is done that way, for any use of bounded polymorphism on an output parameter, a type checking...