Discussions related to Visual Prolog
NuttyProloger
Posts: 2
Joined: 7 May 2024 12:02

Available predicates

Unread post by NuttyProloger »

Hello
Is there a good way to be able to search for built in predicates in VIP? Such as string handling - splitting a string into characters.
NP
User avatar
drspro2
VIP Member
Posts: 103
Joined: 28 Apr 2006 12:03

Re: Available predicates

Unread post by drspro2 »

hi, I think you can find them as follows:

in the VP Ide Editor , double-click a Standard predicate name, or mark it with the mouse,

Press F1 on the keyboard, The Visual-prolog Help should open,

there you have a search function,

and also you can browse to PFC predicates
NuttyProloger
Posts: 2
Joined: 7 May 2024 12:02

Re: Available predicates

Unread post by NuttyProloger »

Hello drspro2

Thanks for your suggestions. They did not work for me because when I press the F1 key, dratted old Microsoft changes my volume for me.
I've just restarted trying things in Prolog. I used Turbo Prolog a lot in the 1980s and found it fun to experiment with. However, Visual Prolog is a fight just to get beyond Hello World. It took me two days to overcome an error - "Main is declared Procedure but is Determ" with the help of the Help Chat.
I have not found a facility that lets me look at a built in predicate such as frontchar to understand how it works. Or find alternates.
Sorry for a little bit of venting.
NuttyProloger
Harrison Pratt
VIP Member
Posts: 451
Joined: 5 Nov 2000 0:01

Re: Available predicates

Unread post by Harrison Pratt »

I suggest that the best place to start is to look at the PFC foundation classes documentation help file. You can search for functions of interested, e.g. "frontChar".

In the IDE you also can highlight the pfc directory and press Ctrl-Shift-F to search all the files for a string (e.g., "frontChar").

In some cases you may need to have your project (no matter how minimal it is) built before you can search or browse.
Attachments
Screenshot 2024-05-19 122738 (Small).png
Screenshot 2024-05-19 122738 (Small).png (72.61 KiB) Viewed 561 times
User avatar
drspro2
VIP Member
Posts: 103
Joined: 28 Apr 2006 12:03

Re: Available predicates

Unread post by drspro2 »

if you catch a predicate like this, it wont complain about "is declared as procedure "
predicate_functname( _Arg1 ):- do_something() , ! .
% catch here like this
predicate_functname( _Arg1 ):- !.
Harrison Pratt
VIP Member
Posts: 451
Joined: 5 Nov 2000 0:01

Re: Available predicates

Unread post by Harrison Pratt »

Or this

Code: Select all

predicate_functname( _Arg1 ):-          do_something() orelse succeed.
Post Reply