is there a real educational book about how to build project

Discussions related to Visual Prolog
billgates198606

is there a real educational book about how to build project

Unread post by billgates198606 » 8 Dec 2013 10:10

we need a book that show how build a project
that have simple and big example with explain not just code

books on visual prolog.com website is not helpful ,it do not have example ,till now i still do not know how to build a full prj ,




and how to test a function that is determ multi nondeterm ,

Code: Select all

predicates fun(a,b)determ (i,o)   goal   myfunc::fun(a,b)
show erro :goal must be procedure

how and why



another problem

use function as varible

i guess it may be ,pls right the right code
DOMAINS

Code: Select all

predicates usefunc(string word,function func{T1,T2}) clauses do:- readln(word ) readln(A,B) usefunc(word,func{T1,T2}) word = update             %means  if word is update  it will call update function func(A,B)                             % IF word is delete mean  it will call  delete function

User avatar
Thomas Linder Puls
VIP Member
Posts: 1174
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 8 Dec 2013 18:34

Please limit each mail to one subject/problem.

Have you followed the Fundamental Visual Prolog tutorials?
The goal has to be a procedure. A determ predicate can be placed in an if-construction:

Code: Select all

clauses     run() :-         if fun(1, X) then             stdio::write(X)         else             stdio::write("fail")         end if.
A nondeterm/multi predicate can be placed in a foreach-construction:

Code: Select all

clauses     run() :-         foreach fun_multi(1, X) do             stdio::write(X)         end foreach.
I do not understand what "do" is supposed to do (and "do" is a reserved word that cannot be used as a predicate name (see the foreach-construction above)), so if you want help with that, you will have to give a better description.
Regards Thomas Linder Puls
PDC

billgates198606

treat a function as a varible

Unread post by billgates198606 » 9 Dec 2013 3:01

predicates
usefunc(string word,function func{T1,T2})
clauses
run():-
readln(word )
readln(A,B)
usefunc(word,func{T1,T2})
word = update %means if word is update it will call update function
func(A,B) % IF word is delete mean it will call delete function

how do define usefunc(word,func{T1,T2}) 's predicates and its domains

User avatar
Thomas Linder Puls
VIP Member
Posts: 1174
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 11 Dec 2013 19:25

The question is the same and I still don't understand it.
Regards Thomas Linder Puls
PDC

Paul Cerkez
VIP Member
Posts: 94
Joined: 6 Mar 2000 0:01

Unread post by Paul Cerkez » 12 Dec 2013 12:49

If I understand what you are trying to do, I think you are making it harder then it is:

try something like this:

Code: Select all

predicates performAction(string, string)   clauses run():- readln(A,B), performAction(A,B).   performAction("Delete", B);-   [execute your code for delete] performAction("Update", B):-   [execute your code for update] performAction(A,B);-    [what ever other actions you want]
AI Rules!
P.

User avatar
Ferenc Nagy
VIP Member
Posts: 216
Joined: 24 Apr 2007 12:26

Look after these books

Unread post by Ferenc Nagy » 13 Dec 2013 12:47

http://www.amazon.com/Guide-Artificial- ... 1432749366

I have learnt much about Visual Prolog 5.2 from
Adamenko A.N., Kuchukov A.M. Logicheskoe programmirovanie i __Visual Prolog__ (BHV, 2003)(ISBN 5941571569)(ru)(600dpi)(T)(990s).
See many other books in
http://f3.tiera.ru/2/Cs_Computer%20scie ... es/Prolog/
TIA, Regards,
Frank Nagy

Post Reply