Jeff,
Producing all predicates, including those not dynamic, is not
possible. You will have to provide for defining all predicates as
dynamic.
However, for your application, it may be the case that you better use
a package for smodels, instead of a module. I guess that what you want
is to transform the original program so that when run it computes the
smodel. I assume this in what follows.
When you want a module to "be" smodel, you could write:
:- module(m,[list_of_exports],[smodel,...]).
In order for this to work smodel.pl has to be accesible in the library
path of Ciao. That package is then loaded at compile-time, so you can
define a compile-time expansion there that does the transformation
before the program is compiled.
One other possibility is to use an expansion to make all predicates
dynamic, so that "listing" works. The expansion will simply add a
declaration "dynamic" for every predicate.
Expansions are declared with the add_*_translation/2-3 family of
predicates. Have a look at the manual chapter "Extending the syntax".
Regards,
Paco
==============================================================================
Message: Address: Action:
help majordomo(a)clip.dia.fi.upm.es Info. on useful commands
subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list
unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list
<whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
-----------------------------------------------------------------------------
Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/
-----------------------------------------------------------------------------
Hi, I
:- use_module(library(listing)).
and when I do
:- listing.
I get even internal functions; how should I qualify my request
to get only the contents of my 'user' module (what I've loaded),
and, to have it show the bodies as well as the heads?
(Ciao does say 'yes' if I do
:- listing(some_specific_predicate).
)
But, what syntax should I use to list the user module?
Thanks,
Jeff Donner
==============================================================================
Message: Address: Action:
help majordomo(a)clip.dia.fi.upm.es Info. on useful commands
subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list
unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list
<whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
-----------------------------------------------------------------------------
Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/
-----------------------------------------------------------------------------
Hi, I
:- use_module(library(listing)).
and when I do
:- listing.
I get even internal functions; how should I qualify my request
to get only the contents of my 'user' module (what I've loaded),
and, to have it show the bodies as well as the heads?
(Ciao does say 'yes' if I do
:- listing(some_specific_predicate).
)
But, what syntax should I use to list the user module?
Thanks,
Jeff Donner
==============================================================================
Message: Address: Action:
help majordomo(a)clip.dia.fi.upm.es Info. on useful commands
subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list
unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list
<whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
-----------------------------------------------------------------------------
Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/
-----------------------------------------------------------------------------
Hi - I am embarking on writing a graphics based program using curl language
enviroment(www.curl.com). Right now this is an exercise for me to evaluate
the curl language for my own interest. In doing this, I would like to
transparently call ciao from the curl runtime enviroment and execute prolog
programs. What might be the best approach for this.
I am running curl on my laptop, and I will host ciao on the same laptop. I
am not accessing the network and I am in a single-user mode.
- what are the easiest (and most robust) ways to access ciao from curl?
Socket calls from curl OK?
- Curl supports XML/SOAP, HTTP and Sockets calls. Considering performance
(an important consideration), how should I format my calls from curl to
ciao.
- Is there a good XML parser in ciao. From the docs alone I am not getting a
clear answer. Some examples will really help.
If you can think of any other aspect that I need to consider in a problem
like this please mention that also. Any and all responses are most welcome.
Thanks, George
==============================================================================
Message: Address: Action:
help majordomo(a)clip.dia.fi.upm.es Info. on useful commands
subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list
unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list
<whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
-----------------------------------------------------------------------------
Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/
-----------------------------------------------------------------------------
Hi All, I would love to hear from anyone who used Ciao in any aspect of
enterprise application development, particularly in the industry.
Please tell us something about the application context, how you strategized
and sold the architectural benefits among the technology/product
stakeholders, how you conducted training, how the project turned out, etc.
This will help all of us think more clearly on how we can move forward with
Ciao in commercial scenarios.
Regards,
George
George Thomas
Architect
Cambridge, MA
==============================================================================
Message: Address: Action:
help majordomo(a)clip.dia.fi.upm.es Info. on useful commands
subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list
unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list
<whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
-----------------------------------------------------------------------------
Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/
-----------------------------------------------------------------------------
Hi ciao-ers,
does anyone know how to execute a command from within a CIAO session?
i want to start JADE from a ciao session using the command
"java jade.Boot -gui"
but i'm not sure how to though i'm told it can be done.
cheers,
doug.
==============================================================================
Message: Address: Action:
help majordomo(a)clip.dia.fi.upm.es Info. on useful commands
subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list
unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list
<whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
-----------------------------------------------------------------------------
Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/
-----------------------------------------------------------------------------
Hi All, I would love to hear from anyone who used Ciao in any aspect of
enterprise application development, particularly in the industry.
Please tell us something about the application context, how you strategized
and sold the architectural benefits among the technology/product
stakeholders, how you conducted training, how the project turned out, etc.
This will help all of us think more clearly on how we can move forward with
Ciao in commercial scenarios.
Regards,
George
George Thomas
Architect
Cambridge, MA
==============================================================================
Message: Address: Action:
help majordomo(a)clip.dia.fi.upm.es Info. on useful commands
subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list
unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list
<whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
-----------------------------------------------------------------------------
Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/
-----------------------------------------------------------------------------
Dear Bartek,
in fact, you are very right...
Some history first: the idea of 'exporting' syntactic extensions is
indeed the basic objective that we had from the start when designing
the concept of packages. Note that when you use a Ciao package (say,
functions) in a module the *effect* is exactly that: you get access to
some predicates that you can call, and you 'import' some operators,
expansions, etc. For example:
%% This is file package_m
:- include(exported_ops_m).
:- use_module(m).
%% end
If the package is then loaded as:
:- use_package(package_m).
(which is really just :- include(library(package_m)).) the net effect
is indeed that you 'import' the predicates exported by module_m, and
also 'import' the syntax extensions defined in exported_ops_m.
Now, the current implementation of packages (making explicit includes,
etc.) is just the simplest way to make it work with the basic pieces
of the current version of the module system.
However, we have been discussing for a while a more elegant user view
of the process, essentially along the lines of what you mention. The
idea is to simply hide away the details of the includes, etc.
In one possible user interface you would have a section of the module
which would contain exported syntax extensions (i.e., you would put
essentially the contents of exported_ops_m there). A simple way to do
this (due to Daniel Cabeza) is to say that anything that appears
before the :- module declaration in a module would be included into
the module that loads it. This would simplify the design of packages
by collapsing two of the three files that are typically used. (note
that you still would need a separate file for the expansions, the ones
that you load into the compiler with load_compilation_module). This
general solution is relatively easy to implement. We simply have not
had time to do it yet.
An alternative user interface is to have explicit new export
declarations for operators. But note that it is not just operators:
there are also expansions, multifiles, etc. So, in the end it is not
so clear that having new export declarations for these is really the
best solution.
Any comments (also from the rest of the user community) are welcome.
MH & the Ciao developers
--
-----------------------------------------------------------------------------
herme(a)fi.upm.es | Manuel Hermenegildo
+34-91-336-7435 (Work) | Facultad de Informatica, UPM
+34-91-352-4819 or 336-7412 (FAX) | Universidad Politecnica de Madrid
http://www.clip.dia.fi.upm.es/~herme | 28660-Boadilla del Monte, MADRID SPAIN
-----------------------------------------------------------------------------
==============================================================================
Message: Address: Action:
help majordomo(a)clip.dia.fi.upm.es Info. on useful commands
subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list
unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list
<whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
-----------------------------------------------------------------------------
Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/
-----------------------------------------------------------------------------
Thanks for the answer. I have read the paper that You have mentioned and I think
that there is something that You are missing.
I have used the Ciao prolog partially because I wanted to have a nice module
system (and i didn't have money for Sicstus :). The other reason was excellent
lpdoc system) but there is, in my opinion, something that could be done for the
support of operators in the module system.
You state in Your work that
"Syntax, flags, etc. should be local to modules" and as one of the reasons you
say that "it should be possible to use different syntactic ( such as operator
declarations or term expansions) in different modules without them interacting"
and I can totally agree with the reason but the outcome is not so sure for me. I
think It would be extremely useful (and much, much more elegant than
include()'ing the operator declarations) to have a possibility to "export"
operator declarations from the module the same way as you do it with predicates
(ie by declaring certain operators as a part of module interface). It would be a
clean and elegant solution allowing the programmer to have local operators that
would not interefere with other modules and some "exported" ones that would be
accessible for the users of the module. Actually you could introduce the common
syntax for any directive (not only operators ) that should be "exported".
I have to admit that I'm looking at the problem from a user (programmer)
perspective and I can understand that there are some reasons (ciao architecture,
or particular decisions made while implementing it) that make this idea hard or
even impossible to implement. Nevertheless I think it is worth discussion.
--
regards
Bartek Wilczyński
Quoting Manuel Hermenegildo <herme(a)clip.dia.fi.upm.es>:
> See my previous message: one smart way to do it is to put all the
> operators (and all other syntactic stuff like expansions, new
> declarations, etc.) in a separate file and ':- include' it in all
> files where you need that fucntionality (and in the top level).
>
> See the description of the concept of 'packages' in the manual
> (:- use_package) and, specially in the following document, which
> explains the philosophy behind the whole thing:
>
> @InProceedings{ciao-modules-cl2000,
> author = {D.~Cabeza and M.~Hermenegildo},
> title = {{A} {N}ew {M}odule {S}ystem for {P}rolog},
> booktitle = {International Conference on Computational Logic, CL2000},
==============================================================================
Message: Address: Action:
help majordomo(a)clip.dia.fi.upm.es Info. on useful commands
subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list
unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list
<whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
-----------------------------------------------------------------------------
Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/
-----------------------------------------------------------------------------
Hi,
I have an example from Bratko, Exercise 3.13. The problem is to
make operators of 'was', 'of', 'the' in such a way as to make:
diana was the secretary of the department.
correct prolog and then to be able to write things like:
?- Who was the secretary of the department.
and get:
Who = diana
etc.
This set of definitions doesn't work in ciao, but works in gprolog:
%% file: diana.pl
:- op(200, fy, the).
:- op(250, xfy, of).
:- op(300, yfx, was).
diana was the secretary of the department.
%% end diana.pl
betenoir ~/logic> ciao
Welcome to the Ciao Prolog Development System!
** WARNING **: your shell initialization scripts have not been
properly modified for locating the Ciao on-line documentation. Please
refer to the instructions in the file /usr/local/ciao/lib/ciao/NewUser.
Ciao-Prolog 1.8 #2: Sat Feb 8 22:26:15 MST 2003
?- [diana].
Note: [diana] is obsolete, use ensure_loaded(diana) instead
yes
?- Who was the secretary of the department.
{SYNTAX ERROR: (lns 6-6) operator expected after expression
Who
** here **
was the secretary of the department .
}
no
?-
-- end ciao
--gprolog session:
betenoir ~/logic> gprolog
GNU Prolog 1.2.16
By Daniel Diaz
Copyright (C) 1999-2002 Daniel Diaz
| ?- [diana].
compiling /home/jd/logic/diana.pl for byte code...
/home/jd/logic/diana.pl compiled, 5 lines read - 589 bytes written, 9 ms
yes
| ?- Who was the secretary of the department.
Who = diana
yes
| ?-
-- end gprolog
I saw an email by Daniel Cabeza Gras on Aug-13-02 but I don't think
that's relevant. Am I doing something wrong?
(I did :- use_module(library(operators)). also but it made no
difference)
Thanks for any info,
Jeff Donner
==============================================================================
Message: Address: Action:
help majordomo(a)clip.dia.fi.upm.es Info. on useful commands
subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list
unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list
<whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
-----------------------------------------------------------------------------
Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/
-----------------------------------------------------------------------------