FORM
4.3
|
Go to the source code of this file.
Data Structures | |
struct | PoSiTiOn |
struct | STOREHEADER |
struct | InDeXeNtRy |
struct | FiLeInDeX |
struct | FiLeDaTa |
struct | VaRrEnUm |
struct | ReNuMbEr |
struct | LIST |
struct | KEYWORD |
struct | KEYWORDV |
struct | NaMeNode |
struct | NaMeTree |
struct | tree |
struct | MiNmAx |
struct | BrAcKeTiNdEx |
struct | BrAcKeTiNfO |
struct | TaBlEs |
struct | ExPrEsSiOn |
struct | SyMbOl |
struct | InDeX |
struct | VeCtOr |
struct | FuNcTiOn |
struct | SeTs |
struct | DuBiOuS |
struct | FaCdOlLaR |
struct | DoLlArS |
struct | MoDoPtDoLlArS |
struct | fixedset |
struct | TaBlEbAsEsUbInDeX |
struct | TaBlEbAsE |
struct | FUN_INFO |
struct | FiLe |
struct | StreaM |
struct | SpecTatoR |
struct | TrAcEs |
struct | TrAcEn |
struct | pReVaR |
struct | INSIDEINFO |
struct | PRELOAD |
struct | PROCEDURE |
struct | DoLoOp |
struct | bit_field |
struct | HANDLERS |
struct | CbUf |
struct | ChAnNeL |
struct | SETUPPARAMETERS |
struct | NeStInG |
struct | StOrEcAcHe |
struct | PeRmUtE |
struct | PeRmUtEp |
struct | DiStRiBuTe |
struct | PaRtI |
struct | sOrT |
struct | POLYMOD |
struct | SHvariables |
struct | COST |
struct | MODNUM |
struct | OPTIMIZE |
struct | OPTIMIZERESULT |
struct | DICTIONARY_ELEMENT |
struct | DICTIONARY |
struct | SWITCHTABLE |
struct | SWITCH |
struct | M_const |
struct | P_const |
struct | C_const |
struct | S_const |
struct | R_const |
struct | T_const |
struct | N_const |
struct | O_const |
struct | X_const |
struct | AllGlobals |
struct | FixedGlobals |
Macros | |
#define | INFILEINDEX ((512-2*sizeof(POSITION))/sizeof(INDEXENTRY)) |
#define | EMPTYININDEX (512-2*sizeof(POSITION)-INFILEINDEX*sizeof(INDEXENTRY)) |
#define | PHEAD |
#define | PHEAD0 VOID |
#define | BHEAD |
#define | BHEAD0 |
Typedefs | |
typedef struct PoSiTiOn | POSITION |
typedef struct InDeXeNtRy | INDEXENTRY |
typedef struct FiLeInDeX | FILEINDEX |
typedef struct FiLeDaTa | FILEDATA |
typedef struct VaRrEnUm | VARRENUM |
typedef struct ReNuMbEr * | RENUMBER |
typedef struct NaMeNode | NAMENODE |
typedef struct NaMeTree | NAMETREE |
typedef struct tree | COMPTREE |
typedef struct MiNmAx | MINMAX |
typedef struct BrAcKeTiNdEx | BRACKETINDEX |
typedef struct BrAcKeTiNfO | BRACKETINFO |
typedef struct TaBlEs * | TABLES |
typedef struct ExPrEsSiOn * | EXPRESSIONS |
typedef struct SyMbOl * | SYMBOLS |
typedef struct InDeX * | INDICES |
typedef struct VeCtOr * | VECTORS |
typedef struct FuNcTiOn * | FUNCTIONS |
typedef struct SeTs * | SETS |
typedef struct DuBiOuS * | DUBIOUSV |
typedef struct FaCdOlLaR | FACDOLLAR |
typedef struct DoLlArS * | DOLLARS |
typedef struct MoDoPtDoLlArS | MODOPTDOLLAR |
typedef struct fixedset | FIXEDSET |
typedef struct TaBlEbAsEsUbInDeX | TABLEBASESUBINDEX |
typedef struct TaBlEbAsE | TABLEBASE |
typedef struct FiLe | FILEHANDLE |
typedef struct StreaM | STREAM |
typedef struct SpecTatoR | SPECTATOR |
typedef struct TrAcEs | TRACES |
typedef struct TrAcEn * | TRACEN |
typedef struct pReVaR | PREVAR |
typedef struct DoLoOp | DOLOOP |
typedef struct bit_field | set_of_char[32] |
typedef struct bit_field * | one_byte |
typedef WORD(* | FINISHUFFLE) (WORD *) |
typedef WORD(* | DO_UFFLE) (WORD *, WORD, WORD, WORD) |
typedef WORD(* | COMPARE) (WORD *, WORD *, WORD) |
typedef struct CbUf | CBUF |
typedef struct ChAnNeL | CHANNEL |
typedef struct NeStInG * | NESTING |
typedef struct StOrEcAcHe * | STORECACHE |
typedef struct PeRmUtE | PERM |
typedef struct PeRmUtEp | PERMP |
typedef struct DiStRiBuTe | DISTRIBUTE |
typedef struct PaRtI | PARTI |
typedef struct sOrT | SORTING |
typedef struct AllGlobals | ALLGLOBALS |
typedef WORD(* | WCN) () |
typedef WORD(* | WCN2) () |
typedef struct FixedGlobals | FIXEDGLOBALS |
Functions | |
STATIC_ASSERT (sizeof(STOREHEADER)==512) | |
STATIC_ASSERT (sizeof(FILEINDEX)==512) | |
Contains definitions for global structs.
!!!CAUTION!!! Changes in this file will most likely have consequences for the recovery mechanism (see checkpoint.c). You need to care for the code in checkpoint.c as well and modify the code there accordingly!
The marker [D] is used in comments in this file to mark pointers to which dynamically allocated memory is assigned by a call to malloc() during runtime (in contrast to pointers that point into already allocated memory). This information is especially helpful if one needs to know which pointers need to be freed (cf. checkpoint.c).
Definition in file structs.h.
#define INFILEINDEX ((512-2*sizeof(POSITION))/sizeof(INDEXENTRY)) |
Maximum number of entries (struct InDeXeNtRy) in a file index (struct FiLeInDeX). Number is calculated such that the size of a file index is no more than 512 bytes.
#define EMPTYININDEX (512-2*sizeof(POSITION)-INFILEINDEX*sizeof(INDEXENTRY)) |
typedef struct InDeXeNtRy INDEXENTRY |
Defines the structure of an entry in a file index (see struct FiLeInDeX).
It represents one expression in the file.
Defines the structure of a file index in store-files and save-files.
It contains several entries (see struct InDeXeNtRy) up to a maximum of INFILEINDEX.
The variable number has been made of type POSITION to avoid padding problems with some types of computers/OS and keep system independence of the .sav files.
This struct is always 512 bytes long.
Contains the pointers to an array in which a binary search will be performed.
Only symb.lo gets dynamically allocated. All other pointers points into this memory.
A struct of type NAMETREE controls a complete (balanced) tree of names for the compiler. The compiler maintains several of such trees and the system has been set up in such a way that one could define more of them if we ever want to work with local name spaces.
The subexpressions in the compiler are kept track of in a (balanced) tree to reduce the need for subexpressions and hence save much space in large rhs expressions (like when we have xxxxxxx occurrences of objects like f(x+1,x+1) in which each x+1 becomes a subexpression. The struct that controls this tree is COMPTREE.
buffers, mm, flags, and prototype are always dynamically allocated, tablepointers only if needed (=0 if unallocated), boomlijst and argtail only for sparse tables.
Allocation is done for both the normal and the stub instance (spare), except for prototype and argtail which share memory.
Contains all information about a function. Also used for tables. It is used in the LIST elements of #AC.
typedef struct FiLe FILEHANDLE |
The type FILEHANDLE is the struct that controls all relevant information of a file, whether it is open or not. The file may even not yet exist. There is a system of caches (PObuffer) and as long as the information to be written still fits inside the cache the file may never be created. There are variables that can store information about different types of files, like scratch files or sort files. Depending on what is available in the system we may also have information about gzip compression (currently sort file only) or locks (TFORM).
Input is read from 'streams' which are represented by objects of type STREAM. A stream can be a file, a do-loop, a procedure, the string value of a preprocessor variable ..... When a new stream is opened we have to keep information about where to fall back in the parent stream to allow this to happen even in the middle of reading names etc as would be the case with a`i'b
The struct TRACES keeps track of the progress during the expansion of a 4-dimensional trace. Each time a term gets generated the expansion tree continues in the next statement. When it returns it has to know where to continue. The 4-dimensional traces are more complicated than the n-dimensional traces (see TRACEN) because of the extra tricks that can be used. They are responsible for the shorter final expressions.
The struct TRACEN keeps track of the progress during the expansion of a 4-dimensional trace. Each time a term gets generated the expansion tree continues in the next statement. When it returns it has to know where to continue.
An element of the type PREVAR is needed for each preprocessor variable.
Each preprocessor do loop has a struct of type DOLOOP to keep track of all relevant parameters like where the beginning of the loop is, what the boundaries, increment and value of the loop parameter are, etc. Also we keep the whole loop inside a buffer of type PRELOAD
typedef struct bit_field set_of_char[32] |
The CBUF struct is used by the compiler. It is a compiler buffer of which since version 3.0 there can be many.
When we read input from text files we have to remember not only their handle but also their name. This is needed for error messages. Hence we call such a file a channel and reserve a struct of type CHANNEL to allow to lay this link.
The NESTING struct is used when we enter the argument of functions and there is the possibility that we have to change something there. Because functions can be nested we have to keep track of all levels of functions in case we have to move the outer layers to make room for a larger function argument.
typedef struct StOrEcAcHe * STORECACHE |
The struct of type STORECACHE is used by a caching system for reading terms from stored expressions. Each thread should have its own system of caches.
The struct PERM is used to generate all permutations when the pattern matcher has to try to match (anti)symmetric functions.
typedef struct DiStRiBuTe DISTRIBUTE |
The struct DISTRIBUTE is used to help the pattern matcher when matching antisymmetric tensors.
The struct PARTI is used to help determining whether a partition_ function can be replaced.
The struct SORTING is used to control a sort operation. It includes a small and a large buffer and arrays for keeping track of various stages of the (merge) sorts. Each sort level has its own struct and different levels can have different sizes for its arrays. Also different threads have their own set of SORTING structs.
typedef struct AllGlobals ALLGLOBALS |
Without pthreads (FORM) the ALLGLOBALS struct has all the global variables
typedef struct FixedGlobals FIXEDGLOBALS |
The FIXEDGLOBALS struct is an anachronism. It started as the struct with global variables that needed initialization. It contains the elements Operation and OperaFind which define a very early way of automatically jumping to the proper operation. We find the results of it in parts of the file opera.c Later operations were treated differently in a more transparent way. We never changed the existing code. The most important part is currently the cTable which is used intensively in the compiler.