Personal Organiser in Prolog 
Author Message
 Personal Organiser in Prolog

[Please note: I am NOT looking for other people's code for this]

I have been set an assignment to write a personal organiser as part of my uni
course finals. The organiser is to contain the usual sort of things, along the
lines of MS Scheduler - address book, appointment organiser, notes, and
whatever else I care to throw in. My problem is, I would like to do this in
Prolog (for the simple reason that Prolog is one of the few languages I don't
actively hate), but I have no idea if this is the sort of thing Prolog can do
or not. It is very much a GUI front to a database, and I'm wondering if I am
only going to make things impossible for myself if I persist in this
direction. Can anyone tell me if I'd be better off choosing a different
language, and if not, point me in the direction of a good beginner's book?

We use LPA Win-Prolog version 3.3 here, running on Win95.

Thanks in advance for any advice.

---
-- Wren



Fri, 09 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog

Quote:

> [Please note: I am NOT looking for other people's code for this]

> I have been set an assignment to write a personal organiser [....]
> but I have no idea if this is the sort of thing Prolog can do
> or not. It is very much a GUI front to a database, and I'm
> wondering if I am only going to make things impossible for myself
> if I persist in this direction.[....]

I haven't used LPA's product, but I'd expect the user interface to be
the hardest part -- in almost any language. Through the years, I've
found Prolog to be excellent for quick experiments and prototypes.

If you don't stumble using LPA's GUI API, you should be just fine using
their product, and using Prolog.

--


1801 California          (on assignment from Analysts International)
Suite 310
Denver, CO 80202
303-965-8473



Fri, 09 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog

Quote:

> [Please note: I am NOT looking for other people's code for this]

> I have been set an assignment to write a personal organiser as part of my uni
> course finals. The organiser is to contain the usual sort of things, along the
> lines of MS Scheduler - address book, appointment organiser, notes, and
> whatever else I care to throw in. My problem is, I would like to do this in
> Prolog (for the simple reason that Prolog is one of the few languages I don't
> actively hate), but I have no idea if this is the sort of thing Prolog can do
> or not. It is very much a GUI front to a database, and I'm wondering if I am
> only going to make things impossible for myself if I persist in this
> direction. Can anyone tell me if I'd be better off choosing a different
> language, and if not, point me in the direction of a good beginner's book?

> We use LPA Win-Prolog version 3.3 here, running on Win95.

> Thanks in advance for any advice.

> ---
> -- Wren

You can certainly use Prolog to write a personal organizer.  If it is an
appropriate language depends on what you want the organizer to _do_.  If
it's going to be "yet another SideKick clone" you can get the job done
with less effort (i.e. lines-of-code) using most any of the visual
database systems.  If you are going to _use_ the features of Prolog (for
example, including a natural language query system for information
searches) it will be easier to do the job in Prolog.  As you seem to
have a certain fondness for Prolog, why not use it and create something
unique?


Sat, 10 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog

Quote:

[snip]
> ... If you are going to _use_ the features of Prolog (for
> example, including a natural language query system for information
> searches) it will be easier to do the job in Prolog.  As you seem to
> have a certain fondness for Prolog, why not use it and create something
> unique?

Agreed - a wonderful achievement if you can do it. The world really
does need original ideas and new developments much more than it needs
more clones using clone UIs and offering clone functionality. However,
please also be aware that much of the idea of such a personal organiser
is based on ease of use - if yours is poor on this count it will almost
certainly be marked down (unfairly, I believe) relative to other
projects on that basis more than you will gain through original
functionality and innovation. Unless the markers are wise.

I have a tendancy away from natural language as I think there are
almost always easier ways of driving a UI; I prefer facilities like
partial or fuzzy matching ('a designer in South London specialising
in XXX'), matching on sounds-like rules ('name rhymes with fish'),
conceptual similarity (the name is a bird) and so on. Loads of fun
things to explore and potentially really useful - a sort of
associative/relational/conceptual model?

Have fun, and I wish you well...

Tim



Sat, 10 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog

Thanks to everyone who replied to my query. I'm still unsure on what to do,
though, because although all the messages were very helpful, a lot of you
seemed to assume that I actually knew how to program! I did a basic Prolog
beginners course two years ago and haven't touched it since. However, I'm
equally hopeless at every other language I've come across (C, C++, Ada, even
Pascal) so that factor shouldn't make any difference in the long run. It's
whether the project is feasible in Prolog that worries me.

Ho hum. Looks like I'll have to make my own decision on this one. I think I'll
go for it - at least I'll get some marks for trying something a bit different,
even if it doesn't work out too well.

Now, can anyone recommend a good beginner's textbook that covers LPA and
interfaces? [that I can get in Ireland, preferably]
---
-- Wren



Sat, 10 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog

Quote:

> [Please note: I am NOT looking for other people's code for this]

> I have been set an assignment to write a personal organiser as part of my uni
> course finals. The organiser is to contain the usual sort of things, along the
> lines of MS Scheduler - address book, appointment organiser, notes, and
> whatever else I care to throw in. My problem is, I would like to do this in
> Prolog (for the simple reason that Prolog is one of the few languages I don't
> actively hate), but I have no idea if this is the sort of thing Prolog can do
> or not. It is very much a GUI front to a database, and I'm wondering if I am
> only going to make things impossible for myself if I persist in this
> direction. Can anyone tell me if I'd be better off choosing a different
> language, and if not, point me in the direction of a good beginner's book?

> We use LPA Win-Prolog version 3.3 here, running on Win95.

> Thanks in advance for any advice.

> ---
> -- Wren

If you are aware of the underlying Windows technology, GUI programming
in LPA is just fun. You need this because some GUI aspects are not well
documented in LPA (note that I use LPA 3.1).

It took me just 4 days to port an old Turbo Prolog program with BGI
graphics (1600 lines) in LPA for windows with no previous knowledge
of LPA but with great Prolog experience. My previous knowledge of
the Object Windows Library of Borland C++ was valuable to understand
how LPA deals with the GUI in few hours.

Anyway, if you are happy with Prolog then you will have the time to
consentrate on the GUI.

Regards

Fotis Kokkoras



Sat, 10 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog

Quote:

> Now, can anyone recommend a good beginner's textbook that covers LPA and
> interfaces? [that I can get in Ireland, preferably]
> ---
> -- Wren

First of all you should refresh your Prolog knowledge. Then have a look
at the SHAPES demo of LPA. The source is included in the pack and the
manual of LPA related to "windows programming with LPA" coves this demo
in detail.

Good luck

Fotis Kokkoras

PS. I assume that you have access to the manuals  :-)



Sun, 11 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog



Quote:
>Thanks to everyone who replied to my query. I'm still unsure on what to do,
>though, because although all the messages were very helpful, a lot of you
>seemed to assume that I actually knew how to program! I did a basic Prolog
>beginners course two years ago and haven't touched it since. However, I'm
>equally hopeless at every other language I've come across (C, C++, Ada, even
>Pascal) so that factor shouldn't make any difference in the long run. It's
>whether the project is feasible in Prolog that worries me.

        I think your project is feasible in Prolog and you have all
the advantages of doing it in prolog:

                (1) If you don't know how to program, I think prolog
is a good language to start, much better than basic: Its much more
structured than basic.

                (2) You life will be much easier once you use prolog,
not only (but also) if you want to do Natural Language Processing
stuff, but any other stuff... So, I sort of disagree with Lou Witt and
Tim Derrick on this. You get List operations, data base querying,
memory allocation and much more for free!

                (3) You get a structured program.

                (4) If you use sicstus Prolog you get LOTS of
libraries and the possibility to run your code on UNIX and PCs.

        Despite this you'll also have some problems:

                (1) IF YOU DON'T USE THE RIGTH THECHNIQUES (namely
SOME cuts in your code), your program may be slow. Try getting the
book:
        "The Art of Prolog" by Sterling and Shapiro for help on this.

                (2) The GUI stuff is not natively in prolog. I've
never used LPA, so I don't know if this is really a problem in LPA or
not.  Although if you want to keep your code PORTABLE you can
try the tcl/tk on sicstus.

        AN ADVICE: Get your options, if you just want to do a GUI,
MAYBE Visual Basic is the answer (I never used the LPA *GUI* so I'm
not certain on this). But, if you want a PROGRAM, use prolog, and
DONT WORRY WITH the GUI: You can do a GREAT program using only text,
or even a better one using only THE PROLOG INTERPRETER.

                (3) Many people will say to you that prolog isn't the
right choice. Certify yourself that who is going to evaluate your work
isn't one of them ;-) .

Quote:
>Ho hum. Looks like I'll have to make my own decision on this one. I think I'll
>go for it - at least I'll get some marks for trying something a bit different,
>even if it doesn't work out too well.

        I believe you have made the right decision then! :) And, once
