Search found 30 matches

by kingchris
1 Dec 2015 4:39
Forum: Visual Prolog
Topic: Simple list head rest split syntax
Replies: 6
Views: 4046

True. That would work perfectly. I just wanted to highlight for myself that lists could be split across the equals/assigment barrier :D I recall copying some code a while back that did this but I misplaced the code and couldn't recall how to do it. Sometimes for debugging purposes its easier to show...
by kingchris
30 Nov 2015 17:04
Forum: Visual Prolog
Topic: Simple list head rest split syntax
Replies: 6
Views: 4046

For those of you who want the cliff notes. This worked for me class facts filename:(string,string,string,string,core::string_list). clauses somePred():- filename(CurrentName._._,_,Name_Parts_Str), [Head,_Rest] = Name_Parts_Str, console::write(CurrentName," ",Head),console::nl(). So simple when you k...
by kingchris
30 Nov 2015 4:19
Forum: Visual Prolog
Topic: Simple list head rest split syntax
Replies: 6
Views: 4046

Simple list head rest split syntax

If I retrieve a string-list from a fact is there a simple syntax-sugar way to split it into the typical head rest vars class facts filename:(string,string,string,string,core::string_list). clauses somePred():- filename(_._._,_,Name_Parts_Str), [Head,Rest] := Name_Parts_Str, % this is wrong but you g...
by kingchris
20 Jun 2014 6:38
Forum: Visual Prolog
Topic: Howto create and populate a real array
Replies: 2
Views: 1167

Thanks for the help. You have excellent suggestions. Just for question completeness. fann_train : (pointer Fann, pointer ArrayInput, positive SizeInput, pointer ArrayOutput, positive SizeOutput) The pointer ArrayOutput parameter is actually an input parameter to the neural net. I am learning neural ...
by kingchris
19 Jun 2014 13:36
Forum: Visual Prolog
Topic: Howto create and populate a real array
Replies: 2
Views: 1167

Howto create and populate a real array

I wish to interface with the fann library for neural nets. I have a class fact that holds the 784 real values that I wish to pass. Assume that I have added the 784 real values already to the list. class facts - test real_data: (real_list) nondeterm. This is the function that I want to call. Its 2nd ...
by kingchris
28 Apr 2014 10:41
Forum: Visual Prolog
Topic: Dynamic runtime predicate pointer binding
Replies: 3
Views: 1360

You are correct in your "wrong school" statements. But please note that I did say Psuedo Code at the top. I and many other people on this forum, I am sure, program in multiple languages from F#, C#, C, C++, assembler, VB, Pascal etc. so its all gets very confusing. The latest PDC Prolog has introduc...
by kingchris
28 Apr 2014 9:38
Forum: Visual Prolog
Topic: Dynamic runtime predicate pointer binding
Replies: 3
Views: 1360

Dynamic runtime predicate pointer binding

Pseudo Code. facts predicate_pointer : pointer(string). predicates doNothing:(string). writeToConsole:(string). app_init(). doLotsOfWork(). clauses app_init():- if (debug_condition=true()) predicate_pointer := writeToConsole() else predicate_pointer := doNothing() end if. doLotsOfWork():- repeat(), ...
by kingchris
12 Aug 2013 15:45
Forum: Visual Prolog
Topic: VIP and GPUs/ CUDA
Replies: 5
Views: 3079

As there is a C and C++ API for CUDA you could speed things up by writing a lex type convertor that could process the header files for the C and C++ API. This at least will give you most of your Prolog .cl file. Automating the scanning of the DLLS, LIBS or raw OBJ would be interesting to obtain the ...
by kingchris
12 Aug 2013 6:09
Forum: Visual Prolog
Topic: VIP and GPUs/ CUDA
Replies: 5
Views: 3079

I am also doing the RTFM part of this. I have used the opengl supported parts of Nvidia library but from VS2008. I have also started to extend the FANN bindings of Gildas Menier to FANN 2.2.0. As the source of FANN is available I would also like to see if parts of this library can be speeded up with...
by kingchris
22 Feb 2013 17:07
Forum: Visual Prolog
Topic: Accessing a dll (Part 2)
Replies: 0
Views: 1191

Accessing a dll (Part 2)

This is a previous message that spoke about this problem. http://discuss.visual-prolog.com/viewtopic.php?t=6392 I am adding my own bindings to the FANN DLL library and come across the old problem of how to put debug statements in the DLL runtime that would actually print somewhere meaningful. So far...
by kingchris
18 Jun 2012 5:06
Forum: Visual Prolog
Topic: Help me to finish my algorithm !! :(
Replies: 4
Views: 1447

In your first message. You state that ' I have seen examples of reading data from a csv but not understand' . To solve your problem you are are going to have to learn and understand the .csv format. Hence my suggestion that you look at the website that I suggested or google your own. Once you unders...
by kingchris
17 Jun 2012 19:22
Forum: Visual Prolog
Topic: Help me to finish my algorithm !! :(
Replies: 4
Views: 1447

Your first move should be to read up on the .csv format http://edoceo.com/utilitas/csv-file-format Your data seems a simple version of .csv so read a line of the file. Read up in the help doc for a predicate that will turn your comma delimited string into a list. As you know lists are very popular i...
by kingchris
17 Jun 2012 6:05
Forum: Visual Prolog
Topic: Hi frnds can anyone help me in coding to the below question??
Replies: 2
Views: 1347

Other than homework. Why are you trying to write this program in Prolog. I see nothing in your spec that needs the abilities that the Prolog language can provide. C or C++ with one of the many runtime frameworks would be fine. Or VB, Delphi etc.
by kingchris
21 Oct 2011 9:57
Forum: Visual Prolog
Topic: VP Support for Address Windowing Extensions
Replies: 2
Views: 1230

VP Support for Address Windowing Extensions

Vp 5.X has an external database where you can create chain files. If I remember correctly you could kind of create them in memory or on disk and there was a third option which I forget. I have a new i7 computer with 12 Gig of ram. Of which XP is only using 3 gig but of course it maps the first 4 gig...