pure-lang-svn Mailing List for Pure (Page 5)
Status: Beta
Brought to you by:
agraef
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
(141) |
Jun
(184) |
Jul
(97) |
Aug
(232) |
Sep
(196) |
Oct
|
Nov
|
Dec
|
---|
From: <ag...@us...> - 2008-09-16 18:36:48
|
Revision: 774 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=774&view=rev Author: agraef Date: 2008-09-16 18:36:59 +0000 (Tue, 16 Sep 2008) Log Message: ----------- Back out previous changes (r772). Modified Paths: -------------- pure/trunk/interpreter.cc Modified: pure/trunk/interpreter.cc =================================================================== --- pure/trunk/interpreter.cc 2008-09-16 18:29:16 UTC (rev 773) +++ pure/trunk/interpreter.cc 2008-09-16 18:36:59 UTC (rev 774) @@ -6105,13 +6105,8 @@ else { // typed variable, must match type tag against value if (!tagv) tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); - if (t.ttag == EXPR::MATRIX) { - Value *tagv1 = f.builder.CreateAnd(tagv, UInt(0xfffffff0)); - f.builder.CreateCondBr - (f.builder.CreateICmpEQ(tagv1, SInt(t.ttag)), matchedbb, failedbb); - } else - f.builder.CreateCondBr - (f.builder.CreateICmpEQ(tagv, SInt(t.ttag)), matchedbb, failedbb); + f.builder.CreateCondBr + (f.builder.CreateICmpEQ(tagv, SInt(t.ttag)), matchedbb, failedbb); } s = t.st; break; @@ -6479,10 +6474,6 @@ vtransbb.push_back (BasicBlock::Create(mklabel("trans.state", s->s, t->st->s))); sw->addCase(SInt(t->ttag), vtransbb[i]); - if (t->ttag == EXPR::MATRIX) { - sw->addCase(SInt(EXPR::CMATRIX), vtransbb[i]); - sw->addCase(SInt(EXPR::IMATRIX), vtransbb[i]); - } } // now handle the transitions on the different type tags for (t = t1, i = 0; t != s->tr.end() && t->tag == EXPR::VAR; t++, i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-16 17:30:16
|
Revision: 772 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=772&view=rev Author: agraef Date: 2008-09-16 17:30:27 +0000 (Tue, 16 Sep 2008) Log Message: ----------- Bugfixes. Modified Paths: -------------- pure/trunk/interpreter.cc Modified: pure/trunk/interpreter.cc =================================================================== --- pure/trunk/interpreter.cc 2008-09-16 12:45:29 UTC (rev 771) +++ pure/trunk/interpreter.cc 2008-09-16 17:30:27 UTC (rev 772) @@ -6096,8 +6096,13 @@ else { // typed variable, must match type tag against value if (!tagv) tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); - f.builder.CreateCondBr - (f.builder.CreateICmpEQ(tagv, SInt(t.ttag)), matchedbb, failedbb); + if (t.ttag == EXPR::MATRIX) { + Value *tagv1 = f.builder.CreateAnd(tagv, UInt(0xfffffff0)); + f.builder.CreateCondBr + (f.builder.CreateICmpEQ(tagv1, SInt(t.ttag)), matchedbb, failedbb); + } else + f.builder.CreateCondBr + (f.builder.CreateICmpEQ(tagv, SInt(t.ttag)), matchedbb, failedbb); } s = t.st; break; @@ -6465,6 +6470,10 @@ vtransbb.push_back (BasicBlock::Create(mklabel("trans.state", s->s, t->st->s))); sw->addCase(SInt(t->ttag), vtransbb[i]); + if (t->ttag == EXPR::MATRIX) { + sw->addCase(SInt(EXPR::CMATRIX), vtransbb[i]); + sw->addCase(SInt(EXPR::IMATRIX), vtransbb[i]); + } } // now handle the transitions on the different type tags for (t = t1, i = 0; t != s->tr.end() && t->tag == EXPR::VAR; t++, i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-16 12:45:19
|
Revision: 771 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=771&view=rev Author: agraef Date: 2008-09-16 12:45:29 +0000 (Tue, 16 Sep 2008) Log Message: ----------- Bugfixes. Modified Paths: -------------- pure/trunk/interpreter.cc pure/trunk/printer.cc pure/trunk/runtime.cc pure/trunk/runtime.h Modified: pure/trunk/interpreter.cc =================================================================== --- pure/trunk/interpreter.cc 2008-09-16 12:22:28 UTC (rev 770) +++ pure/trunk/interpreter.cc 2008-09-16 12:45:29 UTC (rev 771) @@ -870,8 +870,8 @@ return expr(EXPR::PTR, x->data.p); case EXPR::MATRIX: { #ifdef HAVE_GSL - if (x->data.mat && x->data.mat->p) { - gsl_matrix *m = (gsl_matrix*)x->data.mat->p; + if (x->data.mat.p) { + gsl_matrix *m = (gsl_matrix*)x->data.mat.p; exprll *xs = new exprll; for (size_t i = 0; i < m->size1; i++) { xs->push_back(exprl()); @@ -890,8 +890,8 @@ } case EXPR::IMATRIX: { #ifdef HAVE_GSL - if (x->data.mat && x->data.mat->p) { - gsl_matrix_int *m = (gsl_matrix_int*)x->data.mat->p; + if (x->data.mat.p) { + gsl_matrix_int *m = (gsl_matrix_int*)x->data.mat.p; exprll *xs = new exprll; for (size_t i = 0; i < m->size1; i++) { xs->push_back(exprl()); @@ -910,8 +910,8 @@ } case EXPR::CMATRIX: { #ifdef HAVE_GSL - if (x->data.mat && x->data.mat->p) { - gsl_matrix_complex *m = (gsl_matrix_complex*)x->data.mat->p; + if (x->data.mat.p) { + gsl_matrix_complex *m = (gsl_matrix_complex*)x->data.mat.p; exprll *xs = new exprll; for (size_t i = 0; i < m->size1; i++) { xs->push_back(exprl()); Modified: pure/trunk/printer.cc =================================================================== --- pure/trunk/printer.cc 2008-09-16 12:22:28 UTC (rev 770) +++ pure/trunk/printer.cc 2008-09-16 12:45:29 UTC (rev 771) @@ -759,8 +759,8 @@ a whole. */ case EXPR::MATRIX: os << "{"; - if (x->data.mat && x->data.mat->p) { - gsl_matrix *m = (gsl_matrix*)x->data.mat->p; + if (x->data.mat.p) { + gsl_matrix *m = (gsl_matrix*)x->data.mat.p; for (size_t i = 0; i < m->size1; i++) { if (i > 0) os << ";"; for (size_t j = 0; j < m->size2; j++) { @@ -772,8 +772,8 @@ return os << "}"; case EXPR::IMATRIX: os << "{"; - if (x->data.mat && x->data.mat->p) { - gsl_matrix_int *m = (gsl_matrix_int*)x->data.mat->p; + if (x->data.mat.p) { + gsl_matrix_int *m = (gsl_matrix_int*)x->data.mat.p; for (size_t i = 0; i < m->size1; i++) { if (i > 0) os << ";"; for (size_t j = 0; j < m->size2; j++) { @@ -785,8 +785,8 @@ return os << "}"; case EXPR::CMATRIX: os << "{"; - if (x->data.mat && x->data.mat->p) { - gsl_matrix_complex *m = (gsl_matrix_complex*)x->data.mat->p; + if (x->data.mat.p) { + gsl_matrix_complex *m = (gsl_matrix_complex*)x->data.mat.p; for (size_t i = 0; i < m->size1; i++) { if (i > 0) os << ";"; for (size_t j = 0; j < m->size2; j++) { Modified: pure/trunk/runtime.cc =================================================================== --- pure/trunk/runtime.cc 2008-09-16 12:22:28 UTC (rev 770) +++ pure/trunk/runtime.cc 2008-09-16 12:45:29 UTC (rev 771) @@ -272,26 +272,26 @@ static void pure_free_matrix(pure_expr *x) { - assert(x->data.mat && "pure_free_matrix: null data"); - assert(x->data.mat->refc > 0 && "pure_free_matrix: unreferenced data"); - assert(x->data.mat->p && "pure_free_matrix: corrupt data"); - bool owner = --x->data.mat->refc == 0; + if (!x->data.mat.p) return; + assert(x->data.mat.refc && "pure_free_matrix: corrupt data"); + assert(*x->data.mat.refc > 0 && "pure_free_matrix: unreferenced data"); + bool owner = --*x->data.mat.refc == 0; #ifdef HAVE_GSL switch (x->tag) { case EXPR::MATRIX: { - gsl_matrix *m = (gsl_matrix*)x->data.mat->p; + gsl_matrix *m = (gsl_matrix*)x->data.mat.p; m->owner = owner; gsl_matrix_free(m); break; } case EXPR::CMATRIX: { - gsl_matrix_complex *m = (gsl_matrix_complex*)x->data.mat->p; + gsl_matrix_complex *m = (gsl_matrix_complex*)x->data.mat.p; m->owner = owner; gsl_matrix_complex_free(m); break; } case EXPR::IMATRIX: { - gsl_matrix_int *m = (gsl_matrix_int*)x->data.mat->p; + gsl_matrix_int *m = (gsl_matrix_int*)x->data.mat.p; m->owner = owner; gsl_matrix_int_free(m); break; @@ -301,7 +301,7 @@ break; } #endif - if (owner) free(x->data.mat); + if (owner) free(x->data.mat.refc); } #if 1 @@ -339,7 +339,7 @@ case EXPR::MATRIX: case EXPR::CMATRIX: case EXPR::IMATRIX: - if (x->data.mat) pure_free_matrix(x); + pure_free_matrix(x); break; default: assert(x->tag >= 0); @@ -876,8 +876,8 @@ extern "C" bool pure_is_double_matrix(const pure_expr *x, const void **p) { - if (x->tag == EXPR::MATRIX && x->data.mat) { - *p = x->data.mat->p; + if (x->tag == EXPR::MATRIX) { + *p = x->data.mat.p; return true; } else return false; @@ -886,8 +886,8 @@ extern "C" bool pure_is_complex_matrix(const pure_expr *x, const void **p) { - if (x->tag == EXPR::CMATRIX && x->data.mat) { - *p = x->data.mat->p; + if (x->tag == EXPR::CMATRIX) { + *p = x->data.mat.p; return true; } else return false; @@ -896,8 +896,8 @@ extern "C" bool pure_is_int_matrix(const pure_expr *x, const void **p) { - if (x->tag == EXPR::IMATRIX && x->data.mat) { - *p = x->data.mat->p; + if (x->tag == EXPR::IMATRIX) { + *p = x->data.mat.p; return true; } else return false; Modified: pure/trunk/runtime.h =================================================================== --- pure/trunk/runtime.h 2008-09-16 12:22:28 UTC (rev 770) +++ pure/trunk/runtime.h 2008-09-16 12:45:29 UTC (rev 771) @@ -36,7 +36,7 @@ these. */ typedef struct { - uint32_t refc; // reference counter + uint32_t *refc; // reference counter void *p; // pointer to GSL matrix struct } pure_matrix; @@ -54,7 +54,7 @@ double d; // double (EXPR::DBL) char *s; // C string (EXPR::STR) void *p; // generic pointer (EXPR::PTR) - pure_matrix *mat; // matrix data (EXPR::MATRIX et al) + pure_matrix mat; // matrix data (EXPR::MATRIX et al) pure_closure *clos; // closure (0 if none) } data; /* Internal fields (DO NOT TOUCH). The JIT doesn't care about these. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-16 12:22:17
|
Revision: 770 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=770&view=rev Author: agraef Date: 2008-09-16 12:22:28 +0000 (Tue, 16 Sep 2008) Log Message: ----------- Bugfixes. Modified Paths: -------------- pure/trunk/runtime.cc Modified: pure/trunk/runtime.cc =================================================================== --- pure/trunk/runtime.cc 2008-09-16 12:07:48 UTC (rev 769) +++ pure/trunk/runtime.cc 2008-09-16 12:22:28 UTC (rev 770) @@ -272,36 +272,36 @@ static void pure_free_matrix(pure_expr *x) { -#ifdef HAVE_GSL assert(x->data.mat && "pure_free_matrix: null data"); assert(x->data.mat->refc > 0 && "pure_free_matrix: unreferenced data"); assert(x->data.mat->p && "pure_free_matrix: corrupt data"); - if (--x->data.mat->refc == 0) { - switch (x->tag) { - case EXPR::MATRIX: { - gsl_matrix *m = (gsl_matrix*)x->data.mat->p; - m->owner = 1; - gsl_matrix_free(m); - break; - } - case EXPR::CMATRIX: { - gsl_matrix_complex *m = (gsl_matrix_complex*)x->data.mat->p; - m->owner = 1; - gsl_matrix_complex_free(m); - break; - } - case EXPR::IMATRIX: { - gsl_matrix_int *m = (gsl_matrix_int*)x->data.mat->p; - m->owner = 1; - gsl_matrix_int_free(m); - break; - } - default: - assert(0 && "pure_free_matrix: corrupt data"); - break; - } + bool owner = --x->data.mat->refc == 0; +#ifdef HAVE_GSL + switch (x->tag) { + case EXPR::MATRIX: { + gsl_matrix *m = (gsl_matrix*)x->data.mat->p; + m->owner = owner; + gsl_matrix_free(m); + break; } + case EXPR::CMATRIX: { + gsl_matrix_complex *m = (gsl_matrix_complex*)x->data.mat->p; + m->owner = owner; + gsl_matrix_complex_free(m); + break; + } + case EXPR::IMATRIX: { + gsl_matrix_int *m = (gsl_matrix_int*)x->data.mat->p; + m->owner = owner; + gsl_matrix_int_free(m); + break; + } + default: + assert(0 && "pure_free_matrix: corrupt data"); + break; + } #endif + if (owner) free(x->data.mat); } #if 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-16 12:07:39
|
Revision: 769 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=769&view=rev Author: agraef Date: 2008-09-16 12:07:48 +0000 (Tue, 16 Sep 2008) Log Message: ----------- Add basic GSL matrix infrastructure (not quite finished yet). Modified Paths: -------------- pure/trunk/expr.cc pure/trunk/expr.hh pure/trunk/interpreter.cc pure/trunk/interpreter.hh pure/trunk/lib/prelude.pure pure/trunk/printer.cc pure/trunk/runtime.cc pure/trunk/runtime.h pure/trunk/symtable.cc pure/trunk/symtable.hh Modified: pure/trunk/expr.cc =================================================================== --- pure/trunk/expr.cc 2008-09-16 07:35:33 UTC (rev 768) +++ pure/trunk/expr.cc 2008-09-16 12:07:48 UTC (rev 769) @@ -29,6 +29,9 @@ if (data.x[1]) data.x[1]->del(); if (data.x[2]) data.x[2]->del(); break; + case MATRIX: + if (data.xs) delete data.xs; + break; case CASE: if (data.c.x) data.c.x->del(); if (data.c.r) delete data.c.r; Modified: pure/trunk/expr.hh =================================================================== --- pure/trunk/expr.hh 2008-09-16 07:35:33 UTC (rev 768) +++ pure/trunk/expr.hh 2008-09-16 12:07:48 UTC (rev 769) @@ -72,6 +72,21 @@ size_t len() const { return size; } }; +/* Smart expression pointers (see below for the full definition). These are + used recursively as components in matrix representations and rule lists in + the expression data structure. */ + +class expr; + +/* Expression lists and lists of those. These are used to represent + collections of expressions and generic matrix data in a structured way + which facilitates code generation. In the case of exprll, each list member + represents a matrix "row" which is in turn described by a list of + "columns". */ + +typedef list<expr> exprl; +typedef list<exprl> exprll; + /* Rule lists are used to encode collections of equations and other rule sets in 'case' expressions and the like. See the definition of the rule struct at the end of this header. */ @@ -113,6 +128,16 @@ CASE = -10, // case expression WHEN = -11, // when expression WITH = -12, // with expression + // GSL matrix types: + MATRIX = -32, // generic GSL matrix, double matrix in runtime exprs + CMATRIX = -31, // complex matrix in runtime exprs + IMATRIX = -30, // integer matrix in runtime exprs + /* Other values in the range -17..-29 reserved for later use in the + runtime expression data structure. Note that all GSL-related tags, + taken as an unsigned binary quantity, are of the form 0xffffffe0+t, + where the least significant nibble t=0x0..0xf denotes corresponding + subtypes in runtime matrix data. For compile time expressions only the + EXPR::MATRIX tag (t=0) is used. */ }; // special flag values used during compilation: @@ -137,6 +162,7 @@ uint8_t idx; // de Bruin index } v; EXPR *x[3]; // APP, LAMBDA, COND + exprll *xs; // MATRIX struct { // CASE, WHEN, WITH EXPR *x; // expression union { @@ -204,6 +230,9 @@ refc(0), tag(_tag), m(0), flags(0), ttag(0), astag(0), aspath(0) { assert(_tag == WITH); data.c.x = newref(_arg); data.c.e = _e; } + EXPR(int32_t _tag, exprll *_args) : + refc(0), tag(_tag), m(0), flags(0), ttag(0), astag(0), aspath(0) + { assert(_tag == MATRIX); data.xs = _args; } EXPR(EXPR *_fun, EXPR *_arg) : refc(0), tag(APP), m(0), flags(0), ttag(0), astag(0), aspath(0) { data.x[0] = newref(_fun); data.x[1] = newref(_arg); } @@ -222,9 +251,6 @@ /* Smart expression pointers. These take care of reference counting automagically. */ -class expr; -typedef list<expr> exprl; - class expr { EXPR* p; // debug helper @@ -278,6 +304,8 @@ p(new EXPR(tag, &*arg, rules)) { p->incref(); } expr(int32_t tag, expr arg, env *e) : p(new EXPR(tag, &*arg, e)) { p->incref(); } + expr(int32_t tag, exprll *args) : + p(new EXPR(tag, args)) { p->incref(); } expr(expr fun, expr arg) : p(new EXPR(&*fun, &*arg)) { p->incref(); } expr(expr fun, expr arg1, expr arg2) : @@ -337,6 +365,8 @@ p->tag == EXPR::WHEN || p->tag == EXPR::WITH); return expr(p->data.c.x); } + exprll *xvals() const { assert(p->tag == EXPR::MATRIX); + return p->data.xs; } rulel *rules() const { assert(p->tag == EXPR::CASE || p->tag == EXPR::WHEN); return p->data.c.r; } Modified: pure/trunk/interpreter.cc =================================================================== --- pure/trunk/interpreter.cc 2008-09-16 07:35:33 UTC (rev 768) +++ pure/trunk/interpreter.cc 2008-09-16 12:07:48 UTC (rev 769) @@ -16,6 +16,7 @@ #ifdef HAVE_GSL #include <gsl/gsl_version.h> +#include <gsl/gsl_matrix.h> #endif uint8_t interpreter::g_verbose = 0; @@ -246,6 +247,11 @@ declare_extern((void*)pure_apply, "pure_apply", "expr*", 2, "expr*", "expr*"); + declare_extern((void*)pure_matrix_rows, + "pure_matrix_rows", "expr*", -1, "int"); + declare_extern((void*)pure_matrix_columns, + "pure_matrix_columns", "expr*", -1, "int"); + declare_extern((void*)pure_listl, "pure_listl", "expr*", -1, "int"); declare_extern((void*)pure_tuplel, @@ -862,6 +868,68 @@ // Only null pointer constants permitted right now. throw err("pointer must be null in constant definition"); return expr(EXPR::PTR, x->data.p); + case EXPR::MATRIX: { +#ifdef HAVE_GSL + if (x->data.mat && x->data.mat->p) { + gsl_matrix *m = (gsl_matrix*)x->data.mat->p; + exprll *xs = new exprll; + for (size_t i = 0; i < m->size1; i++) { + xs->push_back(exprl()); + exprl& ys = xs->back(); + for (size_t j = 0; j < m->size2; j++) { + ys.push_back(expr(EXPR::DBL, m->data[i * m->tda + j])); + } + } + return expr(EXPR::MATRIX, m); + } else + return expr(EXPR::MATRIX, new exprll); +#else + throw err("GSL matrices not supported in this implementation"); + return expr(EXPR::MATRIX, new exprll); +#endif + } + case EXPR::IMATRIX: { +#ifdef HAVE_GSL + if (x->data.mat && x->data.mat->p) { + gsl_matrix_int *m = (gsl_matrix_int*)x->data.mat->p; + exprll *xs = new exprll; + for (size_t i = 0; i < m->size1; i++) { + xs->push_back(exprl()); + exprl& ys = xs->back(); + for (size_t j = 0; j < m->size2; j++) { + ys.push_back(expr(EXPR::INT, m->data[i * m->tda + j])); + } + } + return expr(EXPR::MATRIX, m); + } else + return expr(EXPR::MATRIX, new exprll); +#else + throw err("GSL matrices not supported in this implementation"); + return expr(EXPR::MATRIX, new exprll); +#endif + } + case EXPR::CMATRIX: { +#ifdef HAVE_GSL + if (x->data.mat && x->data.mat->p) { + gsl_matrix_complex *m = (gsl_matrix_complex*)x->data.mat->p; + exprll *xs = new exprll; + for (size_t i = 0; i < m->size1; i++) { + xs->push_back(exprl()); + exprl& ys = xs->back(); + for (size_t j = 0; j < m->size2; j++) { + expr u = expr(EXPR::DBL, m->data[2*(i * m->tda + j)]); + expr v = expr(EXPR::DBL, m->data[2*(i * m->tda + j) + 1]); + ys.push_back(expr(symtab.complex_rect_sym().x, u, v)); + } + } + return expr(EXPR::MATRIX, m); + } else + return expr(EXPR::MATRIX, new exprll); +#else + throw err("GSL matrices not supported in this implementation"); + return expr(EXPR::MATRIX, new exprll); +#endif + } default: assert(x->tag > 0); if (x->data.clos && x->data.clos->local) @@ -1126,6 +1194,14 @@ { if (x.is_null()) return; switch (x.tag()) { + case EXPR::MATRIX: + for (exprll::iterator xs = x.xvals()->begin(), end = x.xvals()->end(); + xs != end; xs++) + for (exprl::iterator ys = xs->begin(), end = xs->end(); + ys != end; ys++) { + compile(*ys); + } + break; case EXPR::APP: compile(x.xval1()); compile(x.xval2()); @@ -1578,6 +1654,9 @@ break; } // these must not occur on the lhs: + case EXPR::MATRIX: + throw err("matrix expression not permitted in pattern"); + break; case EXPR::LAMBDA: throw err("lambda expression not permitted in pattern"); break; @@ -1717,6 +1796,20 @@ case EXPR::STR: case EXPR::PTR: return x; + // matrix: + case EXPR::MATRIX: { + exprll *us = new exprll; + for (exprll::iterator xs = x.xvals()->begin(), end = x.xvals()->end(); + xs != end; xs++) { + us->push_back(exprl()); + exprl& vs = us->back(); + for (exprl::iterator ys = xs->begin(), end = xs->end(); + ys != end; ys++) { + vs.push_back(subst(vars, *ys, idx)); + } + } + return expr(EXPR::MATRIX, us); + } // application: case EXPR::APP: if (x.xval1().tag() == symtab.amp_sym().f) { @@ -1827,6 +1920,20 @@ case EXPR::STR: case EXPR::PTR: return x; + // matrix: + case EXPR::MATRIX: { + exprll *us = new exprll; + for (exprll::iterator xs = x.xvals()->begin(), end = x.xvals()->end(); + xs != end; xs++) { + us->push_back(exprl()); + exprl& vs = us->back(); + for (exprl::iterator ys = xs->begin(), end = xs->end(); + ys != end; ys++) { + vs.push_back(fsubst(funs, *ys, idx)); + } + } + return expr(EXPR::MATRIX, us); + } // application: case EXPR::APP: if (x.xval1().tag() == symtab.amp_sym().f) { @@ -1929,6 +2036,20 @@ case EXPR::STR: case EXPR::PTR: return x; + // matrix: + case EXPR::MATRIX: { + exprll *us = new exprll; + for (exprll::iterator xs = x.xvals()->begin(), end = x.xvals()->end(); + xs != end; xs++) { + us->push_back(exprl()); + exprl& vs = us->back(); + for (exprl::iterator ys = xs->begin(), end = xs->end(); + ys != end; ys++) { + vs.push_back(csubst(*ys)); + } + } + return expr(EXPR::MATRIX, us); + } // application: case EXPR::APP: if (x.xval1().tag() == symtab.amp_sym().f) { @@ -2044,6 +2165,20 @@ case EXPR::STR: case EXPR::PTR: return x; + // matrix: + case EXPR::MATRIX: { + exprll *us = new exprll; + for (exprll::iterator xs = x.xvals()->begin(), end = x.xvals()->end(); + xs != end; xs++) { + us->push_back(exprl()); + exprl& vs = us->back(); + for (exprl::iterator ys = xs->begin(), end = xs->end(); + ys != end; ys++) { + vs.push_back(macsubst(*ys)); + } + } + return expr(EXPR::MATRIX, us); + } // application: case EXPR::APP: { expr u = macsubst(x.xval1()), @@ -2132,6 +2267,20 @@ case EXPR::STR: case EXPR::PTR: return x; + // matrix: + case EXPR::MATRIX: { + exprll *us = new exprll; + for (exprll::iterator xs = x.xvals()->begin(), end = x.xvals()->end(); + xs != end; xs++) { + us->push_back(exprl()); + exprl& vs = us->back(); + for (exprl::iterator ys = xs->begin(), end = xs->end(); + ys != end; ys++) { + vs.push_back(varsubst(*ys, offs)); + } + } + return expr(EXPR::MATRIX, us); + } // application: case EXPR::APP: { expr u = varsubst(x.xval1(), offs), @@ -2226,6 +2375,20 @@ return v; } else return y; + // matrix: + case EXPR::MATRIX: { + exprll *us = new exprll; + for (exprll::iterator xs = y.xvals()->begin(), end = y.xvals()->end(); + xs != end; xs++) { + us->push_back(exprl()); + exprl& vs = us->back(); + for (exprl::iterator ys = xs->begin(), end = xs->end(); + ys != end; ys++) { + vs.push_back(macred(x, *ys, idx)); + } + } + return expr(EXPR::MATRIX, us); + } // application: case EXPR::APP: if (y.xval1().tag() == symtab.amp_sym().f) { @@ -3034,6 +3197,14 @@ } } break; + case EXPR::MATRIX: + for (exprll::iterator xs = x.xvals()->begin(), end = x.xvals()->end(); + xs != end; xs++) + for (exprl::iterator ys = xs->begin(), end = xs->end(); + ys != end; ys++) { + build_map(*ys); + } + break; case EXPR::APP: { expr f; uint32_t n = count_args(x, f); interpreter& interp = *interpreter::g_interp; @@ -3919,6 +4090,8 @@ return pure_string_dup(x.sval()); case EXPR::PTR: return pure_pointer(x.pval()); + case EXPR::MATRIX: + return const_matrix_value(x); case EXPR::APP: return const_app_value(x); default: { @@ -3959,6 +4132,36 @@ } } +pure_expr *interpreter::const_matrix_value(expr x) +{ + size_t n = x.xvals()->size(), m = 0, i = 0, j = 0; + pure_expr **us = new pure_expr*[n], **vs = 0, *ret; + assert(us); + for (exprll::iterator xs = x.xvals()->begin(), end = x.xvals()->end(); + xs != end; xs++, i++) { + m = xs->size(); j = 0; vs = new pure_expr*[m]; + assert(vs); + for (exprl::iterator ys = xs->begin(), end = xs->end(); + ys != end; ys++, j++) { + vs[j] = const_value(*ys); + if (!vs[j]) goto err; + } + us[i] = pure_matrix_columnsv(m, vs); + if (!us[i]) goto err; + delete[] vs; + } + ret = pure_matrix_rowsv(n, us); + delete[] us; + return ret; + err: + // bail out + for (size_t k = 0; k < j; k++) pure_freenew(vs[k]); + if (vs) delete[] vs; + for (size_t k = 0; k < i; k++) pure_freenew(us[k]); + if (us) delete[] us; + return 0; +} + pure_expr *interpreter::const_app_value(expr x) { if (x.tag() == EXPR::APP) { @@ -4802,6 +5005,25 @@ // FIXME: Only null pointers are supported right now. assert(x.pval() == 0); return pbox(x.pval()); + // matrix: + case EXPR::MATRIX: { + size_t n = x.xvals()->size(), i = 1; + vector<Value*> us(n+1); + us[0] = UInt(n); + for (exprll::iterator xs = x.xvals()->begin(), end = x.xvals()->end(); + xs != end; xs++, i++) { + size_t m = xs->size(), j = 1; + vector<Value*> vs(m+1); + vs[0] = UInt(m); + for (exprl::iterator ys = xs->begin(), end = xs->end(); + ys != end; ys++, j++) { + vs[j] = codegen(*ys); + } + us[i] = + act_env().CreateCall(module->getFunction("pure_matrix_columns"), vs); + } + return act_env().CreateCall(module->getFunction("pure_matrix_rows"), us); + } // application: case EXPR::APP: if (x.ttag() != 0) { @@ -5928,6 +6150,9 @@ case EXPR::PTR: assert(0 && "not implemented"); break; + case EXPR::MATRIX: + assert(0 && "not implemented"); + break; case EXPR::APP: { // first match the tag... BasicBlock *ok1bb = BasicBlock::Create("arg1"); Modified: pure/trunk/interpreter.hh =================================================================== --- pure/trunk/interpreter.hh 2008-09-16 07:35:33 UTC (rev 768) +++ pure/trunk/interpreter.hh 2008-09-16 12:07:48 UTC (rev 769) @@ -520,6 +520,7 @@ Env& act_env() { assert(!envstk.empty()); return *envstk.front(); } Builder& act_builder() { return act_env().builder; } pure_expr *const_value(expr x); + pure_expr *const_matrix_value(expr x); pure_expr *const_app_value(expr x); expr pure_expr_to_expr(pure_expr *x); pure_expr *doeval(expr x, pure_expr*& e); Modified: pure/trunk/lib/prelude.pure =================================================================== --- pure/trunk/lib/prelude.pure 2008-09-16 07:35:33 UTC (rev 768) +++ pure/trunk/lib/prelude.pure 2008-09-16 12:07:48 UTC (rev 769) @@ -27,6 +27,8 @@ nullary failed_cond; // failed conditional (guard, if-then-else) nullary failed_match; // failed pattern match (lambda, case, etc.) nullary stack_fault; // not enough stack space (PURE_STACK limit) +nullary not_implemented; // operation not implemented +// bad_matrix_value x; // error in matrix construction /* Other exceptions defined by the prelude. */ Modified: pure/trunk/printer.cc =================================================================== --- pure/trunk/printer.cc 2008-09-16 07:35:33 UTC (rev 768) +++ pure/trunk/printer.cc 2008-09-16 12:07:48 UTC (rev 769) @@ -6,6 +6,12 @@ #include <sstream> +#include "config.h" + +#ifdef HAVE_GSL +#include <gsl/gsl_matrix.h> +#endif + static inline const string& pname(int32_t f) { assert(f > 0); @@ -60,6 +66,7 @@ case EXPR::VAR: case EXPR::STR: case EXPR::PTR: + case EXPR::MATRIX: return 100; case EXPR::FVAR: return sym_nprec(x.vtag()); @@ -160,6 +167,8 @@ return os << "::double"; case EXPR::STR: return os << "::string"; + case EXPR::MATRIX: + return os << "::matrix"; default: return os; } @@ -246,6 +255,30 @@ } case EXPR::PTR: return os << "#<pointer " << x.pval() << ">"; + case EXPR::MATRIX: { + os << "{"; + for (exprll::const_iterator xs = x.xvals()->begin(), + end = x.xvals()->end(); xs != end; ) { + size_t n = xs->size(); + if (n>1 || n==1 && xs->front().is_pair()) { + // matrix elements at a precedence not larger than ',' have to be + // parenthesized + prec_t p = sym_nprec(interpreter::g_interp->symtab.pair_sym().f) + 1; + for (exprl::const_iterator it = xs->begin(), end = xs->end(); + it != end; ) { + os << paren(p, *it, pat); + if (++it != end) os << ","; + } + } else + for (exprl::const_iterator it = xs->begin(), end = xs->end(); + it != end; ) { + printx(os, *it, pat); + if (++it != end) os << ","; + } + if (++xs != end) os << ";"; + } + return os << "}"; + } case EXPR::APP: { expr u, v, w, y; exprl xs; @@ -565,6 +598,9 @@ switch (x->tag) { case EXPR::STR: case EXPR::PTR: + case EXPR::MATRIX: + case EXPR::CMATRIX: + case EXPR::IMATRIX: return 100; case EXPR::INT: if (x->data.i < 0) @@ -718,6 +754,54 @@ } case EXPR::PTR: return os << "#<pointer " << x->data.p << ">"; + /* NOTE: For performance reasons, we don't do any custom representations for + matrix elements. As a workaround, you can define __show__ on matrices as + a whole. */ + case EXPR::MATRIX: + os << "{"; + if (x->data.mat && x->data.mat->p) { + gsl_matrix *m = (gsl_matrix*)x->data.mat->p; + for (size_t i = 0; i < m->size1; i++) { + if (i > 0) os << ";"; + for (size_t j = 0; j < m->size2; j++) { + if (j > 0) os << ","; + os << m->data[i * m->tda + j]; + } + } + } + return os << "}"; + case EXPR::IMATRIX: + os << "{"; + if (x->data.mat && x->data.mat->p) { + gsl_matrix_int *m = (gsl_matrix_int*)x->data.mat->p; + for (size_t i = 0; i < m->size1; i++) { + if (i > 0) os << ";"; + for (size_t j = 0; j < m->size2; j++) { + if (j > 0) os << ","; + os << m->data[i * m->tda + j]; + } + } + } + return os << "}"; + case EXPR::CMATRIX: + os << "{"; + if (x->data.mat && x->data.mat->p) { + gsl_matrix_complex *m = (gsl_matrix_complex*)x->data.mat->p; + for (size_t i = 0; i < m->size1; i++) { + if (i > 0) os << ";"; + for (size_t j = 0; j < m->size2; j++) { + if (j > 0) os << ","; + /* GSL represents complex matrices using pairs of double values. + FIXME: We take a shortcut here by just printing complex numbers + in rectangular format using the +: operator defined in math.pure. + This has to be adapted when the representation in math.pure + changes. */ + os << m->data[2*(i * m->tda + j)] << "+:" + << m->data[2*(i * m->tda + j) + 1]; + } + } + } + return os << "}"; case EXPR::APP: { list<const pure_expr*> xs; prec_t p; Modified: pure/trunk/runtime.cc =================================================================== --- pure/trunk/runtime.cc 2008-09-16 07:35:33 UTC (rev 768) +++ pure/trunk/runtime.cc 2008-09-16 12:07:48 UTC (rev 769) @@ -36,6 +36,7 @@ #ifdef HAVE_GSL #include <gsl/gsl_errno.h> +#include <gsl/gsl_matrix.h> #endif // Hooks to report stack overflows and other kinds of hard errors. @@ -127,6 +128,12 @@ return pure_const(interpreter::g_interp->symtab.segfault_sym().f); } +static inline pure_expr* not_implemented_exception() +{ + if (!interpreter::g_interp) return 0; + return pure_const(interpreter::g_interp->symtab.not_implemented_sym().f); +} + static inline pure_expr *get_sentry(pure_expr *x) { if (x==0) @@ -263,6 +270,40 @@ return ret; } +static void pure_free_matrix(pure_expr *x) +{ +#ifdef HAVE_GSL + assert(x->data.mat && "pure_free_matrix: null data"); + assert(x->data.mat->refc > 0 && "pure_free_matrix: unreferenced data"); + assert(x->data.mat->p && "pure_free_matrix: corrupt data"); + if (--x->data.mat->refc == 0) { + switch (x->tag) { + case EXPR::MATRIX: { + gsl_matrix *m = (gsl_matrix*)x->data.mat->p; + m->owner = 1; + gsl_matrix_free(m); + break; + } + case EXPR::CMATRIX: { + gsl_matrix_complex *m = (gsl_matrix_complex*)x->data.mat->p; + m->owner = 1; + gsl_matrix_complex_free(m); + break; + } + case EXPR::IMATRIX: { + gsl_matrix_int *m = (gsl_matrix_int*)x->data.mat->p; + m->owner = 1; + gsl_matrix_int_free(m); + break; + } + default: + assert(0 && "pure_free_matrix: corrupt data"); + break; + } + } +#endif +} + #if 1 /* This is implemented (mostly) non-recursively to prevent stack overflows, @@ -286,6 +327,7 @@ goto loop; case EXPR::INT: case EXPR::DBL: + case EXPR::PTR: // nothing to do break; case EXPR::BIGINT: @@ -294,8 +336,10 @@ case EXPR::STR: free(x->data.s); break; - case EXPR::PTR: - // noop right now, should provide installable hook in the future + case EXPR::MATRIX: + case EXPR::CMATRIX: + case EXPR::IMATRIX: + if (x->data.mat) pure_free_matrix(x); break; default: assert(x->tag >= 0); @@ -542,6 +586,110 @@ } extern "C" +pure_expr *pure_double_matrix(void *p) +{ +#ifdef HAVE_GSL + return 0; // XXXTODO +#else + return 0; +#endif +} + +extern "C" +pure_expr *pure_complex_matrix(void *p) +{ +#ifdef HAVE_GSL + return 0; // XXXTODO +#else + return 0; +#endif +} + +extern "C" +pure_expr *pure_int_matrix(void *p) +{ +#ifdef HAVE_GSL + return 0; // XXXTODO +#else + return 0; +#endif +} + +extern "C" +pure_expr *pure_double_matrix_dup(const void *p) +{ +#ifdef HAVE_GSL + return 0; // XXXTODO +#else + return 0; +#endif +} + +extern "C" +pure_expr *pure_complex_matrix_dup(const void *p) +{ +#ifdef HAVE_GSL + return 0; // XXXTODO +#else + return 0; +#endif +} + +extern "C" +pure_expr *pure_int_matrix_dup(const void *p) +{ +#ifdef HAVE_GSL + return 0; // XXXTODO +#else + return 0; +#endif +} + +extern "C" +pure_expr *pure_matrix_rowsl(uint32_t n, ...) +{ +#ifdef HAVE_GSL + // XXXTODO + return 0; +#else + return 0; +#endif +} + +extern "C" +pure_expr *pure_matrix_rowsv(uint32_t n, pure_expr **elems) +{ +#ifdef HAVE_GSL + // XXXTODO + return 0; +#else + return 0; +#endif +} + +extern "C" +pure_expr *pure_matrix_columnsl(uint32_t n, ...) +{ +#ifdef HAVE_GSL + // XXXTODO + return 0; +#else + return 0; +#endif +} + +extern "C" +pure_expr *pure_matrix_columnsv(uint32_t n, pure_expr **elems) +{ +#ifdef HAVE_GSL + // XXXTODO + return 0; +#else + return 0; +#endif +} + +extern "C" pure_expr *pure_app(pure_expr *fun, pure_expr *arg) { return pure_apply2(fun, arg); @@ -726,6 +874,36 @@ } extern "C" +bool pure_is_double_matrix(const pure_expr *x, const void **p) +{ + if (x->tag == EXPR::MATRIX && x->data.mat) { + *p = x->data.mat->p; + return true; + } else + return false; +} + +extern "C" +bool pure_is_complex_matrix(const pure_expr *x, const void **p) +{ + if (x->tag == EXPR::CMATRIX && x->data.mat) { + *p = x->data.mat->p; + return true; + } else + return false; +} + +extern "C" +bool pure_is_int_matrix(const pure_expr *x, const void **p) +{ + if (x->tag == EXPR::IMATRIX && x->data.mat) { + *p = x->data.mat->p; + return true; + } else + return false; +} + +extern "C" bool pure_is_app(const pure_expr *x, pure_expr **fun, pure_expr **arg) { assert(x); @@ -1355,7 +1533,43 @@ return &x->data.z; } +static inline pure_expr* bad_matrix_exception(pure_expr *x) +{ + if (!interpreter::g_interp) return 0; + pure_expr *f = pure_const(interpreter::g_interp->symtab.bad_matrix_sym().f); + if (x) + return pure_apply2(f, x); + else + return f; +} + extern "C" +pure_expr *pure_matrix_rows(uint32_t n, ...) +{ +#ifdef HAVE_GSL + // XXXTODO + pure_throw(not_implemented_exception()); + return 0; +#else + pure_throw(not_implemented_exception()); + return 0; +#endif +} + +extern "C" +pure_expr *pure_matrix_columns(uint32_t n, ...) +{ +#ifdef HAVE_GSL + // XXXTODO + pure_throw(not_implemented_exception()); + return 0; +#else + pure_throw(not_implemented_exception()); + return 0; +#endif +} + +extern "C" pure_expr *pure_call(pure_expr *x) { char test; Modified: pure/trunk/runtime.h =================================================================== --- pure/trunk/runtime.h 2008-09-16 07:35:33 UTC (rev 768) +++ pure/trunk/runtime.h 2008-09-16 12:07:48 UTC (rev 769) @@ -30,6 +30,16 @@ bool thunked; // thunked closure? (kept unevaluated) } pure_closure; +/* Matrix data. The GSL matrix data is represented as a void* whose actual + type depends on the expression tag. Different expressions may share the + same underlying memory block, so we do our own reference counting to manage + these. */ + +typedef struct { + uint32_t refc; // reference counter + void *p; // pointer to GSL matrix struct +} pure_matrix; + /* The runtime expression data structure. Keep this lean and mean. */ typedef struct _pure_expr { @@ -44,6 +54,7 @@ double d; // double (EXPR::DBL) char *s; // C string (EXPR::STR) void *p; // generic pointer (EXPR::PTR) + pure_matrix *mat; // matrix data (EXPR::MATRIX et al) pure_closure *clos; // closure (0 if none) } data; /* Internal fields (DO NOT TOUCH). The JIT doesn't care about these. */ @@ -115,6 +126,37 @@ pure_expr *pure_string(char *s); pure_expr *pure_cstring(char *s); +/* Matrix constructors. The given pointer must point to a valid GSL matrix + struct of the corresponding GSL matrix type (gsl_matrix, gsl_matrix_complex, + gsl_matrix_int). (These are just given as void* here to avoid depending on + the GSL headers which might not be available for some implementations.) In + the case of the _matrix routines, the matrix must be allocated dynamically + and Pure takes ownership of the matrix. The matrix_dup routines first take + a copy of the matrix, so the ownership of the original matrix remains with + the caller. The result is a Pure expression representing the matrix object, + or null if GSL matrix support is not available or some other error + occurs. */ + +pure_expr *pure_double_matrix(void *p); +pure_expr *pure_complex_matrix(void *p); +pure_expr *pure_int_matrix(void *p); +pure_expr *pure_double_matrix_dup(const void *p); +pure_expr *pure_complex_matrix_dup(const void *p); +pure_expr *pure_int_matrix_dup(const void *p); + +/* Convenience functions to construct a Pure matrix from a vector or a varargs + list of element expressions, which can be component matrices or scalars. + The pure_matrix_rows functions arrange the elements vertically, while the + pure_matrix_columns functions arrange them horizontally, given that the + other dimensions match. The elems vectors are owned by the caller and won't + be freed. A null expression is returned in case of an error (no matrix + support, dimension mismatch, or invalid element type). */ + +pure_expr *pure_matrix_rowsl(uint32_t n, ...); +pure_expr *pure_matrix_rowsv(uint32_t n, pure_expr **elems); +pure_expr *pure_matrix_columnsl(uint32_t n, ...); +pure_expr *pure_matrix_columnsv(uint32_t n, pure_expr **elems); + /* Function applications. pure_app applies the given function to the given argument. The result is evaluated if possible (i.e., if it is a saturated function call). Otherwise, the result is a literal application and @@ -172,6 +214,14 @@ bool pure_is_string_dup(const pure_expr *x, char **s); bool pure_is_cstring_dup(const pure_expr *x, char **s); +/* Matrix deconstructors. The returned GSL matrix pointer (represented as a + const void*) points to memory owned by Pure which should be considered + read-only and must not be freed. */ + +bool pure_is_double_matrix(const pure_expr *x, const void **p); +bool pure_is_complex_matrix(const pure_expr *x, const void **p); +bool pure_is_int_matrix(const pure_expr *x, const void **p); + /* Deconstruct literal applications. */ bool pure_is_app(const pure_expr *x, pure_expr **fun, pure_expr **arg); @@ -345,6 +395,14 @@ int64_t pure_get_long(pure_expr *x); int32_t pure_get_int(pure_expr *x); +/* Additional matrix constructors. These work like pure_matrix_rowsl and + pure_matrix_columnsl in the public API, but are intended to be called + directly from generated code and raise the appropriate Pure exceptions in + case of an error condition. */ + +pure_expr *pure_matrix_rows(uint32_t n, ...); +pure_expr *pure_matrix_columns(uint32_t n, ...); + /* Execute a closure. If the given expression x (or x y in the case of pure_apply) is a parameterless closure (or a saturated application of a closure), call it with the appropriate parameters and environment, if Modified: pure/trunk/symtable.cc =================================================================== --- pure/trunk/symtable.cc 2008-09-16 07:35:33 UTC (rev 768) +++ pure/trunk/symtable.cc 2008-09-16 12:07:48 UTC (rev 769) @@ -34,12 +34,17 @@ fdiv_sym(); div_sym(); mod_sym(); + // complex_rect_sym() and complex_polar_sym() are not initialized here, as + // they're supposed to come from math.pure which is not included in the + // prelude catch_sym(); catmap_sym(); failed_match_sym(); failed_cond_sym(); signal_sym(); segfault_sym(); + not_implemented_sym(); + bad_matrix_sym(); amp_sym(); } @@ -363,6 +368,24 @@ return sym("mod", 7, infixl); } +symbol& symtable::complex_rect_sym() +{ + symbol *_sym = lookup("+:"); + if (_sym) + return *_sym; + else + return sym("+", 5, infix); +} + +symbol& symtable::complex_polar_sym() +{ + symbol *_sym = lookup("<:"); + if (_sym) + return *_sym; + else + return sym("+", 5, infix); +} + symbol& symtable::amp_sym() { symbol *_sym = lookup("&"); Modified: pure/trunk/symtable.hh =================================================================== --- pure/trunk/symtable.hh 2008-09-16 07:35:33 UTC (rev 768) +++ pure/trunk/symtable.hh 2008-09-16 12:07:48 UTC (rev 769) @@ -90,12 +90,16 @@ symbol& fdiv_sym(); symbol& div_sym(); symbol& mod_sym(); + symbol& complex_rect_sym(); + symbol& complex_polar_sym(); symbol& catch_sym() { return sym("catch"); } symbol& catmap_sym() { return sym("catmap"); } symbol& failed_match_sym() { return sym("failed_match"); } symbol& failed_cond_sym() { return sym("failed_cond"); } symbol& signal_sym() { return sym("signal"); } symbol& segfault_sym() { return sym("stack_fault"); } + symbol& not_implemented_sym() { return sym("not_implemented"); } + symbol& bad_matrix_sym() { return sym("bad_matrix_value"); } symbol& amp_sym(); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-16 07:35:21
|
Revision: 768 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=768&view=rev Author: agraef Date: 2008-09-16 07:35:33 +0000 (Tue, 16 Sep 2008) Log Message: ----------- Cosmetic change. Modified Paths: -------------- pure/trunk/pure.cc Modified: pure/trunk/pure.cc =================================================================== --- pure/trunk/pure.cc 2008-09-15 06:55:18 UTC (rev 767) +++ pure/trunk/pure.cc 2008-09-16 07:35:33 UTC (rev 768) @@ -18,7 +18,7 @@ #include "config.h" -#if HAVE_GSL +#ifdef HAVE_GSL #include <gsl/gsl_errno.h> #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-15 06:48:14
|
Revision: 765 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=765&view=rev Author: agraef Date: 2008-09-15 06:48:25 +0000 (Mon, 15 Sep 2008) Log Message: ----------- Bump version number. Modified Paths: -------------- pure/trunk/INSTALL pure/trunk/README pure/trunk/configure pure/trunk/configure.ac Modified: pure/trunk/INSTALL =================================================================== --- pure/trunk/INSTALL 2008-09-15 06:29:02 UTC (rev 764) +++ pure/trunk/INSTALL 2008-09-15 06:48:25 UTC (rev 765) @@ -76,7 +76,7 @@ section. STEP 5. Configure, build and install Pure as follows (x.y denotes the current -Pure version number, 0.6 at the time of this writing): +Pure version number, 0.7 at the time of this writing): $ cd pure-x.y $ ./configure @@ -114,10 +114,10 @@ Run Pure interactively as: $ pure -Pure 0.6 (i686-pc-linux-gnu) Copyright (c) 2008 by Albert Graef +Pure 0.7 (i686-pc-linux-gnu) Copyright (c) 2008 by Albert Graef This program is free software distributed under the GNU Public License (GPL V3 or later). Please see the COPYING file for details. -Loaded prelude from /usr/local/lib/pure-0.6/prelude.pure. +Loaded prelude from /usr/local/lib/pure-0.7/prelude.pure. Check that it works: Modified: pure/trunk/README =================================================================== --- pure/trunk/README 2008-09-15 06:29:02 UTC (rev 764) +++ pure/trunk/README 2008-09-15 06:48:25 UTC (rev 765) @@ -45,10 +45,10 @@ can also just type EOF a.k.a. Ctrl-D at the beginning of the interpreter's command line). For instance: -Pure 0.6 (i686-pc-linux-gnu) Copyright (c) 2008 by Albert Graef +Pure 0.7 (i686-pc-linux-gnu) Copyright (c) 2008 by Albert Graef This program is free software distributed under the GNU Public License (GPL V3 or later). Please see the COPYING file for details. -Loaded prelude from /usr/local/lib/pure-0.6/prelude.pure. +Loaded prelude from /usr/local/lib/pure-0.7/prelude.pure. > fact n = if n>0 then n*fact (n-1) else 1; > map fact (1..10); Modified: pure/trunk/configure =================================================================== --- pure/trunk/configure 2008-09-15 06:29:02 UTC (rev 764) +++ pure/trunk/configure 2008-09-15 06:48:25 UTC (rev 765) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for pure 0.6. +# Generated by GNU Autoconf 2.61 for pure 0.7. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -572,8 +572,8 @@ # Identity of this package. PACKAGE_NAME='pure' PACKAGE_TARNAME='pure' -PACKAGE_VERSION='0.6' -PACKAGE_STRING='pure 0.6' +PACKAGE_VERSION='0.7' +PACKAGE_STRING='pure 0.7' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. @@ -1199,7 +1199,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pure 0.6 to adapt to many kinds of systems. +\`configure' configures pure 0.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1264,7 +1264,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pure 0.6:";; + short | recursive ) echo "Configuration of pure 0.7:";; esac cat <<\_ACEOF @@ -1358,7 +1358,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pure configure 0.6 +pure configure 0.7 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1372,7 +1372,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pure $as_me 0.6, which was +It was created by pure $as_me 0.7, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -6716,7 +6716,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pure $as_me 0.6, which was +This file was extended by pure $as_me 0.7, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6765,7 +6765,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -pure config.status 0.6 +pure config.status 0.7 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: pure/trunk/configure.ac =================================================================== --- pure/trunk/configure.ac 2008-09-15 06:29:02 UTC (rev 764) +++ pure/trunk/configure.ac 2008-09-15 06:48:25 UTC (rev 765) @@ -2,7 +2,7 @@ dnl To regenerate the configury after changes: dnl autoconf -I config && autoheader -I config -AC_INIT(pure, 0.6) +AC_INIT(pure, 0.7) AC_CONFIG_AUX_DIR(config) dnl AC_CONFIG_MACRO_DIR(config) AC_CONFIG_HEADERS(config.h) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-15 06:28:52
|
Revision: 764 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=764&view=rev Author: agraef Date: 2008-09-15 06:29:02 +0000 (Mon, 15 Sep 2008) Log Message: ----------- Move inf and nan definitions back to primitives.pure, but make sure that they come after the definition of the arithmetic operators, so that the double arithmetic gets expanded at compile time. Modified Paths: -------------- pure/trunk/interpreter.cc pure/trunk/lib/primitives.pure Modified: pure/trunk/interpreter.cc =================================================================== --- pure/trunk/interpreter.cc 2008-09-15 05:45:18 UTC (rev 763) +++ pure/trunk/interpreter.cc 2008-09-15 06:29:02 UTC (rev 764) @@ -330,7 +330,6 @@ const string& host, const list<string>& argv) { - static const double inf = 1.0e307 * 1.0e307, nan = inf-inf; // command line arguments, system and version information pure_expr *args = pure_const(symtab.nil_sym().f); for (list<string>::const_reverse_iterator it = argv.rbegin(); @@ -347,8 +346,6 @@ #ifdef HAVE_GSL defn("gsl_version", pure_cstring_dup(gsl_version)); #endif - const_defn("inf", pure_double(inf)); - const_defn("nan", pure_double(nan)); } // Errors and warnings. Modified: pure/trunk/lib/primitives.pure =================================================================== --- pure/trunk/lib/primitives.pure 2008-09-15 05:45:18 UTC (rev 763) +++ pure/trunk/lib/primitives.pure 2008-09-15 06:29:02 UTC (rev 764) @@ -63,11 +63,6 @@ tuplep (x,xs) = 1; tuplep _ = 0 otherwise; -/* Predicates to check for IEEE floating point infinities and NaNs. */ - -infp x = case x of x::double = x==inf || x==-inf; _ = 0 end; -nanp x = case x of x::double = not (x==x); _ = 0 end; - /* Compute a 32 bit hash code of a Pure expression. */ extern int hash(expr*); @@ -388,6 +383,16 @@ x::pointer==y::pointer = bigint x == bigint y; x::pointer!=y::pointer = bigint x != bigint y; +/* IEEE floating point infinities and NaNs. Place these after the definitions + of the built-in operators so that the double arithmetic works. */ + +const inf = 1.0e307 * 1.0e307; const nan = inf-inf; + +/* Predicates to check for inf and nan values. */ + +infp x = case x of x::double = x==inf || x==-inf; _ = 0 end; +nanp x = case x of x::double = not (x==x); _ = 0 end; + /* Direct memory accesses. Use with care ... or else! */ private pointer_get_byte pointer_get_int pointer_get_double This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-15 05:45:08
|
Revision: 763 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=763&view=rev Author: agraef Date: 2008-09-15 05:45:18 +0000 (Mon, 15 Sep 2008) Log Message: ----------- Properly handle the case of IEEE 754 negative zeros. Modified Paths: -------------- pure/trunk/printer.cc Modified: pure/trunk/printer.cc =================================================================== --- pure/trunk/printer.cc 2008-09-15 05:34:59 UTC (rev 762) +++ pure/trunk/printer.cc 2008-09-15 05:45:18 UTC (rev 763) @@ -76,7 +76,9 @@ else return 100; case EXPR::DBL: - if (x.dval() < 0.0) + /* NOTE: The check for negative zero really needs IEEE 754 floating point + numbers, otherwise we'll divide by zero here. */ + if (x.dval() < 0.0 || x.dval() == 0.0 && 1.0/x.dval() < 0.0) // precedence of unary minus: return sym_nprec(interpreter::g_interp->symtab.neg_sym().f); else @@ -577,7 +579,9 @@ else return 100; case EXPR::DBL: - if (x->data.d < 0.0) + /* NOTE: The check for negative zero really needs IEEE 754 floating point + numbers, otherwise we'll divide by zero here. */ + if (x->data.d < 0.0 || x->data.d == 0.0 && 1.0/x->data.d < 0.0) // precedence of unary minus: return sym_nprec(interpreter::g_interp->symtab.neg_sym().f); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-15 05:34:49
|
Revision: 762 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=762&view=rev Author: agraef Date: 2008-09-15 05:34:59 +0000 (Mon, 15 Sep 2008) Log Message: ----------- Properly handle the case of IEEE 754 negative zeros. Modified Paths: -------------- pure/trunk/lib/primitives.pure Modified: pure/trunk/lib/primitives.pure =================================================================== --- pure/trunk/lib/primitives.pure 2008-09-15 04:56:26 UTC (rev 761) +++ pure/trunk/lib/primitives.pure 2008-09-15 05:34:59 UTC (rev 762) @@ -125,10 +125,13 @@ // Fractional part of x. frac x::int | frac x::bigint | frac x::double = x-trunc x; -/* Absolute value and sign of a number. */ +/* Absolute value and sign of a number. Note that these don't distinguish + between IEEE 754 positive and negative zeros; abs always returns 0.0, sgn 0 + for these. The real sign bit of a floating point zero can be obtained with + sgn (1/x). */ abs x::int | abs x::bigint | abs x::double - = if x>=0 then x else -x; + = if x>0 then x else -x; sgn x::int | sgn x::bigint | sgn x::double = if x>0 then 1 else if x<0 then -1 else 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-15 04:40:54
|
Revision: 760 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=760&view=rev Author: agraef Date: 2008-09-15 04:41:02 +0000 (Mon, 15 Sep 2008) Log Message: ----------- Simplify definitions of infp and nanp. Modified Paths: -------------- pure/trunk/lib/primitives.pure Modified: pure/trunk/lib/primitives.pure =================================================================== --- pure/trunk/lib/primitives.pure 2008-09-12 11:39:25 UTC (rev 759) +++ pure/trunk/lib/primitives.pure 2008-09-15 04:41:02 UTC (rev 760) @@ -69,8 +69,8 @@ /* Predicates to check for inf and nan values. */ -infp x = case x of x::double = x!==nan && x-x===nan; _ = 0 end; -nanp x = case x of x::double = x===nan; _ = 0 end; +infp x = case x of x::double = x==inf || x==-inf; _ = 0 end; +nanp x = case x of x::double = not (x==x); _ = 0 end; /* Compute a 32 bit hash code of a Pure expression. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-12 11:39:15
|
Revision: 759 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=759&view=rev Author: agraef Date: 2008-09-12 11:39:25 +0000 (Fri, 12 Sep 2008) Log Message: ----------- Add configury for GSL support. Modified Paths: -------------- pure/trunk/config.h.in pure/trunk/configure pure/trunk/configure.ac pure/trunk/interpreter.cc pure/trunk/pure.cc pure/trunk/runtime.cc Modified: pure/trunk/config.h.in =================================================================== --- pure/trunk/config.h.in 2008-09-12 00:38:24 UTC (rev 758) +++ pure/trunk/config.h.in 2008-09-12 11:39:25 UTC (rev 759) @@ -27,6 +27,12 @@ /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY +/* Define when building with GSL vector/matrix support. */ +#undef HAVE_GSL + +/* Define to 1 if you have the <gsl/gsl_version.h> header file. */ +#undef HAVE_GSL_GSL_VERSION_H + /* Define if you have the iconv() function. */ #undef HAVE_ICONV @@ -42,9 +48,18 @@ /* Define to 1 if you have the `gmp' library (-lgmp). */ #undef HAVE_LIBGMP +/* Define to 1 if you have the `gsl' library (-lgsl). */ +#undef HAVE_LIBGSL + +/* Define to 1 if you have the `gslcblas' library (-lgslcblas). */ +#undef HAVE_LIBGSLCBLAS + /* Define to 1 if you have the `iconv' library (-liconv). */ #undef HAVE_LIBICONV +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + /* Define to 1 if you have the `readline' library (-lreadline). */ #undef HAVE_LIBREADLINE Modified: pure/trunk/configure =================================================================== --- pure/trunk/configure 2008-09-12 00:38:24 UTC (rev 758) +++ pure/trunk/configure 2008-09-12 11:39:25 UTC (rev 759) @@ -1271,10 +1271,11 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-release enable the release build + --enable-gsl build with GSL support (default, experimental) --enable-debug enable the debug build --enable-debug2 enable the maintenance build - --disable-shared link the interpreter statically + --enable-release enable the release build + --enable-shared build the shared runtime library (default) --enable-warnings enable compiler warnings (-Wall) Optional Packages: @@ -4280,10 +4281,11 @@ _ACEOF -# Check whether --enable-release was given. -if test "${enable_release+set}" = set; then - enableval=$enable_release; case "${enableval}" in - yes) CPPFLAGS="-DNDEBUG -DDEBUG=0"; CXXFLAGS="-O3" ;; +gsllib=yes +# Check whether --enable-gsl was given. +if test "${enable_gsl+set}" = set; then + enableval=$enable_gsl; case "${enableval}" in + no) gsllib=no ;; esac fi @@ -4301,6 +4303,13 @@ esac fi +# Check whether --enable-release was given. +if test "${enable_release+set}" = set; then + enableval=$enable_release; case "${enableval}" in + yes) CPPFLAGS="-DNDEBUG -DDEBUG=0"; CXXFLAGS="-O3" ;; + esac +fi + sharedlib=yes # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then @@ -4460,6 +4469,77 @@ fi +{ echo "$as_me:$LINENO: checking for cos in -lm" >&5 +echo $ECHO_N "checking for cos in -lm... $ECHO_C" >&6; } +if test "${ac_cv_lib_m_cos+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cos (); +int +main () +{ +return cos (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_m_cos=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_m_cos=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_cos" >&5 +echo "${ECHO_T}$ac_cv_lib_m_cos" >&6; } +if test $ac_cv_lib_m_cos = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + + { echo "$as_me:$LINENO: checking for libiconv in -liconv" >&5 echo $ECHO_N "checking for libiconv in -liconv... $ECHO_C" >&6; } if test "${ac_cv_lib_iconv_libiconv+set}" = set; then @@ -5941,6 +6021,303 @@ fi +if test $gsllib = yes; then + +{ echo "$as_me:$LINENO: checking for cblas_dgemm in -lgslcblas" >&5 +echo $ECHO_N "checking for cblas_dgemm in -lgslcblas... $ECHO_C" >&6; } +if test "${ac_cv_lib_gslcblas_cblas_dgemm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgslcblas $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cblas_dgemm (); +int +main () +{ +return cblas_dgemm (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_gslcblas_cblas_dgemm=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gslcblas_cblas_dgemm=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gslcblas_cblas_dgemm" >&5 +echo "${ECHO_T}$ac_cv_lib_gslcblas_cblas_dgemm" >&6; } +if test $ac_cv_lib_gslcblas_cblas_dgemm = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGSLCBLAS 1 +_ACEOF + + LIBS="-lgslcblas $LIBS" + +fi + + +{ echo "$as_me:$LINENO: checking for gsl_blas_dgemm in -lgsl" >&5 +echo $ECHO_N "checking for gsl_blas_dgemm in -lgsl... $ECHO_C" >&6; } +if test "${ac_cv_lib_gsl_gsl_blas_dgemm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gsl_blas_dgemm (); +int +main () +{ +return gsl_blas_dgemm (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_gsl_gsl_blas_dgemm=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gsl_gsl_blas_dgemm=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gsl_gsl_blas_dgemm" >&5 +echo "${ECHO_T}$ac_cv_lib_gsl_gsl_blas_dgemm" >&6; } +if test $ac_cv_lib_gsl_gsl_blas_dgemm = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGSL 1 +_ACEOF + + LIBS="-lgsl $LIBS" + +fi + + +for ac_header in gsl/gsl_version.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + gsllib=no + if test $ac_cv_lib_gsl_gsl_blas_dgemm = yes; then + if test $ac_cv_header_gsl_gsl_version_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GSL 1 +_ACEOF + + { echo "$as_me:$LINENO: result: Building with GSL support." >&5 +echo "${ECHO_T}Building with GSL support." >&6; } + gsllib=yes + fi + fi +fi ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF @@ -7071,6 +7448,7 @@ Compiler: $CXX $CXXFLAGS $CPPFLAGS Linker: $CXX $LDFLAGS $LIBS Build libpure: $sharedlib + GSL support: $gsllib Now run 'make' to build everything, and 'make install' to install this software on your system. To remove the installed software at a later @@ -7084,6 +7462,7 @@ Compiler: $CXX $CXXFLAGS $CPPFLAGS Linker: $CXX $LDFLAGS $LIBS Build libpure: $sharedlib + GSL support: $gsllib Now run 'make' to build everything, and 'make install' to install this software on your system. To remove the installed software at a later Modified: pure/trunk/configure.ac =================================================================== --- pure/trunk/configure.ac 2008-09-12 00:38:24 UTC (rev 758) +++ pure/trunk/configure.ac 2008-09-12 11:39:25 UTC (rev 759) @@ -44,10 +44,11 @@ dnl Determine pointer sizes. This will be 8 on 64 bit systems. AC_CHECK_SIZEOF(void *) dnl Parse --enable options. -AC_ARG_ENABLE(release, - [ --enable-release enable the release build], +gsllib=yes +AC_ARG_ENABLE(gsl, + [ --enable-gsl build with GSL support (default, experimental)], [case "${enableval}" in - yes) CPPFLAGS="-DNDEBUG -DDEBUG=0"; CXXFLAGS="-O3" ;; + no) gsllib=no ;; esac]) AC_ARG_ENABLE(debug, [ --enable-debug enable the debug build], @@ -59,9 +60,14 @@ [case "${enableval}" in yes) CPPFLAGS="-DDEBUG=2"; CXXFLAGS="-g" ;; esac]) +AC_ARG_ENABLE(release, + [ --enable-release enable the release build], + [case "${enableval}" in + yes) CPPFLAGS="-DNDEBUG -DDEBUG=0"; CXXFLAGS="-O3" ;; + esac]) sharedlib=yes AC_ARG_ENABLE(shared, - [ --disable-shared link the interpreter statically], + [ --enable-shared build the shared runtime library (default)], [case "${enableval}" in no) LDFLAGS="$LDFLAGS $rdynamic"; sharedlib=no ;; esac]) @@ -74,6 +80,7 @@ dnl Check for libraries. AC_CHECK_LIB(gmp, __gmpz_init) AC_CHECK_LIB(readline, readline) +AC_CHECK_LIB(m, cos) dnl On some systems iconv is in a separate library, and may actually be named dnl libiconv. AC_CHECK_LIB(iconv, libiconv) @@ -95,6 +102,20 @@ AC_REINSTALL_SIGHANDLERS dnl Check to see whether we have POSIX/ISOC99 complex numbers. AC_CHECK_TYPES([_Complex float, _Complex double]) +dnl Check for GSL support. +if test $gsllib = yes; then + AC_CHECK_LIB(gslcblas, cblas_dgemm) + AC_CHECK_LIB(gsl, gsl_blas_dgemm) + AC_CHECK_HEADERS([gsl/gsl_version.h]) + gsllib=no + if test $ac_cv_lib_gsl_gsl_blas_dgemm = yes; then + if test $ac_cv_header_gsl_gsl_version_h = yes; then + AC_DEFINE(HAVE_GSL, 1, [Define when building with GSL vector/matrix support.]) + AC_MSG_RESULT([Building with GSL support.]) + gsllib=yes + fi + fi +fi AC_CONFIG_FILES([Makefile]) AC_OUTPUT @@ -106,6 +127,7 @@ Compiler: $CXX $CXXFLAGS $CPPFLAGS Linker: $CXX $LDFLAGS $LIBS Build libpure: $sharedlib + GSL support: $gsllib Now run 'make' to build everything, and 'make install' to install this software on your system. To remove the installed software at a later Modified: pure/trunk/interpreter.cc =================================================================== --- pure/trunk/interpreter.cc 2008-09-12 00:38:24 UTC (rev 758) +++ pure/trunk/interpreter.cc 2008-09-12 11:39:25 UTC (rev 759) @@ -14,6 +14,10 @@ #include "config.h" +#ifdef HAVE_GSL +#include <gsl/gsl_version.h> +#endif + uint8_t interpreter::g_verbose = 0; bool interpreter::g_interactive = false; interpreter* interpreter::g_interp = 0; @@ -339,6 +343,9 @@ defn("argv", args); defn("version", pure_cstring_dup(version.c_str())); defn("sysinfo", pure_cstring_dup(host.c_str())); +#ifdef HAVE_GSL + defn("gsl_version", pure_cstring_dup(gsl_version)); +#endif } // Errors and warnings. Modified: pure/trunk/pure.cc =================================================================== --- pure/trunk/pure.cc 2008-09-12 00:38:24 UTC (rev 758) +++ pure/trunk/pure.cc 2008-09-12 11:39:25 UTC (rev 759) @@ -18,6 +18,10 @@ #include "config.h" +#if HAVE_GSL +#include <gsl/gsl_errno.h> +#endif + using namespace std; #ifndef HOST @@ -339,6 +343,10 @@ // need to have USE_FASTCC in interpreter.hh enabled). llvm::PerformTailCallOpt = true; #endif +#if defined(HAVE_GSL) && DEBUG<2 + // Turn off GSL's own error handler which aborts the program. + gsl_set_error_handler_off(); +#endif // scan the command line options const string prog = *argv; list<string> myargs; Modified: pure/trunk/runtime.cc =================================================================== --- pure/trunk/runtime.cc 2008-09-12 00:38:24 UTC (rev 758) +++ pure/trunk/runtime.cc 2008-09-12 11:39:25 UTC (rev 759) @@ -34,6 +34,10 @@ #include "config.h" #include "funcall.h" +#ifdef HAVE_GSL +#include <gsl/gsl_errno.h> +#endif + // Hooks to report stack overflows and other kinds of hard errors. #define checkstk(test) if (interpreter::stackmax > 0 && \ interpreter::stackdir*(&test - interpreter::baseptr) \ @@ -1059,6 +1063,10 @@ // need to have USE_FASTCC in interpreter.hh enabled). llvm::PerformTailCallOpt = true; #endif +#if defined(HAVE_GSL) && DEBUG<2 + // Turn off GSL's own error handler which aborts the program. + gsl_set_error_handler_off(); +#endif // scan the command line options list<string> myargs; for (char **args = ++argv; *args; ++args) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-12 00:38:14
|
Revision: 758 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=758&view=rev Author: agraef Date: 2008-09-12 00:38:24 +0000 (Fri, 12 Sep 2008) Log Message: ----------- Snapshot Of Pure 0.6. Added Paths: ----------- pure/releases/pure-0.6/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-11 23:31:13
|
Revision: 757 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=757&view=rev Author: agraef Date: 2008-09-11 23:31:24 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Final touches (0.6 release). Modified Paths: -------------- pure/trunk/pure.1.in Modified: pure/trunk/pure.1.in =================================================================== --- pure/trunk/pure.1.in 2008-09-11 23:17:47 UTC (rev 756) +++ pure/trunk/pure.1.in 2008-09-11 23:31:24 UTC (rev 757) @@ -1,4 +1,4 @@ -.TH Pure 1 "August 2008" "Pure Version @version@" +.TH Pure 1 "September 2008" "Pure Version @version@" .SH NAME pure \- the Pure interpreter .SH SYNOPSIS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-11 23:17:38
|
Revision: 756 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=756&view=rev Author: agraef Date: 2008-09-11 23:17:47 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Comment change. Modified Paths: -------------- pure/trunk/pure.cc Modified: pure/trunk/pure.cc =================================================================== --- pure/trunk/pure.cc 2008-09-11 23:17:01 UTC (rev 755) +++ pure/trunk/pure.cc 2008-09-11 23:17:47 UTC (rev 756) @@ -185,7 +185,7 @@ #ifdef _WIN32 -/* Crappy Windoze doesn't have kill, so we need to set up a special kind of +/* Braindead Windows doesn't have kill, so we need to set up a special kind of "console" event handler for Ctrl+C. That at least enables PurePad to signal us. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-11 23:16:50
|
Revision: 755 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=755&view=rev Author: agraef Date: 2008-09-11 23:17:01 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Update documentation. Modified Paths: -------------- pure/trunk/pure.1.in Modified: pure/trunk/pure.1.in =================================================================== --- pure/trunk/pure.1.in 2008-09-11 22:06:53 UTC (rev 754) +++ pure/trunk/pure.1.in 2008-09-11 23:17:01 UTC (rev 755) @@ -857,7 +857,8 @@ .fi .PP (Conversely, you can also turn a list into a stream value with the `stream' -function.) +function. This is done less frequently, but becomes useful if you want to +generate a stream from a finite list in a list comprehension.) .PP For interactive usage it's often convenient to define an eager variation of `take' which combines `take' and `list'. Let's do this now, so that we can use @@ -999,12 +1000,12 @@ .sp .nf all_primes = sieve (2..inf) \fBwith\fP - sieve [] = []; sieve (p:qs) = p : sieve [q; q = qs; q mod p] &; \fBend\fP; .fi .sp -Example: +Note that we can omit the empty list case of `sieve' here, since the sieve now +never becomes empty. Example: .sp .nf > \fBlet\fP P = all_primes; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-11 22:06:44
|
Revision: 754 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=754&view=rev Author: agraef Date: 2008-09-11 22:06:53 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Final touches (0.6 release). Modified Paths: -------------- pure/trunk/ChangeLog pure/trunk/NEWS Modified: pure/trunk/ChangeLog =================================================================== --- pure/trunk/ChangeLog 2008-09-11 22:06:02 UTC (rev 753) +++ pure/trunk/ChangeLog 2008-09-11 22:06:53 UTC (rev 754) @@ -1,7 +1,11 @@ -2008-09-11 Albert Graef <Dr....@t-...> +2008-09-12 Albert Graef <Dr....@t-...> * 0.6 release. + * interpreter.cc: Speedups in pattern-matching code. + +2008-09-11 Albert Graef <Dr....@t-...> + * runtime.cc, lib/math.pure: More bugfixes. 2008-09-06 Albert Graef <Dr....@t-...> Modified: pure/trunk/NEWS =================================================================== --- pure/trunk/NEWS 2008-09-11 22:06:02 UTC (rev 753) +++ pure/trunk/NEWS 2008-09-11 22:06:53 UTC (rev 754) @@ -1,5 +1,5 @@ -** Pure 0.6 2008-09-11 +** Pure 0.6 2008-09-12 New stuff in this release (please see the ChangeLog and the manual for details): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-11 22:05:51
|
Revision: 753 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=753&view=rev Author: agraef Date: 2008-09-11 22:06:02 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Speedups in pattern-matching code. Modified Paths: -------------- pure/trunk/interpreter.cc Modified: pure/trunk/interpreter.cc =================================================================== --- pure/trunk/interpreter.cc 2008-09-11 20:30:06 UTC (rev 752) +++ pure/trunk/interpreter.cc 2008-09-11 22:06:02 UTC (rev 753) @@ -5842,11 +5842,11 @@ msg << "simple match " << f.name; debug(msg.str().c_str()); } #endif + Value *tagv = 0; + // check for thunks which must be forced if (t.tag != EXPR::VAR || t.ttag != 0) { - // check for thunks which must be forced -#if 1 // do a quick check on the tag value - Value *tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); + tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); Value *checkv = f.builder.CreateICmpEQ(tagv, Zero, "check"); BasicBlock *forcebb = BasicBlock::Create("force"); BasicBlock *skipbb = BasicBlock::Create("skip"); @@ -5857,9 +5857,7 @@ f.builder.CreateBr(skipbb); f.f->getBasicBlockList().push_back(skipbb); f.builder.SetInsertPoint(skipbb); -#else - call("pure_force", x); -#endif + tagv = 0; } // match the current symbol switch (t.tag) { @@ -5868,7 +5866,7 @@ f.builder.CreateBr(matchedbb); else { // typed variable, must match type tag against value - Value *tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); + if (!tagv) tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); f.builder.CreateCondBr (f.builder.CreateICmpEQ(tagv, SInt(t.ttag)), matchedbb, failedbb); } @@ -5878,7 +5876,7 @@ case EXPR::DBL: { // first check the tag BasicBlock *okbb = BasicBlock::Create("ok"); - Value *tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); + if (!tagv) tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); f.builder.CreateCondBr (f.builder.CreateICmpEQ(tagv, SInt(t.tag), "cmp"), okbb, failedbb); // next check the values (we inline these for max performance) @@ -5903,7 +5901,7 @@ // first do a quick check on the tag so that we may avoid an expensive // call if the tags don't match BasicBlock *okbb = BasicBlock::Create("ok"); - Value *tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); + if (!tagv) tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); f.builder.CreateCondBr (f.builder.CreateICmpEQ(tagv, SInt(t.tag), "cmp"), okbb, failedbb); // next check the values (like above, but we have to call the runtime for @@ -5927,7 +5925,7 @@ // first match the tag... BasicBlock *ok1bb = BasicBlock::Create("arg1"); BasicBlock *ok2bb = BasicBlock::Create("arg2"); - Value *tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); + if (!tagv) tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); f.builder.CreateCondBr (f.builder.CreateICmpEQ(tagv, SInt(t.tag)), ok1bb, failedbb); s = t.st; @@ -5946,7 +5944,7 @@ default: assert(t.tag > 0); // just do a quick check on the tag - Value *tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); + if (!tagv) tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); f.builder.CreateCondBr (f.builder.CreateICmpEQ(tagv, SInt(t.tag)), matchedbb, failedbb); s = t.st; @@ -6088,11 +6086,11 @@ t0++; m++; } must_force = must_force || t0 != s->tr.end(); + Value *tagv = 0; + // check for thunks which must be forced if (must_force) { - // check for thunks which must be forced -#if 1 // do a quick check on the tag value - Value *tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); + tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); Value *checkv = f.builder.CreateICmpEQ(tagv, Zero, "check"); BasicBlock *forcebb = BasicBlock::Create("force"); BasicBlock *skipbb = BasicBlock::Create("skip"); @@ -6103,14 +6101,12 @@ f.builder.CreateBr(skipbb); f.f->getBasicBlockList().push_back(skipbb); f.builder.SetInsertPoint(skipbb); -#else - call("pure_force", x); -#endif + tagv = 0; } if (t0 != s->tr.end()) { assert(n > m); // get the tag value - Value *tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); + if (!tagv) tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); // set up the switch instruction branching over the different tags SwitchInst *sw = f.builder.CreateSwitch(tagv, retrybb, n-m); /* NOTE: For constant transitions there may be multiple transitions under @@ -6228,7 +6224,7 @@ if (t1->tag == EXPR::VAR && t1->ttag == 0) t1++; if (t1 != s->tr.end() && t1->tag == EXPR::VAR) { // get the tag value - Value *tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); + if (!tagv) tagv = f.CreateLoadGEP(x, Zero, Zero, "tag"); // set up the switch instruction branching over the different type tags SwitchInst *sw = f.builder.CreateSwitch(tagv, defaultbb); vector<BasicBlock*> vtransbb; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-11 20:30:39
|
Revision: 752 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=752&view=rev Author: agraef Date: 2008-09-11 20:30:06 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Final touches (0.6 release). Modified Paths: -------------- pure/trunk/ChangeLog pure/trunk/NEWS pure/trunk/README Modified: pure/trunk/ChangeLog =================================================================== --- pure/trunk/ChangeLog 2008-09-11 16:13:05 UTC (rev 751) +++ pure/trunk/ChangeLog 2008-09-11 20:30:06 UTC (rev 752) @@ -1,3 +1,9 @@ +2008-09-11 Albert Graef <Dr....@t-...> + + * 0.6 release. + + * runtime.cc, lib/math.pure: More bugfixes. + 2008-09-06 Albert Graef <Dr....@t-...> * pure.cc, lexer.ll: Add 'dump' command. This is similar to Modified: pure/trunk/NEWS =================================================================== --- pure/trunk/NEWS 2008-09-11 16:13:05 UTC (rev 751) +++ pure/trunk/NEWS 2008-09-11 20:30:06 UTC (rev 752) @@ -1,5 +1,5 @@ -** Pure 0.6 (in progress) +** Pure 0.6 2008-09-11 New stuff in this release (please see the ChangeLog and the manual for details): Modified: pure/trunk/README =================================================================== --- pure/trunk/README 2008-09-11 16:13:05 UTC (rev 751) +++ pure/trunk/README 2008-09-11 20:30:06 UTC (rev 752) @@ -45,10 +45,10 @@ can also just type EOF a.k.a. Ctrl-D at the beginning of the interpreter's command line). For instance: -Pure 0.5 (i686-pc-linux-gnu) Copyright (c) 2008 by Albert Graef +Pure 0.6 (i686-pc-linux-gnu) Copyright (c) 2008 by Albert Graef This program is free software distributed under the GNU Public License (GPL V3 or later). Please see the COPYING file for details. -Loaded prelude from /usr/local/lib/pure-0.5/prelude.pure. +Loaded prelude from /usr/local/lib/pure-0.6/prelude.pure. > fact n = if n>0 then n*fact (n-1) else 1; > map fact (1..10); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-11 16:12:56
|
Revision: 751 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=751&view=rev Author: agraef Date: 2008-09-11 16:13:05 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Update logs. Modified Paths: -------------- pure/trunk/test/test020.log pure/trunk/test/test021.log Modified: pure/trunk/test/test020.log =================================================================== --- pure/trunk/test/test020.log 2008-09-11 15:54:04 UTC (rev 750) +++ pure/trunk/test/test020.log 2008-09-11 16:13:05 UTC (rev 751) @@ -616,12 +616,12 @@ asinh,1.20+:-4.30,2.18+:-1.29 asinh,1L%2L+:1,0.733+:0.896 asinh,1L%2L+:3L%4L,0.606+:0.682 -asinh,3<:1,1.78+:0.974 -asinh,3<:-2.14,-1.78+:-0.974 -asinh,3.00<:-3,-1.82+:-0.134 -asinh,3.10<:2.50,-1.83+:0.617 -asinh,2L%3L<:2,-0.333+:0.612 -asinh,1L%2L<:3L%4L,0.377+:0.324 +asinh,3<:1,2.03<:0.500 +asinh,3<:-2.14,2.03<:-2.64 +asinh,3.00<:-3,1.82<:-3.07 +asinh,3.10<:2.50,1.93<:2.82 +asinh,2L%3L<:2,0.696<:2.07 +asinh,1L%2L<:3L%4L,0.497<:0.709 asinh,-inf,-inf asinh,nan,nan asinh,x,__failed__ @@ -640,12 +640,12 @@ acosh,1.20+:-4.30,2.20+:-1.30 acosh,1L%2L+:1,0.926+:1.22 acosh,1L%2L+:3L%4L,0.743+:1.17 -acosh,3<:1,1.80+:1.02 -acosh,3<:-2.14,1.80+:-2.12 -acosh,3.00<:-3,1.76+:-2.99 -acosh,3.10<:2.50,1.82+:2.47 -acosh,2L%3L<:2,0.589+:1.81 -acosh,1L%2L<:3L%4L,0.355+:1.22 +acosh,3<:1,2.07<:0.516 +acosh,3<:-2.14,2.78<:-0.865 +acosh,3.00<:-3,3.47<:-1.04 +acosh,3.10<:2.50,3.07<:0.937 +acosh,2L%3L<:2,1.90<:1.26 +acosh,1L%2L<:3L%4L,1.27<:1.29 acosh,-inf,nan acosh,nan,nan acosh,x,__failed__ @@ -664,12 +664,12 @@ atanh,1.20+:-4.30,0.0576+:-1.36 atanh,1L%2L+:1,0.239+:0.848 atanh,1L%2L+:3L%4L,0.310+:0.723 -atanh,3<:1,0.168+:1.29 -atanh,3<:-2.14,-0.168+:-1.29 -atanh,3.00<:-3,-0.342+:-1.52 -atanh,3.10<:2.50,-0.254+:1.37 -atanh,2L%3L<:2,-0.202+:0.571 -atanh,1L%2L<:3L%4L,0.335+:0.369 +atanh,3<:1,1.30<:1.44 +atanh,3<:-2.14,1.30<:-1.70 +atanh,3.00<:-3,1.56<:-1.79 +atanh,3.10<:2.50,1.39<:1.75 +atanh,2L%3L<:2,0.605<:1.91 +atanh,1L%2L<:3L%4L,0.498<:0.833 atanh,-inf,nan atanh,nan,nan atanh,x,__failed__ @@ -1169,12 +1169,12 @@ (+),1,1.20+:-4.30,2.20+:-4.30 (+),1,1L%2L+:1,3L%2L+:1 (+),1,1L%2L+:3L%4L,3L%2L+:3L%4L -(+),1,3<:1,2.62+:2.52 -(+),1,3<:-2.14,-0.621+:-2.52 -(+),1,3.00<:-3,-1.97+:-0.423 -(+),1,3.10<:2.50,-1.48+:1.86 -(+),1,2L%3L<:2,0.723+:0.606 -(+),1,1L%2L<:3L%4L,1.37+:0.341 +(+),1,3<:1,3.64<:0.767 +(+),1,3<:-2.14,2.60<:-1.81 +(+),1,3.00<:-3,2.01<:-2.93 +(+),1,3.10<:2.50,2.38<:2.25 +(+),1,2L%3L<:2,0.943<:0.698 +(+),1,1L%2L<:3L%4L,1.41<:0.245 (+),1,-inf,-inf (+),1,nan,nan (+),1,x,__failed__ @@ -1193,12 +1193,12 @@ (+),-1,1.20+:-4.30,0.200+:-4.30 (+),-1,1L%2L+:1,(-1L)%2L+:1 (+),-1,1L%2L+:3L%4L,(-1L)%2L+:3L%4L -(+),-1,3<:1,0.621+:2.52 -(+),-1,3<:-2.14,-2.62+:-2.52 -(+),-1,3.00<:-3,-3.97+:-0.423 -(+),-1,3.10<:2.50,-3.48+:1.86 -(+),-1,2L%3L<:2,-1.28+:0.606 -(+),-1,1L%2L<:3L%4L,-0.634+:0.341 +(+),-1,3<:1,2.60<:1.33 +(+),-1,3<:-2.14,3.64<:-2.37 +(+),-1,3.00<:-3,3.99<:-3.04 +(+),-1,3.10<:2.50,3.95<:2.65 +(+),-1,2L%3L<:2,1.41<:2.70 +(+),-1,1L%2L<:3L%4L,0.720<:2.65 (+),-1,-inf,-inf (+),-1,nan,nan (+),-1,x,__failed__ @@ -1217,12 +1217,12 @@ (+),0,1.20+:-4.30,1.20+:-4.30 (+),0,1L%2L+:1,1L%2L+:1 (+),0,1L%2L+:3L%4L,1L%2L+:3L%4L -(+),0,3<:1,1.62+:2.52 -(+),0,3<:-2.14,-1.62+:-2.52 -(+),0,3.00<:-3,-2.97+:-0.423 -(+),0,3.10<:2.50,-2.48+:1.86 -(+),0,2L%3L<:2,-0.277+:0.606 -(+),0,1L%2L<:3L%4L,0.366+:0.341 +(+),0,3<:1,3.00<:1.00 +(+),0,3<:-2.14,3.00<:-2.14 +(+),0,3.00<:-3,3.00<:-3.00 +(+),0,3.10<:2.50,3.10<:2.50 +(+),0,2L%3L<:2,0.667<:2.00 +(+),0,1L%2L<:3L%4L,0.500<:0.750 (+),0,-inf,-inf (+),0,nan,nan (+),0,x,__failed__ @@ -1241,12 +1241,12 @@ (+),0.00,1.20+:-4.30,1.20+:-4.30 (+),0.00,1L%2L+:1,0.500+:1 (+),0.00,1L%2L+:3L%4L,0.500+:3L%4L -(+),0.00,3<:1,1.62+:2.52 -(+),0.00,3<:-2.14,-1.62+:-2.52 -(+),0.00,3.00<:-3,-2.97+:-0.423 -(+),0.00,3.10<:2.50,-2.48+:1.86 -(+),0.00,2L%3L<:2,-0.277+:0.606 -(+),0.00,1L%2L<:3L%4L,0.366+:0.341 +(+),0.00,3<:1,3.00<:1.00 +(+),0.00,3<:-2.14,3.00<:-2.14 +(+),0.00,3.00<:-3,3.00<:-3.00 +(+),0.00,3.10<:2.50,3.10<:2.50 +(+),0.00,2L%3L<:2,0.667<:2.00 +(+),0.00,1L%2L<:3L%4L,0.500<:0.750 (+),0.00,-inf,-inf (+),0.00,nan,nan (+),0.00,x,__failed__ @@ -1265,12 +1265,12 @@ (+),1.20,1.20+:-4.30,2.40+:-4.30 (+),1.20,1L%2L+:1,1.70+:1 (+),1.20,1L%2L+:3L%4L,1.70+:3L%4L -(+),1.20,3<:1,2.82+:2.52 -(+),1.20,3<:-2.14,-0.421+:-2.52 -(+),1.20,3.00<:-3,-1.77+:-0.423 -(+),1.20,3.10<:2.50,-1.28+:1.86 -(+),1.20,2L%3L<:2,0.923+:0.606 -(+),1.20,1L%2L<:3L%4L,1.57+:0.341 +(+),1.20,3<:1,3.79<:0.730 +(+),1.20,3<:-2.14,2.56<:-1.74 +(+),1.20,3.00<:-3,1.82<:-2.91 +(+),1.20,3.10<:2.50,2.26<:2.18 +(+),1.20,2L%3L<:2,1.10<:0.581 +(+),1.20,1L%2L<:3L%4L,1.60<:0.214 (+),1.20,-inf,-inf (+),1.20,nan,nan (+),1.20,x,__failed__ @@ -1289,12 +1289,12 @@ (+),-1.20,1.20+:-4.30,0.00+:-4.30 (+),-1.20,1L%2L+:1,-0.700+:1 (+),-1.20,1L%2L+:3L%4L,-0.700+:3L%4L -(+),-1.20,3<:1,0.421+:2.52 -(+),-1.20,3<:-2.14,-2.82+:-2.52 -(+),-1.20,3.00<:-3,-4.17+:-0.423 -(+),-1.20,3.10<:2.50,-3.68+:1.86 -(+),-1.20,2L%3L<:2,-1.48+:0.606 -(+),-1.20,1L%2L<:3L%4L,-0.834+:0.341 +(+),-1.20,3<:1,2.56<:1.41 +(+),-1.20,3<:-2.14,3.79<:-2.41 +(+),-1.20,3.00<:-3,4.19<:-3.04 +(+),-1.20,3.10<:2.50,4.12<:2.68 +(+),-1.20,2L%3L<:2,1.60<:2.75 +(+),-1.20,1L%2L<:3L%4L,0.901<:2.75 (+),-1.20,-inf,-inf (+),-1.20,nan,nan (+),-1.20,x,__failed__ @@ -1313,12 +1313,12 @@ (+),1L%3L,1.20+:-4.30,1.53+:-4.30 (+),1L%3L,1L%2L+:1,5L%6L+:1 (+),1L%3L,1L%2L+:3L%4L,5L%6L+:3L%4L -(+),1L%3L,3<:1,1.95+:2.52 -(+),1L%3L,3<:-2.14,-1.29+:-2.52 -(+),1L%3L,3.00<:-3,-2.64+:-0.423 -(+),1L%3L,3.10<:2.50,-2.15+:1.86 -(+),1L%3L,2L%3L<:2,0.0559+:0.606 -(+),1L%3L,1L%2L<:3L%4L,0.699+:0.341 +(+),1L%3L,3<:1,3.19<:0.912 +(+),1L%3L,3<:-2.14,2.83<:-2.04 +(+),1L%3L,3.00<:-3,2.67<:-2.98 +(+),1L%3L,3.10<:2.50,2.84<:2.43 +(+),1L%3L,2L%3L<:2,0.609<:1.48 +(+),1L%3L,1L%2L<:3L%4L,0.778<:0.454 (+),1L%3L,-inf,-inf (+),1L%3L,nan,nan (+),1L%3L,x,__failed__ @@ -1337,12 +1337,12 @@ (+),(-1L)%4L,1.20+:-4.30,0.950+:-4.30 (+),(-1L)%4L,1L%2L+:1,1L%4L+:1 (+),(-1L)%4L,1L%2L+:3L%4L,1L%4L+:3L%4L -(+),(-1L)%4L,3<:1,1.37+:2.52 -(+),(-1L)%4L,3<:-2.14,-1.87+:-2.52 -(+),(-1L)%4L,3.00<:-3,-3.22+:-0.423 -(+),(-1L)%4L,3.10<:2.50,-2.73+:1.86 -(+),(-1L)%4L,2L%3L<:2,-0.527+:0.606 -(+),(-1L)%4L,1L%2L<:3L%4L,0.116+:0.341 +(+),(-1L)%4L,3<:1,2.87<:1.07 +(+),(-1L)%4L,3<:-2.14,3.14<:-2.21 +(+),(-1L)%4L,3.00<:-3,3.25<:-3.01 +(+),(-1L)%4L,3.10<:2.50,3.30<:2.55 +(+),(-1L)%4L,2L%3L<:2,0.804<:2.29 +(+),(-1L)%4L,1L%2L<:3L%4L,0.360<:1.24 (+),(-1L)%4L,-inf,-inf (+),(-1L)%4L,nan,nan (+),(-1L)%4L,x,__failed__ @@ -1514,14 +1514,14 @@ (+),1L%2L+:3L%4L,-inf,-inf+:3L%4L (+),1L%2L+:3L%4L,nan,nan+:3L%4L (+),1L%2L+:3L%4L,x,__failed__ -(+),3<:1,1,2.62+:2.52 -(+),3<:1,-1,0.621+:2.52 -(+),3<:1,0,1.62+:2.52 -(+),3<:1,0.00,1.62+:2.52 -(+),3<:1,1.20,2.82+:2.52 -(+),3<:1,-1.20,0.421+:2.52 -(+),3<:1,1L%3L,1.95+:2.52 -(+),3<:1,(-1L)%4L,1.37+:2.52 +(+),3<:1,1,3.64<:0.767 +(+),3<:1,-1,2.60<:1.33 +(+),3<:1,0,3.00<:1.00 +(+),3<:1,0.00,3.00<:1.00 +(+),3<:1,1.20,3.79<:0.730 +(+),3<:1,-1.20,2.56<:1.41 +(+),3<:1,1L%3L,3.19<:0.912 +(+),3<:1,(-1L)%4L,2.87<:1.07 (+),3<:1,1+:2,2.62+:4.52 (+),3<:1,-1+:2,0.621+:4.52 (+),3<:1,1+:-2,2.62+:0.524 @@ -1535,17 +1535,17 @@ (+),3<:1,3.10<:2.50,4.46<:1.77 (+),3<:1,2L%3L<:2,3.41<:1.17 (+),3<:1,1L%2L<:3L%4L,3.49<:0.965 -(+),3<:1,-inf,-inf+:2.52 -(+),3<:1,nan,nan+:2.52 +(+),3<:1,-inf,inf<:2.36 +(+),3<:1,nan,nan<:nan (+),3<:1,x,__failed__ -(+),3<:-2.14,1,-0.621+:-2.52 -(+),3<:-2.14,-1,-2.62+:-2.52 -(+),3<:-2.14,0,-1.62+:-2.52 -(+),3<:-2.14,0.00,-1.62+:-2.52 -(+),3<:-2.14,1.20,-0.421+:-2.52 -(+),3<:-2.14,-1.20,-2.82+:-2.52 -(+),3<:-2.14,1L%3L,-1.29+:-2.52 -(+),3<:-2.14,(-1L)%4L,-1.87+:-2.52 +(+),3<:-2.14,1,2.60<:-1.81 +(+),3<:-2.14,-1,3.64<:-2.37 +(+),3<:-2.14,0,3.00<:-2.14 +(+),3<:-2.14,0.00,3.00<:-2.14 +(+),3<:-2.14,1.20,2.56<:-1.74 +(+),3<:-2.14,-1.20,3.79<:-2.41 +(+),3<:-2.14,1L%3L,2.83<:-2.04 +(+),3<:-2.14,(-1L)%4L,3.14<:-2.21 (+),3<:-2.14,1+:2,-0.621+:-0.524 (+),3<:-2.14,-1+:2,-2.62+:-0.524 (+),3<:-2.14,1+:-2,-0.621+:-4.52 @@ -1559,17 +1559,17 @@ (+),3<:-2.14,3.10<:2.50,4.16<:-2.98 (+),3<:-2.14,2L%3L<:2,2.70<:-2.35 (+),3<:-2.14,1L%2L<:3L%4L,2.52<:-2.09 -(+),3<:-2.14,-inf,-inf+:-2.52 -(+),3<:-2.14,nan,nan+:-2.52 +(+),3<:-2.14,-inf,inf<:2.36 +(+),3<:-2.14,nan,nan<:nan (+),3<:-2.14,x,__failed__ -(+),3.00<:-3,1,-1.97+:-0.423 -(+),3.00<:-3,-1,-3.97+:-0.423 -(+),3.00<:-3,0,-2.97+:-0.423 -(+),3.00<:-3,0.00,-2.97+:-0.423 -(+),3.00<:-3,1.20,-1.77+:-0.423 -(+),3.00<:-3,-1.20,-4.17+:-0.423 -(+),3.00<:-3,1L%3L,-2.64+:-0.423 -(+),3.00<:-3,(-1L)%4L,-3.22+:-0.423 +(+),3.00<:-3,1,2.01<:-2.93 +(+),3.00<:-3,-1,3.99<:-3.04 +(+),3.00<:-3,0,3.00<:-3.00 +(+),3.00<:-3,0.00,3.00<:-3.00 +(+),3.00<:-3,1.20,1.82<:-2.91 +(+),3.00<:-3,-1.20,4.19<:-3.04 +(+),3.00<:-3,1L%3L,2.67<:-2.98 +(+),3.00<:-3,(-1L)%4L,3.25<:-3.01 (+),3.00<:-3,1+:2,-1.97+:1.58 (+),3.00<:-3,-1+:2,-3.97+:1.58 (+),3.00<:-3,1+:-2,-1.97+:-2.42 @@ -1583,17 +1583,17 @@ (+),3.00<:-3,3.10<:2.50,5.64<:2.88 (+),3.00<:-3,2L%3L<:2,3.25<:3.09 (+),3.00<:-3,1L%2L<:3L%4L,2.61<:-3.11 -(+),3.00<:-3,-inf,-inf+:-0.423 -(+),3.00<:-3,nan,nan+:-0.423 +(+),3.00<:-3,-inf,inf<:2.36 +(+),3.00<:-3,nan,nan<:nan (+),3.00<:-3,x,__failed__ -(+),3.10<:2.50,1,-1.48+:1.86 -(+),3.10<:2.50,-1,-3.48+:1.86 -(+),3.10<:2.50,0,-2.48+:1.86 -(+),3.10<:2.50,0.00,-2.48+:1.86 -(+),3.10<:2.50,1.20,-1.28+:1.86 -(+),3.10<:2.50,-1.20,-3.68+:1.86 -(+),3.10<:2.50,1L%3L,-2.15+:1.86 -(+),3.10<:2.50,(-1L)%4L,-2.73+:1.86 +(+),3.10<:2.50,1,2.38<:2.25 +(+),3.10<:2.50,-1,3.95<:2.65 +(+),3.10<:2.50,0,3.10<:2.50 +(+),3.10<:2.50,0.00,3.10<:2.50 +(+),3.10<:2.50,1.20,2.26<:2.18 +(+),3.10<:2.50,-1.20,4.12<:2.68 +(+),3.10<:2.50,1L%3L,2.84<:2.43 +(+),3.10<:2.50,(-1L)%4L,3.30<:2.55 (+),3.10<:2.50,1+:2,-1.48+:3.86 (+),3.10<:2.50,-1+:2,-3.48+:3.86 (+),3.10<:2.50,1+:-2,-1.48+:-0.145 @@ -1607,17 +1607,17 @@ (+),3.10<:2.50,3.10<:2.50,6.20<:2.50 (+),3.10<:2.50,2L%3L<:2,3.70<:2.41 (+),3.10<:2.50,1L%2L<:3L%4L,3.05<:2.34 -(+),3.10<:2.50,-inf,-inf+:1.86 -(+),3.10<:2.50,nan,nan+:1.86 +(+),3.10<:2.50,-inf,inf<:2.36 +(+),3.10<:2.50,nan,nan<:nan (+),3.10<:2.50,x,__failed__ -(+),2L%3L<:2,1,0.723+:0.606 -(+),2L%3L<:2,-1,-1.28+:0.606 -(+),2L%3L<:2,0,-0.277+:0.606 -(+),2L%3L<:2,0.00,-0.277+:0.606 -(+),2L%3L<:2,1.20,0.923+:0.606 -(+),2L%3L<:2,-1.20,-1.48+:0.606 -(+),2L%3L<:2,1L%3L,0.0559+:0.606 -(+),2L%3L<:2,(-1L)%4L,-0.527+:0.606 +(+),2L%3L<:2,1,0.943<:0.698 +(+),2L%3L<:2,-1,1.41<:2.70 +(+),2L%3L<:2,0,0.667<:2.00 +(+),2L%3L<:2,0.00,0.667<:2.00 +(+),2L%3L<:2,1.20,1.10<:0.581 +(+),2L%3L<:2,-1.20,1.60<:2.75 +(+),2L%3L<:2,1L%3L,0.609<:1.48 +(+),2L%3L<:2,(-1L)%4L,0.804<:2.29 (+),2L%3L<:2,1+:2,0.723+:2.61 (+),2L%3L<:2,-1+:2,-1.28+:2.61 (+),2L%3L<:2,1+:-2,0.723+:-1.39 @@ -1631,17 +1631,17 @@ (+),2L%3L<:2,3.10<:2.50,3.70<:2.41 (+),2L%3L<:2,2L%3L<:2,1.33<:2.00 (+),2L%3L<:2,1L%2L<:3L%4L,0.951<:1.48 -(+),2L%3L<:2,-inf,-inf+:0.606 -(+),2L%3L<:2,nan,nan+:0.606 +(+),2L%3L<:2,-inf,inf<:2.36 +(+),2L%3L<:2,nan,nan<:nan (+),2L%3L<:2,x,__failed__ -(+),1L%2L<:3L%4L,1,1.37+:0.341 -(+),1L%2L<:3L%4L,-1,-0.634+:0.341 -(+),1L%2L<:3L%4L,0,0.366+:0.341 -(+),1L%2L<:3L%4L,0.00,0.366+:0.341 -(+),1L%2L<:3L%4L,1.20,1.57+:0.341 -(+),1L%2L<:3L%4L,-1.20,-0.834+:0.341 -(+),1L%2L<:3L%4L,1L%3L,0.699+:0.341 -(+),1L%2L<:3L%4L,(-1L)%4L,0.116+:0.341 +(+),1L%2L<:3L%4L,1,1.41<:0.245 +(+),1L%2L<:3L%4L,-1,0.720<:2.65 +(+),1L%2L<:3L%4L,0,0.500<:0.750 +(+),1L%2L<:3L%4L,0.00,0.500<:0.750 +(+),1L%2L<:3L%4L,1.20,1.60<:0.214 +(+),1L%2L<:3L%4L,-1.20,0.901<:2.75 +(+),1L%2L<:3L%4L,1L%3L,0.778<:0.454 +(+),1L%2L<:3L%4L,(-1L)%4L,0.360<:1.24 (+),1L%2L<:3L%4L,1+:2,1.37+:2.34 (+),1L%2L<:3L%4L,-1+:2,-0.634+:2.34 (+),1L%2L<:3L%4L,1+:-2,1.37+:-1.66 @@ -1655,8 +1655,8 @@ (+),1L%2L<:3L%4L,3.10<:2.50,3.05<:2.34 (+),1L%2L<:3L%4L,2L%3L<:2,0.951<:1.48 (+),1L%2L<:3L%4L,1L%2L<:3L%4L,1.00<:0.750 -(+),1L%2L<:3L%4L,-inf,-inf+:0.341 -(+),1L%2L<:3L%4L,nan,nan+:0.341 +(+),1L%2L<:3L%4L,-inf,inf<:2.36 +(+),1L%2L<:3L%4L,nan,nan<:nan (+),1L%2L<:3L%4L,x,__failed__ (+),-inf,1,-inf (+),-inf,-1,-inf @@ -1673,12 +1673,12 @@ (+),-inf,1.20+:-4.30,-inf+:-4.30 (+),-inf,1L%2L+:1,-inf+:1 (+),-inf,1L%2L+:3L%4L,-inf+:3L%4L -(+),-inf,3<:1,-inf+:2.52 -(+),-inf,3<:-2.14,-inf+:-2.52 -(+),-inf,3.00<:-3,-inf+:-0.423 -(+),-inf,3.10<:2.50,-inf+:1.86 -(+),-inf,2L%3L<:2,-inf+:0.606 -(+),-inf,1L%2L<:3L%4L,-inf+:0.341 +(+),-inf,3<:1,inf<:2.36 +(+),-inf,3<:-2.14,inf<:2.36 +(+),-inf,3.00<:-3,inf<:2.36 +(+),-inf,3.10<:2.50,inf<:2.36 +(+),-inf,2L%3L<:2,inf<:2.36 +(+),-inf,1L%2L<:3L%4L,inf<:2.36 (+),-inf,-inf,-inf (+),-inf,nan,nan (+),-inf,x,__failed__ @@ -1697,12 +1697,12 @@ (+),nan,1.20+:-4.30,nan+:-4.30 (+),nan,1L%2L+:1,nan+:1 (+),nan,1L%2L+:3L%4L,nan+:3L%4L -(+),nan,3<:1,nan+:2.52 -(+),nan,3<:-2.14,nan+:-2.52 -(+),nan,3.00<:-3,nan+:-0.423 -(+),nan,3.10<:2.50,nan+:1.86 -(+),nan,2L%3L<:2,nan+:0.606 -(+),nan,1L%2L<:3L%4L,nan+:0.341 +(+),nan,3<:1,nan<:nan +(+),nan,3<:-2.14,nan<:nan +(+),nan,3.00<:-3,nan<:nan +(+),nan,3.10<:2.50,nan<:nan +(+),nan,2L%3L<:2,nan<:nan +(+),nan,1L%2L<:3L%4L,nan<:nan (+),nan,-inf,nan (+),nan,nan,nan (+),nan,x,__failed__ @@ -1745,12 +1745,12 @@ (-),1,1.20+:-4.30,-0.200+:4.30 (-),1,1L%2L+:1,1L%2L+:-1 (-),1,1L%2L+:3L%4L,1L%2L+:(-3L)%4L -(-),1,3<:1,-0.621+:-2.52 -(-),1,3<:-2.14,2.62+:2.52 -(-),1,3.00<:-3,3.97+:0.423 -(-),1,3.10<:2.50,3.48+:-1.86 -(-),1,2L%3L<:2,1.28+:-0.606 -(-),1,1L%2L<:3L%4L,0.634+:-0.341 +(-),1,3<:1,2.60<:-1.81 +(-),1,3<:-2.14,3.64<:0.767 +(-),1,3.00<:-3,3.99<:0.106 +(-),1,3.10<:2.50,3.95<:-0.489 +(-),1,2L%3L<:2,1.41<:-0.443 +(-),1,1L%2L<:3L%4L,0.720<:-0.493 (-),1,-inf,inf (-),1,nan,nan (-),1,x,__failed__ @@ -1769,12 +1769,12 @@ (-),-1,1.20+:-4.30,-2.20+:4.30 (-),-1,1L%2L+:1,(-3L)%2L+:-1 (-),-1,1L%2L+:3L%4L,(-3L)%2L+:(-3L)%4L -(-),-1,3<:1,-2.62+:-2.52 -(-),-1,3<:-2.14,0.621+:2.52 -(-),-1,3.00<:-3,1.97+:0.423 -(-),-1,3.10<:2.50,1.48+:-1.86 -(-),-1,2L%3L<:2,-0.723+:-0.606 -(-),-1,1L%2L<:3L%4L,-1.37+:-0.341 +(-),-1,3<:1,3.64<:-2.37 +(-),-1,3<:-2.14,2.60<:1.33 +(-),-1,3.00<:-3,2.01<:0.212 +(-),-1,3.10<:2.50,2.38<:-0.896 +(-),-1,2L%3L<:2,0.943<:-2.44 +(-),-1,1L%2L<:3L%4L,1.41<:-2.90 (-),-1,-inf,inf (-),-1,nan,nan (-),-1,x,__failed__ @@ -1793,12 +1793,12 @@ (-),0,1.20+:-4.30,-1.20+:4.30 (-),0,1L%2L+:1,(-1L)%2L+:-1 (-),0,1L%2L+:3L%4L,(-1L)%2L+:(-3L)%4L -(-),0,3<:1,-1.62+:-2.52 -(-),0,3<:-2.14,1.62+:2.52 -(-),0,3.00<:-3,2.97+:0.423 -(-),0,3.10<:2.50,2.48+:-1.86 -(-),0,2L%3L<:2,0.277+:-0.606 -(-),0,1L%2L<:3L%4L,-0.366+:-0.341 +(-),0,3<:1,3.00<:-2.14 +(-),0,3<:-2.14,3.00<:1.00 +(-),0,3.00<:-3,3.00<:0.142 +(-),0,3.10<:2.50,3.10<:-0.642 +(-),0,2L%3L<:2,0.667<:-1.14 +(-),0,1L%2L<:3L%4L,0.500<:-2.39 (-),0,-inf,inf (-),0,nan,nan (-),0,x,__failed__ @@ -1817,12 +1817,12 @@ (-),0.00,1.20+:-4.30,-1.20+:4.30 (-),0.00,1L%2L+:1,-0.500+:-1 (-),0.00,1L%2L+:3L%4L,-0.500+:(-3L)%4L -(-),0.00,3<:1,-1.62+:-2.52 -(-),0.00,3<:-2.14,1.62+:2.52 -(-),0.00,3.00<:-3,2.97+:0.423 -(-),0.00,3.10<:2.50,2.48+:-1.86 -(-),0.00,2L%3L<:2,0.277+:-0.606 -(-),0.00,1L%2L<:3L%4L,-0.366+:-0.341 +(-),0.00,3<:1,3.00<:-2.14 +(-),0.00,3<:-2.14,3.00<:1.00 +(-),0.00,3.00<:-3,3.00<:0.142 +(-),0.00,3.10<:2.50,3.10<:-0.642 +(-),0.00,2L%3L<:2,0.667<:-1.14 +(-),0.00,1L%2L<:3L%4L,0.500<:-2.39 (-),0.00,-inf,inf (-),0.00,nan,nan (-),0.00,x,__failed__ @@ -1841,12 +1841,12 @@ (-),1.20,1.20+:-4.30,0.00+:4.30 (-),1.20,1L%2L+:1,0.700+:-1 (-),1.20,1L%2L+:3L%4L,0.700+:(-3L)%4L -(-),1.20,3<:1,-0.421+:-2.52 -(-),1.20,3<:-2.14,2.82+:2.52 -(-),1.20,3.00<:-3,4.17+:0.423 -(-),1.20,3.10<:2.50,3.68+:-1.86 -(-),1.20,2L%3L<:2,1.48+:-0.606 -(-),1.20,1L%2L<:3L%4L,0.834+:-0.341 +(-),1.20,3<:1,2.56<:-1.74 +(-),1.20,3<:-2.14,3.79<:0.730 +(-),1.20,3.00<:-3,4.19<:0.101 +(-),1.20,3.10<:2.50,4.12<:-0.467 +(-),1.20,2L%3L<:2,1.60<:-0.389 +(-),1.20,1L%2L<:3L%4L,0.901<:-0.388 (-),1.20,-inf,inf (-),1.20,nan,nan (-),1.20,x,__failed__ @@ -1865,12 +1865,12 @@ (-),-1.20,1.20+:-4.30,-2.40+:4.30 (-),-1.20,1L%2L+:1,-1.70+:-1 (-),-1.20,1L%2L+:3L%4L,-1.70+:(-3L)%4L -(-),-1.20,3<:1,-2.82+:-2.52 -(-),-1.20,3<:-2.14,0.421+:2.52 -(-),-1.20,3.00<:-3,1.77+:0.423 -(-),-1.20,3.10<:2.50,1.28+:-1.86 -(-),-1.20,2L%3L<:2,-0.923+:-0.606 -(-),-1.20,1L%2L<:3L%4L,-1.57+:-0.341 +(-),-1.20,3<:1,3.79<:-2.41 +(-),-1.20,3<:-2.14,2.56<:1.41 +(-),-1.20,3.00<:-3,1.82<:0.235 +(-),-1.20,3.10<:2.50,2.26<:-0.966 +(-),-1.20,2L%3L<:2,1.10<:-2.56 +(-),-1.20,1L%2L<:3L%4L,1.60<:-2.93 (-),-1.20,-inf,inf (-),-1.20,nan,nan (-),-1.20,x,__failed__ @@ -1889,12 +1889,12 @@ (-),1L%3L,1.20+:-4.30,-0.867+:4.30 (-),1L%3L,1L%2L+:1,(-1L)%6L+:-1 (-),1L%3L,1L%2L+:3L%4L,(-1L)%6L+:(-3L)%4L -(-),1L%3L,3<:1,-1.29+:-2.52 -(-),1L%3L,3<:-2.14,1.95+:2.52 -(-),1L%3L,3.00<:-3,3.30+:0.423 -(-),1L%3L,3.10<:2.50,2.82+:-1.86 -(-),1L%3L,2L%3L<:2,0.611+:-0.606 -(-),1L%3L,1L%2L<:3L%4L,-0.0325+:-0.341 +(-),1L%3L,3<:1,2.83<:-2.04 +(-),1L%3L,3<:-2.14,3.19<:0.912 +(-),1L%3L,3.00<:-3,3.33<:0.127 +(-),1L%3L,3.10<:2.50,3.37<:-0.582 +(-),1L%3L,2L%3L<:2,0.861<:-0.782 +(-),1L%3L,1L%2L<:3L%4L,0.342<:-1.67 (-),1L%3L,-inf,inf (-),1L%3L,nan,nan (-),1L%3L,x,__failed__ @@ -1913,12 +1913,12 @@ (-),(-1L)%4L,1.20+:-4.30,-1.45+:4.30 (-),(-1L)%4L,1L%2L+:1,(-3L)%4L+:-1 (-),(-1L)%4L,1L%2L+:3L%4L,(-3L)%4L+:(-3L)%4L -(-),(-1L)%4L,3<:1,-1.87+:-2.52 -(-),(-1L)%4L,3<:-2.14,1.37+:2.52 -(-),(-1L)%4L,3.00<:-3,2.72+:0.423 -(-),(-1L)%4L,3.10<:2.50,2.23+:-1.86 -(-),(-1L)%4L,2L%3L<:2,0.0274+:-0.606 -(-),(-1L)%4L,1L%2L<:3L%4L,-0.616+:-0.341 +(-),(-1L)%4L,3<:1,3.14<:-2.21 +(-),(-1L)%4L,3<:-2.14,2.87<:1.07 +(-),(-1L)%4L,3.00<:-3,2.75<:0.154 +(-),(-1L)%4L,3.10<:2.50,2.90<:-0.693 +(-),(-1L)%4L,2L%3L<:2,0.607<:-1.53 +(-),(-1L)%4L,1L%2L<:3L%4L,0.704<:-2.64 (-),(-1L)%4L,-inf,inf (-),(-1L)%4L,nan,nan (-),(-1L)%4L,x,__failed__ @@ -2090,14 +2090,14 @@ (-),1L%2L+:3L%4L,-inf,inf+:3L%4L (-),1L%2L+:3L%4L,nan,nan+:3L%4L (-),1L%2L+:3L%4L,x,__failed__ -(-),3<:1,1,0.621+:2.52 -(-),3<:1,-1,2.62+:2.52 -(-),3<:1,0,1.62+:2.52 -(-),3<:1,0.00,1.62+:2.52 -(-),3<:1,1.20,0.421+:2.52 -(-),3<:1,-1.20,2.82+:2.52 -(-),3<:1,1L%3L,1.29+:2.52 -(-),3<:1,(-1L)%4L,1.87+:2.52 +(-),3<:1,1,2.60<:1.33 +(-),3<:1,-1,3.64<:0.767 +(-),3<:1,0,3.00<:1.00 +(-),3<:1,0.00,3.00<:1.00 +(-),3<:1,1.20,2.56<:1.41 +(-),3<:1,-1.20,3.79<:0.730 +(-),3<:1,1L%3L,2.83<:1.10 +(-),3<:1,(-1L)%4L,3.14<:0.933 (-),3<:1,1+:2,0.621+:0.524 (-),3<:1,-1+:2,2.62+:0.524 (-),3<:1,1+:-2,0.621+:4.52 @@ -2111,17 +2111,17 @@ (-),3<:1,3.10<:2.50,4.16<:0.162 (-),3<:1,2L%3L<:2,2.70<:0.791 (-),3<:1,1L%2L<:3L%4L,2.52<:1.05 -(-),3<:1,-inf,inf+:2.52 -(-),3<:1,nan,nan+:2.52 +(-),3<:1,-inf,inf<:-0.785 +(-),3<:1,nan,nan<:nan (-),3<:1,x,__failed__ -(-),3<:-2.14,1,-2.62+:-2.52 -(-),3<:-2.14,-1,-0.621+:-2.52 -(-),3<:-2.14,0,-1.62+:-2.52 -(-),3<:-2.14,0.00,-1.62+:-2.52 -(-),3<:-2.14,1.20,-2.82+:-2.52 -(-),3<:-2.14,-1.20,-0.421+:-2.52 -(-),3<:-2.14,1L%3L,-1.95+:-2.52 -(-),3<:-2.14,(-1L)%4L,-1.37+:-2.52 +(-),3<:-2.14,1,3.64<:-2.37 +(-),3<:-2.14,-1,2.60<:-1.81 +(-),3<:-2.14,0,3.00<:-2.14 +(-),3<:-2.14,0.00,3.00<:-2.14 +(-),3<:-2.14,1.20,3.79<:-2.41 +(-),3<:-2.14,-1.20,2.56<:-1.74 +(-),3<:-2.14,1L%3L,3.19<:-2.23 +(-),3<:-2.14,(-1L)%4L,2.87<:-2.07 (-),3<:-2.14,1+:2,-2.62+:-4.52 (-),3<:-2.14,-1+:2,-0.621+:-4.52 (-),3<:-2.14,1+:-2,-2.62+:-0.524 @@ -2135,17 +2135,17 @@ (-),3<:-2.14,3.10<:2.50,4.46<:-1.38 (-),3<:-2.14,2L%3L<:2,3.41<:-1.98 (-),3<:-2.14,1L%2L<:3L%4L,3.49<:-2.18 -(-),3<:-2.14,-inf,inf+:-2.52 -(-),3<:-2.14,nan,nan+:-2.52 +(-),3<:-2.14,-inf,inf<:-0.785 +(-),3<:-2.14,nan,nan<:nan (-),3<:-2.14,x,__failed__ -(-),3.00<:-3,1,-3.97+:-0.423 -(-),3.00<:-3,-1,-1.97+:-0.423 -(-),3.00<:-3,0,-2.97+:-0.423 -(-),3.00<:-3,0.00,-2.97+:-0.423 -(-),3.00<:-3,1.20,-4.17+:-0.423 -(-),3.00<:-3,-1.20,-1.77+:-0.423 -(-),3.00<:-3,1L%3L,-3.30+:-0.423 -(-),3.00<:-3,(-1L)%4L,-2.72+:-0.423 +(-),3.00<:-3,1,3.99<:-3.04 +(-),3.00<:-3,-1,2.01<:-2.93 +(-),3.00<:-3,0,3.00<:-3.00 +(-),3.00<:-3,0.00,3.00<:-3.00 +(-),3.00<:-3,1.20,4.19<:-3.04 +(-),3.00<:-3,-1.20,1.82<:-2.91 +(-),3.00<:-3,1L%3L,3.33<:-3.01 +(-),3.00<:-3,(-1L)%4L,2.75<:-2.99 (-),3.00<:-3,1+:2,-3.97+:-2.42 (-),3.00<:-3,-1+:2,-1.97+:-2.42 (-),3.00<:-3,1+:-2,-3.97+:1.58 @@ -2159,17 +2159,17 @@ (-),3.00<:-3,3.10<:2.50,2.33<:-1.78 (-),3.00<:-3,2L%3L<:2,2.88<:-2.78 (-),3.00<:-3,1L%2L<:3L%4L,3.42<:-2.92 -(-),3.00<:-3,-inf,inf+:-0.423 -(-),3.00<:-3,nan,nan+:-0.423 +(-),3.00<:-3,-inf,inf<:-0.785 +(-),3.00<:-3,nan,nan<:nan (-),3.00<:-3,x,__failed__ -(-),3.10<:2.50,1,-3.48+:1.86 -(-),3.10<:2.50,-1,-1.48+:1.86 -(-),3.10<:2.50,0,-2.48+:1.86 -(-),3.10<:2.50,0.00,-2.48+:1.86 -(-),3.10<:2.50,1.20,-3.68+:1.86 -(-),3.10<:2.50,-1.20,-1.28+:1.86 -(-),3.10<:2.50,1L%3L,-2.82+:1.86 -(-),3.10<:2.50,(-1L)%4L,-2.23+:1.86 +(-),3.10<:2.50,1,3.95<:2.65 +(-),3.10<:2.50,-1,2.38<:2.25 +(-),3.10<:2.50,0,3.10<:2.50 +(-),3.10<:2.50,0.00,3.10<:2.50 +(-),3.10<:2.50,1.20,4.12<:2.68 +(-),3.10<:2.50,-1.20,2.26<:2.18 +(-),3.10<:2.50,1L%3L,3.37<:2.56 +(-),3.10<:2.50,(-1L)%4L,2.90<:2.45 (-),3.10<:2.50,1+:2,-3.48+:-0.145 (-),3.10<:2.50,-1+:2,-1.48+:-0.145 (-),3.10<:2.50,1+:-2,-3.48+:3.86 @@ -2183,17 +2183,17 @@ (-),3.10<:2.50,3.10<:2.50,0.00<:0.00 (-),3.10<:2.50,2L%3L<:2,2.54<:2.63 (-),3.10<:2.50,1L%2L<:3L%4L,3.23<:2.65 -(-),3.10<:2.50,-inf,inf+:1.86 -(-),3.10<:2.50,nan,nan+:1.86 +(-),3.10<:2.50,-inf,inf<:-0.785 +(-),3.10<:2.50,nan,nan<:nan (-),3.10<:2.50,x,__failed__ -(-),2L%3L<:2,1,-1.28+:0.606 -(-),2L%3L<:2,-1,0.723+:0.606 -(-),2L%3L<:2,0,-0.277+:0.606 -(-),2L%3L<:2,0.00,-0.277+:0.606 -(-),2L%3L<:2,1.20,-1.48+:0.606 -(-),2L%3L<:2,-1.20,0.923+:0.606 -(-),2L%3L<:2,1L%3L,-0.611+:0.606 -(-),2L%3L<:2,(-1L)%4L,-0.0274+:0.606 +(-),2L%3L<:2,1,1.41<:2.70 +(-),2L%3L<:2,-1,0.943<:0.698 +(-),2L%3L<:2,0,0.667<:2.00 +(-),2L%3L<:2,0.00,0.667<:2.00 +(-),2L%3L<:2,1.20,1.60<:2.75 +(-),2L%3L<:2,-1.20,1.10<:0.581 +(-),2L%3L<:2,1L%3L,0.861<:2.36 +(-),2L%3L<:2,(-1L)%4L,0.607<:1.62 (-),2L%3L<:2,1+:2,-1.28+:-1.39 (-),2L%3L<:2,-1+:2,0.723+:-1.39 (-),2L%3L<:2,1+:-2,-1.28+:2.61 @@ -2207,17 +2207,17 @@ (-),2L%3L<:2,3.10<:2.50,2.54<:-0.515 (-),2L%3L<:2,2L%3L<:2,0.00<:0.00 (-),2L%3L<:2,1L%2L<:3L%4L,0.696<:2.75 -(-),2L%3L<:2,-inf,inf+:0.606 -(-),2L%3L<:2,nan,nan+:0.606 +(-),2L%3L<:2,-inf,inf<:-0.785 +(-),2L%3L<:2,nan,nan<:nan (-),2L%3L<:2,x,__failed__ -(-),1L%2L<:3L%4L,1,-0.634+:0.341 -(-),1L%2L<:3L%4L,-1,1.37+:0.341 -(-),1L%2L<:3L%4L,0,0.366+:0.341 -(-),1L%2L<:3L%4L,0.00,0.366+:0.341 -(-),1L%2L<:3L%4L,1.20,-0.834+:0.341 -(-),1L%2L<:3L%4L,-1.20,1.57+:0.341 -(-),1L%2L<:3L%4L,1L%3L,0.0325+:0.341 -(-),1L%2L<:3L%4L,(-1L)%4L,0.616+:0.341 +(-),1L%2L<:3L%4L,1,0.720<:2.65 +(-),1L%2L<:3L%4L,-1,1.41<:0.245 +(-),1L%2L<:3L%4L,0,0.500<:0.750 +(-),1L%2L<:3L%4L,0.00,0.500<:0.750 +(-),1L%2L<:3L%4L,1.20,0.901<:2.75 +(-),1L%2L<:3L%4L,-1.20,1.60<:0.214 +(-),1L%2L<:3L%4L,1L%3L,0.342<:1.48 +(-),1L%2L<:3L%4L,(-1L)%4L,0.704<:0.505 (-),1L%2L<:3L%4L,1+:2,-0.634+:-1.66 (-),1L%2L<:3L%4L,-1+:2,1.37+:-1.66 (-),1L%2L<:3L%4L,1+:-2,-0.634+:2.34 @@ -2231,8 +2231,8 @@ (-),1L%2L<:3L%4L,3.10<:2.50,3.23<:-0.489 (-),1L%2L<:3L%4L,2L%3L<:2,0.696<:-0.391 (-),1L%2L<:3L%4L,1L%2L<:3L%4L,0.00<:0.00 -(-),1L%2L<:3L%4L,-inf,inf+:0.341 -(-),1L%2L<:3L%4L,nan,nan+:0.341 +(-),1L%2L<:3L%4L,-inf,inf<:-0.785 +(-),1L%2L<:3L%4L,nan,nan<:nan (-),1L%2L<:3L%4L,x,__failed__ (-),-inf,1,-inf (-),-inf,-1,-inf @@ -2249,12 +2249,12 @@ (-),-inf,1.20+:-4.30,-inf+:4.30 (-),-inf,1L%2L+:1,-inf+:-1 (-),-inf,1L%2L+:3L%4L,-inf+:(-3L)%4L -(-),-inf,3<:1,-inf+:-2.52 -(-),-inf,3<:-2.14,-inf+:2.52 -(-),-inf,3.00<:-3,-inf+:0.423 -(-),-inf,3.10<:2.50,-inf+:-1.86 -(-),-inf,2L%3L<:2,-inf+:-0.606 -(-),-inf,1L%2L<:3L%4L,-inf+:-0.341 +(-),-inf,3<:1,inf<:2.36 +(-),-inf,3<:-2.14,inf<:2.36 +(-),-inf,3.00<:-3,inf<:2.36 +(-),-inf,3.10<:2.50,inf<:2.36 +(-),-inf,2L%3L<:2,inf<:2.36 +(-),-inf,1L%2L<:3L%4L,inf<:2.36 (-),-inf,-inf,nan (-),-inf,nan,nan (-),-inf,x,__failed__ @@ -2273,12 +2273,12 @@ (-),nan,1.20+:-4.30,nan+:4.30 (-),nan,1L%2L+:1,nan+:-1 (-),nan,1L%2L+:3L%4L,nan+:(-3L)%4L -(-),nan,3<:1,nan+:-2.52 -(-),nan,3<:-2.14,nan+:2.52 -(-),nan,3.00<:-3,nan+:0.423 -(-),nan,3.10<:2.50,nan+:-1.86 -(-),nan,2L%3L<:2,nan+:-0.606 -(-),nan,1L%2L<:3L%4L,nan+:-0.341 +(-),nan,3<:1,nan<:nan +(-),nan,3<:-2.14,nan<:nan +(-),nan,3.00<:-3,nan<:nan +(-),nan,3.10<:2.50,nan<:nan +(-),nan,2L%3L<:2,nan<:nan +(-),nan,1L%2L<:3L%4L,nan<:nan (-),nan,-inf,nan (-),nan,nan,nan (-),nan,x,__failed__ @@ -2319,7 +2319,7 @@ (*),1,1+:-2,1+:-2 (*),1,-1.20+:4.30,-1.20+:4.30 (*),1,1.20+:-4.30,1.20+:-4.30 -(*),1,1L%2L+:1,1L%2L+:1 +(*),1,1L%2L+:1,1L%2L+:1L%1L (*),1,1L%2L+:3L%4L,1L%2L+:3L%4L (*),1,3<:1,3<:1 (*),1,3<:-2.14,3<:-2.14 @@ -2343,7 +2343,7 @@ (*),-1,1+:-2,-1+:2 (*),-1,-1.20+:4.30,1.20+:-4.30 (*),-1,1.20+:-4.30,-1.20+:4.30 -(*),-1,1L%2L+:1,(-1L)%2L+:-1 +(*),-1,1L%2L+:1,(-1L)%2L+:(-1L)%1L (*),-1,1L%2L+:3L%4L,(-1L)%2L+:(-3L)%4L (*),-1,3<:1,3<:-2.14 (*),-1,3<:-2.14,3<:1.00 @@ -2367,7 +2367,7 @@ (*),0,1+:-2,0+:0 (*),0,-1.20+:4.30,0.00+:0.00 (*),0,1.20+:-4.30,0.00+:0.00 -(*),0,1L%2L+:1,0L%1L+:0 +(*),0,1L%2L+:1,0L%1L+:0L%1L (*),0,1L%2L+:3L%4L,0L%1L+:0L%1L (*),0,3<:1,0<:1 (*),0,3<:-2.14,0<:-2.14 @@ -2618,9 +2618,9 @@ (*),1.20+:-4.30,-inf,-inf+:inf (*),1.20+:-4.30,nan,nan+:nan (*),1.20+:-4.30,x,__failed__ -(*),1L%2L+:1,1,1L%2L+:1 -(*),1L%2L+:1,-1,(-1L)%2L+:-1 -(*),1L%2L+:1,0,0L%1L+:0 +(*),1L%2L+:1,1,1L%2L+:1L%1L +(*),1L%2L+:1,-1,(-1L)%2L+:(-1L)%1L +(*),1L%2L+:1,0,0L%1L+:0L%1L (*),1L%2L+:1,0.00,0.00+:0.00 (*),1L%2L+:1,1.20,0.600+:1.20 (*),1L%2L+:1,-1.20,-0.600+:-1.20 @@ -3076,8 +3076,8 @@ (/),(-1L)%4L,x,__failed__ (/),1+:2,1,1.00+:2.00 (/),1+:2,-1,-1.00+:-2.00 -(/),1+:2,0,inf+:inf -(/),1+:2,0.00,inf+:inf +(/),1+:2,0,nan+:nan +(/),1+:2,0.00,nan+:nan (/),1+:2,1.20,0.833+:1.67 (/),1+:2,-1.20,-0.833+:-1.67 (/),1+:2,1L%3L,3.00+:6.00 @@ -3095,13 +3095,13 @@ (/),1+:2,3.10<:2.50,0.128+:-0.710 (/),1+:2,2L%3L<:2,2.10+:-2.61 (/),1+:2,1L%2L<:3L%4L,4.19+:1.56 -(/),1+:2,-inf,0.00+:0.00 +(/),1+:2,-inf,nan+:nan (/),1+:2,nan,nan+:nan (/),1+:2,x,__failed__ (/),-1+:2,1,-1.00+:2.00 (/),-1+:2,-1,1.00+:-2.00 -(/),-1+:2,0,-inf+:inf -(/),-1+:2,0.00,-inf+:inf +(/),-1+:2,0,nan+:nan +(/),-1+:2,0.00,nan+:nan (/),-1+:2,1.20,-0.833+:1.67 (/),-1+:2,-1.20,0.833+:-1.67 (/),-1+:2,1L%3L,-3.00+:6.00 @@ -3119,13 +3119,13 @@ (/),-1+:2,3.10<:2.50,0.645+:-0.324 (/),-1+:2,2L%3L<:2,3.35+:0.116 (/),-1+:2,1L%2L<:3L%4L,1.26+:4.29 -(/),-1+:2,-inf,0.00+:0.00 +(/),-1+:2,-inf,nan+:nan (/),-1+:2,nan,nan+:nan (/),-1+:2,x,__failed__ (/),1+:-2,1,1.00+:-2.00 (/),1+:-2,-1,-1.00+:2.00 -(/),1+:-2,0,inf+:-inf -(/),1+:-2,0.00,inf+:-inf +(/),1+:-2,0,nan+:nan +(/),1+:-2,0.00,nan+:nan (/),1+:-2,1.20,0.833+:-1.67 (/),1+:-2,-1.20,-0.833+:1.67 (/),1+:-2,1L%3L,3.00+:-6.00 @@ -3143,13 +3143,13 @@ (/),1+:-2,3.10<:2.50,-0.645+:0.324 (/),1+:-2,2L%3L<:2,-3.35+:-0.116 (/),1+:-2,1L%2L<:3L%4L,-1.26+:-4.29 -(/),1+:-2,-inf,0.00+:0.00 +(/),1+:-2,-inf,nan+:nan (/),1+:-2,nan,nan+:nan (/),1+:-2,x,__failed__ (/),-1.20+:4.30,1,-1.20+:4.30 (/),-1.20+:4.30,-1,1.20+:-4.30 -(/),-1.20+:4.30,0,-inf+:inf -(/),-1.20+:4.30,0.00,-inf+:inf +(/),-1.20+:4.30,0,nan+:nan +(/),-1.20+:4.30,0.00,nan+:nan (/),-1.20+:4.30,1.20,-1.00+:3.58 (/),-1.20+:4.30,-1.20,1.00+:-3.58 (/),-1.20+:4.30,1L%3L,-3.60+:12.9 @@ -3167,13 +3167,13 @@ (/),-1.20+:4.30,3.10<:2.50,1.14+:-0.880 (/),-1.20+:4.30,2L%3L<:2,6.61+:-1.05 (/),-1.20+:4.30,1L%2L<:3L%4L,4.11+:7.93 -(/),-1.20+:4.30,-inf,0.00+:0.00 +(/),-1.20+:4.30,-inf,nan+:nan (/),-1.20+:4.30,nan,nan+:nan (/),-1.20+:4.30,x,__failed__ (/),1.20+:-4.30,1,1.20+:-4.30 (/),1.20+:-4.30,-1,-1.20+:4.30 -(/),1.20+:-4.30,0,inf+:-inf -(/),1.20+:-4.30,0.00,inf+:-inf +(/),1.20+:-4.30,0,nan+:nan +(/),1.20+:-4.30,0.00,nan+:nan (/),1.20+:-4.30,1.20,1.00+:-3.58 (/),1.20+:-4.30,-1.20,-1.00+:3.58 (/),1.20+:-4.30,1L%3L,3.60+:-12.9 @@ -3191,13 +3191,13 @@ (/),1.20+:-4.30,3.10<:2.50,-1.14+:0.880 (/),1.20+:-4.30,2L%3L<:2,-6.61+:1.05 (/),1.20+:-4.30,1L%2L<:3L%4L,-4.11+:-7.93 -(/),1.20+:-4.30,-inf,0.00+:0.00 +(/),1.20+:-4.30,-inf,nan+:nan (/),1.20+:-4.30,nan,nan+:nan (/),1.20+:-4.30,x,__failed__ (/),1L%2L+:1,1,0.500+:1.00 (/),1L%2L+:1,-1,-0.500+:-1.00 -(/),1L%2L+:1,0,inf+:inf -(/),1L%2L+:1,0.00,inf+:inf +(/),1L%2L+:1,0,nan+:nan +(/),1L%2L+:1,0.00,nan+:nan (/),1L%2L+:1,1.20,0.417+:0.833 (/),1L%2L+:1,-1.20,-0.417+:-0.833 (/),1L%2L+:1,1L%3L,1.50+:3.00 @@ -3215,13 +3215,13 @@ (/),1L%2L+:1,3.10<:2.50,0.0638+:-0.355 (/),1L%2L+:1,2L%3L<:2,1.05+:-1.31 (/),1L%2L+:1,1L%2L<:3L%4L,2.09+:0.782 -(/),1L%2L+:1,-inf,0.00+:0.00 +(/),1L%2L+:1,-inf,nan+:nan (/),1L%2L+:1,nan,nan+:nan (/),1L%2L+:1,x,__failed__ (/),1L%2L+:3L%4L,1,0.500+:0.750 (/),1L%2L+:3L%4L,-1,-0.500+:-0.750 -(/),1L%2L+:3L%4L,0,inf+:inf -(/),1L%2L+:3L%4L,0.00,inf+:inf +(/),1L%2L+:3L%4L,0,nan+:nan +(/),1L%2L+:3L%4L,0.00,nan+:nan (/),1L%2L+:3L%4L,1.20,0.417+:0.625 (/),1L%2L+:3L%4L,-1.20,-0.417+:-0.625 (/),1L%2L+:3L%4L,1L%3L,1.50+:2.25 @@ -3239,7 +3239,7 @@ (/),1L%2L+:3L%4L,3.10<:2.50,0.0156+:-0.290 (/),1L%2L+:3L%4L,2L%3L<:2,0.711+:-1.15 (/),1L%2L+:3L%4L,1L%2L<:3L%4L,1.75+:0.416 -(/),1L%2L+:3L%4L,-inf,0.00+:0.00 +(/),1L%2L+:3L%4L,-inf,nan+:nan (/),1L%2L+:3L%4L,nan,nan+:nan (/),1L%2L+:3L%4L,x,__failed__ (/),3<:1,1,3.00<:1 Modified: pure/trunk/test/test021.log =================================================================== --- pure/trunk/test/test021.log 2008-09-11 15:54:04 UTC (rev 750) +++ pure/trunk/test/test021.log 2008-09-11 16:13:05 UTC (rev 751) @@ -272,10 +272,10 @@ } *** EXACT/INEXACT *** (+),2,2+:3,4+:3 -(+),2,2<:3,0.0200+:0.282 +(+),2,2<:3,0.283<:1.50 (+),2,2L%3L,8L%3L (-),2,2+:3,0+:-3 -(-),2,2<:3,3.98+:-0.282 +(-),2,2<:3,3.99<:-0.0708 (-),2,2L%3L,4L%3L (*),2,2+:3,4+:6 (*),2,2<:3,4<:3 @@ -290,10 +290,10 @@ (^),2,2<:3,0.253<:0.196 (^),2,2L%3L,1.59 (+),2+:3,2,4+:3 -(+),2<:3,2,0.0200+:0.282 +(+),2<:3,2,0.283<:1.50 (+),2L%3L,2,8L%3L (-),2+:3,2,0+:3 -(-),2<:3,2,-3.98+:0.282 +(-),2<:3,2,3.99<:3.07 (-),2L%3L,2,(-4L)%3L (*),2+:3,2,4+:6 (*),2<:3,2,4<:3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-11 15:53:53
|
Revision: 750 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=750&view=rev Author: agraef Date: 2008-09-11 15:54:04 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Handle thunked values in runtime routines. Modified Paths: -------------- pure/trunk/runtime.cc pure/trunk/runtime.h Modified: pure/trunk/runtime.cc =================================================================== --- pure/trunk/runtime.cc 2008-09-11 14:47:38 UTC (rev 749) +++ pure/trunk/runtime.cc 2008-09-11 15:54:04 UTC (rev 750) @@ -1387,12 +1387,14 @@ } } +#define is_thunk(x) ((x)->tag == 0 && (x)->data.clos && (x)->data.clos->n == 0) + extern "C" pure_expr *pure_force(pure_expr *x) { char test; assert(x); - if (x->tag == 0 && x->data.clos && x->data.clos->n == 0) { + if (is_thunk(x)) { // parameterless anonymous closure (thunk) assert(x->data.clos->thunked); pure_expr *ret; @@ -1438,12 +1440,12 @@ else ret = ((pure_expr*(*)())fp)(); #if DEBUG>1 - cerr << "pure_force: result " << x << " = " << ret << " -> " << (void*)ret << ", refc = " << ret->refc << endl; + cerr << "pure_force: result " << x << " = " << ret << " -> " << (void*)ret << ", refc = " << ret->refc << endl; #endif // check whether the result is again a thunk, then we have to evaluate // that recursively - if (ret->tag == 0 && ret->data.clos && ret->data.clos->n == 0) - ret = pure_force(pure_new_internal(ret)); + if (is_thunk(ret)) + pure_force(pure_new_internal(ret)); pure_new_internal(ret); // memoize the result assert(x!=ret); @@ -1485,7 +1487,7 @@ char test; assert(x && y && x->refc > 0 && y->refc > 0); // if the function in this call is a thunk, evaluate it now - if (x->tag == 0 && x->data.clos && x->data.clos->n == 0) pure_force(x); + if (is_thunk(x)) pure_force(x); // travel down the spine, count arguments pure_expr *f = x, *f0, *ret; uint32_t n = 1; @@ -2019,6 +2021,7 @@ pure_expr *pure_intval(pure_expr *x) { assert(x); + if (is_thunk(x)) pure_force(x); switch (x->tag) { case EXPR::INT: return x; case EXPR::BIGINT: return pure_int(pure_get_int(x)); @@ -2038,6 +2041,7 @@ pure_expr *pure_dblval(pure_expr *x) { assert(x); + if (is_thunk(x)) pure_force(x); switch (x->tag) { case EXPR::INT: return pure_double((double)x->data.i); case EXPR::BIGINT: return pure_double(mpz_get_d(x->data.z)); @@ -2050,6 +2054,7 @@ pure_expr *pure_pointerval(pure_expr *x) { assert(x); + if (is_thunk(x)) pure_force(x); switch (x->tag) { case EXPR::PTR: return x; case EXPR::STR: return pure_pointer(x->data.s); @@ -2099,6 +2104,7 @@ pure_expr *pure_bigintval(pure_expr *x) { assert(x); + if (is_thunk(x)) pure_force(x); if (x->tag == EXPR::BIGINT) return x; else if (x->tag == EXPR::PTR) @@ -2465,12 +2471,17 @@ pure_expr *string_concat_list(pure_expr *xs) { // linear-time concatenation of a list of strings + assert(xs); + if (is_thunk(xs)) pure_force(xs); // calculate the size of the result string pure_expr *ys = xs, *z, *zs; size_t n = 0; - while (is_cons(ys, z, zs) && z->tag == EXPR::STR) { + while (is_cons(ys, z, zs)) { + if (is_thunk(z)) pure_force(z); + if (z->tag != EXPR::STR) break; n += strlen(z->data.s); ys = zs; + if (is_thunk(ys)) pure_force(ys); } if (!is_nil(ys)) return 0; // allocate the result string @@ -2593,9 +2604,10 @@ } extern "C" -uint32_t hash(const pure_expr *x) +uint32_t hash(pure_expr *x) { char test; + if (is_thunk(x)) pure_force(x); switch (x->tag) { case EXPR::INT: return (uint32_t)x->data.i; @@ -2630,10 +2642,8 @@ char test; if (x == y) return 1; - if (x->tag == 0 && x->data.clos && x->data.clos->n == 0) - pure_force(x); - if (y->tag == 0 && y->data.clos && y->data.clos->n == 0) - pure_force(y); + if (is_thunk(x)) pure_force(x); + if (is_thunk(y)) pure_force(y); if (x->tag != y->tag) return 0; else if (x->tag >= 0 && y->tag >= 0) Modified: pure/trunk/runtime.h =================================================================== --- pure/trunk/runtime.h 2008-09-11 14:47:38 UTC (rev 749) +++ pure/trunk/runtime.h 2008-09-11 15:54:04 UTC (rev 750) @@ -545,7 +545,7 @@ /* Compute a 32 bit hash code of a Pure expression. This makes it possible to use arbitary Pure values as keys in a hash table. */ -uint32_t hash(const pure_expr *x); +uint32_t hash(pure_expr *x); /* Check whether two objects are the "same" (syntactically). */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-11 14:47:28
|
Revision: 749 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=749&view=rev Author: agraef Date: 2008-09-11 14:47:38 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Mixed polar/real cases of + and - now return polar results as advertized. Modified Paths: -------------- pure/trunk/lib/math.pure Modified: pure/trunk/lib/math.pure =================================================================== --- pure/trunk/lib/math.pure 2008-09-11 14:41:07 UTC (rev 748) +++ pure/trunk/lib/math.pure 2008-09-11 14:47:38 UTC (rev 749) @@ -275,13 +275,13 @@ (x1+:y1)+x2 = x1+x2 +: y1 if realp x2; x1+(x2+:y2) = x1+x2 +: y2 if realp x1; -z1@(r1<:t1)+x2 = rect z1 + x2 if realp x2; -x1+z2@(r2<:t2) = x1 + rect z2 if realp x1; +z1@(r1<:t1)+x2 = z1 + polar x2 if realp x2; +x1+z2@(r2<:t2) = polar x1 + z2 if realp x1; (x1+:y1)-x2 = x1-x2 +: y1 if realp x2; x1-(x2+:y2) = x1-x2 +: -y2 if realp x1; -z1@(r1<:t1)-x2 = rect z1 - x2 if realp x2; -x1-z2@(r2<:t2) = x1 - rect z2 if realp x1; +z1@(r1<:t1)-x2 = z1 - polar x2 if realp x2; +x1-z2@(r2<:t2) = polar x1 - z2 if realp x1; z1@(x1+:y1)*x2 = z1 * rect x2 if realp x2; x1*z2@(x2+:y2) = rect x1 * z2 if realp x1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-11 14:40:56
|
Revision: 748 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=748&view=rev Author: agraef Date: 2008-09-11 14:41:07 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Make mixed complex/real cases of * and / return results consistent with complex/complex cases. Reported by Eddie Rucker. Modified Paths: -------------- pure/trunk/lib/math.pure Modified: pure/trunk/lib/math.pure =================================================================== --- pure/trunk/lib/math.pure 2008-09-09 10:12:35 UTC (rev 747) +++ pure/trunk/lib/math.pure 2008-09-11 14:41:07 UTC (rev 748) @@ -246,10 +246,14 @@ (x1+:y1) - (x2+:y2) = x1-x2 +: y1-y2; z1@(r1<:t1)-z2@(r2<:t2) = polar (rect z1 - rect z2); +// TODO: Review ISO/IEC9899 Annex G recommendations for * and / to fix up +// nan+:nan results in rectangular representation. + (x1+:y1) * (x2+:y2) = x1*x2-y1*y2 +: x1*y2+y1*x2; (r1<:t1) * (r2<:t2) = r1*r2 <: t1+t2; -(x1+:y1) / (x2+:y2) = (x1*x2+y1*y2 +: y1*x2-x1*y2) / (x2*x2+y2*y2); +(x1+:y1) / (x2+:y2) = (x1*x2+y1*y2)/d +: (y1*x2-x1*y2)/d + when d = x2*x2+y2*y2 end; (r1<:t1) / (r2<:t2) = r1/r2 <: t1-t2; /* Mixed rect/polar and polar/rect forms always return a rect result. */ @@ -279,13 +283,13 @@ z1@(r1<:t1)-x2 = rect z1 - x2 if realp x2; x1-z2@(r2<:t2) = x1 - rect z2 if realp x1; -(x1+:y1)*x2 = x1*x2 +: y1*x2 if realp x2; -x1*(x2+:y2) = x1*x2 +: x1*y2 if realp x1; +z1@(x1+:y1)*x2 = z1 * rect x2 if realp x2; +x1*z2@(x2+:y2) = rect x1 * z2 if realp x1; (r1<:t1)*x2 = r1*x2 <: t1 if realp x2; x1*(r2<:t2) = x1*r2 <: t2 if realp x1; -(x1+:y1)/x2 = x1/x2 +: y1/x2 if realp x2; -x1/z2@(x2+:y2) = (x1*x2 +: -x1*y2) / (x2*x2+y2*y2) if realp x1; +z1@(x1+:y1)/x2 = z1 / rect x2 if realp x2; +x1/z2@(x2+:y2) = rect x1 / z2 if realp x1; (r1<:t1)/x2 = r1/x2 <: t1 if realp x2; x1/(r2<:t2) = x1/r2 <: -t2 if realp x1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-09 10:20:35
|
Revision: 747 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=747&view=rev Author: agraef Date: 2008-09-09 10:12:35 +0000 (Tue, 09 Sep 2008) Log Message: ----------- Cosmetic changes. Modified Paths: -------------- pure/trunk/examples/hello.pure Modified: pure/trunk/examples/hello.pure =================================================================== --- pure/trunk/examples/hello.pure 2008-09-08 16:50:11 UTC (rev 746) +++ pure/trunk/examples/hello.pure 2008-09-09 10:12:35 UTC (rev 747) @@ -170,7 +170,6 @@ prime numbers. */ all_primes = sieve (2..inf) with - sieve [] = []; sieve (p:qs) = p : sieve [q; q = qs; q mod p] &; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-09-08 16:50:01
|
Revision: 746 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=746&view=rev Author: agraef Date: 2008-09-08 16:50:11 +0000 (Mon, 08 Sep 2008) Log Message: ----------- Update NEWS file. Modified Paths: -------------- pure/trunk/NEWS Modified: pure/trunk/NEWS =================================================================== --- pure/trunk/NEWS 2008-09-08 14:25:33 UTC (rev 745) +++ pure/trunk/NEWS 2008-09-08 16:50:11 UTC (rev 746) @@ -35,6 +35,8 @@ - Syntax highlighting for gedit (contributed by Eddie Rucker, thanks!). +- "PurePad", a little graphical frontend for the Pure interpreter on Windows. + ** Pure 0.5 2008-08-24 This release sports LLVM 2.3 support and a bunch of bug fixes and improvements This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |