Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ jobs:

- name: Generate LCOV coverage data
run: |
lcov -d . -c -o coverage.lcov
lcov --config-file .lcovrc -d . -c -o coverage.lcov
lcov -r coverage.lcov '*/usr/include/*' '*/extern/*'${{ matrix.flint != 'no' && ' ''*/lib/*''' || '' }} -o coverage.lcov

- name: Coveralls Parallel
Expand Down
8 changes: 8 additions & 0 deletions .lcovrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# FORM-specific LCOV exclusion markers:
#
# - INTERNAL_ERROR_EXCL_...: exclude internal errors from the coverage statistics
# - UNFINISHED_FEATURE_EXCL_...: exclude unfinished features code.
#
lcov_excl_start = (INTERNAL_ERROR_EXCL_START|UNFINISHED_FEATURE_EXCL_START)
lcov_excl_stop = (INTERNAL_ERROR_EXCL_STOP|UNFINISHED_FEATURE_EXCL_STOP)
lcov_excl_line = (INTERNAL_ERROR_EXCL_LINE|UNFINISHED_FEATURE_EXCL_LINE)
4 changes: 2 additions & 2 deletions sources/checkpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
#] License :
#[ Includes :
*/

/* UNFINISHED_FEATURE_EXCL_START */
#include "form3.h"

#include <errno.h>
Expand Down Expand Up @@ -3244,7 +3244,7 @@ void DoCheckpoint(int moduletype)
}/*if(PF.me != MASTER)*/
#endif
}

/* UNFINISHED_FEATURE_EXCL_STOP */
/*
#] DoCheckpoint :
*/
12 changes: 6 additions & 6 deletions sources/compcomm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3920,7 +3920,7 @@ int CoAntiBracket(UBYTE *inp)
Syntax:
MultiBracket:{A|B} bracketinfo:...:{A|B} bracketinfo;
*/

/* UNFINISHED_FEATURE_EXCL_START */
int CoMultiBracket(UBYTE *inp)
{
GETIDENTITY
Expand Down Expand Up @@ -4027,7 +4027,7 @@ int CoMultiBracket(UBYTE *inp)
AT.bracketindexflag = 0;
return(error);
}

/* UNFINISHED_FEATURE_EXCL_STOP */
/*
#] CoMultiBracket :
#[ CountComp :
Expand Down Expand Up @@ -7404,7 +7404,7 @@ int CoEndSwitch(UBYTE *s)
#] CoEndSwitch :
#[ CoSetUserFlag :
*/

/* UNFINISHED_FEATURE_EXCL_START */
int CoSetUserFlag(UBYTE *s)
{
int error = 0;
Expand All @@ -7427,12 +7427,12 @@ int CoSetUserFlag(UBYTE *s)
}
return(error);
}

/* UNFINISHED_FEATURE_EXCL_STOP */
/*
#] CoSetUserFlag :
#[ CoClearUserFlag :
*/

/* UNFINISHED_FEATURE_EXCL_START */
int CoClearUserFlag(UBYTE *s)
{
int error = 0;
Expand All @@ -7455,7 +7455,7 @@ int CoClearUserFlag(UBYTE *s)
}
return(error);
}

/* UNFINISHED_FEATURE_EXCL_STOP */
/*
#] CoClearUserFlag :
#[ CoCreateAllLoops :
Expand Down
4 changes: 3 additions & 1 deletion sources/diagrams.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/*
#[ Includes : diagrams.c
*/

/* UNFINISHED_FEATURE_EXCL_START */
#include "form3.h"

static WORD one = 1;
Expand Down Expand Up @@ -661,3 +661,5 @@ MesPrint("partitions = %a",2*nvert,partitions);
/*
#] DoShattering :
*/

