Search found 276 matches

by Martin Meyer
19 Jul 2019 15:24
Forum: Visual Prolog
Topic: Compiled clauses
Replies: 1
Views: 12

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: 402

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: 402

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: 100

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: 402

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: 402

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: 165

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: 165

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: 143

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: 491

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: 491

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: 491

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...
by Martin Meyer
18 May 2019 17:13
Forum: Visual Prolog
Topic: Problem with Comparing Trees
Replies: 4
Views: 2295

Re: Problem with Comparing Trees

Hello Thomas,

I am bringing this issue back to the top because it (still or again) needs a treatment (in build 902).
by Martin Meyer
17 May 2019 15:54
Forum: Visual Prolog
Topic: Bounded polymorphism problem
Replies: 6
Views: 491

Bounded polymorphism problem

Hello Thomas, this works (in build 902): class predicates p : () -> Dom where Dom supports integer. clauses p() = 1 + 0. But with these variants there is some problem: class predicates p1 : () -> Dom where Dom supports integer. clauses p1() = 1. % raises: 1 is not in the domain 'Dom' class predicate...
by Martin Meyer
12 May 2019 22:34
Forum: Visual Prolog
Topic: Default parameter problem
Replies: 1
Views: 324

Default parameter problem

Hello Thomas,

please check this code (in build 902). It dumps:

Code: Select all

class predicates     p : (core::comparator{Type} Comp = compare). clauses     p(_Comp).   clauses     run() :-         p().