diff options
Diffstat (limited to '')
| -rw-r--r-- | Changelog.md | 23 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | src/inpla.y | 26 |
3 files changed, 45 insertions, 6 deletions
diff --git a/Changelog.md b/Changelog.md index 8268419..5ec0230 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,28 @@ # Change log +### v0.12.5 (released on 24 August 2024) + +#### Bug fix + +- **Large nets are acceptable**: For example, the following net was not acceptable due to excessive use of registers: + + ``` + Inpla 0.12.4 : Interaction nets as a programming language [built: 6 June 2024] + >>> r~[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]; + SYSTEM ERROR: CmEnv.localNamePtr exceeded VM_REG_SIZE. + ``` + + In the previous versions, we used the Bytecodes compiler in the one-pass method, and each allocated register was referenced only once, so the number of registers could easily exceed the total size. Therefore, the large net could not be accepted. In the current two-pass compiler, these are optimised to be re-allocated. So, it is sufficient to check the size limit of occupied registers during the two-pass optimisation process. Now, the net is acceptable: + + ``` + Inpla 0.12.5 : Interaction nets as a programming language [built: 24 Aug. 2024] + >>> r~[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]; + (0 interactions, 0.00 sec) + >>> + ``` + + + ### v0.12.4 (released on 6 June 2024) #### New Features @@ -6,7 +6,7 @@ Inpla is a multi-threaded parallel interpreter of interaction nets. Once you write programs for sequential execution, it works also in multi-threaded parallel execution. Each thread is managed on each CPU-core with POSIX-thread library. -* The current version is 0.12.4, released on **6 June 2024**. (See [Changelog.md](Changelog.md) for details.) +* The current version is 0.12.5, released on **24 August 2024**. (See [Changelog.md](Changelog.md) for details.) * The below graph shows speed-up ratio to threads numbers for programs in the following benchmark table.  diff --git a/src/inpla.y b/src/inpla.y index 435584e..9c1fdb4 100644 --- a/src/inpla.y +++ b/src/inpla.y @@ -22,8 +22,8 @@ // ---------------------------------------------- -#define VERSION "0.12.4" -#define BUILT_DATE "6 June 2024" +#define VERSION "0.12.5" +#define BUILT_DATE "24 Aug. 2024" // ------------------------------------------------------------------ @@ -37,6 +37,8 @@ // For global optionss --------------------------------- + +#ifndef THREAD typedef struct { int verbose_memory_use; // default is 0 (NOT enable) } GlobalOptions_t; @@ -44,7 +46,7 @@ typedef struct { static GlobalOptions_t GlobalOptions = { .verbose_memory_use = 0, }; - +#endif @@ -3620,10 +3622,12 @@ int CmEnv_set_symbol_as_name(char *name) { result = CmEnv.localNamePtr; CmEnv.localNamePtr++; + /* if (CmEnv.localNamePtr > VM_REG_SIZE) { puts("SYSTEM ERROR: CmEnv.localNamePtr exceeded VM_REG_SIZE."); exit(-1); } + */ return result; } @@ -3668,11 +3672,13 @@ int CmEnv_set_as_INTVAR(char *name) { } CmEnv.localNamePtr++; + /* if (CmEnv.localNamePtr > VM_REG_SIZE) { puts("SYSTEM ERROR: CmEnv.localNamePtr exceeded VM_REG_SIZE."); exit(-1); } - + */ + return result; } return -1; @@ -3720,11 +3726,12 @@ int CmEnv_newvar(void) { int result; result = CmEnv.localNamePtr; CmEnv.localNamePtr++; + /* if (CmEnv.localNamePtr > VM_REG_SIZE) { puts("SYSTEM ERROR: CmEnv.localNamePtr exceeded VM_REG_SIZE."); exit(-1); } - + */ return result; } @@ -6494,7 +6501,10 @@ int Compile_term_on_ast(Ast *ptr, int target) { case AST_OPCONS: ptr = ptr->right; + + /* A register of the element alloc[0] = Compile_term_on_ast(ptr->left, -1); + */ alloc[1] = Compile_term_on_ast(ptr->right->left, -1); @@ -6503,18 +6513,24 @@ int Compile_term_on_ast(Ast *ptr, int target) { #ifdef USE_MKAGENT_N mkagent = OP_MKAGENT2; + + alloc[0] = Compile_term_on_ast(ptr->left, -1); IMCode_genCode4(mkagent, ID_CONS, alloc[0], alloc[1], result); #else // expanded operations IMCode_genCode2(OP_MKAGENT0, ID_CONS, result); + + alloc[0] = Compile_term_on_ast(ptr->left, -1); IMCode_genCode3(OP_LOADP, alloc[0], 0, result); + IMCode_genCode3(OP_LOADP, alloc[1], 1, result); #endif } else { result = target; + alloc[0] = Compile_term_on_ast(ptr->left, -1); // OLD Version with OP_REUSEAGENT2 //#definen OLD_REUSEAGENT |
