Search found 270 matches

by Martin Meyer
4 Jun 2019 1:09
Forum: Visual Prolog
Topic: Problem picking a predicate of certain arity
Replies: 2
Views: 75

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

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

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

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

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

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

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

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

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().
by Martin Meyer
9 May 2019 1:17
Forum: Visual Prolog
Topic: API reference
Replies: 3
Views: 311

Re: API reference

Hi hyphz,

are you searching for the pfc help file? If you install Visual Prolog to folder
"C:\Program Files (x86)\Visual Prolog 9 PE\" then the help file will be
"C:\Program Files (x86)\Visual Prolog 9 PE\appData\doc\vip.chm".

I have created a link to the file in my start menu.
by Martin Meyer
8 May 2019 3:14
Forum: Visual Prolog
Topic: Accessing supported constants and domains
Replies: 7
Views: 403

Re: Accessing supported constants and domains

Thank you for answering! No else questions in this post. Just my thoughts/remarks in case you want to read them. Anyway, it is a fundamental property of Visual Prolog ... Yes, I see. Changing a fundamental property can turn a lot of things upside down. I can imagine that it could easily produce an u...
by Martin Meyer
7 May 2019 1:22
Forum: Visual Prolog
Topic: Accessing supported constants and domains
Replies: 7
Views: 403

Re: Accessing supported constants and domains

OK. In the Language Reference it reads but: constants and domains defined in an interface are not part of the type that the interface denotes But these matters are a question of how to formulate the theory (and you are doing that always concisely very well). What I want to tell by the thread is howe...
by Martin Meyer
5 May 2019 21:30
Forum: Visual Prolog
Topic: Accessing supported constants and domains
Replies: 7
Views: 403

Re: Accessing supported constants and domains

Yes. However why must that imply, we cannot refer via objC to the constants/domains of the interfaces it supports, i.e. to const1 and dom1 ? An interface uniformly exhibits predicates/properties originally declared in it as well as those it supports. Why to treat constants/domains differently in thi...
by Martin Meyer
5 May 2019 14:39
Forum: Visual Prolog
Topic: Accessing supported constants and domains
Replies: 7
Views: 403

Accessing supported constants and domains

Hello Thomas, VIP's object system is sound and powerful. Its latest add-on "bounded polymorphism" is working already fine in my code. The only issue about the object system which I think is questionable, is the difference interfaces impose on their type and scope. You have explained it in Interface ...
by Martin Meyer
28 Apr 2019 21:30
Forum: Visual Prolog
Topic: Predicate not found
Replies: 5
Views: 347

Re: Predicate not found

This works too: interface obj0 predicates p : (). end interface obj0 %=== interface obj1 supports obj0 end interface obj1 %=== interface obj2 supports obj1 end interface obj2 %=== interface obj3 predicates from obj2 p/0 end interface obj3 But that does not: interface obj0 predicates p : (). end inte...