Search found 298 matches

by Martin Meyer
30 Jan 2015 21:33
Forum: Visual Prolog
Topic: Predicate Constant
Replies: 14
Views: 9186

No problem, with next release will be also fine.

Many regards
Martin
by Martin Meyer
30 Jan 2015 15:30
Forum: Visual Prolog
Topic: Predicate Constant
Replies: 14
Views: 9186

In the new features list http://wiki.visual-prolog.com/index.php?title=New_Features_in_Visual_Prolog_7.5#Build_7501 I see an entry "Problem with predicate constants". But when I try to replace the class fact from the example by constants personIdSet_union : function{personIdSet PersonIdSet...
by Martin Meyer
30 Jan 2015 15:00
Forum: Visual Prolog
Topic: Generic predicates
Replies: 6
Views: 5451

Hi Peter, why do you want to have two (or even more) predicates get_text and get_sheet resp. try_text and try_sheet at all, rather than better using respectively one, which serves all purposes by means of polymorphism? It can be done like in below code. Regards Martin interface folder{@Type} predica...
by Martin Meyer
27 Jan 2015 15:20
Forum: Visual Prolog
Topic: uncheckedConvert question
Replies: 2
Views: 2947

I understand. Thank you!

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

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 &...
by Martin Meyer
22 Jan 2015 15:10
Forum: Visual Prolog
Topic: Stack Overflow
Replies: 4
Views: 4025

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

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, std...
by Martin Meyer
22 Jan 2015 0:01
Forum: Visual Prolog
Topic: how to remove duplicates of facts ?
Replies: 16
Views: 12493

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

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

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

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

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

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), "...
by Martin Meyer
28 Oct 2014 18:15
Forum: Visual Prolog
Topic: Problem with Must-Unify
Replies: 2
Views: 3999

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

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