Hi,
Is there anyway in PolyML to trace function calls?
Cheers,
--
Paulo J. Matos : pocm [_at_] mega . ist . utl . pt
Instituto Superior Tecnico - Lisbon
Computer and Software Eng. - A.I.
- > http://mega.ist.utl.pt/~pocm
---
-> God had a deadline...
So, he wrote it all in Lisp!
Hi,
While playing with polyml limits I executed the function squares from
Paulsons Book:
fun squares r =
let fun between (x, y) = (* all pair between x and y*)
let val diff = r - x*x
fun above y = (* all pairs above y*)
if y>x then []
else if y*y < diff then above (y + 1)
else if y*y = diff then (x, y) :: between(x-1, y+1)
else (*y*y > diff*) between(x-1, y)
in above y end;
val firstx = floor(Math.sqrt(real r))
in between(firstx, 0) end;
And then I executed and I got:
> squares 3092481270109283;
Warning - Increasing stack from 147456 to 294912 bytes
Warning - Increasing stack from 294912 to 589824 bytes
Warning - Increasing stack from 589824 to 1179648 bytes
Warning - Increasing stack from 1179648 to 2359296 bytes
Warning - Increasing stack from 2359296 to 4718592 bytes
Warning - Increasing stack from 4718592 to 9437184 bytes
Warning - Increasing stack from 9437184 to 18874368 bytes
Warning - Increasing stack from 18874368 to 37748736 bytes
Warning - Increasing stack from 37748736 to 67108860 bytes
Warning - Stack limit reached - interrupting process
Exception- Interrupt raised
I know it's a huge number, that was the idea. :D How can I increase the
stack limit?
Cheers,
--
Paulo J. Matos : pocm [_at_] mega . ist . utl . pt
Instituto Superior Tecnico - Lisbon
Computer and Software Eng. - A.I.
- > http://mega.ist.utl.pt/~pocm
---
-> God had a deadline...
So, he wrote it all in Lisp!
Hi,
I originally sent this post to the Isabelle theorem prover users'
mailing list. Larry Paulson suggested I forward it to the Poly ML
mailing list as well. In particular, does Poly ML support the ability
for C functions to call ML functions, like SML/NJ does?
Thanks!
-john
--
John Matthews Assistant Professor
johnm(a)cse.ogi.edu OGI School of Science & Engineering
(503) 748-1220 Oregon Health & Science University
http://cse.ogi.edu/~johnm Beaverton, OR USA
---------- Forwarded message ----------
Date: Thu, 18 Mar 2004 15:58:41 -0800 (PST)
From: John Matthews <johnm(a)cse.ogi.edu>
To: isabelle-users(a)cl.cam.ac.uk
Subject: Is Isabelle/PolyML reentrant?
Tom Harke and I are interested in modifying an external oracle
(verification tool) for Isabelle that is written in C. We would like
the oracle to call back to selected Isabelle tactics while it is
running, in order to deal with verification conditions that the
external oracle can't handle itself.
For this to work, the foreign function interface of the underlying SML
compiler needs to allow foreign functions to call SML functions. I've
found documentation for SML/NJ that indicates that this is possible,
but nothing in the Poly ML documentation says that this can be done.
Does this mean that I will be limited to running Isabelle on SML/NJ?
If so, is support for running Isabelle on SML/NJ going to continue, or
will future versions of Isabelle be limited to running only on Poly
ML?
Thanks,
-john
Hi all,
Is PolyML development dead? Is it safe to keep developing ML programs
dependent on PolyML compiler?
Cheers,
--
Paulo J. Matos : pocm [_at_] mega . ist . utl . pt
Instituto Superior Tecnico - Lisbon
Computer and Software Eng. - A.I.
- > http://mega.ist.utl.pt/~pocm
---
-> God had a deadline...
So, he wrote it all in Lisp!
Hi all,
I've created sample.c file with:
int difference (int x, int y) {
return x > y ? x - y: y - x;
}
Run gcc and ld:
pmatos@euler sml_c_scheme $ gcc -c sample.c -o sample.o
pmatos@euler sml_c_scheme $ ld -o sample.so sample.o
ld: warning: cannot find entry symbol _start; defaulting to
0000000008048094
pmatos@euler sml_c_scheme $
Created an sml file with:
fun get_sym lib sym = load_sym (load_lib lib) sym;
Ran poly and evaluated the file and I got:
Error: in '/tmp/sml6042nwv', line 1.
Value or constructor (load_sym) has not been declared
Found near load_sym(load_lib(lib))(sym)
Error: in '/tmp/sml6042nwv', line 1.
Value or constructor (load_lib) has not been declared
Found near load_sym(load_lib(lib))(sym)
Exception- Fail "Static errors (pass2)" raised
Do I need to import something? What's wrong?
Best regards,
A Merry Christmas and a Happy New Year,
--
Paulo J. Matos : pocm [_at_] mega . ist . utl . pt
Instituto Superior Tecnico - Lisbon
Computer and Software Eng. - A.I.
- > http://mega.ist.utl.pt/~pocm
---
-> God had a deadline...
So, he wrote it all in Lisp!
Hi all,
I'm trying to build PolyML from scratch so I got the basis, driver and
mlsource tarballs and unpacked driver, then unpacked basis and mlsource
into driver, did the symlink for CodeCons and in the drive dir I ran:
pmatos@euler driver $ ./poly ML_dbase < mlsource/BuildAll.sml
Poly/ML RTS version I386-4.1.3 (15:24:34 Dec 10 2003)
Copyright (c) 2002 CUTS and contributors.
Running with heap parameters (h=10240K,ib=2048K,ip=100%,mb=6144K,mp=20%)
Unable to open ML_dbase
Can anybody please explain me what's the problem?
I'm just trying to follow the instructions at:
http://www.polyml.org/download.html
Best regards,
--
Paulo J. Matos : pocm [_at_] mega . ist . utl . pt
Instituto Superior Tecnico - Lisbon
Computer and Software Eng. - A.I.
- > http://mega.ist.utl.pt/~pocm
---
-> God had a deadline...
So, he wrote it all in Lisp!
Hi all,
Where can I find printable documentation (PS, PDF, DVI) for the Poly/ML
compiler?
Best regards,
--
Paulo J. Matos : pocm [_at_] mega . ist . utl . pt
Instituto Superior Tecnico - Lisbon
Computer and Software Eng. - A.I.
- > http://mega.ist.utl.pt/~pocm
---
-> God had a deadline...
So, he wrote it all in Lisp!
Hi,
I'm writing an interface between a proprietary model checker and the
theorem prover Isabelle. For this, I need to parse some XML and I've
been carrying around a record with different data I need for this.
After trying to exend this record, I get
InternalError: addFieldToGeneric: Not a labelled record raised while
compiling
when trying to load my XML parser. Unfortunately, I'm somewhat
restrained when it comes to posting my code, but maybe someone can
help me locate the problem anyway.
The working version of the program had the functions
fun update_typs {typs,thy} typs' = {typs=typs',thy=thy }
fun update_thy {typs,thy} thy' = {typs=typs ,thy=thy'}
and the main function was just
fun import_file filename thy =
let
val body = body_of (parse_file filename)
val typs = Symtab.update_new(("t",Free("t",timeT)),Symtab.empty)
in
#thy (parse_itl body {typs=typs,thy=thy})
end
all code reachable from the function parse_itl only
accesses/manipulates the record through functions #thy, #typs,
update_typs, and update_thy, and this worked fine. I then needed an
extra field, and thefore extended the record:
fun update_typs {macs,typs,thy} typs' = {macs=macs,typs=typs',thy=thy }
fun update_thy {macs,typs,thy} thy' = {macs=macs,typs=typs ,thy=thy'}
fun import_file filename thy =
let
val body = body_of (parse_file filename)
val typs = Symtab.update_new(("t",Free("t",timeT)),Symtab.empty)
in
#thy (parse_itl body {macs=Symtab.empty,typs=typs,thy=thy})
end
with the rest of the program unchanged; This provokes the
aforementioned "internal error". I've tried to isolate the problem,
but so far without success. Any ideas?
Best,
- Sebastian
--
http://www.mangust.dk/skalberg/
The Motif document refers to a "PolyML for X Reference". Does it exist?
--
Wer Schoenheit angeschaut mit Augen, hat dem Tode schon Anheim gegeben.
Von Platen.
1. I wish to install Poly/ML 4.1.3 on Linux. Since we don't usually
install from RPMs, I first downloaded and unpacked the tar file of the
binary release. With the files in a single directory, ./polyml worked
fine:
$ ls -l
total 4152
-rwxr-xr-x 1 john staff 3653632 Sep 30 15:48 DB413Release
lrwxrwxrwx 1 john staff 12 Sep 30 15:48 ML_dbase ->
DB413Release
-rwxr-xr-x 1 john staff 586235 Sep 30 2002 poly
$ ./poly
Poly/ML RTS version I386-4.1.3 (13:57:33 Sep 30 2002)
Copyright (c) 2002 CUTS and contributors.
Running with heap parameters (h=10240K,ib=2048K,ip=100%,mb=6144K,mp=20%)
Mapping ./ML_dbase
Poly/ML 4.1.3 Release
>
but when I tried placing the DB413Release database file (and its
symbolic link ML_dbase) in a) /usr/local/lib/poly and b) /usr/lib/poly.
(Experiment shows me that the search path is:
.:/usr/local/lib/poly:/usr/lib/poly - it would be good if the web page
http://www.polyml.org/download.html mentioned this under "Tar-ed
archives".) I found that DB413Release had to be writeable (nothing to do
with where I put it, of course, just the file permissions I used):
$ ./poly
Poly/ML RTS version I386-4.1.3 (13:57:33 Sep 30 2002)
Copyright (c) 2002 CUTS and contributors.
Running with heap parameters (h=10240K,ib=2048K,ip=100%,mb=6144K,mp=20%)
WARNING:/usr/local/lib/poly/ML_dbase: Write permission denied.
WARNING:/usr/local/lib/poly/ML_dbase: Opened for reading only.
Mapping /usr/local/lib/poly/ML_dbase
Poly/ML 4.1.3 Release
>
Does this matter? If so, if the database must be generally writeable, I
think that this is rather unfortunate.
2. I'd really like to be able to put the database somewhere else. (We
have the convention of placing installations of application software in
version-specific sub-directories of /usr/local/pkg - e.g. PKG=
/usr/local/pkg/polyml-$VERSION/, and any library files in ./lib.) In
order to do this, I recompiled from source. One aspect of this wasn't
immediately obvious to me.
Perhaps the web page http://www.polyml.org/download.html should say "You
may alter the DEFAULT_POLYPATH assignment in driver/configure to
indicate where you will place the DB413Release file and the link
ML_dbase." before "To build the poly binary download the driver, unpack
it and then type:
cd driver; ./configure; make
Then, after "Then run
poly ML_dbase < mlsource/BuildAll.sml", add:
"Finally, copy DB413Release into the directory you have specified in the
driver/configure file and link DB413Release to ML_dbase. The poly(1)
command should locate it. There is no need to copy anything else from
the source." (If the last is true!)
3. There are no Unix manual pages for Poly/ML, either for the command or
for the library routines. I'd write some, but I think the developers
will know best what to write. The Linux manual page man(7) explains the
format best, I've found.
John A. Murdie
Department of Computer Science
University of York