users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prolog Syntax.


From: Diego Fernando Rodríguez Varón
Subject: Re: Prolog Syntax.
Date: Wed, 8 May 2002 09:21:26 -0500

Hi again.
 
The syntax I'm talking about is the language syntax grammar. I'm not sure how to define it but to give an idea here are some keywords: BNF, context free grammar, tokens, keywords, identifiers, constants, literals, operators, expressions and so on. The reason I would like to find a formal description is not to learn prolog... I have 2 books and some web tutorials, but to know how to WRITE in GNU-Prolog.
For example I used a variable named like "something+otherthing". The program compiled but did funny things. If you write "father (bob, joe)". It's a syntax error because of the space before the first parentheses and nowhere in the manual says that you can't put a space there. The same for comments... they are not described in the manual. Other example: all directives are documented in the manual, but not that they must start with ":-". See what I mean?
 
When I say this language rocks I mean that it is great. It's a completely new way to program. As a good C programmer, I thought that all languages should be the same... a mechanism to tell a computer HOW TO DO something, not WHAT TO DO like prolog.
 
Also this compiler rocks!
I appreciate a lot the efforts of Daniel Diaz to share this great product with the community. Thank you.
 
----- Original Message -----
Sent: Tuesday, May 07, 2002 3:34 PM
Subject: Prolog Syntax.

Hi everyone.
 
I'm new to logic programming and (obviously) GNU-Prolog.
 
After spending some hours trying to figure out how to make some little programs work (and finally succeeding) I have some questions.
 
1. Why can't I create a new axiom in the interactive window?
Ex.
  sunny_day.
  father(bob, susan).
 
2. I've checked the documentation entirely and there's no description of the GNU-Prolog syntax. How is anyone supposed to figure out how comments are, or what are the valid characters for an atom, variable or goal?
 
3. O.K. so I figured out that maybe the syntax was the same in the Prolog ISO Standard, but I've been trying to access the link in the manual (http://www.logic-programming.org/prolog_std.html) for several days and it just don't work. Does somebody knows why? (or where to find the standard?)
 
4. Does anyone knows of a tutorial or something alike that can help GNU-Prolog newbies?
 
5. This language rocks!
 
I'm using version 1.2.9 for win32.
 
Thanks.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]