Search found 280 matches

by Martin Meyer
27 Jan 2015 15:20
Forum: Visual Prolog
Topic: uncheckedConvert question
Replies: 2
Views: 2416

I understand. Thank you!

Regards
Martin
by Martin Meyer
27 Jan 2015 13:46
Forum: Visual Prolog
Topic: uncheckedConvert question
Replies: 2
Views: 2416

The Language Reference says about uncheckedConvert : >> It makes only compile time checking of bit-size equality of the converted domains. << But why below predicate test outputs in 64 bit mode (in 7501) " converted variable of size 4 unchecked to variable of size 8 "? Its further output " IntNative...
by Martin Meyer
22 Jan 2015 15:10
Forum: Visual Prolog
Topic: Stack Overflow
Replies: 4
Views: 3230

Yes, Paul, it goes into an infinite loop on the first call of floodStack to itself. The call is not tail recursive, because it is followed by a second one (which however actually will never be reached). Because the call is not tail recursive, each execution of it eats up a further piece of stack. Wh...
by Martin Meyer
22 Jan 2015 12:08
Forum: Visual Prolog
Topic: Stack Overflow
Replies: 4
Views: 3230

Stack Overflow

Hi Thomas, there is a -low importance- issue about stack overflows. In my tries (using 7501) below predicate test has worked out in 32 bit mode, but crashed in 64 bit mode. class predicates test : (). clauses test() :- try floodStack() catch _ do stdIo::write("I'll be back\n") end try, stdIo::write(...
by Martin Meyer
22 Jan 2015 0:01
Forum: Visual Prolog
Topic: how to remove duplicates of facts ?
Replies: 16
Views: 10277

I agree to your conclusion: The higher the quota of duplicates on all facts is, the better performs the retractAll -solution. When counting the steps for the retractAll -solution in the case you mention (n - total quantity of facts, m - quantity of unique facts, r - quantity of occurrences of each f...
by Martin Meyer
21 Jan 2015 21:25
Forum: Visual Prolog
Topic: Sizes of Integer Types
Replies: 5
Views: 5370

Thank you once again Thomas for the info, I appreciate your good support in this forum a lot!

Regards
Martin
by Martin Meyer
21 Jan 2015 18:01
Forum: Visual Prolog
Topic: Sizes of Integer Types
Replies: 5
Views: 5370

Thank you! I understand now about the sizes of variables of type rec8 to rec64 . The optimization of functors' memory layout looks very well! But I still wonder about these lines from the current build: Bytesize of domain integer8 is 1 Bytesize of variable I8 is 4 Bytesize of type variable is 1 Byte...
by Martin Meyer
21 Jan 2015 0:34
Forum: Visual Prolog
Topic: how to remove duplicates of facts ?
Replies: 16
Views: 10277

Yes, the deduplication can also be performed using retractAll: class facts exampleFact : (string). class predicates dedupExampleFactDb : (). clauses dedupExampleFactDb() :- foreach exampleFact(S) do retractAll(exampleFact(S)), assertA(exampleFact(S)) end foreach. The advantage over the no-list-solut...
by Martin Meyer
20 Jan 2015 9:35
Forum: Visual Prolog
Topic: how to remove duplicates of facts ?
Replies: 16
Views: 10277

Hi Jason, the best way is probably to retract each fact from the fact database, inserting it in a list, sort resp. deduplicate the list and finally assert each element of the list back into the fact database. So, for example: class facts exampleFact : (string). class predicates dedupExampleFactDb : ...
by Martin Meyer
19 Jan 2015 23:17
Forum: Visual Prolog
Topic: Sizes of Integer Types
Replies: 5
Views: 5370

Sizes of Integer Types

Hello Thomas, hi all, I have run the below predicate test , which displays several byte sizes of integer types and variables, in different VIP builds. class predicates writeByteSize : (Type Var). clauses writeByteSize(Var) :- stdIo::write("Bytesize of type variable is ", sizeOf(Var), "\n"). domains ...
by Martin Meyer
28 Oct 2014 18:15
Forum: Visual Prolog
Topic: Problem with Must-Unify
Replies: 2
Views: 3359

Problem with Must-Unify

Hi Thomas, please check this construction, the compiler (build 7500) has a problem with it: domains record{Type} = empty; node(Type Item). class predicates compareRecord : (comparator{Type} CompareItem) -> comparator{record{Type}} CompareRecord. clauses compareRecord(CompareItem) = { (RecordA, Recor...
by Martin Meyer
18 Oct 2014 12:34
Forum: Visual Prolog
Topic: Error using Properties from Generic Interface
Replies: 2
Views: 2876

Error using Properties from Generic Interface

Hi Thomas, please have a look at below code. The compiler (build 7500) throws error c504 : The expression has type '::string', which is incompatible with the type '@Type' on it. Regards Martin interface objA{@Type} properties prop : @Type (o). end interface objA %--- interface objB properties from o...
by Martin Meyer
16 Oct 2014 15:42
Forum: Visual Prolog
Topic: Predicate Constant
Replies: 14
Views: 7191

The example below deals with personID's and sets of them. The personID's are implemented as of domain symbol and the sets as of domain personIdSet . Domain personIdSet in turn is implemented through a patricia set of unsignedNative keys (patricia set's code is just a modified version of the radixTre...
by Martin Meyer
11 Oct 2014 15:01
Forum: Visual Prolog
Topic: Predicate Constant
Replies: 14
Views: 7191

Thanx for the info Thomas! Maybe you can make predicate constants work in a future release? They have usage in increasing code's readability and easing its maintainance. In the place, where I tried to use it, I have now put a wrapper predicate in the style of class predicates myRenamedPredicate : ()...
by Martin Meyer
11 Oct 2014 12:31
Forum: Visual Prolog
Topic: Predicate Constant
Replies: 14
Views: 7191

Predicate Constant

Hello Thomas and hi all, the below code throws error c229 : Undeclared identifier 'myRenamedPredicate/0' (in VIP build 7500). Is it intended or bug? Regards Martin class predicates myPredicate : (). clauses myPredicate(). constants myRenamedPredicate : core::predicate = myPredicate. class predicates...