Skip to content

Release Notes Form 4.2.0

Takahiro Ueda edited this page Mar 8, 2024 · 9 revisions

We introduce Form 4.2.0, a new minor release. We have made more than 360 revisions, including more than 50 bugfixes, and the introduction of more than 20 new features.

Three highlights of the new features are id all, Format O4, and Polyratfun expand.

id all

The statement id all generates all matches instead of just the first:

CF v,f,s;
L F = v(1,2,3,4);
id all v(?a,?b) = f(?a)*s(?b);

Print +s;
.end
F =
   + f*s(1,2,3,4)
   + f(1)*s(2,3,4)
   + f(1,2)*s(3,4)
   + f(1,2,3)*s(4)
   + f(1,2,3,4)*s
  ;

This statement is useful, for example, to generate automorphisms of graphs.

Format O4

Format O4 is a new output mode for polynomials. It uses local search methods to reduce the number of operations in the polynomial. Generally it produces better results and is faster than O3. For example:

S   a,b,c,d,e,f,g,h,i,j,k,l,m,n;
L   G = (4*a^4+b+c+d + i^4 + g*n^3)^10 +
        (a*h + e + f*i*j + g + h)^8 + (i + j + k + l + m + n)^12;
Format O4,saIter=300; * use 300 iterations for optimization
.sort
#optimize G
#write "Optimized with Horner scheme: `optimscheme_'"
#write "Number of operations in output: `optimvalue_'"
#clearoptimize
.end
Optimized with Horner scheme: h,a,f,j,d,c,b,i,e,m,g,k,l,n
Number of operations in output: 1937

Polyratfun expand

The Polyratfun, which is used for rational coefficients, now supports expansion. For example:

S ep;
CF rat;
Polyratfun rat;
L F = rat(1+ep,ep^2 + 3*ep + 1);
Print +s;
.sort
Polyratfun rat(expand,ep,5);

Print +s;
.end

produces

  F = + rat(ep + 1,ep^2 + 3*ep + 1)
....
  F = + rat(1 - 2*ep + 5*ep^2 - 13*ep^3 + 34*ep^4 - 89*ep^5)

Further changes are described in the Changelog below.

Changelog - Form 4.2.0 (2017-07-06)