it is done, if it is well done, I think your code may be useful, if
you want to share it, please let me know when you finished it ;) !

Quote:

>Now, can anyone recommend a good beginner's textbook that covers LPA and
>interfaces? [that I can get in Ireland, preferably]

        Not me, but the art of prolog is a very good book on logic
programming and prolog.

Regards,
Miguel



Fri, 16 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog

Quote:

>First of all you should refresh your Prolog knowledge. Then have a look
>at the SHAPES demo of LPA. The source is included in the pack and the
>manual of LPA related to "windows programming with LPA" coves this demo
>in detail.

>Good luck

>Fotis Kokkoras

>PS. I assume that you have access to the manuals  :-)

Unfortunately, no. There are only 3 copies in the university library and they
are all either (a) not returned even though they are due back, or (b) reserved
from now till eternity by other people. My chances of getting my hands on a
copy before my project is due to be handed in are slim to non-existent.

Anyway, thanks to everyone who mailed me with helpful advice. I'll let you all
know how I get on if I ever get the project finished :)
---
-- Wren



Fri, 16 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog

Quote:
>>feasible in Prolog<<

I did not get the first part of this thread, but a personal organiser in
Prolog should be not only feasible, but easy.  No further decision-making
required.

Regards,

Greg Bourassa



Fri, 16 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog

