Search found 283 matches

by Martin Meyer
14 Sep 2019 18:02
Forum: Visual Prolog
Topic: unsigned64 bit operations
Replies: 0
Views: 91

unsigned64 bit operations

Hello Thomas, updating my code to the new bit operations I came upon a case with an unexpected result (in build 902): open bit class predicates getHighBitMask64_oldStyle : (unsigned64 X) -> unsigned64 Mask. clauses getHighBitMask64_oldStyle(X) = bitAnd(X_7, bitNot(bitRight(X_7, 1))) :- X_1 = bitOr(X...
by Martin Meyer
13 Sep 2019 17:00
Forum: Visual Prolog
Topic: convert unsigned 64
Replies: 5
Views: 145

Re: convert unsigned 64

The result of predicate bit::getLow32of64/1-> has type unsigned . The value of an unsigned can be represented by an integer only if the value does not exceed the limits of the integer type. That is, convert(integer, U32 ) cannot work out when the value of the unsigned U32 is greater than upperBound(...
by Martin Meyer
7 Sep 2019 17:28
Forum: Visual Prolog
Topic: unsigned8 bit operations
Replies: 3
Views: 212

Re: unsigned8 bit operations

Yes, there is a better way. Just make sure that ByteOut has domain unsigned8 : open core clauses run() :- hasDomain(unsigned8, Byte1), hasDomain(unsigned8, Byte2), Byte1 = 1 * 0x04 + 0 * 0x02 + 1 * 0x01, Byte2 = 1 * 0x04 + 1 * 0x02 + 0 * 0x01, hasDomain(unsigned8, ByteOut), ByteOut = Byte1 ^^ Byte2,...
by Martin Meyer
4 Sep 2019 0:37
Forum: Visual Prolog
Topic: Optional parameters
Replies: 1
Views: 210

Optional parameters

Hello Thomas, in below call to enum/3 the last argument for an [out] parameter cannot (unintentionally?) be skipped (in VIP 902). domains unsigned3Enumerator = (unsigned A [out], unsigned B [out], unsigned C [out]) nondeterm. class predicates enum : unsigned3Enumerator. clauses enum(1, 2, 3). enum(4...
by Martin Meyer
5 Aug 2019 19:21
Forum: Visual Prolog
Topic: Otherwise operator with erroneous predicate
Replies: 2
Views: 533

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

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

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

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

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

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

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

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

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

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

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...