Caveats

  • Duplicated labels in a module now give compiler errors, which were just ignored in previous versions (#69)
  • Now FORM does not accept := in defining expressions like Local F := 1; and gives compiler errors (84d7188, #293)
  • Introduction of pattern matching with minus vector may break programs written for previous versions. Now f(-v?) matches with both f(-p) (where v = p) and f(p) (v = -p) (but does not match with a generic vector-like object, e.g., f(p+q), which is currently not supported). To avoid the latter match, one needs to use vector_ as f(-v?vector_).

Added

Textual manipulation on the output.

  • #Add
  • #CloseDictionary
  • #OpenDictionary
  • #UseDictionary

Storage for spectator terms.

  • CopySpectator
  • CreateSpectator
  • EmptySpectator
  • RemoveSpectator
  • ToSpectator

Setup parameters

  • tempsortdir setup parameter, $FORMTMPSORT environment variable and -ts command line option to specify a directory for sort files
  • wtimestats setup parameter, On/Off wtimestats statement and -W command line option to print the wall-clock time on the master (#127)
  • T (= 10^12) was added as an unit prefix for integer parameters

Preprocessor

  • activeexprnames_ and numactiveexprs_ variables allow one to enumerate currently active expressions (#175)
  • optimvalue_ and optimscheme_ variables provide additional information from output optimization
  • pid_ variable gives the process identifier of the FORM process
  • toupper_() and tolower_() macros to convert text to upper/lower case
  • #AppendPath and #PrependPath to manipulate the FORMPATH at runtime
  • #If
    • isdefined() checks if an object has been defined
  • #ReverseInclude reads an input file but in reverse order
  • #SkipExtraSymbols adds a number of dummy extra symbols, which can be used to keep extra symbols in previous output optimizations (forum?f=8&t=133)

Statements

  • ArgToExtraSymbol converts function arguments into external symbols (#137)
  • CommuteInset declares partially commutative sets (forum?f=8&t=131)
  • Delete ExtraSymbols removes extra symbols from the system (forum?f=8&t=133)
  • Format
    • O4 option to use local stochastic search for output optimization
    • QuadFortran option to print numbers as quadruple floating-point numbers in Fortran compilers
  • Identify
    • all option generates all matches
  • If
    • occurs() checks if variables occur inside the current term
  • PolyRatFun
    • the second function RAT as the reciprocal of a polyratfun
    • expand and divergence options to expand polyratfun with respect to a symbol
  • Table
    • zero-dimensional sparse tables, which behave as pure functions. Some examples can be found in #86
    • onefill option to fill table elements with 1 by default
  • Transform
    • addargs to add function arguments
    • mulargs to multiply function arguments
    • selectargs, dropargs to select/drop some of function arguments (#86)
    • dedup to remove duplicates from function arguments (see also #158)

Set

  • vector_, the set of all declared vectors (#84)

Functions

  • id_ tries for simple replacements
  • mul_ performs polynomial multiplication (#49)
  • partitions_ generates all partitions of the arguments
  • perm_ generates all permutations of the arguments
  • putfirst_ moves a function argument to the first position (#86)

Changed

  • [parform] FillExpression is now available (#17)
  • The test suite was rewritten to work without strace (#20)
  • Setup options path and incdir are now available as in the reference manual (#72)
  • Sets now can have negative vectors (#78)
  • Bracket and Antibracket now accept a set (#87)
  • #$var=... and #Inside are now allowed inside other statements (#135)
  • Now NTHREADS_ is always 1 for the sequential FORM and ParFORM. (#159)

Fixed

  • [tform] Fixed a bug with Collect (#11)
  • [tform] Fixed a crash in factorizing a constant (#18)
  • Fixed failures of substitutions immediately after PutInside/AntiPutInside (#30)
  • Fixed a bug of transform,replace that xarg_ acted only on symbols (#54)
  • Fixed a bug with combining Bracket+ and IntoHide (#61)
  • Fixed a bug that PolyRatFun in functions always gave errors (#73)
  • Fixed a freeze with $x^n? in LHS (#77)
  • Fixed wrong results by simplifications on powers (exp_ function) (#90)
  • Put a runtime check for gamma matrix without spin line (#94)
  • Fixed failures in pattern matching with ?a and symmetric functions (#117)
  • Fixed a bug that repeat is ignored for some of generated terms of dd_ (#121)
  • Fixed a behaviour of redefining hidden expressions that made duplicates (#129)
  • Fixed corrupted characters in printing the maximum negative integer (#139)
  • Fixed a crash of Bracket+ for large functions (#142)
  • Fixed a bug that a set of indices matched to a number (#153)
  • Fixed a bug in Keep Bracket which ran out the compressed buffer (#154)
  • Fixed a bug that expr[x] lost some terms with Bracket+ for functions (#162)
  • Fixed Normalize to work with f(-v) where v is a vector (#163)
  • [tform] Fixed a crash of expr[x] with Bracket+ and big expressions (#165)
  • Fixed a behaviour of count_ in functions (#167)
  • Fixed a bug that argument field wildcards were not expanded for distrib_ (#186)
  • Fixed gcd_ with 0 (#191)
  • Fixed a bug in the preprocessor that a comment character was eaten after a blcok construction (forum?f=3&t=135)
  • Fixed a bug in the compiler to parse arguments for ArgImplode/ArgExplode (forum?f=3&t=169)
  • Fixed the Argument environment with sets of functions (forum?f=3&t=187)
  • [parform] Fixed bugs in InParallel (forum?f=8&t=158)
  • Fixed #write "%e",expr for Fortran (44cf65f, aecd000)
  • Fixed Delete Storage (44cf65f)
  • Fixed the DoubleFortran mode that printed an integer as a floating-point number unnecessarily (e80f244)
  • Fixed an infinite loop bug in polynomial GCD and increased performance (58bb42d, 726f55d, 483d98f)
  • [parform] Fixed a failure in disabling parallelization for global $-variables (928e8c9)
  • Fixed a bug in factorization due to corruption of the coefficient in Hensel lifting (6f06e94)
  • [sequential form] Fixed a forgotten initialization of a pointer. This led to crashes with $-variables storing big polynomials (b32e53e)
  • Fixed signs with functions inside functions (baa5b36)
  • Fix a memory bug in MakeInteger (4cc67db)
  • [tform] Fixed a bug in Hide (e73c865)
  • Fixed a bug that caused a hide file not deleted at termination (1e6bfda)
  • Fixed the compiler to correctly recognize !<vector or set> option of the ToTensor statement (e9643be)
  • Fixed a silent crash due to workspace overflow in function pattern matching (a8b0f2d)
  • Fixed memory bugs at the startup that gave unreasonable crashes in some circumstances (9b58d87)
  • Fixed build errors and improved portability (7136dda, 6990928, 043727c)
  • Fixed a nasty bug in Bracket+ (1ddffec)
  • Fixed a rare bug in Bracket+ (0f784ed)
  • Fixed memory allocation for $-variables, which seemed to be problematic only on macOS (f6b7409)

And some other small bug fixes, improvements and code refactoring.

Clone this wiki locally