Search found 314 matches

by Martin Meyer
21 May 2023 11:57
Forum: Visual Prolog
Topic: Do I have to uninstall vp 10.01, in order to upgrade to 10.02?
Replies: 4
Views: 133

Do I have to uninstall vp 10.01, in order to upgrade to 10.02?

Hi, in installing 1002 error Thomas answered: .. you cannot have two instances of Vip 9 or two instances of Vip10. Actually Visual Prolog itself doesn't mind you can have as many as you like, but when making installers you will have to decide which is the same and should be considered updates and wh...
by Martin Meyer
19 May 2023 22:23
Forum: Visual Prolog
Topic: How to get binary data from a picture
Replies: 2
Views: 74

Re: How to get binary data from a picture

Hi Paul, all predicates of your old code are still there in VIP 10ce. I have tried it, created a new console project in VIP 10ce and put the code with a little add-on in main.pro : class globals properties desired_Output : real. end class globals implement globals class facts desired_Output : real :...
by Martin Meyer
12 May 2023 17:44
Forum: Visual Prolog
Topic: Working with Integers
Replies: 3
Views: 135

Re: Working with Integers

Hi Kim, working with integers is same easy as with strings. Here are two working variants of your code which may hopefully help: clauses run() :- StrList = ["Huey", "Dewey", "Louie"], processStrList(StrList, 1). class predicates processStrList : (string* DataList, integ...
by Martin Meyer
15 Nov 2022 1:33
Forum: Visual Prolog
Topic: Reverting changes on backtracking
Replies: 16
Views: 1667

Re: Reverting changes on backtracking

OK. But just to the objSetM_chain construction: Of course a persistent data structure is one where every operation returns a new data structure but also preserves the old one. I think, you mention it because I made a mistake: My objSetM_chain example is not appropriate. When I tried to make class ob...
by Martin Meyer
14 Nov 2022 20:25
Forum: Visual Prolog
Topic: Incompatible types
Replies: 1
Views: 366

Incompatible types

Hello Thomas,

on attached example the compiler throws "The expression has type 'arrayP::repDomain', which is incompatible with the type 'arrayP::repDomain{@ItemType}'". Is it a bug?
by Martin Meyer
13 Nov 2022 1:24
Forum: Visual Prolog
Topic: Reverting changes on backtracking
Replies: 16
Views: 1667

Re: Reverting changes on backtracking

Thank you again for the detailed answer. If I had to pay you for all the time, you have invested over the years in answering my posts, I would be a poor man. I understand that the proposed construction is a hook into the runtime system rather than a genuine language feature and the if-rewrite you pr...
by Martin Meyer
30 Oct 2022 13:38
Forum: Visual Prolog
Topic: Reverting changes on backtracking
Replies: 16
Views: 1667

Re: Reverting changes on backtracking

:D Thank you, Thomas !
by Martin Meyer
29 Oct 2022 13:26
Forum: Visual Prolog
Topic: Prolog 7.3 black box in code
Replies: 3
Views: 551

Re: Prolog 7.3 black box in code

In old VIP 7.3 dialogs have been looking different, but fonts have also been selectable:

Options_Fonts.jpg
Options_Fonts.jpg (23.69 KiB) Viewed 537 times
Options_Editor.jpg
Options_Editor.jpg (39.63 KiB) Viewed 537 times
by Martin Meyer
29 Oct 2022 11:10
Forum: Visual Prolog
Topic: Prolog 7.3 black box in code
Replies: 3
Views: 551

Re: Prolog 7.3 black box in code

Hello Linda, it looks like something is messed up with the fonts on your PC. Maybe the font, which VIP uses in the editor, is missing. Under "Tools", "Options..." it is possible to specify font for all IDE windows. I suppose my font settings are default: Options.jpg Try to change...
by Martin Meyer
27 Oct 2022 16:11
Forum: Visual Prolog
Topic: Reverting changes on backtracking
Replies: 16
Views: 1667

Re: Reverting changes on backtracking

I have been seeking for a way which solves the problem, but does not produce too much effort to implement. Can this one win your sympathy? Please check: In backtrack points VIP is pushing some data on the stack. Let me call that data a backtrack-frame. Add one extra pointer to the backtrack-frame. T...
by Martin Meyer
25 Oct 2022 10:35
Forum: Visual Prolog
Topic: Reverting changes on backtracking
Replies: 16
Views: 1667

Re: Reverting changes on backtracking

Without adding "amortized", the performance claim is not correct. Because, when placing the undo calls right behind the regular backtrack points, a single failure can trigger many undo calls. Thus the backtracking initiated by a single failure executes in O(n) in the persistent array const...
by Martin Meyer
25 Oct 2022 9:01
Forum: Visual Prolog
Topic: Reverting changes on backtracking
Replies: 16
Views: 1667

Re: Reverting changes on backtracking

To be exact about the performance characteristics of the persistent array construction compared to the ephemeral arrayM : The characteristics are preserved in amortized costs. The cost to move n states forwards is in O(n), the cost to move backwards n states is also in O(n). Thus amortized, every si...
by Martin Meyer
24 Oct 2022 21:05
Forum: Visual Prolog
Topic: Reverting changes on backtracking
Replies: 16
Views: 1667

Re: Reverting changes on backtracking

I have a class named stateManager in which the undo functionality is also not tied to backtracking (see attached Example2.zip). Both classes reversion and stateManager are about turning an ephemeral data structure into a persistent data structure . The reversion class only supports accessing the new...
by Martin Meyer
19 Oct 2022 16:07
Forum: Visual Prolog
Topic: Reverting changes on backtracking
Replies: 16
Views: 1667

Re: Reverting changes on backtracking

Add-on: The example can be simplified. When using the reversion class, the stack fact is not needed: class facts state : string := "initial". class predicates changeState : (string Update). clauses changeState(Update) :- State = state, state := Update, reversion::addUndoAction({ :- state :...
by Martin Meyer
19 Oct 2022 15:50
Forum: Visual Prolog
Topic: Reverting changes on backtracking
Replies: 16
Views: 1667

Re: Reverting changes on backtracking

Thank you Thomas for the info! To treat the problem I am using a class named reversion (see it in attached Example.zip). Using that class the example looks like: class facts state : string := "initial". class facts stack : string* := []. class predicates changeState : (string Update). clau...