/* UNFINISHED_FEATURE_EXCL_STOP */
80 changes: 60 additions & 20 deletions sources/flintinterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,20 @@ WORD* flint::divmod_mpoly(PHEAD const WORD *a, const WORD *b, const bool return_
// The input won't have any symbols with negative powers, but there may be rational
// coefficients. Verify this:
if ( fmpz_mpoly_is_fmpz(denpa.d, ctx.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::divmod_mpoly: error: denpa is non-constant");
MesPrint("!>flint::divmod_mpoly: error: denpa is non-constant");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}
if ( fmpz_mpoly_is_fmpz(denpb.d, ctx.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::divmod_mpoly: error: denpb is non-constant");
MesPrint("!>flint::divmod_mpoly: error: denpb is non-constant");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}


Expand Down Expand Up @@ -169,16 +173,20 @@ WORD* flint::divmod_poly(PHEAD const WORD *a, const WORD *b, const bool return_r
// The input won't have any symbols with negative powers, but there may be rational
// coefficients. Verify this:
if ( fmpz_poly_length(denpa.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::divmod_poly: error: denpa is non-constant");
MesPrint("!>flint::divmod_poly: error: denpa is non-constant");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}
if ( fmpz_poly_length(denpb.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::divmod_poly: error: denpb is non-constant");
MesPrint("!>flint::divmod_poly: error: denpb is non-constant");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}

flint::fmpz scale;
Expand Down Expand Up @@ -241,10 +249,12 @@ WORD* flint::factorize_mpoly(PHEAD const WORD *argin, WORD *argout, const bool w
flint::from_argument_mpoly(arg.d, den.d, argin, with_arghead, var_map, ctx.d);
// The denominator must be 1:
if ( fmpz_mpoly_is_one(den.d, ctx.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::factorize_mpoly error: den != 1");
MesPrint("!>flint::factorize_mpoly error: den != 1");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}


Expand All @@ -258,10 +268,12 @@ WORD* flint::factorize_mpoly(PHEAD const WORD *argin, WORD *argout, const bool w
// FORM should always have taken the overall constant out in the content. Thus this overall
// constant factor should be +- 1 here. Verify this:
if ( ! ( fmpz_equal_si(overall_constant.d, 1) || fmpz_equal_si(overall_constant.d, -1) ) ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::factorize_mpoly error: overall constant factor != +-1");
MesPrint("!>flint::factorize_mpoly error: overall constant factor != +-1");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}

// Construct the output. If argout is not NULL, we write the result there.
Expand Down Expand Up @@ -389,10 +401,12 @@ WORD* flint::factorize_poly(PHEAD const WORD *argin, WORD *argout, const bool wi
flint::from_argument_poly(arg.d, den.d, argin, with_arghead);
// The denominator must be 1:
if ( fmpz_poly_is_one(den.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::factorize_poly error: den != 1");
MesPrint("!>flint::factorize_poly error: den != 1");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}


Expand Down Expand Up @@ -512,11 +526,13 @@ void flint::form_sort(PHEAD WORD *terms) {

// Check the final size
if ( in_size != out_size ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::form_sort: error: unexpected sorted arg length change %d->%d", in_size,
MesPrint("!>flint::form_sort: error: unexpected sorted arg length change %d->%d", in_size,
out_size);
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}

AR.SortType = oldsorttype;
Expand Down Expand Up @@ -949,16 +965,20 @@ WORD* flint::gcd_mpoly(PHEAD const WORD *a, const WORD *b, const WORD must_fit_t

// denpa, denpb must be 1:
if ( fmpz_mpoly_is_one(denpa.d, ctx.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::gcd_mpoly: error: denpa != 1");
MesPrint("!>flint::gcd_mpoly: error: denpa != 1");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}
if ( fmpz_mpoly_is_one(denpb.d, ctx.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::gcd_mpoly: error: denpb != 1");
MesPrint("!>flint::gcd_mpoly: error: denpb != 1");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}

// poly returns pa if pa == pb, regardless of the lcoeff sign
Expand All @@ -973,17 +993,21 @@ WORD* flint::gcd_mpoly(PHEAD const WORD *a, const WORD *b, const WORD must_fit_t
flint::mpoly tmp(ctx.d);
fmpz_mpoly_term_content(tmp.d, pa.d, ctx.d);
if ( fmpz_mpoly_is_one(tmp.d, ctx.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::gcd_mpoly: error: content of 1st arg != 1");
MesPrint("!>flint::gcd_mpoly: error: content of 1st arg != 1");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}
fmpz_mpoly_term_content(tmp.d, pb.d, ctx.d);
if ( fmpz_mpoly_is_one(tmp.d, ctx.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::gcd_mpoly: error: content of 2nd arg != 1");
MesPrint("!>flint::gcd_mpoly: error: content of 2nd arg != 1");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}

// The poly class now divides the content out of a,b so that they have a positive lcoeff.
Expand Down Expand Up @@ -1044,16 +1068,20 @@ WORD* flint::gcd_poly(PHEAD const WORD *a, const WORD *b, const WORD must_fit_te

// denpa, denpb must be 1:
if ( fmpz_poly_is_one(denpa.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::gcd_poly: error: denpa != 1");
MesPrint("!>flint::gcd_poly: error: denpa != 1");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}
if ( fmpz_poly_is_one(denpb.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::gcd_poly: error: denpb != 1");
MesPrint("!>flint::gcd_poly: error: denpb != 1");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}

// poly returns pa if pa == pb, regardless of the lcoeff sign
Expand All @@ -1067,17 +1095,21 @@ WORD* flint::gcd_poly(PHEAD const WORD *a, const WORD *b, const WORD must_fit_te
flint::fmpz tmp;
fmpz_poly_content(tmp.d, pa.d);
if ( fmpz_is_one(tmp.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::gcd_poly: error: content of 1st arg != 1");
MesPrint("!>flint::gcd_poly: error: content of 1st arg != 1");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}
fmpz_poly_content(tmp.d, pb.d);
if ( fmpz_is_one(tmp.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::gcd_poly: error: content of 2nd arg != 1");
MesPrint("!>flint::gcd_poly: error: content of 2nd arg != 1");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}

fmpz_poly_gcd(gcd.d, pa.d, pb.d);
Expand Down Expand Up @@ -1325,16 +1357,20 @@ WORD* flint::mul_mpoly(PHEAD const WORD *a, const WORD *b, const var_map_t &var_

// denpa, denpb must be integers. Negative symbol powers have been converted to extra symbols.
if ( fmpz_mpoly_is_fmpz(denpa.d, ctx.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::mul_mpoly: error: denpa is non-constant");
MesPrint("!>flint::mul_mpoly: error: denpa is non-constant");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}
if ( fmpz_mpoly_is_fmpz(denpb.d, ctx.d) != 1 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::mul_mpoly: error: denpb is non-constant");
MesPrint("!>flint::mul_mpoly: error: denpb is non-constant");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}

// Multiply numerators, store result in pa
Expand Down Expand Up @@ -1376,16 +1412,20 @@ WORD* flint::mul_poly(PHEAD const WORD *a, const WORD *b, const var_map_t &var_m

// denpa, denpb must be integers. Negative symbol powers have been converted to extra symbols.
if ( fmpz_poly_degree(denpa.d) != 0 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::mul_poly: error: denpa is non-constant");
MesPrint("!>flint::mul_poly: error: denpa is non-constant");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}
if ( fmpz_poly_degree(denpb.d) != 0 ) {
// INTERNAL_ERROR_EXCL_START
MLOCK(ErrorMessageLock);
MesPrint("flint::mul_poly: error: denpb is non-constant");
MesPrint("!>flint::mul_poly: error: denpb is non-constant");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
// INTERNAL_ERROR_EXCL_STOP
}

// Multiply numerators, store result in pa
Expand Down
20 changes: 18 additions & 2 deletions sources/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ NORETURN void MesWork(void)
# " ==> "
@ " ==> " Preprocessor error
& ' --> ' Regular compiler error
!> ' ~~> ' Internal error
Each call is terminated with a new line.
Put a % at the end of the string to suppress the new line.

Expand Down Expand Up @@ -172,7 +173,7 @@ int MesPrint(const char *fmt, ... )
t = Out;
stopper = Out + AC.LineLength;
while ( *s ) {
if ( ( ( *s == '&' && AO.ErrorBlock == 0 ) || *s == '@' || *s == '#' ) && AC.CurrentStream != 0 ) {
if ( ( *s == '&' || *s == '@' || *s == '#' || ( *s == '!' && s[1] == '>' ) ) && AO.ErrorBlock == 0 && AC.CurrentStream != 0 ) {
u = (char *)AC.CurrentStream->name;
while ( *u ) {
*t++ = *u++;
Expand All @@ -199,9 +200,24 @@ int MesPrint(const char *fmt, ... )
if ( ( *s == '&' && AO.ErrorBlock == 0 ) ) {
*t++ = ' '; *t++ = '-'; *t++ = '-'; *t++ = '>'; *t++ = ' '; s++;
}
else if ( *s == '@' || *s == '#' ) {
else if ( ( *s == '@' || *s == '#' ) && AO.ErrorBlock == 0 ) {
*t++ = ' '; *t++ = '='; *t++ = '='; *t++ = '>'; *t++ = ' '; s++;
}
else if ( *s == '!' && s[1] == '>' && AO.ErrorBlock == 0 ) {
const char *m = " ~~> Internal error, please report with the following message:";
while ( *m ) {
*t++ = *m++;
if ( t >= stopper ) {
num = t - Out;
WriteString(ERROROUT,(UBYTE *)Out,num);
num = 0; t = Out;
}
}
num = t - Out;
WriteString(ERROROUT,(UBYTE *)Out,num);
num = 0; t = Out;
s += 2;
}
/*
else if ( *s == '&' && AO.ErrorBlock == 1 ) {

Expand Down
Loading
Loading