... give me your address, and I'll get a copy of the GUI-related
manual to you.

clive spenser
marketing director
lpa ltd
studio 4, rvpb,                         http://www.lpa.co.uk
trinity road, london               fax: +44 (0) 181 874 0449
sw18 3sx, england                  tel: +44 (0) 181 871 2016



Sun, 18 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog

Just for anyone who is interested, I will certainly share my code with anyone
who wants it, if I ever get this organiser finished [and that's not really an
option, because I'll fail my degree if I fail the project]. I'm always
interested to see what other people have done, so I've got no objection to
sharing my bug collection to anyone who wants it! :)
---
-- Wren



Fri, 23 Jul 1999 03:00:00 GMT  
 Personal Organiser in Prolog

I must apologize, my prvious prime number program didn't work, i hope
anyone hasn't wasted time typing it in.
I now have access to a prolog program and am re-writing the program, the
reason im writing this now, is to encourage somone else to write it as
well,i.e. a prolog wizard!, i would just like to see a realy effiecient
soloution to the problem as i am not used to optimising stuyff..

regards,
Justin
.



Fri, 06 Aug 1999 03:00:00 GMT  
 Personal Organiser in Prolog

Quote:

> I must apologize, my prvious prime number program didn't work, ...

I attach an example which I hope you find helpful:

[ PRIMES.TXT 2K ]
I have a general approach to crypto-arithmetic puzzles based on simple
extensions to DCG. The problem statement is purely declarative, and the
solution code is expressed in DCG with substitute terminal semantics.

PUZZLES:  

%
% List of crypto-arithmetic puzzles to choose.
% Argument of each term is the domain in which to solve it.
% 0-9 by default.
% + [ ... ] means endless list.
[
fun,
money,
gerald,
goodnight,
ocean,
primes(+[2,3,5,7]),
schuh([0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9]),
xroads
].

PRIMES.CRY:     Puzzle statement!

  ***
   **
 ----
 ****
****
-----
*****

PRIMES.PRO:     Generated code.

:- dcg_terminal(draw).

:- noNonTerminals.

go :- solution(+ [2,3,5,7], X).

solution -->

[R5], [R12], evaluate(R5 * R12, PCarry12, R26), [R26],
evaluate(0 + R26 , SCarry2, R46), [R46],

[R4], evaluate(R4 * R12 + PCarry12, PCarry13, R25), [R25],
[R11], R11 > 0, evaluate(R5 * R11, PCarry23, R32), [R32],
evaluate(SCarry2 + R32 + R25 , SCarry3, R45), [R45],

[R3], R3 > 0, evaluate(R3 * R12 + PCarry13, R23, R24), [R24],
evaluate(R4 * R11 + PCarry23, PCarry24, R31), [R31],
evaluate(SCarry3 + R31 + R24 , SCarry4, R44), [R44],

[R23], R23 > 0, evaluate(R3 * R11 + PCarry24, R29, R30), [R30],
evaluate(SCarry4 + R30 + R23 , SCarry5, R43), [R43],

[R29], R29 > 0, evaluate(SCarry5 + R29 , 0, R42), [R42], R42 > 0,

displayGram(
        ['R42', 'R29', 'R43', 'R30', 'R23', 'R44', 'R31', 'R24', 'R3', 'R45', 'R32', 'R11', 'R25', 'R4', 'R46', 'R26', 'R12', 'R5'],
        [R42,R29,R43,R30,R23,R44,R31,R24,R3,R45,R32,R11,R25,R4,R46,R26,R12,R5]  ).

RUNTIME RECORD:

?- crypto(primes).
Generate solution code (primes.pro):
setup time:   2.0 seconds
Execute solution code:

  775
   33
-----    
 2325
2325
-----    
25575

time for all solutions:   2.0 seconds

yes
?-

This record is from a 50MHz machine running uncompiled code in AMZI! prolog.

To clarify the code:
'evaluate' applies 'is' to the first argument,  and returns carry in the
second argument and result in the third argument. It is not threaded
because the declaration 'noNonTerminals' says all routines are actions
as though in braces.
The internal representation of this problem is:

         R3  R4  R5
            R11 R12
------------------
    R23 R24 R25 R26
R29 R30 R31 R32
------------------
R42 R43 R44 R45 R46



Thu, 12 Aug 1999 03:00:00 GMT  
 
 [ 15 post ] 

 Relevant Pages 

1. Visual Prolog Personal Edition as freeware

2. The Visual Prolog Personal Edition can now be downloaded

3. Clipper Apps on a Psion Organiser ??

4. PDC prolog and prolog++ (object-prolog)

5. meeting others through personal ads (advertisement)

6. Witness Lee and the "Local Churches": A Personal Testimony

7. APL for SGI Personal Iris?

8. TRY A MORE PERSONAL AGENCY

9. Bug in Personal Money?

10. The Personal Money Tutorial

11. Trouble using vw5i.4 with Oracle 8i Personal Ed.

12. Personal TPF Download (Simulated S390/TPF System)

 

 
Powered by phpBB® Forum Software