From 94e22e90224fba092e87ecceeaa2d4a4ce834b38 Mon Sep 17 00:00:00 2001 From: howsohazard <143410553+howsohazard@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:36:18 -0500 Subject: [PATCH] 22093: Removes query_count from language and vastly improves performance of size opcode, especially with queries, MAJOR (#300) --- docs/language.js | 8 - src/Amalgam/Opcodes.cpp | 1 - src/Amalgam/Opcodes.h | 5 +- src/Amalgam/amlg_code/full_test.amlg | 10 - src/Amalgam/entity/EntityQueries.cpp | 10 - src/Amalgam/entity/EntityQueryCaches.cpp | 49 +- src/Amalgam/entity/EntityQueryCaches.h | 9 +- .../evaluablenode/EvaluableNodeManagement.h | 9 + .../EvaluableNodeTreeManipulation.cpp | 1 - src/Amalgam/interpreter/Interpreter.cpp | 1 - src/Amalgam/interpreter/Interpreter.h | 4 +- .../InterpreterOpcodesEntityAccess.cpp | 7 +- .../InterpreterOpcodesListManipulation.cpp | 30 +- .../InterpreterOpcodesTransformations.cpp | 32 +- src/Amalgam/out.txt | 8175 +++++++++-------- 15 files changed, 4295 insertions(+), 4056 deletions(-) diff --git a/docs/language.js b/docs/language.js index d924f534..6105391f 100644 --- a/docs/language.js +++ b/docs/language.js @@ -1401,14 +1401,6 @@ var data = [ "example" : "(create_entities (list \"TestEntity\" \"Child\")\n (lambda (null ##TargetLabel 3))\n) \n\n (compute_on_contained_entities \"TestEntity\" (list\n (query_exists \"TargetLabel\")\n)) \n\n ; For more examples see the individual entries for each query." }, - { - "parameter" : "query_count", - "output" : "query", - "new value" : "new", - "description" : "When used as a compute_on_contained_entities argument, counts the number of entities that match the criteria and returns the number.", - "example" : "(compute_on_contained_entities \"TestEntity\" (list\n (query_count)\n))" - }, - { "parameter" : "query_select number num_to_select [number start_offset] [number random_seed]", "output" : "query", diff --git a/src/Amalgam/Opcodes.cpp b/src/Amalgam/Opcodes.cpp index 9332f298..49355432 100644 --- a/src/Amalgam/Opcodes.cpp +++ b/src/Amalgam/Opcodes.cpp @@ -255,7 +255,6 @@ void StringInternPool::InitializeStaticStrings() //entity query EmplaceNodeTypeString(ENT_CONTAINED_ENTITIES, "contained_entities"); EmplaceNodeTypeString(ENT_COMPUTE_ON_CONTAINED_ENTITIES, "compute_on_contained_entities"); - EmplaceNodeTypeString(ENT_QUERY_COUNT, "query_count"); EmplaceNodeTypeString(ENT_QUERY_SELECT, "query_select"); EmplaceNodeTypeString(ENT_QUERY_SAMPLE, "query_sample"); EmplaceNodeTypeString(ENT_QUERY_WEIGHTED_SAMPLE, "query_weighted_sample"); diff --git a/src/Amalgam/Opcodes.h b/src/Amalgam/Opcodes.h index 70954af3..0a7344d2 100644 --- a/src/Amalgam/Opcodes.h +++ b/src/Amalgam/Opcodes.h @@ -241,7 +241,6 @@ enum EvaluableNodeType : uint8_t ENT_QUERY_WEIGHTED_SAMPLE, ENT_QUERY_IN_ENTITY_LIST, ENT_QUERY_NOT_IN_ENTITY_LIST, - ENT_QUERY_COUNT, ENT_QUERY_EXISTS, ENT_QUERY_NOT_EXISTS, ENT_QUERY_EQUALS, @@ -339,7 +338,7 @@ constexpr OrderedChildNodeType GetInstructionOrderedChildNodeType(EvaluableNodeT case ENT_CREATE_ENTITIES: case ENT_CONTAINED_ENTITIES: case ENT_COMPUTE_ON_CONTAINED_ENTITIES: case ENT_QUERY_SELECT: case ENT_QUERY_SAMPLE: case ENT_QUERY_WEIGHTED_SAMPLE: - case ENT_QUERY_IN_ENTITY_LIST: case ENT_QUERY_NOT_IN_ENTITY_LIST: case ENT_QUERY_COUNT: + case ENT_QUERY_IN_ENTITY_LIST: case ENT_QUERY_NOT_IN_ENTITY_LIST: case ENT_QUERY_EXISTS: case ENT_QUERY_NOT_EXISTS: case ENT_QUERY_EQUALS: case ENT_QUERY_NOT_EQUALS: case ENT_QUERY_BETWEEN: case ENT_QUERY_NOT_BETWEEN: @@ -482,7 +481,7 @@ constexpr bool DoesEvaluableNodeTypeCreateScope(EvaluableNodeType t) //returns true if t is a query constexpr bool IsEvaluableNodeTypeQuery(EvaluableNodeType t) { - return (t == ENT_QUERY_SELECT || t == ENT_QUERY_IN_ENTITY_LIST || t == ENT_QUERY_NOT_IN_ENTITY_LIST || t == ENT_QUERY_COUNT + return (t == ENT_QUERY_SELECT || t == ENT_QUERY_IN_ENTITY_LIST || t == ENT_QUERY_NOT_IN_ENTITY_LIST || t == ENT_QUERY_SAMPLE || t == ENT_QUERY_WEIGHTED_SAMPLE || t == ENT_QUERY_EXISTS || t == ENT_QUERY_NOT_EXISTS || t == ENT_QUERY_EQUALS || t == ENT_QUERY_NOT_EQUALS || t == ENT_QUERY_BETWEEN || t == ENT_QUERY_NOT_BETWEEN || t == ENT_QUERY_AMONG || t == ENT_QUERY_NOT_AMONG diff --git a/src/Amalgam/amlg_code/full_test.amlg b/src/Amalgam/amlg_code/full_test.amlg index c7a1f291..60900fed 100644 --- a/src/Amalgam/amlg_code/full_test.amlg +++ b/src/Amalgam/amlg_code/full_test.amlg @@ -2513,16 +2513,6 @@ (query_not_in_entity_list (list "Child6" "Child7")) ))) - (print "--query_count--\n") - (print (compute_on_contained_entities "TestContainerExec" (list - (query_count) - )) "\n") - - (print (compute_on_contained_entities "TestContainerExec" (list - (query_not_exists "q") - (query_count) - )) "\n") - (print "--query_exists--\n") (print (contained_entities "TestContainerExec" (list (query_exists "q") diff --git a/src/Amalgam/entity/EntityQueries.cpp b/src/Amalgam/entity/EntityQueries.cpp index 26a72d05..404e3053 100644 --- a/src/Amalgam/entity/EntityQueries.cpp +++ b/src/Amalgam/entity/EntityQueries.cpp @@ -20,7 +20,6 @@ bool EntityQueryCondition::DoesEntityMatchCondition(Entity *e) case ENT_QUERY_SELECT: case ENT_QUERY_SAMPLE: case ENT_QUERY_WEIGHTED_SAMPLE: - case ENT_QUERY_COUNT: //it does not fail the condition here - needs to be checked elsewhere return true; @@ -431,15 +430,6 @@ EvaluableNodeReference EntityQueryCondition::GetMatchingEntities(Entity *contain return EvaluableNodeReference::Null(); } - case ENT_QUERY_COUNT: - { - //not useful unless computing - if(enm == nullptr) - return EvaluableNodeReference::Null(); - - return EvaluableNodeReference(enm->AllocNode(static_cast(matching_entities.size())), true); - } - case ENT_QUERY_EXISTS: { //find those that match diff --git a/src/Amalgam/entity/EntityQueryCaches.cpp b/src/Amalgam/entity/EntityQueryCaches.cpp index 866fb2d6..d1293290 100644 --- a/src/Amalgam/entity/EntityQueryCaches.cpp +++ b/src/Amalgam/entity/EntityQueryCaches.cpp @@ -917,7 +917,8 @@ void EntityQueryCaches::GetMatchingEntitiesViaSamplingWithReplacement(EntityQuer } EvaluableNodeReference EntityQueryCaches::GetMatchingEntitiesFromQueryCaches(Entity *container, - std::vector &conditions, EvaluableNodeManager *enm, bool return_query_value) + std::vector &conditions, EvaluableNodeManager *enm, + bool return_query_value, bool immediate_result) { //get the cache associated with this container // use the first condition as an heuristic for building it if it doesn't exist @@ -948,16 +949,14 @@ EvaluableNodeReference EntityQueryCaches::GetMatchingEntitiesFromQueryCaches(Ent //if query_none, return results as empty list if(cond.queryType == ENT_NULL) + { + if(immediate_result) + return EvaluableNodeReference(0.0); return EvaluableNodeReference(enm->AllocNode(ENT_LIST), true); + } switch(cond.queryType) { - case ENT_QUERY_COUNT: - if(is_first) - return EvaluableNodeReference(enm->AllocNode(static_cast(container->GetNumContainedEntities())), true); - else - return EvaluableNodeReference(enm->AllocNode(static_cast(matching_ents.size())), true); - case ENT_QUERY_IN_ENTITY_LIST: { if(is_first) @@ -1041,9 +1040,9 @@ EvaluableNodeReference EntityQueryCaches::GetMatchingEntitiesFromQueryCaches(Ent entity_caches->GetMatchingEntities(&cond, matching_ents, compute_results, is_first, !is_last || !return_query_value); if(compute_results.size() > 0) - return EvaluableNodeReference(enm->AllocNode(static_cast(compute_results[0].distance)), true); + return enm->AllocIfNotImmediate(static_cast(compute_results[0].distance), immediate_result); else - return EvaluableNodeReference(enm->AllocNode(std::numeric_limits::quiet_NaN()), true); + return EvaluableNodeReference::Null(); } case ENT_QUERY_MODE: @@ -1053,16 +1052,16 @@ EvaluableNodeReference EntityQueryCaches::GetMatchingEntitiesFromQueryCaches(Ent entity_caches->GetMatchingEntities(&cond, matching_ents, compute_results, is_first, !is_last || !return_query_value); if(compute_results.size() > 0) - return EvaluableNodeReference(enm->AllocNode(static_cast(compute_results[0].distance)), true); + return enm->AllocIfNotImmediate(static_cast(compute_results[0].distance), immediate_result); else - return EvaluableNodeReference(enm->AllocNode(std::numeric_limits::quiet_NaN()), true); + return EvaluableNodeReference::Null(); } else if(cond.singleLabelType == ENIVT_STRING_ID) { StringInternPool::StringID mode = string_intern_pool.NOT_A_STRING_ID; if(entity_caches->ComputeValueFromMatchingEntities(&cond, matching_ents, mode, is_first)) - return EvaluableNodeReference(enm->AllocNode(ENT_STRING, mode), true); + return enm->AllocIfNotImmediate(mode, immediate_result); else return EvaluableNodeReference::Null(); } @@ -1076,6 +1075,9 @@ EvaluableNodeReference EntityQueryCaches::GetMatchingEntitiesFromQueryCaches(Ent FastHashMap, DoubleNanHashComparator> value_weights; entity_caches->ComputeValuesFromMatchingEntities(&cond, matching_ents, value_weights, is_first); + if(immediate_result) + return EvaluableNodeReference(static_cast(value_weights.size())); + EvaluableNode *assoc = enm->AllocNode(ENT_ASSOC); assoc->ReserveMappedChildNodes(value_weights.size()); @@ -1093,6 +1095,9 @@ EvaluableNodeReference EntityQueryCaches::GetMatchingEntitiesFromQueryCaches(Ent FastHashMap value_weights; entity_caches->ComputeValuesFromMatchingEntities(&cond, matching_ents, value_weights, is_first); + if(immediate_result) + return EvaluableNodeReference(static_cast(value_weights.size())); + EvaluableNode *assoc = enm->AllocNode(ENT_ASSOC); assoc->ReserveMappedChildNodes(value_weights.size()); @@ -1238,7 +1243,12 @@ EvaluableNodeReference EntityQueryCaches::GetMatchingEntitiesFromQueryCaches(Ent //if last query condition is query sample, return each sampled entity id which may include duplicates if(last_query_type == ENT_QUERY_SAMPLE || last_query_type == ENT_QUERY_WEIGHTED_SAMPLE) + { + if(immediate_result) + return EvaluableNodeReference(static_cast(indices_with_duplicates.size())); + return CreateListOfStringsIdsFromIteratorAndFunction(indices_with_duplicates, enm, entity_index_to_id); + } //return data as appropriate if(return_query_value && last_query != nullptr) @@ -1252,12 +1262,18 @@ EvaluableNodeReference EntityQueryCaches::GetMatchingEntitiesFromQueryCaches(Ent || last_query_type == ENT_COMPUTE_ENTITY_CONVICTIONS || last_query_type == ENT_COMPUTE_ENTITY_KL_DIVERGENCES) { + if(immediate_result) + return EvaluableNodeReference(static_cast(compute_results.size())); + return EntityManipulation::ConvertResultsToEvaluableNodes(compute_results, enm, last_query->returnSortedList, last_query->additionalSortedListLabels, [&contained_entities](auto entity_index) { return contained_entities[entity_index]; }); } else //if there are no compute results, return an assoc of the requested labels for each entity { + if(immediate_result) + return EvaluableNodeReference(static_cast(matching_ents.size())); + //return assoc of distances if requested EvaluableNode *query_return = enm->AllocNode(ENT_ASSOC); query_return->ReserveMappedChildNodes(matching_ents.size()); @@ -1296,11 +1312,14 @@ EvaluableNodeReference EntityQueryCaches::GetMatchingEntitiesFromQueryCaches(Ent } } + if(immediate_result) + return EvaluableNodeReference(static_cast(matching_ents.size())); return CreateListOfStringsIdsFromIteratorAndFunction(matching_ents, enm, entity_index_to_id); } -EvaluableNodeReference EntityQueryCaches::GetEntitiesMatchingQuery(EntityReadReference &container, std::vector &conditions, EvaluableNodeManager *enm, bool return_query_value) +EvaluableNodeReference EntityQueryCaches::GetEntitiesMatchingQuery(EntityReadReference &container, + std::vector &conditions, EvaluableNodeManager *enm, bool return_query_value, bool immediate_result) { if(_enable_SBF_datastore && CanUseQueryCaches(conditions)) { @@ -1319,7 +1338,7 @@ EvaluableNodeReference EntityQueryCaches::GetEntitiesMatchingQuery(EntityReadRef #endif } - return GetMatchingEntitiesFromQueryCaches(container, conditions, enm, return_query_value); + return GetMatchingEntitiesFromQueryCaches(container, conditions, enm, return_query_value, immediate_result); } if(container == nullptr) @@ -1360,7 +1379,7 @@ EvaluableNodeReference EntityQueryCaches::GetEntitiesMatchingQuery(EntityReadRef #endif } - return GetMatchingEntitiesFromQueryCaches(container, conditions, enm, return_query_value); + return GetMatchingEntitiesFromQueryCaches(container, conditions, enm, return_query_value, immediate_result); } query_return_value = conditions[cond_index].GetMatchingEntities(container, matching_entities, first_condition, (return_query_value && last_condition) ? enm : nullptr); diff --git a/src/Amalgam/entity/EntityQueryCaches.h b/src/Amalgam/entity/EntityQueryCaches.h index 28228c21..aa54a335 100644 --- a/src/Amalgam/entity/EntityQueryCaches.h +++ b/src/Amalgam/entity/EntityQueryCaches.h @@ -124,11 +124,16 @@ class EntityQueryCaches //searches container for contained entities matching query. // if return_query_value is false, then returns a list of all IDs of matching contained entities // if return_query_value is true, then returns whatever the appropriate structure is for the query type for the final query - static EvaluableNodeReference GetEntitiesMatchingQuery(EntityReadReference &container, std::vector &conditions, EvaluableNodeManager *enm, bool return_query_value); + // if immediate_result is true, will return an immediate value as the result + static EvaluableNodeReference GetEntitiesMatchingQuery(EntityReadReference &container, + std::vector &conditions, EvaluableNodeManager *enm, + bool return_query_value, bool immediate_result); //returns the collection of entities (and optionally associated compute values) that satisfy the specified chain of query conditions // uses efficient querying methods with a query database, one database per container - static EvaluableNodeReference GetMatchingEntitiesFromQueryCaches(Entity *container, std::vector &conditions, EvaluableNodeManager *enm, bool return_query_value); + static EvaluableNodeReference GetMatchingEntitiesFromQueryCaches(Entity *container, + std::vector &conditions, EvaluableNodeManager *enm, + bool return_query_value, bool immediate_result); //the container this is a cache for Entity *container; diff --git a/src/Amalgam/evaluablenode/EvaluableNodeManagement.h b/src/Amalgam/evaluablenode/EvaluableNodeManagement.h index ace63d17..ba41e66e 100644 --- a/src/Amalgam/evaluablenode/EvaluableNodeManagement.h +++ b/src/Amalgam/evaluablenode/EvaluableNodeManagement.h @@ -469,6 +469,15 @@ class EvaluableNodeManager original = EvaluableNodeReference(copy, (copy->GetNumChildNodes() == 0)); } + //returns an EvaluableNodeReference for value, allocating if necessary based on if immediate result is needed + template + inline EvaluableNodeReference AllocIfNotImmediate(T value, bool immediate_result) + { + if(immediate_result) + return EvaluableNodeReference(value); + return EvaluableNodeReference(AllocNode(value), true); + } + //attempts to reuse candidate if it is unique and change it into the specified type //if candidate is not unique, then it allocates and returns a new node inline EvaluableNodeReference ReuseOrAllocNode(EvaluableNodeReference candidate, EvaluableNodeType type) diff --git a/src/Amalgam/evaluablenode/EvaluableNodeTreeManipulation.cpp b/src/Amalgam/evaluablenode/EvaluableNodeTreeManipulation.cpp index 43c8f9e1..5b42b4b7 100644 --- a/src/Amalgam/evaluablenode/EvaluableNodeTreeManipulation.cpp +++ b/src/Amalgam/evaluablenode/EvaluableNodeTreeManipulation.cpp @@ -2130,7 +2130,6 @@ CompactHashMap EvaluableNodeTreeManipulation::evaluab {ENT_QUERY_WEIGHTED_SAMPLE, 0.2}, {ENT_QUERY_IN_ENTITY_LIST, 0.2}, {ENT_QUERY_NOT_IN_ENTITY_LIST, 0.2}, - {ENT_QUERY_COUNT, 0.2}, {ENT_QUERY_EXISTS, 0.2}, {ENT_QUERY_NOT_EXISTS, 0.2}, {ENT_QUERY_EQUALS, 0.2}, diff --git a/src/Amalgam/interpreter/Interpreter.cpp b/src/Amalgam/interpreter/Interpreter.cpp index d00e8e39..390bc87e 100644 --- a/src/Amalgam/interpreter/Interpreter.cpp +++ b/src/Amalgam/interpreter/Interpreter.cpp @@ -255,7 +255,6 @@ std::array Interpreter &Interpreter::InterpretNode_ENT_QUERY_and_COMPUTE_opcodes, // ENT_QUERY_WEIGHTED_SAMPLE &Interpreter::InterpretNode_ENT_QUERY_and_COMPUTE_opcodes, // ENT_QUERY_IN_ENTITY_LIST &Interpreter::InterpretNode_ENT_QUERY_and_COMPUTE_opcodes, // ENT_QUERY_NOT_IN_ENTITY_LIST - &Interpreter::InterpretNode_ENT_QUERY_and_COMPUTE_opcodes, // ENT_QUERY_COUNT &Interpreter::InterpretNode_ENT_QUERY_and_COMPUTE_opcodes, // ENT_QUERY_EXISTS &Interpreter::InterpretNode_ENT_QUERY_and_COMPUTE_opcodes, // ENT_QUERY_NOT_EXISTS &Interpreter::InterpretNode_ENT_QUERY_and_COMPUTE_opcodes, // ENT_QUERY_EQUALS diff --git a/src/Amalgam/interpreter/Interpreter.h b/src/Amalgam/interpreter/Interpreter.h index 7a0b1fcd..37b96b49 100644 --- a/src/Amalgam/interpreter/Interpreter.h +++ b/src/Amalgam/interpreter/Interpreter.h @@ -455,9 +455,7 @@ class Interpreter template inline EvaluableNodeReference AllocReturn(T value, bool immediate_result) { - if(immediate_result) - return EvaluableNodeReference(value); - return EvaluableNodeReference(evaluableNodeManager->AllocNode(value), true); + return evaluableNodeManager->AllocIfNotImmediate(value, immediate_result); } //like AllocReturn, but if immediate_result, then it will attempt to free candidate, diff --git a/src/Amalgam/interpreter/InterpreterOpcodesEntityAccess.cpp b/src/Amalgam/interpreter/InterpreterOpcodesEntityAccess.cpp index 2eeeda74..a2017425 100644 --- a/src/Amalgam/interpreter/InterpreterOpcodesEntityAccess.cpp +++ b/src/Amalgam/interpreter/InterpreterOpcodesEntityAccess.cpp @@ -99,6 +99,10 @@ EvaluableNodeReference Interpreter::InterpretNode_ENT_CONTAINED_ENTITIES_and_COM auto &contained_entities = source_entity->GetContainedEntities(); + //if only looking for how many entities are contained, quickly exit + if(immediate_result) + return EvaluableNodeReference(static_cast(contained_entities.size())); + //new list containing the contained entity ids to return EvaluableNodeReference result( evaluableNodeManager->AllocListNodeWithOrderedChildNodes(ENT_STRING, contained_entities.size()), true); @@ -159,7 +163,8 @@ EvaluableNodeReference Interpreter::InterpretNode_ENT_CONTAINED_ENTITIES_and_COM } //perform query - auto result = EntityQueryCaches::GetEntitiesMatchingQuery(source_entity, conditionsBuffer, evaluableNodeManager, return_query_value); + auto result = EntityQueryCaches::GetEntitiesMatchingQuery(source_entity, + conditionsBuffer, evaluableNodeManager, return_query_value, immediate_result); //free query_params after the query just in case query_params is the only place that a given string id exists, //so the value isn't swapped out diff --git a/src/Amalgam/interpreter/InterpreterOpcodesListManipulation.cpp b/src/Amalgam/interpreter/InterpreterOpcodesListManipulation.cpp index d6baaf5b..5ff022d5 100644 --- a/src/Amalgam/interpreter/InterpreterOpcodesListManipulation.cpp +++ b/src/Amalgam/interpreter/InterpreterOpcodesListManipulation.cpp @@ -530,22 +530,36 @@ EvaluableNodeReference Interpreter::InterpretNode_ENT_SIZE(EvaluableNode *en, bo if(ocn.size() == 0) return EvaluableNodeReference::Null(); - auto cur = InterpretNodeForImmediateUse(ocn[0]); - size_t size = 0; - if(cur != nullptr) + auto n = InterpretNodeForImmediateUse(ocn[0], true); + + double size = 0; + if(n.IsImmediateValue()) + { + auto &value = n.GetValue(); + + if(value.nodeType == ENIVT_NUMBER) + size = value.nodeValue.number; + if(value.nodeType == ENIVT_STRING_ID) + size = static_cast(StringManipulation::GetNumUTF8Characters(value.nodeValue.stringID->string)); + else if(value.nodeType == ENIVT_CODE && value.nodeValue.code != nullptr) + size = static_cast(value.nodeValue.code->GetNumChildNodes()); + + return AllocReturn(size, immediate_result); + } + else if(n != nullptr) { - if(cur->GetType() == ENT_STRING) + if(n->GetType() == ENT_STRING) { - auto &s = cur->GetStringValue(); - size = StringManipulation::GetNumUTF8Characters(s); + auto &s = n->GetStringValue(); + size = static_cast(StringManipulation::GetNumUTF8Characters(s)); } else { - size = cur->GetNumChildNodes(); + size = static_cast(n->GetNumChildNodes()); } } - return ReuseOrAllocReturn(cur, static_cast(size), immediate_result); + return ReuseOrAllocReturn(n, size, immediate_result); } EvaluableNodeReference Interpreter::InterpretNode_ENT_RANGE(EvaluableNode *en, bool immediate_result) diff --git a/src/Amalgam/interpreter/InterpreterOpcodesTransformations.cpp b/src/Amalgam/interpreter/InterpreterOpcodesTransformations.cpp index 6d67bcbf..2f24ee12 100644 --- a/src/Amalgam/interpreter/InterpreterOpcodesTransformations.cpp +++ b/src/Amalgam/interpreter/InterpreterOpcodesTransformations.cpp @@ -362,7 +362,37 @@ EvaluableNodeReference Interpreter::InterpretNode_ENT_FILTER(EvaluableNode *en, if(ocn.size() == 1) { - //get list + //specialized path for immediate result just getting the count + if(immediate_result) + { + auto list = InterpretNodeForImmediateUse(ocn[0]); + if(list == nullptr) + return EvaluableNodeReference::Null(); + + size_t num_elements_not_filtered = 0; + if(list->IsAssociativeArray()) + { + auto &list_mcn = list->GetMappedChildNodesReference(); + for(auto &[cn_id, cn] : list_mcn) + { + if(!EvaluableNode::IsNull(cn)) + num_elements_not_filtered++; + } + } + else if(list->IsOrderedArray()) + { + auto &list_ocn = list->GetOrderedChildNodesReference(); + for(auto &cn : list_ocn) + { + if(!EvaluableNode::IsNull(cn)) + num_elements_not_filtered++; + } + } + + evaluableNodeManager->FreeNodeTreeIfPossible(list); + return EvaluableNodeReference(static_cast(num_elements_not_filtered)); + } + auto list = InterpretNode(ocn[0]); if(list == nullptr) return EvaluableNodeReference::Null(); diff --git a/src/Amalgam/out.txt b/src/Amalgam/out.txt index 4e0ab8c5..04be5b44 100644 --- a/src/Amalgam/out.txt +++ b/src/Amalgam/out.txt @@ -5,265 +5,264 @@ hello world: 12 and 2 hello world: 12 and 2 --get_defaults-- -{ - != 0.65 - !~ 0.1 - * 0.65 - + 0.9 - "-" 0.65 - / 0.6 - < 0.85 - <= 0.85 - = 1.2 - > 0.85 - >= 0.85 - abs 0.4 - accum 0.25 - accum_entity_roots 0.01 - accum_to_entities 0.5 - acos 0.2 - acosh 0.07 - and 0.75 - append 0.65 - apply 0.5 - args 0.08 - asin 0.2 - asinh 0.07 - assign 0.95 - assign_entity_roots 0.01 - assign_to_entities 0.5 - assoc 3 - associate 0.8 - atan 0.2 - atanh 0.07 - call 1.5 - call_container 0.5 - call_entity 0.5 - call_entity_get_changes 0.05 - call_sandboxed 0.25 - ceil 0.6 - clone_entities 0.1 - commonality 0.2 - commonality_entities 0.02 - compute_entity_convictions 0.2 - compute_entity_distance_contributions 0.2 - compute_entity_group_kl_divergence 0.2 - compute_entity_kl_divergences 0.2 - compute_on_contained_entities 0.3 - concat 0.2 - conclude 0.05 - contained_entities 0.3 - contains_entity 0.1 - contains_index 0.5 - contains_label 0.5 - contains_value 0.5 - cos 0.2 - cosh 0.07 - create_entities 0.1 - crypto_sign 0.01 - crypto_sign_verify 0.01 - current_index 0.1 - current_value 0.1 - declare 0.5 - decrypt 0.01 - destroy_entities 0.1 - difference 0.2 - difference_entities 0.02 - direct_assign_to_entities 0.01 - direct_retrieve_from_entity 0.01 - dot_product 0.2 - edit_distance 0.2 - edit_distance_entities 0.02 - encrypt 0.01 - erf 0.05 - exp 0.4 - explode 0.02 - false 0.1 - filter 0.5 - first 0.65 - flatten_entity 0.02 - floor 0.6 - format 0.05 - generalized_distance 0.15 - get 3 - get_all_labels 0.05 - get_comments 0.05 - get_concurrency 0.01 - get_defaults 0.01 - get_digits 0.1 - get_entity_comments 0.01 - get_entity_rand_seed 0.01 - get_entity_root_permission 0.01 - get_labels 0.1 - get_rand_seed 0.02 - get_type 0.25 - get_type_string 0.25 - get_value 0.15 - if 1 - indices 0.5 - intersect 0.2 - intersect_entities 0.02 - keep 0.5 - lambda 1.5 - last 0.65 - let 0.95 - lgamma 0.07 - list 2 - load 0.01 - load_entity 0.01 - log 0.4 - map 1.1 - max 0.4 - min 0.4 - mix 0.2 - mix_entities 0.02 - mix_labels 0.2 - mod 0.2 - move_entities 0.15 - mutate 0.2 - mutate_entity 0.02 - not 0.75 - null 0.75 - number 8 - opcode_stack 0.01 - or 0.75 - parallel 0.5 - parse 0.05 - pow 0.2 - previous_result 0.05 - print 0.01 - query_among 0.2 - query_between 0.2 - query_count 0.2 - query_equals 0.2 - query_exists 0.2 - query_generalized_mean 0.2 - query_greater_or_equal_to 0.2 - query_in_entity_list 0.2 - query_less_or_equal_to 0.2 - query_max 0.2 - query_max_difference 0.2 - query_min 0.2 - query_min_difference 0.2 - query_mode 0.2 - query_nearest_generalized_distance 0.2 - query_not_among 0.2 - query_not_between 0.2 - query_not_equals 0.2 - query_not_exists 0.2 - query_not_in_entity_list 0.2 - query_quantile 0.2 - query_sample 0.2 - query_select 0.2 - query_sum 0.2 - query_value_masses 0.2 - query_weighted_sample 0.2 - query_within_generalized_distance 0.2 - rand 0.4 - range 0.5 - reduce 0.7 - remove 0.5 - replace 0.1 - retrieve 0.1 - retrieve_entity_root 0.01 - retrieve_from_entity 0.5 - return 0.05 - reverse 0.4 - rewrite 0.1 - round 0.6 - seq 0.5 - set 0.35 - set_comments 0.05 - set_concurrency 0.01 - set_digits 0.1 - set_entity_rand_seed 0.01 - set_entity_root_permission 0.01 - set_labels 0.1 - set_rand_seed 0.02 - set_type 0.35 - set_value 0.15 - sin 0.2 - sinh 0.07 - size 0.6 - sort 0.5 - split 0.2 - sqrt 0.2 - stack 0.05 - store 0.01 - store_entity 0.01 - string 4 - substr 0.2 - symbol 10 - system 0.05 - system_time 0.01 - tail 0.65 - tan 0.2 - tanh 0.07 - target 0.1 - tgamma 0.07 - total_entity_size 0.02 - total_size 0.2 - true 0.1 - trunc 0.65 - union 0.2 - union_entities 0.02 - unparse 0.05 - unzip 0.25 - values 0.5 - weave 0.2 - weighted_rand 0.02 - while 0.1 - xor 0.75 - zip 0.35 - zip_labels 0.02 - ~ 0.1 -} -{ - change_label 0.04 - change_type 0.28 - deep_copy_elements 0.05 - delete 0.12 - delete_elements 0.04 - insert 0.23 - swap_elements 0.24 -} +{ + != 0.65 + !~ 0.1 + * 0.65 + + 0.9 + "-" 0.65 + / 0.6 + < 0.85 + <= 0.85 + = 1.2 + > 0.85 + >= 0.85 + abs 0.4 + accum 0.25 + accum_entity_roots 0.01 + accum_to_entities 0.5 + acos 0.2 + acosh 0.07 + and 0.75 + append 0.65 + apply 0.5 + args 0.08 + asin 0.2 + asinh 0.07 + assign 0.95 + assign_entity_roots 0.01 + assign_to_entities 0.5 + assoc 3 + associate 0.8 + atan 0.2 + atanh 0.07 + call 1.5 + call_container 0.5 + call_entity 0.5 + call_entity_get_changes 0.05 + call_sandboxed 0.25 + ceil 0.6 + clone_entities 0.1 + commonality 0.2 + commonality_entities 0.02 + compute_entity_convictions 0.2 + compute_entity_distance_contributions 0.2 + compute_entity_group_kl_divergence 0.2 + compute_entity_kl_divergences 0.2 + compute_on_contained_entities 0.3 + concat 0.2 + conclude 0.05 + contained_entities 0.3 + contains_entity 0.1 + contains_index 0.5 + contains_label 0.5 + contains_value 0.5 + cos 0.2 + cosh 0.07 + create_entities 0.1 + crypto_sign 0.01 + crypto_sign_verify 0.01 + current_index 0.1 + current_value 0.1 + declare 0.5 + decrypt 0.01 + destroy_entities 0.1 + difference 0.2 + difference_entities 0.02 + direct_assign_to_entities 0.01 + direct_retrieve_from_entity 0.01 + dot_product 0.2 + edit_distance 0.2 + edit_distance_entities 0.02 + encrypt 0.01 + erf 0.05 + exp 0.4 + explode 0.02 + false 0.1 + filter 0.5 + first 0.65 + flatten_entity 0.02 + floor 0.6 + format 0.05 + generalized_distance 0.15 + get 3 + get_all_labels 0.05 + get_comments 0.05 + get_concurrency 0.01 + get_defaults 0.01 + get_digits 0.1 + get_entity_comments 0.01 + get_entity_rand_seed 0.01 + get_entity_root_permission 0.01 + get_labels 0.1 + get_rand_seed 0.02 + get_type 0.25 + get_type_string 0.25 + get_value 0.15 + if 1 + indices 0.5 + intersect 0.2 + intersect_entities 0.02 + keep 0.5 + lambda 1.5 + last 0.65 + let 0.95 + lgamma 0.07 + list 2 + load 0.01 + load_entity 0.01 + log 0.4 + map 1.1 + max 0.4 + min 0.4 + mix 0.2 + mix_entities 0.02 + mix_labels 0.2 + mod 0.2 + move_entities 0.15 + mutate 0.2 + mutate_entity 0.02 + not 0.75 + null 0.75 + number 8 + opcode_stack 0.01 + or 0.75 + parallel 0.5 + parse 0.05 + pow 0.2 + previous_result 0.05 + print 0.01 + query_among 0.2 + query_between 0.2 + query_equals 0.2 + query_exists 0.2 + query_generalized_mean 0.2 + query_greater_or_equal_to 0.2 + query_in_entity_list 0.2 + query_less_or_equal_to 0.2 + query_max 0.2 + query_max_difference 0.2 + query_min 0.2 + query_min_difference 0.2 + query_mode 0.2 + query_nearest_generalized_distance 0.2 + query_not_among 0.2 + query_not_between 0.2 + query_not_equals 0.2 + query_not_exists 0.2 + query_not_in_entity_list 0.2 + query_quantile 0.2 + query_sample 0.2 + query_select 0.2 + query_sum 0.2 + query_value_masses 0.2 + query_weighted_sample 0.2 + query_within_generalized_distance 0.2 + rand 0.4 + range 0.5 + reduce 0.7 + remove 0.5 + replace 0.1 + retrieve 0.1 + retrieve_entity_root 0.01 + retrieve_from_entity 0.5 + return 0.05 + reverse 0.4 + rewrite 0.1 + round 0.6 + seq 0.5 + set 0.35 + set_comments 0.05 + set_concurrency 0.01 + set_digits 0.1 + set_entity_rand_seed 0.01 + set_entity_root_permission 0.01 + set_labels 0.1 + set_rand_seed 0.02 + set_type 0.35 + set_value 0.15 + sin 0.2 + sinh 0.07 + size 0.6 + sort 0.5 + split 0.2 + sqrt 0.2 + stack 0.05 + store 0.01 + store_entity 0.01 + string 4 + substr 0.2 + symbol 10 + system 0.05 + system_time 0.01 + tail 0.65 + tan 0.2 + tanh 0.07 + target 0.1 + tgamma 0.07 + total_entity_size 0.02 + total_size 0.2 + true 0.1 + trunc 0.65 + union 0.2 + union_entities 0.02 + unparse 0.05 + unzip 0.25 + values 0.5 + weave 0.2 + weighted_rand 0.02 + while 0.1 + xor 0.75 + zip 0.35 + zip_labels 0.02 + ~ 0.1 +} +{ + change_label 0.04 + change_type 0.28 + deep_copy_elements 0.05 + delete 0.12 + delete_elements 0.04 + insert 0.23 + swap_elements 0.24 +} --parse and unparse-- (print "hello") -[(null) (null) .infinity -.infinity] - -{a 1 b 2 c ["alpha" "beta" "gamma"]} -{ - a 1 - b 2 - c ["alpha" "beta" "gamma"] -} - -(apply "6") - -(apply "notakeyword") - -(seq - (+ 1 2) -) -[ - (seq - (+ 1 2) - (+) - ) - ["Warning: 2 missing closing parenthesis at line 1, column 17"] -] -[ - (seq - (+ 1 2) - ) - ["Warning: 1 missing closing parenthesis at line 1, column 17"] -] -[ - (seq - (+ 1 2) - ) - ["Warning: Invalid opcode \"a\"; transforming to apply opcode using the invalid opcode type at line 1, column 19"] -] +[(null) (null) .infinity -.infinity] + +{c ["alpha" "beta" "gamma"] a 1 b 2} +{ + c ["alpha" "beta" "gamma"] + a 1 + b 2 +} + +(apply "6") + +(apply "notakeyword") + +(seq + (+ 1 2) +) +[ + (seq + (+ 1 2) + (+) + ) + ["Warning: 2 missing closing parenthesis at line 1, column 17"] +] +[ + (seq + (+ 1 2) + ) + ["Warning: 1 missing closing parenthesis at line 1, column 17"] +] +[ + (seq + (+ 1 2) + ) + ["Warning: Invalid opcode \"a\"; transforming to apply opcode using the invalid opcode type at line 1, column 19"] +] --if-- if 1 if 2 @@ -273,17 +272,17 @@ if 2 2 3 --lambda and call-- -(declare - {x 6} - (+ x 2) -) +(declare + {x 6} + (+ x 2) +) 5 -(lambda - (+ 1 2) -) +(lambda + (+ 1 2) +) --call_sandboxed-- 7 -(null) +(null) 11 (null) @@ -319,78 +318,78 @@ declare1 success --assign-- 10 20 -[ - 0 - 1 - 2 - {a 1 b 2 c 3} -] -[ - 0 - "not 1" - 2 - {a 1 b 2 c 3} -] -[ - 0 - "not 1" - 2 - { - a ["a attribute"] - b 2 - c ["c attribute"] - } -] +[ + 0 + 1 + 2 + {a 1 b 2 c 3} +] +[ + 0 + "not 1" + 2 + {a 1 b 2 c 3} +] +[ + 0 + "not 1" + 2 + { + a ["a attribute"] + b 2 + c ["c attribute"] + } +] --accum-- 10 11 abcdef -[1 2 3 4 5 6] - -[ - 1 - 2 - 3 - 4 - 5 - 6 - "7" - 8 -] - -{ - a 1 - b 2 - c 3 - d 4 -} - -{ - a 1 - b 2 - c 3 - d 4 - e 5 -} +[1 2 3 4 5 6] + +[ + 1 + 2 + 3 + 4 + 5 + 6 + "7" + 8 +] + +{ + a 1 + b 2 + c 3 + d 4 +} + +{ + a 1 + b 2 + c 3 + d 4 + e 5 +} 5 -[ - 0 - 2 - 2 - {a 1 b 2 c 3} -] +[ + 0 + 2 + 2 + {a 1 b 2 c 3} +] --retrieve-- 1 1 -[1 2] -{raaa 2 rwww 1} +[1 2] +{raaa 2 rwww 1} --assign-- 8 12 -[0 1 10 3 4] -{a 3 b 2} +[0 1 10 3 4] +{a 3 b 2} --+-- 10 ----- @@ -403,86 +402,86 @@ abcdef --mod-- 1 --get_digits-- -[ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 0 - 0 - 0 -] -[ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 8 - 9 - 9 -] -[ - 5 - 6 - 7 - 8 - 0 - 0 - 0 - 0 - 0 - 0 - 0 -] -[1 1 1] -[1 0 0 0 0] -[1 2 0] -[1 1 1 1] -[1 0 0 0 0] -[2 0] -[0 0 0 0 1 1] -[1 0] -[ - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 1 -] -[1 2 3 4 5] -[5 6 7 8 0] -[1 2 3 4 5] -[5 6 7 8 0] -[] -[] -[] -[ - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 -] +[ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 0 + 0 + 0 +] +[ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 8 + 9 + 9 +] +[ + 5 + 6 + 7 + 8 + 0 + 0 + 0 + 0 + 0 + 0 + 0 +] +[1 1 1] +[1 0 0 0 0] +[1 2 0] +[1 1 1 1] +[1 0 0 0 0] +[2 0] +[0 0 0 0 1 1] +[1 0] +[ + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 1 +] +[1 2 3 4 5] +[5 6 7 8 0] +[1 2 3 4 5] +[5 6 7 8 0] +[] +[] +[] +[ + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 +] --set_digits-- 5554567.8 1234567.555 @@ -497,9 +496,9 @@ abcdef 5.555567800000001e+100 1.2345555499999999e+100 1.23456585e+100 -[1 0 1 0] -[1 0 1 0] -[1 0 1 0] +[1 0 1 0] +[1 0 1 0] +[1 0 1 0] --floor-- 1 --ceil-- @@ -547,7 +546,7 @@ abcdef --cosh-- 1.1276259652063807 --acosh-- -(null) +(null) --tanh-- 0.46211715726000974 @@ -606,7 +605,7 @@ abcdef 26 2.23606797749979 27 3.0000000031604355 28 3 -29 (null) +29 (null) 30 6 31 4 @@ -637,40 +636,40 @@ abcdef 1 0 a -(null) +(null) --tail-- -[9.2 "this"] -[2 3 4 5 6] -[5 6] -[3 4 5 6] -[] -[1 2 3 4 5 6] -[1 2 3 4 5 6] -[] -{ - a 1 - c 3 - d 4 - e 5 - f 6 -} -{c 3 d 4} -{ - c 3 - d 4 - e 5 - f 6 -} -{ - a 1 - b 2 - c 3 - d 4 - e 5 - f 6 -} -{} +[9.2 "this"] +[2 3 4 5 6] +[5 6] +[3 4 5 6] +[] +[1 2 3 4 5 6] +[1 2 3 4 5 6] +[] +{ + a 1 + b 2 + c 3 + e 5 + f 6 +} +{b 2 e 5} +{ + a 1 + b 2 + e 5 + f 6 +} +{ + a 1 + b 2 + c 3 + d 4 + e 5 + f 6 +} +{} 2 0 bcdef @@ -680,7 +679,7 @@ abcdef abcdef -(null) +(null) --last-- this @@ -688,40 +687,40 @@ this 1 0 c -(null) +(null) --trunc-- -[4 9.2] -[1 2 3 4 5] -[1 2] -[1 2 3 4] -[] -[1 2 3 4 5 6] -[1 2 3 4 5 6] -[] -{ - a 1 - c 3 - d 4 - e 5 - f 6 -} -{c 3 d 4} -{ - c 3 - d 4 - e 5 - f 6 -} -{ - a 1 - b 2 - c 3 - d 4 - e 5 - f 6 -} -{} +[4 9.2] +[1 2 3 4 5] +[1 2] +[1 2 3 4] +[] +[1 2 3 4 5 6] +[1 2 3 4 5 6] +[] +{ + a 1 + b 2 + c 3 + e 5 + f 6 +} +{b 2 e 5} +{ + a 1 + b 2 + e 5 + f 6 +} +{ + a 1 + b 2 + c 3 + d 4 + e 5 + f 6 +} +{} 2 0 abcde @@ -731,252 +730,252 @@ abcdef abcdef -(null) +(null) --append-- -[ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -] -{ - 0 1 - 1 2 - 2 3 - 3 7 - 4 8 - 5 9 - a 4 - b 5 - c 6 - d 10 - e 11 -} -[4 9.2 "this" "end"] -{ - 0 4 - 1 9.2 - 2 "this" - 3 "end" -} +[ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +] +{ + 0 1 + 1 2 + 2 3 + 3 7 + 4 8 + 5 9 + a 4 + b 5 + c 6 + d 10 + e 11 +} +[4 9.2 "this" "end"] +{ + 0 4 + 1 9.2 + 2 "this" + 3 "end" +} --size-- 3 4 5 --range-- -[ - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 -] -[ - 10 - 9 - 8 - 7 - 6 - 5 - 4 - 3 - 2 - 1 - 0 -] -[] -[0 1 2 3 4 5] -[12 12 12 12 12 12] -[1 2 3 4 5 6] -[1 2 3 4 5 6] +[ + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 +] +[ + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 0 +] +[] +[0 1 2 3 4 5] +[12 12 12 12 12 12] +[1 2 3 4 5 6] +[1 2 3 4 5 6] --replace-- -[ - {a 13} -] -[ - [4 5 6] - (null) - 1 -] -[ - [4 5 6] - (null) - 1 -] -[ - {a 1 b 2} -] +[ + {a 13} +] +[ + [4 5 6] + (null) + 1 +] +[ + [4 5 6] + (null) + 1 +] +[ + {a 1 b 2} +] --rewrite-- -[ - {a 14} -] -[ - (associate "a" 312) -] -[ - 8 - 8 - 8 - 8 - 8 - 8 - 8 - 8 - 8 -] -(+ 17 a) +[ + {a 14} +] +[ + (associate "a" 312) +] +[ + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 8 +] +(+ 17 a) --map-- -[2 4 6 8] -[ - 10 - 2 - 22 - 5 - 34 - 8 - 46 - 11 -] -{ - 10 11 - 20 22 - 30 33 - 40 44 -} -[3 4 5 6 7 8] -[3 4 5 6 7 (null)] -{ - 0 3 - 1 (null) - 2 (null) - 3 (null) - a (null) -} +[2 4 6 8] +[ + 10 + 2 + 22 + 5 + 34 + 8 + 46 + 11 +] +{ + 10 11 + 20 22 + 30 33 + 40 44 +} +[3 4 5 6 7 8] +[3 4 5 6 7 (null)] +{ + 0 3 + 1 (null) + 2 (null) + 3 (null) + a (null) +} --filter-- -[3 4] -[10 1 20] -{10 1} -[10 1 20 30 40 4] -[ - 10 - 1 - 20 - 30 - "" - 40 - 4 -] -{ - a 10 - b 1 - c 20 - d "" - e 30 - f 3 - h 4 -} -{ - a 10 - b 1 - c 20 - d "" - e 30 - f 3 - h 4 -} +[3 4] +[10 1 20] +{10 1} +[10 1 20 30 40 4] +[ + 10 + 1 + 20 + 30 + "" + 40 + 4 +] +{ + a 10 + b 1 + c 20 + d "" + e 30 + f 3 + h 4 +} +{ + a 10 + b 1 + c 20 + d "" + e 30 + f 3 + h 4 +} --weave-- -[1 2 3] - -[1 2 3 4 5 6] - -[2 (null) 4 (null) 6 (null)] - -["a" 2 @(get (target 2) 0) 4 @(get (target 2) 0) 6] - -[ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -] - -[ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 -] - -[ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 -] - -[ - 2 - 4 - 6 - 8 - 10 - 12 - 14 - 16 - 18 - 20 - 22 - 24 -] - -[1 2 3 4 5 6] - -[ - 1 - 2 - 3 - 5 - 4 - 5 - 6 - 6 - 7 -] - -[3 4 5] +[1 2 3] + +[1 2 3 4 5 6] + +[2 (null) 4 (null) 6 (null)] + +["a" 2 @(get (target 2) 0) 4 @(get (target 2) 0) 6] + +[ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +] + +[ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 +] + +[ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 +] + +[ + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 20 + 22 + 24 +] + +[1 2 3 4 5 6] + +[ + 1 + 2 + 3 + 5 + 4 + 5 + 6 + 6 + 7 +] + +[3 4 5] --reduce-- 24 24 @@ -985,275 +984,275 @@ abcdef 15 10 --reverse-- -[5 4 3 2 1] +[5 4 3 2 1] --sort-- -[1 3 4 5 9] -[ - 1 - 3.2 - 4 - "b" - "hello" - [1 2 3] - "n" - "soy" -] -[ - 1 - "1x" - "10" - 20 - "z2" - "z10" - "z100" -] -[ - "001x" - "010" - 1 - 20 - "z002" - "z010" - "z100" -] -[1 3 4 5 9] -[ - 1 - 2 - 9 - 3 - 0 - 4 - 5 - 8 - 7 - 10 - 6 -] -[ - "2020-06-08 lunes 11.32.36" - "2020-06-08 lunes 11.32.37" - "2020-06-08 lunes 11.32.38" - "2020-06-08 lunes 11.32.39" - "2020-06-08 lunes 11.32.46" - "2020-06-08 lunes 11.32.47" - "2020-06-08 lunes 11.32.48" - "2020-06-08 lunes 11.32.49" - "2020-06-08 lunes 11.32.56" - "2020-06-08 lunes 11.32.57" - "2020-06-08 lunes 11.32.58" - "2020-06-08 lunes 11.32.59" - "2020-06-08 lunes 11.33.36" - "2020-06-08 lunes 11.33.37" - "2020-06-08 lunes 11.33.38" - "2020-06-08 lunes 11.33.39" - "2020-06-08 lunes 11.33.40" - "2020-06-08 lunes 11.33.41" - "2020-06-08 lunes 11.33.42" - "2020-06-08 lunes 11.33.43" - "2020-06-08 lunes 11.33.44" - "2020-06-08 lunes 11.33.45" - "2020-06-08 lunes 11.33.46" - "2020-06-08 lunes 11.33.47" - "2020-06-08 lunes 11.33.48" -] -[1 3] -[9 5] -[1 3] -[9 5] +[1 3 4 5 9] +[ + 1 + 3.2 + 4 + "b" + "hello" + [1 2 3] + "n" + "soy" +] +[ + 1 + "1x" + "10" + 20 + "z2" + "z10" + "z100" +] +[ + "001x" + "010" + 1 + 20 + "z002" + "z010" + "z100" +] +[1 3 4 5 9] +[ + 1 + 6 + 2 + 7 + 0 + 3 + 4 + 10 + 5 + 8 + 9 +] +[ + "2020-06-08 lunes 11.32.36" + "2020-06-08 lunes 11.32.37" + "2020-06-08 lunes 11.32.38" + "2020-06-08 lunes 11.32.39" + "2020-06-08 lunes 11.32.46" + "2020-06-08 lunes 11.32.47" + "2020-06-08 lunes 11.32.48" + "2020-06-08 lunes 11.32.49" + "2020-06-08 lunes 11.32.56" + "2020-06-08 lunes 11.32.57" + "2020-06-08 lunes 11.32.58" + "2020-06-08 lunes 11.32.59" + "2020-06-08 lunes 11.33.36" + "2020-06-08 lunes 11.33.37" + "2020-06-08 lunes 11.33.38" + "2020-06-08 lunes 11.33.39" + "2020-06-08 lunes 11.33.40" + "2020-06-08 lunes 11.33.41" + "2020-06-08 lunes 11.33.42" + "2020-06-08 lunes 11.33.43" + "2020-06-08 lunes 11.33.44" + "2020-06-08 lunes 11.33.45" + "2020-06-08 lunes 11.33.46" + "2020-06-08 lunes 11.33.47" + "2020-06-08 lunes 11.33.48" +] +[1 3] +[9 5] +[1 3] +[9 5] --indices-- -["a" "b" "4" "c"] -[ - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 -] +["4" "c" "a" "b"] +[ + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 +] --values-- -[1 "d" 2 3] -[ - "a" - 1 - "b" - 2 - "c" - 3 - 4 - "d" -] -[ - "a" - 1 - "b" - 2 - "c" - 3 - 4 - "d" -] -[2 1 "d" 3] -[ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 -] +[3 "d" 1 2] +[ + "a" + 1 + "b" + 2 + "c" + 3 + 4 + "d" +] +[ + "a" + 1 + "b" + 2 + "c" + 3 + 4 + "d" +] +[3 1 2 "d"] +[ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 +] --contains_index-- -(true) +(true) -(false) +(false) -(true) +(true) -(false) +(false) --contains_value-- -(true) +(true) -(false) +(false) -(true) +(true) -(false) +(false) -(true) -(true) -(true) -(true) -(false) -(true) +(true) +(true) +(true) +(true) +(false) +(true) --remove-- -{a 1 b 2 c 3} -[ - "a" - 1 - "b" - 2 - 3 - 4 - "d" -] -{b 2 c 3} -[ - "a" - 1 - "b" - 2 - 3 - 4 - "d" -] -[1 3 4 5] -[0 1 2 3 4] -[1 2 3 4] -[] +{a 1 b 2 c 3} +[ + "a" + 1 + "b" + 2 + 3 + 4 + "d" +] +{b 2 c 3} +[ + "a" + 1 + "b" + 2 + 3 + 4 + "d" +] +[1 3 4 5] +[0 1 2 3 4] +[1 2 3 4] +[] --keep-- -{4 "d"} -["c"] -{4 "d" a 1} -["c"] -[0 2] -[5] -[0 5] -[0 1 2 3 4 5] +{4 "d"} +["c"] +{4 "d" a 1} +["c"] +[0 2] +[5] +[0 5] +[0 1 2 3 4 5] --zip-- -{ - a 1 - b 2 - c 3 - d 4 -} -{ - a (null) - b (null) - c (null) - d (null) -} -{ - a 3 - b @(get - (target 2) - "a" - ) - c @(get - (target 2) - "a" - ) - d @(get - (target 2) - "a" - ) -} -{ - a 4 - b 2 - c 3 - d 4 -} -{ - a 5 - b 2 - c 3 - d 4 -} -{ - a 2 - b 1 - c @(get - (target 2) - "b" - ) - d @(get - (target 2) - "b" - ) -} +{ + a 1 + b 2 + c 3 + d 4 +} +{ + a (null) + b (null) + c (null) + d (null) +} +{ + a 3 + b @(get + (target 2) + "a" + ) + c @(get + (target 2) + "a" + ) + d @(get + (target 2) + "a" + ) +} +{ + a 4 + b 2 + c 3 + d 4 +} +{ + a 5 + b 2 + c 3 + d 4 +} +{ + a 2 + b 1 + c @(get + (target 2) + "b" + ) + d @(get + (target 2) + "b" + ) +} --unzip-- -[1 2] -[1 3 2] +[1 2] +[1 3 2] --get-- -[4 9.2 "this"] +[4 9.2 "this"] 9.2 3 1 -[9.2 "this"] +[9.2 "this"] 2: 2 (null): (null) (null): (null) 3 --set-- -{ - 4 "d" - a 1 - b 2 - c 3 - e 5 -} -[0 1 10 3 4] -{a 3 b 2} +{ + 4 "d" + a 1 + b 2 + c 3 + e 5 +} +[0 1 10 3 4] +{a 3 b 2} --target-- -[1 2 3 (null) (null)] +[1 2 3 (null) (null)] --current_index-- 3 (null) @@ -1273,369 +1272,369 @@ current_index: 2 (null) --opcode_stack-- 4 -(seq - (seq - (opcode_stack 2) - ) -) +(seq + (seq + (opcode_stack 2) + ) +) -;Full test -;This is a suite of unit tests. -; This is the second line of the unit test description. -(seq) +;Full test +;This is a suite of unit tests. +; This is the second line of the unit test description. +(seq) --stack-- -[ - { - abcdefghijklmnop 1 - accum_assoc { - a 1 - b 2 - c 3 - d 4 - e 5 - } - accum_list [ - 1 - 2 - 3 - 4 - 5 - 6 - "7" - 8 - ] - accum_string "abcdef" - argv ["C:\\Users\\ChristopherHazard\\Desktop\\Howso_repos\\amalgam\\src\\Amalgam\\./amlg_code/full_test.amlg"] - bar (declare - {x 6} - (+ x 2) - ) - foo (declare - {x 6} - (+ x 2) - ) - get_test_assoc { - A {B 2} - B 2 - } - interpreter "C:\\Users\\ChristopherHazard\\Desktop\\Howso_repos\\amalgam\\x64\\MT_Release_EXE\\Amalgam.exe" - raaa 2 - rmdir "rmdir /s /q " - rmfile "del /s /q " - rwww 1 - slash "\\" - start_time 1730419803.177727 - www 1 - x 12 - zz 10 - } -] +[ + { + abcdefghijklmnop 1 + accum_assoc { + a 1 + b 2 + c 3 + d 4 + e 5 + } + accum_list [ + 1 + 2 + 3 + 4 + 5 + 6 + "7" + 8 + ] + accum_string "abcdef" + argv ["C:\\Users\\Chris Hazard\\Desktop\\Howso_repos\\amalgam\\src\\Amalgam\\./amlg_code/full_test.amlg"] + bar (declare + {x 6} + (+ x 2) + ) + foo (declare + {x 6} + (+ x 2) + ) + get_test_assoc { + A {B 2} + B 2 + } + interpreter "C:\\Users\\Chris Hazard\\Desktop\\Howso_repos\\amalgam\\x64\\MT_Release_EXE\\Amalgam.exe" + raaa 2 + rmdir "rmdir /s /q " + rmfile "del /s /q " + rwww 1 + slash "\\" + start_time 1730659255.572875 + www 1 + x 12 + zz 10 + } +] --args-- -{ - abcdefghijklmnop 1 - accum_assoc { - a 1 - b 2 - c 3 - d 4 - e 5 - } - accum_list [ - 1 - 2 - 3 - 4 - 5 - 6 - "7" - 8 - ] - accum_string "abcdef" - argv ["C:\\Users\\ChristopherHazard\\Desktop\\Howso_repos\\amalgam\\src\\Amalgam\\./amlg_code/full_test.amlg"] - bar (declare - {x 6} - (+ x 2) - ) - foo (declare - {x 6} - (+ x 2) - ) - get_test_assoc { - A {B 2} - B 2 - } - interpreter "C:\\Users\\ChristopherHazard\\Desktop\\Howso_repos\\amalgam\\x64\\MT_Release_EXE\\Amalgam.exe" - raaa 2 - rmdir "rmdir /s /q " - rmfile "del /s /q " - rwww 1 - slash "\\" - start_time 1730419803.177727 - www 1 - x 12 - zz 10 -} -{bbb 3} -{ - abcdefghijklmnop 1 - accum_assoc { - a 1 - b 2 - c 3 - d 4 - e 5 - } - accum_list [ - 1 - 2 - 3 - 4 - 5 - 6 - "7" - 8 - ] - accum_string "abcdef" - argv ["C:\\Users\\ChristopherHazard\\Desktop\\Howso_repos\\amalgam\\src\\Amalgam\\./amlg_code/full_test.amlg"] - bar (declare - {x 6} - (+ x 2) - ) - foo (declare - {x 6} - (+ x 2) - ) - get_test_assoc { - A {B 2} - B 2 - } - interpreter "C:\\Users\\ChristopherHazard\\Desktop\\Howso_repos\\amalgam\\x64\\MT_Release_EXE\\Amalgam.exe" - raaa 2 - rmdir "rmdir /s /q " - rmfile "del /s /q " - rwww 1 - slash "\\" - start_time 1730419803.177727 - www 1 - x 12 - zz 10 -} +{ + abcdefghijklmnop 1 + accum_assoc { + a 1 + b 2 + c 3 + d 4 + e 5 + } + accum_list [ + 1 + 2 + 3 + 4 + 5 + 6 + "7" + 8 + ] + accum_string "abcdef" + argv ["C:\\Users\\Chris Hazard\\Desktop\\Howso_repos\\amalgam\\src\\Amalgam\\./amlg_code/full_test.amlg"] + bar (declare + {x 6} + (+ x 2) + ) + foo (declare + {x 6} + (+ x 2) + ) + get_test_assoc { + A {B 2} + B 2 + } + interpreter "C:\\Users\\Chris Hazard\\Desktop\\Howso_repos\\amalgam\\x64\\MT_Release_EXE\\Amalgam.exe" + raaa 2 + rmdir "rmdir /s /q " + rmfile "del /s /q " + rwww 1 + slash "\\" + start_time 1730659255.572875 + www 1 + x 12 + zz 10 +} +{bbb 3} +{ + abcdefghijklmnop 1 + accum_assoc { + a 1 + b 2 + c 3 + d 4 + e 5 + } + accum_list [ + 1 + 2 + 3 + 4 + 5 + 6 + "7" + 8 + ] + accum_string "abcdef" + argv ["C:\\Users\\Chris Hazard\\Desktop\\Howso_repos\\amalgam\\src\\Amalgam\\./amlg_code/full_test.amlg"] + bar (declare + {x 6} + (+ x 2) + ) + foo (declare + {x 6} + (+ x 2) + ) + get_test_assoc { + A {B 2} + B 2 + } + interpreter "C:\\Users\\Chris Hazard\\Desktop\\Howso_repos\\amalgam\\x64\\MT_Release_EXE\\Amalgam.exe" + raaa 2 + rmdir "rmdir /s /q " + rmfile "del /s /q " + rwww 1 + slash "\\" + start_time 1730659255.572875 + www 1 + x 12 + zz 10 +} --and-- true -(false) +(false) --or-- 1 1 -(false) +(false) --xor-- -(true) +(true) -(false) +(false) --not-- -(false) +(false) -(true) +(true) --=-- -(false) +(false) -(true) +(true) -(true) +(true) -(true) +(true) -(true) +(true) -(false) +(false) --!=-- -(false) +(false) -(true) +(true) -(false) +(false) -(false) +(false) -(false) +(false) -(false) +(false) -(true) +(true) --<-- -(true) +(true) -(false) +(false) -(true) +(true) -(false) +(false) --<=-- -(true) +(true) -(true) +(true) -(true) +(true) -(false) +(false) -(false) +(false) -(false) +(false) -->-- -(true) +(true) -(false) +(false) -(true) +(true) -(false) +(false) -->=-- -(true) +(true) -(true) +(true) -(true) +(true) -(false) +(false) -(false) +(false) -(false) +(false) --~-- -(true) +(true) -(false) +(false) --!~-- -(false) +(false) -(true) +(true) --rand-- -0.3085212072078084 -0.8108604140462151 -36.53852784176681 -7 +0.4354658822862165 +0.21633478712323329 +16.519946352271695 +4 7 -[] +[] -[9] +[1] -[ - 8 - 6 - 1 - 9 - 5 - 0 - 3 - 4 - 7 - 2 -] +[ + 9 + 2 + 5 + 0 + 8 + 3 + 10 + 1 + 4 + 7 +] -[15.147298145412242 2.8707229850232165 1.1842755192409848 26.133999503489054] +[7.171706438820119 32.23595572370973 31.007463842801343 46.83241306269183] --weighted_rand-- b -["b" "a" "b" "b"] +["a" "a" "a" "a"] b -["b" @(get (target 2) 0) "a" @(get (target 2) 2)] +["a" "b" @(get (target 2) 1) @(get (target 2) 1)] -["b" @(get (target 2) 0) @(get (target 2) 0) "a"] +["a" @(get (target 2) 0) @(get (target 2) 0) @(get (target 2) 0)] -infinity test c or d: ["d" "d" "c" "d"] +infinity test c or d: ["c" "c" "c" "c"] -infinity test c or d: ["c" "d" @(get (target 2) 1) @(get (target 2) 0)] +infinity test c or d: ["c" @(get (target 2) 0) @(get (target 2) 0) @(get (target 2) 0)] -{a 16 b 61 c 23} +{a 18 b 53 c 29} -{a 30 b 50 c 20} +{a 25 b 50 c 25} -["1" "3" "9"] +["2" "5" "1"] --get_rand_seed-- -0R'`!cl + A)p1͉ --set_rand_seed-- -0.14733430167075878 -0.7960497320657874 -0.14733430167075878 -0.7960497320657874 +0.45713181313394535 +0.2514913417952701 +0.45713181313394535 +0.2514913417952701 --true-- -(true) +(true) --false-- -(false) +(false) --null-- -(null) +(null) -(null - (+ 3 5) - 7 -) +(null + (+ 3 5) + 7 +) --node null-- -#nulltest (null) +#nulltest (null) --infinity-- .infinity -.infinity --list-- -["a" 1 "b"] +["a" 1 "b"] --associate-- -{ - 4 "d" - a 1 - b 2 - c 3 -} +{ + 4 "d" + a 1 + b 2 + c 3 +} --assoc-- -{b 2 c 3} -{(null) 3} +{b 2 c 3} +{(null) 3} --get_type-- -(+) +(+) --get_type_string-- + string --set_type-- -(- 3 4) -["a" 4 "b" 3] -["a" 4 "b" 3] -{a 4 b 3} +(- 3 4) +["a" 4 "b" 3] +["a" 4 "b" 3] +{a 4 b 3} 8.7 -(parallel - #react - (+ 3 4) -) +(parallel + #react + (+ 3 4) +) --format-- -[ - 97 - 98 - 99 - 100 - 101 - 102 - 103 - -17 - -84 - -105 - -22 - -83 - -106 - -49 - -95 -] +[ + 97 + 98 + 99 + 100 + 101 + 102 + 103 + -17 + -84 + -105 + -22 + -83 + -106 + -49 + -95 +] 1: A 2: -100 3: -100 @@ -1656,21 +1655,21 @@ string 18: Many hands make light work. 19: Many hands make light work.. 19: Many hands make light work... -20: [ - {a 3 b 4} - {c "c"} -] -21: [{"b":4,"a":3},{"d":null,"c":"c"}] +20: [ + {a 3 b 4} + {c "c"} +] +21: [{"a":3,"b":4},{"d":null,"c":"c"}] 22: [{"a":3,"b":4},{"c":"c","d":null}] -23: b: 2 +23: d: 4 +c: 3 a: 1 +b: 2 e: - a - b - - .inf -d: 4 -c: 3 24: a: 1 b: 2 @@ -1682,8 +1681,8 @@ e: - - .inf -25: {a 1} -current date-time in epoch: 2024-10-31-20.10.03.2292550 +25: {a 1} +current date-time in epoch: 2024-11-03-13.40.56.2811770 2020-06-07 00:22:59 1391230800 1391230800 @@ -1721,140 +1720,140 @@ domingo, jun. 07, 2020 12:00:00AM 12:00:00AM --get_labels-- -["labelB"] +["labelB"] --get_all_labels-- -{ - label-number-22 #label-number-22 3 - label21 #label21 - (print - "hello world: " - (* - @(get - (target 4) - "label-number-22" - ) - 4 - ) - #label23 " and " - (* 1 2) - ) - label23 @(get - (target 2) - ["label21" 2] - ) -} -{ - labelA #labelQ #labelA - (lambda - #labelB (true) - ) - labelB @(get - (target 2) - ["labelA" 0] - ) - labelQ @(get - (target 2) - "labelA" - ) -} -{ - labelA #labelQ #labelA - (lambda - #labelB (true) - ) - labelB @(get - (target 2) - ["labelA" 0] - ) - labelQ @(get - (target 2) - "labelA" - ) -} +{ + label-number-22 #label-number-22 3 + label21 #label21 + (print + "hello world: " + (* + @(get + (target 4) + "label-number-22" + ) + 4 + ) + #label23 " and " + (* 1 2) + ) + label23 @(get + (target 2) + ["label21" 2] + ) +} +{ + labelA #labelQ #labelA + (lambda + #labelB (true) + ) + labelB @(get + (target 2) + ["labelA" 0] + ) + labelQ @(get + (target 2) + "labelA" + ) +} +{ + labelA #labelQ #labelA + (lambda + #labelB (true) + ) + labelB @(get + (target 2) + ["labelA" 0] + ) + labelQ @(get + (target 2) + "labelA" + ) +} --set_labels-- -#labelD #labelE (true) +#labelD #labelE (true) --zip_labels-- -[ - #l1 1 - #l2 2 - #l3 3 -] +[ + #l1 1 + #l2 2 + #l3 3 +] --get_comments-- comment too --set_comments-- -;new comment -(true) +;new comment +(true) --get_concurrency-- -(false) +(false) -(true) +(true) -(true) +(true) --set_concurrency-- -||(print "hello") +||(print "hello") -;complex test -#somelabel -||{a "hello" b 4} +;complex test +#somelabel +||{a "hello" b 4} --get_value-- -(true) +(true) --set_value-- 3 --explode-- -[ - "a" - "b" - "c" - "d" - "e" - "f" - "g" - "ﬗ" - "ꭖ" - "ϡ" -] -[ - "a" - "b" - "c" - "d" - "e" - "f" - "g" - "" - "" - "" - "" - "" - "" - "" - "" -] -[ - "ab" - "cd" - "ef" - "g" - "" - "" - "" - "" -] -["abc" "def" "g" "" "ϡ"] -["abcd" "efg" "" "ϡ"] +[ + "a" + "b" + "c" + "d" + "e" + "f" + "g" + "ﬗ" + "ꭖ" + "ϡ" +] +[ + "a" + "b" + "c" + "d" + "e" + "f" + "g" + "" + "" + "" + "" + "" + "" + "" + "" +] +[ + "ab" + "cd" + "ef" + "g" + "" + "" + "" + "" +] +["abc" "def" "g" "" "ϡ"] +["abcd" "efg" "" "ϡ"] --split-- -["hello world"] -["hello" "world"] -["hello" "world" "!"] -["hello" "world !"] -["hello " " the world"] -["abcdefgﬗꭖϡ"] -["abc" "de" "fgﬗꭖϡ"] -["abc" "de" "fgﬗꭖϡ"] -["abc" "de fgﬗꭖϡ"] -["abc de fgﬗꭖϡ"] +["hello world"] +["hello" "world"] +["hello" "world" "!"] +["hello" "world !"] +["hello " " the world"] +["abcdefgﬗꭖϡ"] +["abc" "de" "fgﬗꭖϡ"] +["abc" "de" "fgﬗꭖϡ"] +["abc" "de fgﬗꭖϡ"] +["abc de fgﬗꭖϡ"] --substr-- hello world ello world @@ -1866,32 +1865,32 @@ orl hxlo world e he -["he"] +["he"] -["he" "wo"] +["he" "wo"] -["he" "wo"] +["he" "wo"] -[ - ["he" "e"] -] +[ + ["he" "e"] +] -[ - ["he" "e"] - ["wo" "o"] -] +[ + ["he" "e"] + ["wo" "o"] +] -[ - ["he" "he" "h" "e"] - ["wo" "wo" "w" "o"] -] +[ + ["he" "he" "h" "e"] + ["wo" "wo" "w" "o"] +] -[ - ["he" "h"] - ["wo" "w"] -] +[ + ["he" "h"] + ["wo" "w"] +] -[] +[] h[e]ll[o] w[o]rld h[e]ll[o] world @@ -1906,94 +1905,94 @@ axdefgﬗꭖϡ --concat-- hello world --crypto_sign and crypto_sign_verify-- -valid signature: (true) +valid signature: (true) --encrypt and decrypt-- symmetric key encryption decrypted: hello public key encryption decrypted: hello --print-- -[ - 0 - 1 - 10 - 12 - 100 - 120 - 122 - 1000 - 1000.123 - 10000 - 100000 - 0.1 - 0.01 - 0.001 - 0.0001 - 1e-05 - 1.23456789e-05 - 1.2345e-149 -] -[ - -0 - -1 - -10 - -12 - -100 - -120 - -122 - -1000 - -1000.123 - -10000 - -100000 - -0.1 - -0.01 - -0.001 - -0.0001 - -1e-05 - -1.23456789e-05 - -1.2345e-149 -] +[ + 0 + 1 + 10 + 12 + 100 + 120 + 122 + 1000 + 1000.123 + 10000 + 100000 + 0.1 + 0.01 + 0.001 + 0.0001 + 1e-05 + 1.23456789e-05 + 1.2345e-149 +] +[ + -0 + -1 + -10 + -12 + -100 + -120 + -122 + -1000 + -1000.123 + -10000 + -100000 + -0.1 + -0.01 + -0.001 + -0.0001 + -1e-05 + -1.23456789e-05 + -1.2345e-149 +] .infinity -(true) +(true) -(false) +(false) --total_size-- 10 --mutate-- -[ - 1 - (associate) - 3 - 4 - 5 - 6 - 7 - 8 - (associate) - (<=) - 11 - 12 - (sort) - 14 - (associate (filter) 1 b -4.890719465763954) -] -[ - (+) - 2 - 3 - 4 - (associate "alpha" 5 "beta" (-)) - (associate - "nest" - (associate - "count" - [7 8 9] - ) - "end" - [(+) (+) (*)] - ) -] +[ + 1 + {} + 3 + (and) + 5 + (reduce) + (get) + 8 + 4 + 10 + (values) + 12 + 13 + (assign) + (associate "a" 1 "b" 2) +] +[ + 1 + 2 + (-) + 4 + (associate "alpha" 5 "beta" 6) + (associate + "nest" + (associate + "count" + [7 8 9 (+)] + ) + "end" + [] + ) +] --commonality-- 3 15 @@ -2019,2070 +2018,2256 @@ decrypted: hello 3 1 --intersect-- -[ - 1 - (- 4 2) - {b 4} -] -(seq 2 1) -(parallel 2 (get_entity_comments) 1) -[ - 1 - 2 - 3 - {b 4} - (if - true - 1 - (parallel - (get_entity_comments) - #label-not-1 1 - ) - ) - [5 6] -] -[ - 1 - (associate "b" 4) -] -(replace 4 2 6 1 7) -[ - - ;comment 2 - ;comment 3 - 1 -] -[1 2 3] +[ + 1 + (- 4 2) + {b 4} +] +(seq 2 1) +(parallel 2 (get_entity_comments) 1) +[ + 1 + 2 + 3 + {b 4} + (if + true + 1 + (parallel + (get_entity_comments) + #label-not-1 1 + ) + ) + [5 6] +] +[ + 1 + (associate "b" 4) +] +(replace 4 2 6 1 7) +[ + + ;comment 2 + ;comment 3 + 1 +] +[1 2 3] --union-- -(seq 2 (get_entity_comments) 1 4 (get_entity_comments)) -[ - 1 - (- 4 2) - {a 3 b 4 c 3} -] -(parallel 2 (get_entity_comments) 1 4) -[ - 1 - 2 - 3 - {a 3 b 4 c 3} - (if - true - 1 - (parallel - (get_entity_comments) - #label-not-1 1 - ) - ) - [5 6] -] -[ - 1 - (associate "b" 4 "a" 3 "c" 3) -] -[3 4 2] -[3 2 4 3] -[ - - ;comment 1 - ;comment 2 - ;comment 3 - ;comment 4 - 1 - - ;comment x - 2 - 4 - 3 - 6 - 5 - 8 - 7 - 10 - 9 - 12 - 11 - 14 - 13 -] -[ - [1 2 3] -] - -[ - [1 2 3] -] - -(parallel - [1 2 3] -) +(seq 2 (get_entity_comments) 1 4 (get_entity_comments)) +[ + 1 + (- 4 2) + {a 3 b 4 c 3} +] +(parallel 2 (get_entity_comments) 1 4) +[ + 1 + 2 + 3 + {a 3 b 4 c 3} + (if + true + 1 + (parallel + (get_entity_comments) + #label-not-1 1 + ) + ) + [5 6] +] +[ + 1 + (associate "b" 4 "a" 3 "c" 3) +] +[3 4 2] +[3 2 4 3] +[ + + ;comment 1 + ;comment 2 + ;comment 3 + ;comment 4 + 1 + + ;comment x + 2 + 4 + 3 + 6 + 5 + 8 + 7 + 10 + 9 + 12 + 11 + 14 + 13 +] +[ + [1 2 3] +] + +[ + [1 2 3] +] + +(parallel + [1 2 3] +) --difference-- -(declare - {_ (null)} - (replace - _ - [] - (lambda - [ - a - 2 - c - 4 - d - 6 - q - 8 - e - 10 - f - 12 - g - 14 - ] - ) - ) -) -(declare - {_ (null)} - (replace - _ - [] - (lambda - { - a 2 - c (get - (current_value 1) - "c" - ) - d 6 - e (get - (current_value 1) - "e" - ) - f (get - (current_value 1) - "f" - ) - g 14 - q 8 - } - ) - ) -) -(declare - {_ (null)} - (replace - _ - [] - (lambda - [ - (get - (current_value 1) - 1 - ) - (get - (current_value 1) - 2 - ) - 6 - 8 - (get - (current_value 1) - 4 - ) - (get - (current_value 1) - 5 - ) - 14 - ] - ) - ) -) -(declare - {_ (null)} - (replace - _ - [] - (lambda - { - a 2 - c (get - (current_value 1) - "c" - ) - d 6 - e (get - (current_value 1) - "e" - ) - f (get - (current_value 1) - "f" - ) - g 14 - q 8 - } - ) - ) -) -(declare - {_ (null)} - (replace - _ - ["g"] - (lambda - [ - (get - (current_value 1) - 0 - ) - 4 - ] - ) - [] - (lambda - { - a 2 - g (get - (current_value 1) - "g" - ) - } - ) - ) -) -(declare - {_ (null)} - (replace - _ - [3] - (lambda - [ - (get - (current_value 1) - 0 - ) - 4 - ] - ) - [] - (lambda - (set_type - [ - a - 2 - g - (get - (current_value 1) - 3 - ) - ] - "associate" - ) - ) - ) -) -(declare - {_ (null)} - (replace - _ - [] - (lambda - { - 2 (null) - 5 (null) - 6 (null) - a 1 - } - ) - ) -) -(declare - {_ (null)} - (replace - _ - [] - (lambda - {2 (null) 5 (null) 6 (null)} - ) - ) -) -(declare - {_ (null)} - (replace - _ - [] - (lambda - {2 (null) 5 (null) 6 (null)} - ) - ) -) -(declare - {_ (null)} - (replace - _ - [1] - (lambda - [ - (get - (current_value 1) - 0 - ) - 4 - ] - ) - [] - (lambda - [ - 7 - (get - (current_value 1) - 1 - ) - ] - ) - ) -) -[ - 7 - [1 4] -] -(declare - {_ (null)} - (replace - _ - [1] - (lambda - [ - (get - (current_value 1) - 0 - ) - 4 - ] - ) - [0] - (lambda - (set_type - [7 8] - "+" - ) - ) - ) -) -[ - (+ 7 8) - [1 4] -] -(declare - {_ (null)} - (replace - _ - [1 0] - (lambda - [ - (get - (current_value 1) - 0 - ) - "x" - ] - ) - [1] - (lambda - [ - (get - (current_value 1) - 0 - ) - (get - (current_value 1) - 1 - ) - 4 - ] - ) - [] - (lambda - [ - 7 - (get - (current_value 1) - 1 - ) - ] - ) - ) -) -[ - 7 - [ - ["a" "x"] - 1 - 4 - ] -] +(declare + {_ (null)} + (replace + _ + [] + (lambda + [ + a + 2 + c + 4 + d + 6 + q + 8 + e + 10 + f + 12 + g + 14 + ] + ) + ) +) +(declare + {_ (null)} + (replace + _ + [] + (lambda + { + a 2 + c (get + (current_value 1) + "c" + ) + d 6 + e (get + (current_value 1) + "e" + ) + f (get + (current_value 1) + "f" + ) + g 14 + q 8 + } + ) + ) +) +(declare + {_ (null)} + (replace + _ + [] + (lambda + [ + (get + (current_value 1) + 1 + ) + (get + (current_value 1) + 2 + ) + 6 + 8 + (get + (current_value 1) + 4 + ) + (get + (current_value 1) + 5 + ) + 14 + ] + ) + ) +) +(declare + {_ (null)} + (replace + _ + [] + (lambda + { + a 2 + c (get + (current_value 1) + "c" + ) + d 6 + e (get + (current_value 1) + "e" + ) + f (get + (current_value 1) + "f" + ) + g 14 + q 8 + } + ) + ) +) +(declare + {_ (null)} + (replace + _ + [] + (lambda + { + a 2 + g (get + (current_value 1) + "g" + ) + } + ) + ["g"] + (lambda + [ + (get + (current_value 1) + 0 + ) + 4 + ] + ) + ) +) +(declare + {_ (null)} + (replace + _ + [3] + (lambda + [ + (get + (current_value 1) + 0 + ) + 4 + ] + ) + [] + (lambda + (set_type + [ + a + 2 + g + (get + (current_value 1) + 3 + ) + ] + "associate" + ) + ) + ) +) +(declare + {_ (null)} + (replace + _ + [] + (lambda + { + 2 (null) + 5 (null) + 6 (null) + a 1 + } + ) + ) +) +(declare + {_ (null)} + (replace + _ + [] + (lambda + {2 (null) 5 (null) 6 (null)} + ) + ) +) +(declare + {_ (null)} + (replace + _ + [] + (lambda + {2 (null) 5 (null) 6 (null)} + ) + ) +) +(declare + {_ (null)} + (replace + _ + [1] + (lambda + [ + (get + (current_value 1) + 0 + ) + 4 + ] + ) + [] + (lambda + [ + 7 + (get + (current_value 1) + 1 + ) + ] + ) + ) +) +[ + 7 + [1 4] +] +(declare + {_ (null)} + (replace + _ + [1] + (lambda + [ + (get + (current_value 1) + 0 + ) + 4 + ] + ) + [0] + (lambda + (set_type + [7 8] + "+" + ) + ) + ) +) +[ + (+ 7 8) + [1 4] +] +(declare + {_ (null)} + (replace + _ + [1 0] + (lambda + [ + (get + (current_value 1) + 0 + ) + "x" + ] + ) + [1] + (lambda + [ + (get + (current_value 1) + 0 + ) + (get + (current_value 1) + 1 + ) + 4 + ] + ) + [] + (lambda + [ + 7 + (get + (current_value 1) + 1 + ) + ] + ) + ) +) +[ + 7 + [ + ["a" "x"] + 1 + 4 + ] +] --mix-- -[ - 1 - 2 - 3.5 - 5.5 - 7.5 - 9.5 - 11.5 - 13.5 -] -[ - - ;comment 1 - ;comment 2 - ;comment 3 - ;comment 4 - 1 - 4 - 5.5 - 7.5 - 9.5 - 11.5 - 13.5 -] -[ - 1 - 5 - 2.5 - (associate "a" 3 "b" 4) - (lambda - (if - true - 1 - (parallel - (get_entity_comments) - (lambda - (print - [2 9] - ) - ) - ) - ) - ) - [5 6] -] -[ - 1 - 5 - 2.5 - (associate "a" 3) - (lambda - (if - true - 1 - (seq - (get_entity_comments) - (lambda (null)) - 1 - ) - ) - ) - [5 6] -] -[ - (true) - 3.5 - 5.5 - 7.5 - 9.5 - 11.5 - 13.5 -] -[ - (true) - 2 - 3 - 6 - 8 - 7 - 10 - 9 - 12 - 14 -] +[3.5 5 7.5 10 11.5 13.5] +[ + + ;comment 1 + ;comment 2 + ;comment 3 + ;comment 4 + 1 + 3.5 + 5.5 + 7.5 + 9.5 + 11.5 + 13.5 +] +[ + 1 + 5 + 2.5 + (associate "a" 3 "b" 4) + (lambda + (if + true + 1 + (parallel (get_entity_comments) 1) + ) + ) + [5 6] +] +[ + 1 + 5 + 2.5 + (associate) + (lambda + (if + true + 1 + (seq (get_entity_comments)) + ) + ) + [5 6] +] +[ + (true) + 3.5 + 5.5 + 7.5 + 9.5 + 11.5 + 13.5 +] +[ + 2 + 4 + 6 + 7 + 9 + 11 + 14 + 13 +] 1 1 -4 +2.5 2.5 abcdexyz -abcdeoxyz -abcdeomxyz +abcoxyz +abcemxyz --mix_labels-- -[ - 1 - #mixtest1 2 - #mixtest2 - (associate "a" 3 "b" 4) - (lambda - (if - #mixtest3 true - 1 - (parallel - (get_entity_comments) - #mixtest4 1 - ) - ) - ) - [5 6] -] +[ + 1 + #mixtest1 2 + #mixtest2 + (associate "a" 3 "b" 4) + (lambda + (if + #mixtest3 true + 1 + (parallel + (get_entity_comments) + #mixtest4 1 + ) + ) + ) + [5 6] +] --total_entity_size-- 79 87 --flatten_entity-- -0.40971200496539806 -iA;@VOV- -0.7136950384635786 -0.7136950384635786 -0.6522822782263927 -0.6522822782263927 +0.04246645104716629 +QjXT3 +0.6062880615697428 +0.6062880615697428 +0.12674824318312972 +0.12674824318312972 flatten restore with seeds test -(declare - {create_new_entity (true) new_entity (null)} - (let - { - _ (lambda - (parallel - ##a (rand) - ) - ) - } - (if - create_new_entity - (assign - "new_entity" - (first - (create_entities new_entity _) - ) - ) - (assign_entity_roots new_entity _) - ) - ) - (set_entity_rand_seed new_entity "£=mVOV-") - (set_entity_rand_seed - (first - (create_entities - (append new_entity "DeepRand") - (lambda - (parallel - ##a (rand) - ) - ) - ) - ) - "aE&K\"(X&\0" - ) - new_entity -) -(declare - {create_new_entity (true) new_entity (null)} - (let - { - _ (lambda - (parallel - ##a (rand) - ) - ) - } - (if - create_new_entity - (assign - "new_entity" - (first - (create_entities new_entity _) - ) - ) - (assign_entity_roots new_entity _) - ) - ) - (set_entity_rand_seed new_entity "M:pVVOV-") - (set_entity_rand_seed - (first - (create_entities - (append new_entity "DeepRand") - (lambda - (parallel - ##a (rand) - ) - ) - ) - ) - "aE&K\"(X&\0" - ) - new_entity -) -(declare - {_ (null) new_entity (null)} - (clone_entities _ new_entity) -) +(declare + {create_new_entity (true) new_entity (null)} + (let + { + _ (lambda + (parallel + ##a (rand) + ) + ) + } + (if + create_new_entity + (assign + "new_entity" + (first + (create_entities new_entity _) + ) + ) + (assign_entity_roots new_entity _) + ) + ) + (set_entity_rand_seed new_entity ")m4+T3") + (set_entity_rand_seed + (first + (create_entities + (append new_entity "DeepRand") + (lambda + (parallel + ##a (rand) + ) + ) + ) + ) + "w!HǰF" + ) + new_entity +) +(declare + {create_new_entity (true) new_entity (null)} + (let + { + _ (lambda + (parallel + ##a (rand) + ) + ) + } + (if + create_new_entity + (assign + "new_entity" + (first + (create_entities new_entity _) + ) + ) + (assign_entity_roots new_entity _) + ) + ) + (set_entity_rand_seed new_entity "&)W3BT3") + (set_entity_rand_seed + (first + (create_entities + (append new_entity "DeepRand") + (lambda + (parallel + ##a (rand) + ) + ) + ) + ) + "w!HǰF" + ) + new_entity +) +(declare + {_ (null) new_entity (null)} + (clone_entities _ new_entity) +) flatten restore without seeds test -(declare - {create_new_entity (true) new_entity (null)} - (let - { - _ (lambda - (parallel - ##a (rand) - ) - ) - } - (if - create_new_entity - (assign - "new_entity" - (first - (create_entities new_entity _) - ) - ) - (assign_entity_roots new_entity _) - ) - ) - (create_entities - (append new_entity "DeepRand") - (lambda - (parallel - ##a (rand) - ) - ) - ) - new_entity -) -(declare - {create_new_entity (true) new_entity (null)} - (let - { - _ (lambda - (parallel - ##a (rand) - ) - ) - } - (if - create_new_entity - (assign - "new_entity" - (first - (create_entities new_entity _) - ) - ) - (assign_entity_roots new_entity _) - ) - ) - (set_entity_rand_seed new_entity "{'IC") - (set_entity_rand_seed - (first - (create_entities - (append new_entity "DeepRand") - (lambda - (parallel - ##a (rand) - ) - ) - ) - ) - "5z^\rF/VQ" - ) - new_entity -) -(declare - {_ (null) new_entity (null)} - (clone_entities _ new_entity) -) +(declare + {create_new_entity (true) new_entity (null)} + (let + { + _ (lambda + (parallel + ##a (rand) + ) + ) + } + (if + create_new_entity + (assign + "new_entity" + (first + (create_entities new_entity _) + ) + ) + (assign_entity_roots new_entity _) + ) + ) + (create_entities + (append new_entity "DeepRand") + (lambda + (parallel + ##a (rand) + ) + ) + ) + new_entity +) +(declare + {create_new_entity (true) new_entity (null)} + (let + { + _ (lambda + (parallel + ##a (rand) + ) + ) + } + (if + create_new_entity + (assign + "new_entity" + (first + (create_entities new_entity _) + ) + ) + (assign_entity_roots new_entity _) + ) + ) + (set_entity_rand_seed new_entity "o/bzxk;1") + (set_entity_rand_seed + (first + (create_entities + (append new_entity "DeepRand") + (lambda + (parallel + ##a (rand) + ) + ) + ) + ) + "{>L|\\ " + ) + new_entity +) +(declare + {_ (null) new_entity (null)} + (clone_entities _ new_entity) +) flatten restore with parallel -(declare - {create_new_entity (true) new_entity (null)} - (let - { - _ (lambda - (parallel - ##a (rand) - ) - ) - } - (if - create_new_entity - (assign - "new_entity" - (first - (create_entities new_entity _) - ) - ) - (assign_entity_roots new_entity _) - ) - ) - (set_entity_rand_seed new_entity "£=mVOV-") - ||(parallel - (set_entity_rand_seed - (first - (create_entities - (append new_entity "DeepRand") - (lambda - (parallel - ##a (rand) - ) - ) - ) - ) - "aE&K\"(X&\0" - ) - ) - new_entity -) -(declare - {create_new_entity (true) new_entity (null)} - (let - { - _ (lambda - (parallel - ##a (rand) - ) - ) - } - (if - create_new_entity - (assign - "new_entity" - (first - (create_entities new_entity _) - ) - ) - (assign_entity_roots new_entity _) - ) - ) - (set_entity_rand_seed new_entity "M:pVVOV-") - (set_entity_rand_seed - (first - (create_entities - (append new_entity "DeepRand") - (lambda - (parallel - ##a (rand) - ) - ) - ) - ) - "aE&K\"(X&\0" - ) - new_entity -) -(declare - {_ (null) new_entity (null)} - (clone_entities _ new_entity) -) +(declare + {create_new_entity (true) new_entity (null)} + (let + { + _ (lambda + (parallel + ##a (rand) + ) + ) + } + (if + create_new_entity + (assign + "new_entity" + (first + (create_entities new_entity _) + ) + ) + (assign_entity_roots new_entity _) + ) + ) + (set_entity_rand_seed new_entity ")m4+T3") + ||(parallel + (set_entity_rand_seed + (first + (create_entities + (append new_entity "DeepRand") + (lambda + (parallel + ##a (rand) + ) + ) + ) + ) + "w!HǰF" + ) + ) + new_entity +) +(declare + {create_new_entity (true) new_entity (null)} + (let + { + _ (lambda + (parallel + ##a (rand) + ) + ) + } + (if + create_new_entity + (assign + "new_entity" + (first + (create_entities new_entity _) + ) + ) + (assign_entity_roots new_entity _) + ) + ) + (set_entity_rand_seed new_entity "&)W3BT3") + (set_entity_rand_seed + (first + (create_entities + (append new_entity "DeepRand") + (lambda + (parallel + ##a (rand) + ) + ) + ) + ) + "w!HǰF" + ) + new_entity +) +(declare + {_ (null) new_entity (null)} + (clone_entities _ new_entity) +) --mutate_entity-- -[ - 1 - 2 - "a" - 4 - (<=) - 6 - 7 - 8 - (contains_value) - (get) - 11 - a - 13 - 14 - (associate) -] - -13 -[ - 1 - 2 - 3 - (*) - (-) - 6 - 7 - 8 - (-) - (+) - 11 - (*) - 13 - (-) - "b" -] +[ + (/) + a + (keep) + 4 + 5 + 6 + 7 + 8 + (keep) + 10 + 11 + 12 + 1 + 14 + (call_sandboxed) +] + +[ + (substr) + (contains_value) + (query_among) + (get) + 5 + 6 + 7 + 8 + 1 + 10 + 11 + 12 + 13 + (store) + (associate) +] + +[ + 1 + 2 + 3 + 4 + (+) + 6 + (*) + (+) + 9 + (-) + (*) + (-) + 13 + 14 + (associate "a" 1 "b") +] --commonality_entities-- 73.3678794503212 --edit_distance_entities-- 19.264241099357605 --intersect_entities-- -(associate "b" 4) +(associate "b" 4) MergeEntityChild2 -(associate "p" 3 "q" 4) +(associate "p" 3 "q" 4) MergeEntityChild1 -(associate "x" 3 "y" 4) -_3130331116 -(associate "E" 3 "F" 4) -_1651806471 -(associate "e" 3 "f" 4) +(associate "x" 3 "y" 4) +_2710920158 +(associate "E" 3 "F" 4) +_1797215995 +(associate "e" 3 "f" 4) --union_entities-- -(associate "b" 4 "a" 3 "c" 3) +(associate "b" 4 "a" 3 "c" 3) MergeEntityChild2 -(associate - "p" - 3 - "q" - 4 - "u" - 5 - "v" - 6 - "w" - 7 -) +(associate + "p" + 3 + "q" + 4 + "u" + 5 + "v" + 6 + "w" + 7 +) MergeEntityChild1 -(associate "x" 3 "y" 4 "z" 5) -_3130331116 -(associate - "E" - 3 - "F" - 4 - "G" - 5 - "H" - 6 -) -_1651806471 -(associate - "e" - 3 - "f" - 4 - "g" - 5 - "h" - 6 -) -(parallel - ##p - ["_2325275497" "_2325275497" "_2973704165" "_2973704165"] -) -_2973704165 -(associate - "e" - 3 - "f" - 4 - "g" - 5 - "h" - 6 -) -_2325275497 -(associate - "E" - 3 - "F" - 4 - "G" - 5 - "H" - 6 -) +(associate "x" 3 "y" 4 "z" 5) +_2710920158 +(associate + "E" + 3 + "F" + 4 + "G" + 5 + "H" + 6 +) +_1797215995 +(associate + "e" + 3 + "f" + 4 + "g" + 5 + "h" + 6 +) +(parallel + ##p + ["_525077026" "_525077026" "_4145172689" "_4145172689"] +) +_525077026 +(associate + "E" + 3 + "F" + 4 + "G" + 5 + "H" + 6 +) +_4145172689 +(associate + "e" + 3 + "f" + 4 + "g" + 5 + "h" + 6 +) --difference_entities-- -(declare - {_ (null) new_entity (null)} - (clone_entities _ new_entity) -) -(declare - {_ (null) new_entity (null)} - (assign - "new_entity" - (first - (create_entities - new_entity - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - (set_type - [ - "c" - 3 - (get - (current_value 1) - 2 - ) - (get - (current_value 1) - 3 - ) - ] - "associate" - ) - ) - ) - ) - ) - { - _ (retrieve_entity_root _) - } - ) - ) - ) - ) - (create_entities - (append new_entity "MergeEntityChild1") - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - (set_type - [ - (get - (current_value 1) - 0 - ) - (get - (current_value 1) - 1 - ) - (get - (current_value 1) - 2 - ) - (get - (current_value 1) - 3 - ) - "z" - 5 - ] - "associate" - ) - ) - ) - ) - ) - { - _ (retrieve_entity_root - (append _ "MergeEntityChild1") - ) - } - ) - ) - (create_entities - (append new_entity "MergeEntityChild2") - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - (set_type - [ - (get - (current_value 1) - 0 - ) - (get - (current_value 1) - 1 - ) - (get - (current_value 1) - 2 - ) - (get - (current_value 1) - 3 - ) - "u" - 5 - "v" - 6 - "w" - 7 - ] - "associate" - ) - ) - ) - ) - ) - { - _ (retrieve_entity_root - (append _ "MergeEntityChild2") - ) - } - ) - ) - (create_entities - (append new_entity "_2565637960") - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - (set_type - [ - (get - (current_value 1) - 0 - ) - (get - (current_value 1) - 1 - ) - (get - (current_value 1) - 2 - ) - (get - (current_value 1) - 3 - ) - "G" - 5 - "H" - 6 - ] - "associate" - ) - ) - ) - ) - ) - { - _ (retrieve_entity_root - (append _ "_2565637960") - ) - } - ) - ) - (create_entities - (append new_entity "_407614051") - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - (set_type - [ - (get - (current_value 1) - 0 - ) - (get - (current_value 1) - 1 - ) - (get - (current_value 1) - 2 - ) - (get - (current_value 1) - 3 - ) - ] - "associate" - ) - ) - ) - ) - ) - { - _ (retrieve_entity_root - (append _ "_407614051") - ) - } - ) - ) - new_entity -) -_3532185687 -["DiffEntityChild1" "OnlyIn2" "_3626604918" "_3823131681"] -(declare - {_ (null) new_entity (null)} - (assign - "new_entity" - (first - (create_entities - new_entity - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - { - b (get - (current_value 1) - "b" - ) - c 3 - } - ) - ) - ) - ) - { - _ (retrieve_entity_root _) - } - ) - ) - ) - ) - (create_entities - (append new_entity "DiffEntityChild1") - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - { - x (get - (current_value 1) - "x" - ) - y (get - (current_value 1) - "y" - ) - z 5 - } - ) - ) - ) - ) - { - _ (retrieve_entity_root - (append _ "DiffEntityChild1") - ) - } - ) - ) - (create_entities - (append new_entity "OnlyIn2") - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - {o 6} - ) - ) - ) - ) - { - _ (retrieve_entity_root - (append _ "OnlyIn2") - ) - } - ) - ) - (create_entities - (append new_entity "_3626604918") - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - { - E 3 - F 4 - G 5 - H 6 - } - ) - ) - ) - ) - { - _ (retrieve_entity_root - (append _ "_3626604918") - ) - } - ) - ) - (create_entities - (append new_entity "_3823131681") - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - {e 3 f 4} - ) - ) - ) - ) - { - _ (retrieve_entity_root - (append _ "_3823131681") - ) - } - ) - ) - (clone_entities - (append - _ - ["DiffEntityChild1" "DiffEntityChild2"] - ) - (append - new_entity - ["DiffEntityChild1" "DiffEntityChild2"] - ) - ) - new_entity -) -new_entity: _1461236888 -new_entity root: {b 4 c 3} +(declare + {_ (null) new_entity (null)} + (clone_entities _ new_entity) +) +(declare + {_ (null) new_entity (null)} + (assign + "new_entity" + (first + (create_entities + new_entity + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + (set_type + [ + "c" + 3 + (get + (current_value 1) + 2 + ) + (get + (current_value 1) + 3 + ) + ] + "associate" + ) + ) + ) + ) + ) + { + _ (retrieve_entity_root _) + } + ) + ) + ) + ) + (create_entities + (append new_entity "MergeEntityChild1") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + (set_type + [ + (get + (current_value 1) + 0 + ) + (get + (current_value 1) + 1 + ) + (get + (current_value 1) + 2 + ) + (get + (current_value 1) + 3 + ) + "z" + 5 + ] + "associate" + ) + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "MergeEntityChild1") + ) + } + ) + ) + (create_entities + (append new_entity "MergeEntityChild2") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + (set_type + [ + (get + (current_value 1) + 0 + ) + (get + (current_value 1) + 1 + ) + (get + (current_value 1) + 2 + ) + (get + (current_value 1) + 3 + ) + "u" + 5 + "v" + 6 + "w" + 7 + ] + "associate" + ) + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "MergeEntityChild2") + ) + } + ) + ) + (create_entities + (append new_entity "_3562807220") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + (set_type + [ + (get + (current_value 1) + 0 + ) + (get + (current_value 1) + 1 + ) + (get + (current_value 1) + 2 + ) + (get + (current_value 1) + 3 + ) + "G" + 5 + "H" + 6 + ] + "associate" + ) + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "_3562807220") + ) + } + ) + ) + (create_entities + (append new_entity "_1744305324") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + (set_type + [ + (get + (current_value 1) + 0 + ) + (get + (current_value 1) + 1 + ) + (get + (current_value 1) + 2 + ) + (get + (current_value 1) + 3 + ) + ] + "associate" + ) + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "_1744305324") + ) + } + ) + ) + new_entity +) +_830877783 +["DiffEntityChild1" "OnlyIn2" "_445026204" "_1497566482"] +(declare + {_ (null) new_entity (null)} + (assign + "new_entity" + (first + (create_entities + new_entity + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + { + b (get + (current_value 1) + "b" + ) + c 3 + } + ) + ) + ) + ) + { + _ (retrieve_entity_root _) + } + ) + ) + ) + ) + (create_entities + (append new_entity "DiffEntityChild1") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + { + x (get + (current_value 1) + "x" + ) + y (get + (current_value 1) + "y" + ) + z 5 + } + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "DiffEntityChild1") + ) + } + ) + ) + (create_entities + (append new_entity "OnlyIn2") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + {o 6} + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "OnlyIn2") + ) + } + ) + ) + (create_entities + (append new_entity "_445026204") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + { + E (get + (current_value 1) + "E" + ) + F (get + (current_value 1) + "F" + ) + G 5 + H 6 + } + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "_445026204") + ) + } + ) + ) + (create_entities + (append new_entity "_1497566482") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + { + e (get + (current_value 1) + "e" + ) + f (get + (current_value 1) + "f" + ) + } + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "_1497566482") + ) + } + ) + ) + (clone_entities + (append + _ + ["DiffEntityChild1" "DiffEntityChild2"] + ) + (append + new_entity + ["DiffEntityChild1" "DiffEntityChild2"] + ) + ) + new_entity +) +new_entity: _2654358599 +new_entity root: {b 4 c 3} DiffEntityChild1 root: -{x 3 y 4 z 5} -contained_entities new_entity: ["DiffEntityChild1" "OnlyIn2" "_3626604918" "_3823131681"] +{x 3 y 4 z 5} +contained_entities new_entity: ["DiffEntityChild1" "OnlyIn2" "_445026204" "_1497566482"] difference between DiffEntity2 and new_entity: -(declare - {_ (null) new_entity (null)} - (clone_entities _ new_entity) -) -(declare - {_ (null) new_entity (null)} - (assign - "new_entity" - (first - (create_entities - new_entity - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - { - b (get - (current_value 1) - "b" - ) - c 3 - } - ) - ) - ) - ) - { - _ (retrieve_entity_root _) - } - ) - ) - ) - ) - (create_entities - (append new_entity "OnlyIn2") - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - {o 6} - ) - ) - ) - ) - { - _ (retrieve_entity_root - (append _ "OnlyIn2") - ) - } - ) - ) - (create_entities - (append new_entity "_1985995361") - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - { - E 3 - F 4 - G 5 - H 6 - } - ) - ) - ) - ) - { - _ (retrieve_entity_root - (append _ "_1985995361") - ) - } - ) - ) - (create_entities - (append new_entity "_2783372341") - (call - (lambda - (declare - {_ (null)} - (replace - _ - [] - (lambda - {e 3 f 4} - ) - ) - ) - ) - { - _ (retrieve_entity_root - (append _ "_2783372341") - ) - } - ) - ) - (clone_entities - (append _ "DiffEntityChild1") - (append new_entity "DiffEntityChild1") - ) - new_entity -) +(declare + {_ (null) new_entity (null)} + (assign + "new_entity" + (first + (create_entities + new_entity + (call + (lambda + (declare + {_ (null)} + (replace _) + ) + ) + { + _ (retrieve_entity_root _) + } + ) + ) + ) + ) + (create_entities + (append new_entity "_445026204") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + { + E (null) + F (null) + G (get + (current_value 1) + "G" + ) + H (get + (current_value 1) + "H" + ) + } + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "_445026204") + ) + } + ) + ) + (create_entities + (append new_entity "_1497566482") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + {e (null) f (null)} + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "_1497566482") + ) + } + ) + ) + (clone_entities + (append _ "DiffEntityChild1") + (append new_entity "DiffEntityChild1") + ) + (clone_entities + (append _ "OnlyIn2") + (append new_entity "OnlyIn2") + ) + new_entity +) +(declare + {_ (null) new_entity (null)} + (assign + "new_entity" + (first + (create_entities + new_entity + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + { + b (get + (current_value 1) + "b" + ) + c 3 + } + ) + ) + ) + ) + { + _ (retrieve_entity_root _) + } + ) + ) + ) + ) + (create_entities + (append new_entity "OnlyIn2") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + {o 6} + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "OnlyIn2") + ) + } + ) + ) + (create_entities + (append new_entity "_2860796594") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + { + E (get + (current_value 1) + "E" + ) + F (get + (current_value 1) + "F" + ) + G 5 + H 6 + } + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "_2860796594") + ) + } + ) + ) + (create_entities + (append new_entity "_2612373163") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + { + e (get + (current_value 1) + "e" + ) + f (get + (current_value 1) + "f" + ) + } + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "_2612373163") + ) + } + ) + ) + (clone_entities + (append _ "DiffEntityChild1") + (append new_entity "DiffEntityChild1") + ) + new_entity +) new_entity: DiffContainerReconstructed -new_entity root: {b 4 c 3} +new_entity root: {b 4 c 3} DiffEntityChild1 root: -{x 3 y 4 z 6} -contained_entities new_entity: ["OnlyIn2" "_1985995361" "_2783372341" "DiffEntityChild1"] +{x 3 y 4 z 6} +contained_entities new_entity: ["OnlyIn2" "_2860796594" "_2612373163" "DiffEntityChild1"] difference between DiffContainer and DiffEntity2: -(declare - {_ (null) new_entity (null)} - (clone_entities _ new_entity) -) +(declare + {_ (null) new_entity (null)} + (assign + "new_entity" + (first + (create_entities + new_entity + (call + (lambda + (declare + {_ (null)} + (replace _) + ) + ) + { + _ (retrieve_entity_root _) + } + ) + ) + ) + ) + (create_entities + (append new_entity "_2860796594") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + { + E (null) + F (null) + G (get + (current_value 1) + "G" + ) + H (get + (current_value 1) + "H" + ) + } + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "_2860796594") + ) + } + ) + ) + (create_entities + (append new_entity "_2612373163") + (call + (lambda + (declare + {_ (null)} + (replace + _ + [] + (lambda + {e (null) f (null)} + ) + ) + ) + ) + { + _ (retrieve_entity_root + (append _ "_2612373163") + ) + } + ) + ) + (clone_entities + (append _ "OnlyIn2") + (append new_entity "OnlyIn2") + ) + (clone_entities + (append _ "DiffEntityChild1") + (append new_entity "DiffEntityChild1") + ) + new_entity +) --mix_entities-- -(associate "b" 4) +(associate "b" 4 "a" 3) MergeEntityChild2 -(associate "p" 3 "q" 4 "w" 7) +(associate + "p" + 3 + "q" + 4 + "u" + 5 + "v" + 6 +) MergeEntityChild1 -(associate "x" 3 "y" 4 "z" 5) -_3130331116 -(associate - "E" - 3 - "F" - 4 - "G" - 5 - "H" - 6 -) -_1651806471 -(associate "e" 3 "f" 4) +(associate "x" 3 "y" 4) +_2710920158 +(associate "E" 3 "F" 4 "H" 6) +_1797215995 +(associate "e" 3 "f" 4 "h" 6) --get_entity_comments-- -Full test -This is a suite of unit tests. +Full test +This is a suite of unit tests. This is the second line of the unit test description. this is a fully described entity -{ - ^containervar "a variable accessible to contained entities" - foo "the function foo" - get_api "returns the api details" - publicvar "some public variable" -} -[ - { - x ["the value of x\r\nthe default value of x" 1] - y ["the value of y" 2] - } - "a number representing the sum" -] -{ - description "this is a fully described entity" - labels { - ^containervar {description "a variable accessible to contained entities" parameters (null)} - foo { - description "the function foo" - parameters [ - { - x ["the value of x\r\nthe default value of x" 1] - y ["the value of y" 2] - } - "a number representing the sum" - ] - } - get_api {description "returns the api details" parameters (null)} - publicvar {description "some public variable" parameters (null)} - } -} +{ + ^containervar "a variable accessible to contained entities" + foo "the function foo" + get_api "returns the api details" + publicvar "some public variable" +} +[ + { + x ["the value of x\r\nthe default value of x" 1] + y ["the value of y" 2] + } + "a number representing the sum" +] +{ + description "this is a fully described entity" + labels { + ^containervar {description "a variable accessible to contained entities" parameters (null)} + foo { + description "the function foo" + parameters [ + { + x ["the value of x\r\nthe default value of x" 1] + y ["the value of y" 2] + } + "a number representing the sum" + ] + } + get_api {description "returns the api details" parameters (null)} + publicvar {description "some public variable" parameters (null)} + } +} --retrieve_entity_root-- -[ - 1 - 2 - ##three 3 -] -[ - 1 - 2 - #three 3 -] -[ - 1 - 2 - ##three 3 -] +[ + 1 + 2 + ##three 3 +] +[ + 1 + 2 + #three 3 +] +[ + 1 + 2 + ##three 3 +] --assign_entity_roots-- -[4 5 6] +[4 5 6] --accum_entity_roots-- -(null - #a 1 - #b 2 - #c 3 -) -(null - #c 3 -) +(null + #a 1 + #b 2 + #c 3 +) +(null + #c 3 +) --get_entity_rand_seed-- -3yr>89012345 -0.812564396753873 -adx)5 iD +`oWw +0.6175157570664995 +{hg5@)޳ --set_entity_rand_seed-- -0.21086495653466275 -0.21086495653466275 +0.14708866302817414 +0.14708866302817414 deep sets -0.6853081112330822 -0.6853081112330822 +0.07779057832369474 +0.07779057832369474 --get_entity_root_permission-- -(false) +(false) --set_entity_root_permission-- RootTest -1730419803.505288 -(true) +1730659256.490269 +(true) RootTest (null) -(false) +(false) --create_entities-- -["MyLibrary"] +["MyLibrary"] --nested create_entities-- -["Child1" "Child2"] -["MultipleTest1"] +["Child1" "Child2"] +["MultipleTest1"] -["MultipleTest2"] +["MultipleTest2"] --clone_entities-- -["MyNewLibrary"] +["MyNewLibrary"] --move_entities-- -["MyLibrary2"] +["MyLibrary2"] --destroy_entities-- -[ - "MergeEntity1" - "MergeEntity2" - "FlattenTest" - "_3220334892" - "_2587601847" - "_570580630" - "_4288357968" - "_3069907149" - "_350559405" - "MutateEntity" - "MutatedEntity" - "MutatedEntity2" - "MutatedEntity3" - "AndedEntities" - "OredEntities" - "ComplexMergeEntity1" - "ComplexMergeEntity2" - "ComplexOredEntities" - "_3532185687" - "DiffEntity1" - "DiffEntity2" - "_1461236888" - "DiffContainer" - "DiffContainerReconstructed" - "MixedEntities" - "descriptive_entity" - "SetGetCodeTest" - "AER_test" - "AER_test_2" - "RandTest" - "RootTest" - "MyNewLibrary" - "EntityWithChildren" - "MultipleTest1" - "MultipleTest2" - "MyLibrary2" -] -[ - "MergeEntity1" - "MergeEntity2" - "FlattenTest" - "_3220334892" - "_2587601847" - "_570580630" - "_4288357968" - "_3069907149" - "_350559405" - "MutateEntity" - "MutatedEntity" - "MutatedEntity2" - "MutatedEntity3" - "AndedEntities" - "OredEntities" - "ComplexMergeEntity1" - "ComplexMergeEntity2" - "ComplexOredEntities" - "_3532185687" - "DiffEntity1" - "DiffEntity2" - "_1461236888" - "DiffContainer" - "DiffContainerReconstructed" - "MixedEntities" - "descriptive_entity" - "SetGetCodeTest" - "AER_test" - "AER_test_2" - "RandTest" - "RootTest" - "MyNewLibrary" - "EntityWithChildren" - "MultipleTest1" - "MultipleTest2" -] -[ - "MergeEntity1" - "MergeEntity2" - "FlattenTest" - "_3220334892" - "_2587601847" - "_570580630" - "_4288357968" - "_3069907149" - "_350559405" - "MutateEntity" - "MutatedEntity" - "MutatedEntity2" - "MutatedEntity3" - "AndedEntities" - "OredEntities" - "ComplexMergeEntity1" - "ComplexMergeEntity2" - "ComplexOredEntities" - "_3532185687" - "DiffEntity1" - "DiffEntity2" - "_1461236888" - "DiffContainer" - "DiffContainerReconstructed" - "MixedEntities" - "descriptive_entity" - "SetGetCodeTest" - "AER_test" - "AER_test_2" - "RandTest" - "RootTest" - "MyNewLibrary" - "EntityWithChildren" -] +[ + "MergeEntity1" + "MergeEntity2" + "FlattenTest" + "_1451190156" + "_1989294406" + "_3643253163" + "_2827522608" + "_3380015993" + "_2364738013" + "MutateEntity" + "MutatedEntity" + "MutatedEntity2" + "MutatedEntity3" + "AndedEntities" + "OredEntities" + "ComplexMergeEntity1" + "ComplexMergeEntity2" + "ComplexOredEntities" + "_830877783" + "DiffEntity1" + "DiffEntity2" + "_2654358599" + "DiffContainer" + "DiffContainerReconstructed" + "MixedEntities" + "descriptive_entity" + "SetGetCodeTest" + "AER_test" + "AER_test_2" + "RandTest" + "RootTest" + "MyNewLibrary" + "EntityWithChildren" + "MultipleTest1" + "MultipleTest2" + "MyLibrary2" +] +[ + "MergeEntity1" + "MergeEntity2" + "FlattenTest" + "_1451190156" + "_1989294406" + "_3643253163" + "_2827522608" + "_3380015993" + "_2364738013" + "MutateEntity" + "MutatedEntity" + "MutatedEntity2" + "MutatedEntity3" + "AndedEntities" + "OredEntities" + "ComplexMergeEntity1" + "ComplexMergeEntity2" + "ComplexOredEntities" + "_830877783" + "DiffEntity1" + "DiffEntity2" + "_2654358599" + "DiffContainer" + "DiffContainerReconstructed" + "MixedEntities" + "descriptive_entity" + "SetGetCodeTest" + "AER_test" + "AER_test_2" + "RandTest" + "RootTest" + "MyNewLibrary" + "EntityWithChildren" + "MultipleTest1" + "MultipleTest2" +] +[ + "MergeEntity1" + "MergeEntity2" + "FlattenTest" + "_1451190156" + "_1989294406" + "_3643253163" + "_2827522608" + "_3380015993" + "_2364738013" + "MutateEntity" + "MutatedEntity" + "MutatedEntity2" + "MutatedEntity3" + "AndedEntities" + "OredEntities" + "ComplexMergeEntity1" + "ComplexMergeEntity2" + "ComplexOredEntities" + "_830877783" + "DiffEntity1" + "DiffEntity2" + "_2654358599" + "DiffContainer" + "DiffContainerReconstructed" + "MixedEntities" + "descriptive_entity" + "SetGetCodeTest" + "AER_test" + "AER_test_2" + "RandTest" + "RootTest" + "MyNewLibrary" + "EntityWithChildren" +] --load-- -{ - a #a 1 - b #b (true) - c #c 0.1 - d #d 100000000 - hello #hello - (print "hello\n") -} +{ + a #a 1 + b #b (true) + c #c 0.1 + d #d 100000000 + hello #hello + (print "hello\n") +} load from .json: -[ - {a 3 b 4} - {c "c" d (null)} -] +[ + {a 3 b 4} + {c "c" d (null)} +] load from .yaml: -[ - { - a 123 - b "ABC" - c 123.45 - d "true" - } -] +[ + { + a 123 + b "ABC" + c 123.45 + d "true" + } +] --load_entity-- load from .amlg: hello -(declare - {create_new_entity (true) new_entity (null)} - (let - { - _ (lambda - { - a ##a 1 - b ##b (true) - c ##c 0.1 - d ##d 100000000 - hello ##hello - (print "hello\n") - } - ) - } - (if - create_new_entity - (assign - "new_entity" - (first - (create_entities new_entity _) - ) - ) - (assign_entity_roots new_entity _) - ) - ) - (set_entity_rand_seed new_entity "X~wb3") - (set_entity_rand_seed - (first - (create_entities - (append new_entity "submoduletest") - (lambda - (parallel - ##a 7 - ##hello - (print "sub hello\n") - ) - ) - ) - ) - "DA30W^vha&" - ) - (set_entity_rand_seed - (first - (create_entities - (append new_entity "submoduletest2") - (lambda - (parallel - ##a 8 - ##hello - (print "sub hello 2\n") - ) - ) - ) - ) - "= \0Fyf@)" - ) - new_entity -) +(declare + {create_new_entity (true) new_entity (null)} + (let + { + _ (lambda + { + a ##a 1 + b ##b (true) + c ##c 0.1 + d ##d 100000000 + hello ##hello + (print "hello\n") + } + ) + } + (if + create_new_entity + (assign + "new_entity" + (first + (create_entities new_entity _) + ) + ) + (assign_entity_roots new_entity _) + ) + ) + (set_entity_rand_seed new_entity "qE9fDS") + (set_entity_rand_seed + (first + (create_entities + (append new_entity "submoduletest") + (lambda + (parallel + ##a 7 + ##hello + (print "sub hello\n") + ) + ) + ) + ) + "p54֫-P:" + ) + (set_entity_rand_seed + (first + (create_entities + (append new_entity "submoduletest2") + (lambda + (parallel + ##a 8 + ##hello + (print "sub hello 2\n") + ) + ) + ) + ) + "6ʊ:R9 Y" + ) + new_entity +) persistent loads -(declare - {create_new_entity (true) new_entity (null)} - (let - { - _ (lambda - (parallel - ##a 8 - ##hello - (print "hello\n") - ) - ) - } - (if - create_new_entity - (assign - "new_entity" - (first - (create_entities new_entity _) - ) - ) - (assign_entity_roots new_entity _) - ) - ) - (set_entity_rand_seed new_entity "1a2.Ww") - (set_entity_rand_seed - (first - (create_entities - (append new_entity "NewModule") - (lambda - (associate "a" 1 "b" 2) - ) - ) - ) - "-O[3yCŒ" - ) - (set_entity_rand_seed - (first - (create_entities - (append new_entity "psm") - (lambda - (parallel - ##a 5 - ##hello - (print "hello from psm\n") - ) - ) - ) - ) - "&$ܴ@n>\"FN" - ) - new_entity -) -(declare - {create_new_entity (true) new_entity (null)} - (let - { - _ (lambda - (parallel - ##a 1 - ##hello - (print "hello\n") - ) - ) - } - (if - create_new_entity - (assign - "new_entity" - (first - (create_entities new_entity _) - ) - ) - (assign_entity_roots new_entity _) - ) - ) - (set_entity_rand_seed new_entity "1a2.Ww") - (set_entity_rand_seed - (first - (create_entities - (append new_entity "psm") - (lambda - (parallel - ##a 8 - ##hello - (print "hello from psm\n") - ) - ) - ) - ) - "&$ܴ@n>\"FN" - ) - new_entity -) +(declare + {create_new_entity (true) new_entity (null)} + (let + { + _ (lambda + (parallel + ##a 8 + ##hello + (print "hello\n") + ) + ) + } + (if + create_new_entity + (assign + "new_entity" + (first + (create_entities new_entity _) + ) + ) + (assign_entity_roots new_entity _) + ) + ) + (set_entity_rand_seed new_entity "++X¶۵6") + (set_entity_rand_seed + (first + (create_entities + (append new_entity "NewModule") + (lambda + (associate "a" 1 "b" 2) + ) + ) + ) + "W[x2S0~," + ) + (set_entity_rand_seed + (first + (create_entities + (append new_entity "psm") + (lambda + (parallel + ##a 5 + ##hello + (print "hello from psm\n") + ) + ) + ) + ) + "h𒂘O" + ) + new_entity +) +(declare + {create_new_entity (true) new_entity (null)} + (let + { + _ (lambda + (parallel + ##a 1 + ##hello + (print "hello\n") + ) + ) + } + (if + create_new_entity + (assign + "new_entity" + (first + (create_entities new_entity _) + ) + ) + (assign_entity_roots new_entity _) + ) + ) + (set_entity_rand_seed new_entity "++X¶۵6") + (set_entity_rand_seed + (first + (create_entities + (append new_entity "psm") + (lambda + (parallel + ##a 8 + ##hello + (print "hello from psm\n") + ) + ) + ) + ) + "h𒂘O" + ) + new_entity +) Load Root: PersistTreeRoot Load Inter: -["PersistTreeRoot" "PersistTreeInter"] +["PersistTreeRoot" "PersistTreeInter"] Load Leaf: -["PersistTreeRoot" "PersistTreeInter" "PersistTreeLeaf"] +["PersistTreeRoot" "PersistTreeInter" "PersistTreeLeaf"] Root contained: -["PersistTreeInter"] +["PersistTreeInter"] Root b: 2 Inter contained: -["PersistTreeLeaf"] +["PersistTreeLeaf"] Leaf f: 2 Leaf f: 6 --store-- -[1 2 3 4] -(parallel - #".#blah" 1 -) +[1 2 3 4] +(parallel + #".#blah" 1 +) retrieved: 1 loaded from file: -(parallel - #".#blah" 1 -) +(parallel + #".#blah" 1 +) retrieved: 1 --store other file formats--- [This is text!] -(seq - (print "hello") -) - -contained entities in quackers before file: ["!@#$%^&*)(_+=-'][{}.marbles" "buklulu is good.amlg"] - -contained entity in quackers2 loaded back from file: ["buklulu is good.amlg" "!@#$%^&*)(_+=-'][{}.marbles"] - -[ - [6.4 2.8 5.6 2.2 "virginica"] - [4.9 2.5 4.5 1.7 "virg\"inica"] - [(null)] - [(null) (null) (null) (null)] - [4.9 3.1 1.5 0.1 "set\nosa" 3] - [4.4 3.2 1.3 0.2 "setosa"] -] +(seq + (print "hello") +) + +contained entities in quackers before file: ["!@#$%^&*)(_+=-'][{}.marbles" "buklulu is good.amlg"] + +contained entity in quackers2 loaded back from file: ["buklulu is good.amlg" "!@#$%^&*)(_+=-'][{}.marbles"] + +[ + [6.4 2.8 5.6 2.2 "virginica"] + [4.9 2.5 4.5 1.7 "virg\"inica"] + [(null)] + [(null) (null) (null) (null)] + [4.9 3.1 1.5 0.1 "set\nosa" 3] + [4.4 3.2 1.3 0.2 "setosa"] +] --store_entity-- store to .amlg: -2 -2 -Compression difference: (declare - {_ (null) new_entity (null)} - (clone_entities _ new_entity) -) - -Compression difference: (declare - {_ (null) new_entity (null)} - (clone_entities _ new_entity) -) +2 +2 +Compression difference: (declare + {_ (null) new_entity (null)} + (clone_entities _ new_entity) +) + +Compression difference: (declare + {_ (null) new_entity (null)} + (clone_entities _ new_entity) +) store to .json in amlg format -[ - {a 3 b 4} - {c "c" d (null)} -] +[ + {a 3 b 4} + {c "c" d (null)} +] store to .json normally -[ - {a 3 b 4} - {c "c" d (null)} -] +[ + {a 3 b 4} + {c "c" d (null)} +] --contains_entity-- -(true) +(true) -(false) +(false) --contained_entities-- -[ - "Child1" - "Child2" - "Child3" - "Child4" - "Child5" - "Child6" - "Child7" -] +[ + "Child1" + "Child2" + "Child3" + "Child4" + "Child5" + "Child6" + "Child7" +] --query_select-- -["Child1" "Child2" "Child3"] -["Child2" "Child3" "Child4"] -["Child3" "Child4" "Child5" "Child6" "Child7"] -["Child1" "Child5"] -["Child3" "Child4"] -["Child6" "Child7"] -["Child1" "Child2" "Child6" "Child7"] -["Child1" "Child4" "Child6" "Child7"] -["Child4" "Child6"] +["Child1" "Child2" "Child3"] +["Child2" "Child3" "Child4"] +["Child3" "Child4" "Child5" "Child6" "Child7"] +["Child1" "Child5"] +["Child3" "Child4"] +["Child6" "Child7"] +["Child2" "Child3" "Child4" "Child7"] +["Child1" "Child2" "Child3" "Child7"] +["Child4" "Child6"] --query_sample-- -["Child1"] -["Child2" "Child1"] -["Child4"] -["Child7"] +["Child2"] +["Child1" "Child1"] +["Child6"] +["Child2"] --query_weighted_sample-- -["Child1"] -["Child1"] -[ - "Child1" - "Child1" - "Child1" - "Child2" - "Child6" - "Child2" - "Child1" - "Child1" - "Child1" - "Child1" - "Child5" - "Child2" - "Child2" - "Child2" - "Child2" - "Child2" - "Child1" - "Child2" - "Child2" - "Child1" -] -[ - "Child1" - "Child2" - "Child4" - "Child2" - "Child2" - "Child1" - "Child1" - "Child2" - "Child1" - "Child1" - "Child1" - "Child4" - "Child1" - "Child2" - "Child1" - "Child1" - "Child2" - "Child1" - "Child2" - "Child1" -] -[ - "Child2" - "Child2" - "Child4" - "Child2" - "Child2" - "Child2" - "Child2" - "Child6" - "Child2" - "Child2" -] -["Child2" "Child4"] +["Child2"] +["Child4"] +[ + "Child2" + "Child1" + "Child2" + "Child1" + "Child5" + "Child2" + "Child1" + "Child5" + "Child3" + "Child3" + "Child1" + "Child2" + "Child3" + "Child1" + "Child2" + "Child1" + "Child1" + "Child1" + "Child1" + "Child2" +] +[ + "Child2" + "Child6" + "Child1" + "Child1" + "Child3" + "Child6" + "Child1" + "Child1" + "Child2" + "Child2" + "Child1" + "Child1" + "Child1" + "Child2" + "Child1" + "Child2" + "Child1" + "Child2" + "Child1" + "Child2" +] +[ + "Child2" + "Child2" + "Child2" + "Child2" + "Child2" + "Child2" + "Child2" + "Child4" + "Child2" + "Child2" +] +["Child2"] --query_in_entity_list-- -["Child6" "Child7"] +["Child6" "Child7"] --query_not_in_entity_list-- -["Child1" "Child2" "Child3" "Child4" "Child5"] ---query_count-- -7 -6 +["Child1" "Child2" "Child3" "Child4" "Child5"] --query_exists-- -["Child5"] -[] -["Child5"] +["Child5"] +[] +["Child5"] --query_not_exists-- -["Child1" "Child2" "Child3" "Child4" "Child6" "Child7"] -["Child5"] +["Child1" "Child2" "Child3" "Child4" "Child6" "Child7"] +["Child5"] --query_equals-- -["Child5"] -["Child5"] +["Child5"] +["Child5"] --query_not_equals-- -["Child1" "Child2" "Child6" "Child7"] -["Child1" "Child2" "Child6" "Child7"] -["Child5"] -["Child1" "Child2" "Child6" "Child7"] +["Child1" "Child2" "Child6" "Child7"] +["Child1" "Child2" "Child6" "Child7"] +["Child5"] +["Child1" "Child2" "Child6" "Child7"] --query_between-- -["Child1" "Child6" "Child7"] -["Child1" "Child6" "Child7"] -["Child2"] +["Child1" "Child6" "Child7"] +["Child1" "Child6" "Child7"] +["Child2"] --query_not_between-- -["Child2" "Child3" "Child4"] -["Child5"] -["Child6"] -cascading global query: ["Child3" "Child4" "Child7"] +["Child2" "Child3" "Child4"] +["Child5"] +["Child6"] +cascading global query: ["Child3" "Child4" "Child7"] --query_among-- -among x = 0, 100: ["Child3" "Child4" "Child7"] -among x = 0, 100: ["Child3" "Child4" "Child7"] -among bar = not crunchy: ["Child6"] -among bar = not crunchy: ["Child6"] +among x = 0, 100: ["Child3" "Child4" "Child7"] +among x = 0, 100: ["Child3" "Child4" "Child7"] +among bar = not crunchy: ["Child6"] +among bar = not crunchy: ["Child6"] --query_not_among-- -not_among x = 0, 100: ["Child1" "Child2" "Child6"] -not_among x = 0, 100: ["Child1" "Child2" "Child6"] -not_among bar = not crunchy: ["Child5"] -not_among bar = not crunchy: [] +not_among x = 0, 100: ["Child1" "Child2" "Child6"] +not_among x = 0, 100: ["Child1" "Child2" "Child6"] +not_among bar = not crunchy: ["Child5"] +not_among bar = not crunchy: [] --query_nearest_generalized_distance-- -cascading query_not_equals: ["Child1" "Child6"] -cascading query_not_in_entity_list: ["Child6" "Child7"] -unweighted query: { - Child1 4 - Child2 1 - Child4 100 - Child6 2 - Child7 10 -} -weighted query: { - Child1 1.8 - Child2 0.45 - Child3 2 - Child6 0.04 - Child7 0.2 -} -weighted query list of lists: [ - ["Child6" "Child7" "Child2" "Child1" "Child3"] - [0.04 0.2 0.45 1.8 2] -] -weighted query list of lists: [ - ["Child2" "Child6" "Child1" "Child7" "Child3"] - [1 2 4 10 100] - [-1 2 4 10 100] -] -weighted query list of lists with multiple values: [ - ["Child2" "Child6" "Child1" "Child7" "Child3"] - [1 2 4 10 100] - [-1 2 4 10 100] - [-1 1 3 0 100] -] -[ - [ - "_524432977" - "_1793553781" - "_3097960239" - "_2816641722" - "_369871947" - "_2842357671" - "_1688523560" - "_490936350" - ] - [ - 8.333333333333327 - 4.545454545454546 - 3.333333333333333 - 3.333333333333333 - 3.333333333333333 - 2.499999999999999 - 2 - 1.9999999999999991 - ] -] +cascading query_not_equals: ["Child1" "Child6"] +cascading query_not_in_entity_list: ["Child6" "Child7"] +unweighted query: { + Child1 4 + Child2 1 + Child3 100 + Child6 2 + Child7 10 +} +weighted query: { + Child1 1.8 + Child2 0.45 + Child3 2 + Child6 0.04 + Child7 0.2 +} +weighted query list of lists: [ + ["Child6" "Child7" "Child2" "Child1" "Child4"] + [0.04 0.2 0.45 1.8 2] +] +weighted query list of lists: [ + ["Child2" "Child6" "Child1" "Child7" "Child3"] + [1 2 4 10 100] + [-1 2 4 10 100] +] +weighted query list of lists with multiple values: [ + ["Child2" "Child6" "Child1" "Child7" "Child3"] + [1 2 4 10 100] + [-1 2 4 10 100] + [-1 1 3 0 100] +] +[ + [ + "_2131365383" + "_498755418" + "_842378747" + "_3348897774" + "_2893824972" + "_1567576627" + "_251284800" + "_3380262628" + ] + [ + 8.333333333333327 + 4.545454545454546 + 3.333333333333333 + 3.333333333333333 + 3.333333333333333 + 2.499999999999999 + 2 + 1.9999999999999991 + ] +] test code and string distances -1: ["Child1" "Child4"] -2: ["Child1" "Child2" "Child4" "Child5"] -3: ["Child1" "Child2" "Child4" "Child5"] -4: ["Child1" "Child2" "Child4" "Child5"] -5: ["Child1" "Child2" "Child6"] +1: ["Child1" "Child4"] +2: ["Child1" "Child2" "Child4" "Child5"] +3: ["Child1" "Child2" "Child4" "Child5"] +4: ["Child1" "Child2" "Child4" "Child5"] +5: ["Child1" "Child2" "Child6"] --query_max-- -["Child1" "Child3" "Child4"] -["Child1" "Child3" "Child4"] +["Child1" "Child3" "Child4"] +["Child1" "Child3" "Child4"] --query_min-- -["Child2" "Child7"] -["Child2" "Child7"] +["Child2" "Child7"] +["Child2" "Child7"] --query_sum-- 203 4.92 @@ -4116,672 +4301,678 @@ test code and string distances 97 199 --query_value_masses-- -{ - "-1" 1 - 0 1 - 1 1 - 3 1 - 100 2 -} - -{ - "-1" 0.45 - 0 0.02 - 1 0.02 - 3 0.45 - 100 0.04 -} - -{crunchy 1 "not crunchy" 1} +{ + "-1" 1 + 0 1 + 1 1 + 3 1 + 100 2 +} + +{ + "-1" 0.45 + 0 0.02 + 1 0.02 + 3 0.45 + 100 0.04 +} + +{crunchy 1 "not crunchy" 1} --query_less_or_equal_to-- -["Child1" "Child2" "Child6" "Child7"] -["Child1" "Child2" "Child6" "Child7"] +["Child1" "Child2" "Child6" "Child7"] +["Child1" "Child2" "Child6" "Child7"] --query_greater_or_equal_to-- -["Child3" "Child4"] -["Child3" "Child4"] +["Child3" "Child4"] +["Child3" "Child4"] --query_within_generalized_distance-- -["Child1" "Child2" "Child4" "Child6" "Child7"] -["Child1" "Child2" "Child4" "Child6" "Child7"] +["Child1" "Child2" "Child4" "Child6" "Child7"] +["Child1" "Child2" "Child4" "Child6" "Child7"] --query_nearest_generalized_distance-- -["Child2" "Child4"] -["Child2" "Child4"] -["Child1" "Child2" "Child4" "Child6" "Child7"] -["Child1" "Child2" "Child4" "Child6" "Child7"] -["Child2" "Child4"] -["Child2" "Child4" "Child7"] -["Child2" "Child4" "Child7"] -assoc-based: ["Child2" "Child4" "Child7"] -["Child2" "Child4" "Child6"] +["Child2" "Child4"] +["Child2" "Child4"] +["Child1" "Child2" "Child4" "Child6" "Child7"] +["Child1" "Child2" "Child4" "Child6" "Child7"] +["Child2" "Child4"] +["Child2" "Child4" "Child7"] +["Child2" "Child4" "Child7"] +assoc-based: ["Child2" "Child4" "Child7"] +["Child2" "Child4" "Child6"] --contained_entities caching and permissions-- -(false) +(false) (null) -(parallel - ##^a 3 - ##b (contained_entities) - ##c - (+ x 1) - ##d - (call_entity - "Child5" - "q" - {x x} - ) - ##!e 12 - ##x 4 - ##y 5 -) +(parallel + ##^a 3 + ##b (contained_entities) + ##c + (+ x 1) + ##d + (call_entity + "Child5" + "q" + {x x} + ) + ##!e 12 + ##x 4 + ##y 5 +) 1 0 0 1 -[ - (parallel - ##x 0 - ##y 0 - ) - (parallel - ##x 1 - ##y 0 - ) - (parallel - ##x 0 - ##y 1 - ) -] -[ - (parallel - ##x 0 - ##y 0 - ) - (parallel - ##x 1 - ##y 0 - ) - (parallel - ##x 0 - ##y 1 - ) - (parallel - ##x 0 - ##y 0.5 - ) -] -[ - (parallel - ##x 0 - ##y 0 - ) - (parallel - ##x 0 - ##y 1 - ) -] +[ + (parallel + ##x 0 + ##y 0 + ) + (parallel + ##x 1 + ##y 0 + ) + (parallel + ##x 0 + ##y 1 + ) +] +[ + (parallel + ##x 0 + ##y 0 + ) + (parallel + ##x 1 + ##y 0 + ) + (parallel + ##x 0 + ##y 1 + ) + (parallel + ##x 0 + ##y 0.5 + ) +] +[ + (parallel + ##x 0 + ##y 0 + ) + (parallel + ##x 0 + ##y 1 + ) +] --compute_on_contained_entities-- -{ - Child5 { - q (+ - x - (call_container "^a") - ) - } -} -{ - Child1 7 - Child2 2 - Child4 -200 - Child6 3 - Child7 10 -} -{ - Child1 7 - Child2 2 - Child4 -200 - Child6 3 - Child7 10 -} -{Child2 2 Child4 -200} +{ + Child5 { + q (+ + x + (call_container "^a") + ) + } +} +{ + Child1 7 + Child2 2 + Child4 -200 + Child6 3 + Child7 10 +} +{ + Child1 7 + Child2 2 + Child4 -200 + Child6 3 + Child7 10 +} +{Child2 2 Child4 -200} --compute_entity_convictions-- case convictions: -{ - entity1 1.8849070781661639 - entity2 0.6863118922121982 - entity3 0.8222276770849821 - entity4 1.9468118839925106 - entity5 0.7797040417153973 -} +{ + entity1 1.8849070781661639 + entity2 0.6863118922121982 + entity3 0.8222276770849821 + entity4 1.9468118839925106 + entity5 0.7797040417153973 +} case convictions: -{ - entity1 0.655877894152981 - entity2 4.719518200776451 - entity3 3.1299148442694946 - entity4 0.6588967213280371 - entity5 0.7011374455603876 -} +{ + entity1 0.655877894152981 + entity2 4.719518200776451 + entity3 3.1299148442694946 + entity4 0.6588967213280371 + entity5 0.7011374455603876 +} case convictions unweighted: -{ - entity1 2.2695667753739017 - entity2 0.6731896181878543 - entity3 1.1557765434908727 - entity4 38.384973496395396 - entity5 0.45815851485891435 -} +{ + entity1 2.2695667753739017 + entity2 0.6731896181878543 + entity3 1.1557765434908727 + entity4 38.384973496395396 + entity5 0.45815851485891435 +} case convictions weighted by object (with erroneously long nominal): -{ - TestContainerExec 0.2828909712209332 - vert0 1.2974898602334366 - vert1 1.2974898602334366 - vert2 1.1342260882087178 - vert3 1.2974898602334366 - vert4 73.7945497230898 - vert5 3.880438191446671 -} +{ + TestContainerExec 0.2828909712209332 + vert0 1.2974898602334366 + vert1 1.2974898602334366 + vert2 1.1342260882087178 + vert3 1.2974898602334366 + vert4 73.7945497230898 + vert5 3.880438191446671 +} case convictions x exists before: -{entity3 1.0000000933277426 entity4 0.9999998458521889 entity5 1.0000000608201045} +{entity3 1.0000000933277426 entity4 0.9999998458521889 entity5 1.0000000608201045} case convictions x exists after: -{ - entity3 {x 16} - entity4 {x 8} - entity5 {x 32} -} +{ + entity3 {x 16} + entity4 {x 8} + entity5 {x 32} +} case convictions object = 1: -{ - vert0 0.9999999999999484 - vert1 0.9999999999999976 - vert2 1.0000000000000566 - vert3 0.9999999999999976 -} +{ + vert0 0.9999999999999484 + vert1 0.9999999999999976 + vert2 1.0000000000000566 + vert3 0.9999999999999976 +} case convictions on a subset: -{vert0 0.5 vert3 0} +{vert0 0.5 vert3 0} --compute_entity_group_kl_divergence-- 0.01228960638554566 --compute_entity_distance_contributions-- -{ - TestContainerExec 4.721359549995793 - vert0 0.8284271247461902 - vert1 0.8284271247461902 - vert2 0.8284271247461902 - vert3 0.8284271247461902 - vert4 0.7071067811865476 - vert5 1.17157287525381 -} +{ + TestContainerExec 4.721359549995793 + vert0 0.8284271247461902 + vert1 0.8284271247461902 + vert2 0.8284271247461902 + vert3 0.8284271247461902 + vert4 0.7071067811865476 + vert5 1.17157287525381 +} (these values should match the values of the subset of these keys in the previous assoc): -{vert0 0.8284271247461902 vert1 0.8284271247461902 vert2 0.8284271247461902} -{ - vert0 0.8284271247461902 - vert1 0.8284271247461902 - vert2 0.8284271247461902 - vert3 0.8284271247461902 - vert4 0.7071067811865476 - vert5 1.17157287525381 -} +{vert0 0.8284271247461902 vert1 0.8284271247461902 vert2 0.8284271247461902} +{ + vert0 0.8284271247461902 + vert1 0.8284271247461902 + vert2 0.8284271247461902 + vert3 0.8284271247461902 + vert4 0.7071067811865476 + vert5 1.17157287525381 +} (these values should match the values of the subset of these keys in the previous assoc): -{vert4 0.7071067811865476 vert5 1.17157287525381} +{vert4 0.7071067811865476 vert5 1.17157287525381} --compute_entity_kl_divergences-- -{ - vert0 0.00018681393615961172 - vert1 0.0003526679446349979 - vert2 0.005341750456218763 - vert3 0.00018681393615961172 - vert4 0.006401917906003654 - vert5 0.010670757326457676 -} -(these values should match the values of the subset of these keys in the previous assoc):{vert0 0.00018681393615961172 vert3 0} +{ + vert0 0.00018681393615961172 + vert1 0.0003526679446349979 + vert2 0.005341750456218763 + vert3 0.00018681393615961172 + vert4 0.006401917906003654 + vert5 0.010670757326457676 +} +(these values should match the values of the subset of these keys in the previous assoc):{vert0 0.00018681393615961172 vert3 0} additional conviction calculations: -case conviction:{ - vert0 0.8000570855094574 - vert1 0.7468655552274358 - vert3 6.2015767755691655 - vert5 0.8000570855094727 -} -case conviction:{ - vert0 0.6770361498076789 - vert1 3.8439118699400026 - vert3 1.3354696017896601 - vert5 0.6604923501807921 -} -cyclic feature nearest neighbors: {cyclic1 1 cyclic5 0.5} +case conviction:{ + vert0 0.8000570855094574 + vert1 0.7468655552274358 + vert3 6.2015767755691655 + vert5 0.8000570855094727 +} +case conviction:{ + vert0 0.6770361498076789 + vert1 3.8439118699400026 + vert3 1.3354696017896601 + vert5 0.6604923501807921 +} +cyclic feature nearest neighbors: {cyclic1 1 cyclic5 0.5} cyclic test expected: 155, 200, 190 ... deg values of 0 8 and 12: -155: 0.1 (null - ##deg 0 -) -200: 0.05555555555555555 (null - ##deg 8 -) -190: 0.045454545454545456 (null - ##deg 12 -) +190: 0.045454545454545456 (null + ##deg 12 +) +155: 0.1 (null + ##deg 0 +) +200: 0.05555555555555555 (null + ##deg 8 +) --contains_label-- -(true) +(contains_label "label3") -(false) +(contains_label "hhccc") -(true) +(contains_label + ["TestContainerExec" "Child1"] + "y" +) -(false) +(contains_label + ["TestContainerExec" "Child1"] + "qq" +) --assign_to_entities-- -#a2e (null) -" or " -3 -(true) -5 +#a2e (null) +" or " +3 +(true) +5 (parallel #asgn_test 12) -(true) -4 -(parallel - ##a 2 - ##b 3 - ##c 4 -) -(+ - ##three 12 - 4 -) +(true) +4 +(parallel + ##a 2 + ##b 3 + ##c 4 +) +(+ + ##three 12 + 4 +) --direct_assign_to_entities-- -#a 12 -(true) -#a 7 +#a 12 +(true) +#a 7 --accum_to_entities-- 7 -#i2e2 -[1 2 3 4] +#i2e2 +[1 2 3 4] --retrieve_from_entity-- -" and " -12 -12 -[12 13] -{a 12 b 13} +" and " +12 +12 +[12 13] +{a 12 b 13} --direct_retrieve_from_entity-- -7 -#a 7 +7 +#a 7 --call_entity-- -[ - "Child1" - "Child2" - "Child3" - "Child4" - "Child5" - "Child6" - "Child7" -] -(parallel - ##^a 3 - ##b (contained_entities) - ##c - (+ x 1) - ##d - (call_entity - "Child5" - "q" - {x x} - ) - ##!e 12 - ##x 4 - ##y 5 -) -3 -[ - "Child1" - "Child2" - "Child3" - "Child4" - "Child5" - "Child6" - "Child7" -] -6 +[ + "Child1" + "Child2" + "Child3" + "Child4" + "Child5" + "Child6" + "Child7" +] +(parallel + ##^a 3 + ##b (contained_entities) + ##c + (+ x 1) + ##d + (call_entity + "Child5" + "q" + {x x} + ) + ##!e 12 + ##x 4 + ##y 5 +) +3 +[ + "Child1" + "Child2" + "Child3" + "Child4" + "Child5" + "Child6" + "Child7" +] +6 execution limits tests 87 --call_entity_get_changes-- -4 -6 -[ - (true) - (seq - (create_entities - ["CEGCTest" "Contained"] - (null - #a 4 - #b 6 - ) - ) - (print "4\r\n") - (assign_to_entities - ["CEGCTest" "Contained"] - {a 6 b 10} - ) - (print "6\r\n") - (set_entity_rand_seed - ["CEGCTest" "Contained"] - "bbbb" - (false) - ) - (destroy_entities - ["CEGCTest" "Contained"] - ) - ) -] +4 +6 +[ + (true) + (seq + (create_entities + ["CEGCTest" "Contained"] + (null + #a 4 + #b 6 + ) + ) + (print "4\r\n") + (assign_to_entities + ["CEGCTest" "Contained"] + {a 6 b 10} + ) + (print "6\r\n") + (set_entity_rand_seed + ["CEGCTest" "Contained"] + "bbbb" + (false) + ) + (destroy_entities + ["CEGCTest" "Contained"] + ) + ) +] --call_container-- 8 8 (null) --circular, repeated, and preevaluated references-- -{a 1 b 2} -(associate "a" 1 "b" 2) +{a 1 b 2} +(associate "a" 1 "b" 2) (null) 1 (null) -[ - {a 1} - @(get - (target 2) - 0 - ) - 1 -] -[ - {a 1} - @(get - (target 2) - 0 - ) - 1 -] +[ + {a 1} + @(get + (target 2) + 0 + ) + 1 +] +[ + {a 1} + @(get + (target 2) + 0 + ) + 1 +] 3 -[ - {a 3} - @(get - (target 2) - [0 "a"] - ) -] - -[ - {a 3} - @(get - (target 2) - [0 "a"] - ) -] +[ + {a 3} + @(get + (target 2) + [0 "a"] + ) +] + +[ + {a 3} + @(get + (target 2) + [0 "a"] + ) +] entity cyclic test: -(declare - {create_new_entity (true) new_entity (null)} - (let - { - _ (lambda - ##label_target - [ - {a 3} - @(get - (target 2) - [0 "a"] - ) - ] - ) - } - (if - create_new_entity - (assign - "new_entity" - (first - (create_entities new_entity _) - ) - ) - (assign_entity_roots new_entity _) - ) - ) - (set_entity_rand_seed new_entity "\\| ;;V;") - new_entity -) +(declare + {create_new_entity (true) new_entity (null)} + (let + { + _ (lambda + ##label_target + [ + {a 3} + @(get + (target 2) + [0 "a"] + ) + ] + ) + } + (if + create_new_entity + (assign + "new_entity" + (first + (create_entities new_entity _) + ) + ) + (assign_entity_roots new_entity _) + ) + ) + (set_entity_rand_seed new_entity "O\rBxQ\thh^8K") + new_entity +) 3 -(declare - {create_new_entity (true) new_entity (null)} - (let - { - _ (lambda - ##label_target - [ - {a 3} - @(get - (target 2) - [0 "a"] - ) - ] - ) - } - (if - create_new_entity - (assign - "new_entity" - (first - (create_entities new_entity _) - ) - ) - (assign_entity_roots new_entity _) - ) - ) - (set_entity_rand_seed new_entity "\\| ;;V;") - new_entity -) +(declare + {create_new_entity (true) new_entity (null)} + (let + { + _ (lambda + ##label_target + [ + {a 3} + @(get + (target 2) + [0 "a"] + ) + ] + ) + } + (if + create_new_entity + (assign + "new_entity" + (first + (create_entities new_entity _) + ) + ) + (assign_entity_roots new_entity _) + ) + ) + (set_entity_rand_seed new_entity "O\rBxQ\thh^8K") + new_entity +) cyclic lookup test: -{ - original { - auto_derive_on_train {series_id_features "id"} - } - pointer [ - [@(get (target 4) ["original" "auto_derive_on_train" "series_id_features"])] - ] -} +{ + original { + auto_derive_on_train {series_id_features "id"} + } + pointer [ + [@(get (target 4) ["original" "auto_derive_on_train" "series_id_features"])] + ] +} cyclic lookup test 2: -{ - ".f1_rate_1" { - auto_derive_on_train { - ordered_by_features ["date"] - } - } - ".f3_rate_1" { - auto_derive_on_train { - ordered_by_features [@(get (target 5) [".f1_rate_1" "auto_derive_on_train" "ordered_by_features" 0])] - } - } -} +{ + ".f1_rate_1" { + auto_derive_on_train { + ordered_by_features ["date"] + } + } + ".f3_rate_1" { + auto_derive_on_train { + ordered_by_features [@(get (target 5) [".f1_rate_1" "auto_derive_on_train" "ordered_by_features" 0])] + } + } +} --null equality tests-- -(= (null) (null)): (true) +(= (null) (null)): (true) -(= (+ (null)) (null)): (true) +(= (+ (null)) (null)): (true) -["Entity3"] -["EntityNull" "EntityNaN"] -["EntityNull" "EntityNaN"] -["Entity3" "EntityNull" "EntityNaN"] +["Entity3"] +["EntityNull" "EntityNaN"] +["EntityNull" "EntityNaN"] +["Entity3" "EntityNull" "EntityNaN"] --combo tests-- 4.5 5 -(null - #A 10 - #duped - ["b"] - @(get - (target 2) - 1 - ) -) - -["hello" "!"] -{a1 1.4142135623730951 a2 2 a3 1.4142135623730951} -{a1 1.4142135623730951 a3 1.4142135623730951} -{a3 1.4142135623730951} -{a1 5.0990195135927845 a2 2 a3 5.0990195135927845} -{a1 1 a3 1 a4 0} +(null + #A 10 + #duped + ["b"] + @(get + (target 2) + 1 + ) +) + +["hello" "!"] +{a1 1.4142135623730951 a2 2 a3 1.4142135623730951} +{a1 1.4142135623730951 a3 1.4142135623730951} +{a3 1.4142135623730951} +{a1 5.0990195135927845 a2 2 a3 5.0990195135927845} +{a1 1 a3 1 a4 0} --accuracy tests-- 1036.1581794564518 24.769501899470985 4.3464184709105573e-45 -{point1 1036.1581794564518 point2 978.5569789822398 point3 1036.1581794564518} +{point1 1036.1581794564518 point2 978.5569789822398 point3 1036.1581794564518} distance symmetry tests -[ - [ - "B" - "C" - "D" - "A" - "I" - "F" - "J" - "E" - ] - [ - 0 - 1 - 1 - 1 - 1 - 1 - 1024 - 1024 - ] -] -[ - [ - "B" - "C" - "I" - "A" - "F" - "D" - "J" - "G" - ] - [ - 0 - 1 - 1 - 1 - 1 - 1 - 1024 - 1024 - ] -] +[ + [ + "B" + "I" + "D" + "A" + "C" + "F" + "G" + "J" + ] + [ + 0 + 1 + 1 + 1 + 1 + 1 + 1024 + 1024 + ] +] +[ + [ + "B" + "C" + "A" + "I" + "F" + "D" + "J" + "E" + ] + [ + 0 + 1 + 1 + 1 + 1 + 1 + 1024 + 1024 + ] +] distance contributions -dc: [ - ["vert0" "vert1" "vert2" "vert3"] - [1 1 1 1.4142135623730951] -] -weighted dc: { - vert0 2 - vert1 1 - vert2 1 - vert3 1.4142135623730951 -} +dc: [ + ["vert0" "vert1" "vert2" "vert3"] + [1 1 1 1.4142135623730951] +] +weighted dc: { + vert0 2 + vert1 1 + vert2 1 + vert3 1.4142135623730951 +} removal conviction -kl: { - vert0 0.012498962161828123 - vert1 0.0014999155151563248 - vert2 0.012940692023868397 - vert3 0.012498962161828303 -} -weighted kl: { - vert0 0.043840314666364594 - vert1 0.01215014552815915 - vert2 0.023216985559271874 - vert3 0.00033148949739295053 -} -convictions: { - vert0 0.7888361319935541 - vert1 6.573458882210904 - vert2 0.7619092508719576 - vert3 0.7888361319935426 -} -further parameterized convictions: { - vert0 0.7888361319935541 - vert1 6.573458882210904 - vert2 0.7619092508719576 - vert3 0.7888361319935426 -} -weighted convictions: { - vert0 0.4535718770297335 - vert1 1.6365840035999841 - vert2 0.8564735401170989 - vert3 59.98601454701778 -} +kl: { + vert0 0.012498962161828123 + vert1 0.0014999155151563248 + vert2 0.012940692023868397 + vert3 0.012498962161828303 +} +weighted kl: { + vert0 0.043840314666364594 + vert1 0.01215014552815915 + vert2 0.023216985559271874 + vert3 0.00033148949739295053 +} +convictions: { + vert0 0.7888361319935541 + vert1 6.573458882210904 + vert2 0.7619092508719576 + vert3 0.7888361319935426 +} +further parameterized convictions: { + vert0 0.7888361319935541 + vert1 6.573458882210904 + vert2 0.7619092508719576 + vert3 0.7888361319935426 +} +weighted convictions: { + vert0 0.4535718770297335 + vert1 1.6365840035999841 + vert2 0.8564735401170989 + vert3 59.98601454701778 +} group kl divergence: 0.0014999155151563318 weighted group kl divergence: 0.012150145528158986 addition conviction -kl: { - vert0 0.0118919309314467 - vert1 0.0015341620278852101 - vert2 0.012738870517593676 - vert3 0.01189193093144647 -} -weighted kl: { - vert0 0.04280308290362862 - vert1 0.013070224898692417 - vert2 0.023586134873106707 - vert3 0.0003283237047790495 -} -convictions: { - vert0 0.8000570855094574 - vert1 6.2015767755691655 - vert2 0.7468655552274358 - vert3 0.8000570855094727 -} -further parameterized convictions: { - vert0 0.8000570855094574 - vert1 6.2015767755691655 - vert2 0.7468655552274358 - vert3 0.8000570855094727 -} -weighted convictions: { - vert0 0.466016469887516 - vert1 1.5261360649614566 - vert2 0.8457062465879276 - vert3 60.753888021808535 -} +kl: { + vert0 0.0118919309314467 + vert1 0.0015341620278852101 + vert2 0.012738870517593676 + vert3 0.01189193093144647 +} +weighted kl: { + vert0 0.04280308290362862 + vert1 0.013070224898692417 + vert2 0.023586134873106707 + vert3 0.0003283237047790495 +} +convictions: { + vert0 0.8000570855094574 + vert1 6.2015767755691655 + vert2 0.7468655552274358 + vert3 0.8000570855094727 +} +further parameterized convictions: { + vert0 0.8000570855094574 + vert1 6.2015767755691655 + vert2 0.7468655552274358 + vert3 0.8000570855094727 +} +weighted convictions: { + vert0 0.466016469887516 + vert1 1.5261360649614566 + vert2 0.8457062465879276 + vert3 60.753888021808535 +} group kl divergence: 0.0015341620278852813 weighted group kl divergence: 0.013070224898692494 adding a case -noncyclic KL: { - vert0 0.01467982549299679 - vert1 0.0027281364373075885 - vert2 0.0027281364373075885 - vert3 0.016383251387214498 - vert4 0.0051662807478393205 -} +noncyclic KL: { + vert0 0.01467982549299679 + vert1 0.0027281364373075885 + vert2 0.0027281364373075885 + vert3 0.016383251387214498 + vert4 0.0051662807478393205 +} noncyclic group kl divergence: 0.005166280747839411 -cyclic KL: { - vert0 0.06449882851689671 - vert1 0.0020695242435298626 - vert2 0.0020695242435298626 - vert3 0.03622271709266012 - vert4 0.06081391029364311 -} -cyclic conviction: { - vert0 0.5137287240708814 - vert1 16.01087833672136 - vert2 16.01087833672136 - vert3 0.9147547047144656 - vert4 0.5448572656824459 -} +cyclic KL: { + vert0 0.06449882851689671 + vert1 0.0020695242435298626 + vert2 0.0020695242435298626 + vert3 0.03622271709266012 + vert4 0.06081391029364311 +} +cyclic conviction: { + vert0 0.5137287240708814 + vert1 16.01087833672136 + vert2 16.01087833672136 + vert3 0.9147547047144656 + vert4 0.5448572656824459 +} cyclic group kl divergence: 0.06081391029364306 surprisal transforms -probabilities: [ - ["vert0" "vert1" "vert2" "vert3"] - [2.7535180455541748e-05 2.7535180455541748e-05 5.043471233780792e-07 9.237449443012879e-09] -] - -weighted probabilities: [ - ["vert0" "vert2" "vert3" "vert1"] - [5.506960272483319e-05 5.043471233780792e-07 9.237449443012879e-09 0] -] - -surprisal contribution: {testvert 9.797630298091489} -weighted surprisal contribution: {testvert 9.797630298091489} +probabilities: [ + ["vert0" "vert1" "vert2" "vert3"] + [2.7535180455541748e-05 2.7535180455541748e-05 5.043471233780792e-07 9.237449443012879e-09] +] + +weighted probabilities: [ + ["vert0" "vert2" "vert3" "vert1"] + [5.506960272483319e-05 5.043471233780792e-07 9.237449443012879e-09 0] +] + +surprisal contribution: {testvert 9.797630298091489} +weighted surprisal contribution: {testvert 9.797630298091489} --concurrency tests-- hello hello @@ -4792,60 +4983,60 @@ hello mod : 1 max : 10 min : 1 -and : (true) +and : (true) -or : (true) +or : (true) -xor : (true) +xor : (true) -= : (false) += : (false) -!= : (false) +!= : (false) -< : (false) +< : (false) -<= : (true) +<= : (true) -> : (false) +> : (false) ->= : (false) +>= : (false) -~ : (true) +~ : (true) -list : [1 1 1 2] +list : [1 1 1 2] -associate : { - a 1 - b 1 - c 1 - d 2 -} +associate : { + a 1 + b 1 + c 1 + d 2 +} -assoc : { - a 1 - b 1 - c 1 - d 2 -} +assoc : { + a 1 + b 1 + c 1 + d 2 +} -map list : [2 4 6 8] +map list : [2 4 6 8] -map assoc : { - a 2 - b 4 - c 6 - d 8 -} +map assoc : { + a 2 + b 4 + c 6 + d 8 +} -filter list : [3 4] +filter list : [3 4] -filter assoc : {10 1} +filter assoc : {10 1} -filter assoc 2 : {10 1 20 2} +filter assoc 2 : {10 1 20 2} Expecting 1000: 1000 --concurrent entity writes-- -concurrent entity writes successful: (true) +concurrent entity writes successful: (true) --clean-up test files-- rmdir /s /q amlg_code\test_output @@ -4853,4 +5044,4 @@ rmdir /s /q amlg_code\persistent_tree_test_root del /s /q amlg_code\persist_module_test\psm.mdam del /s /q amlg_code\persist_module_test.mdam --total execution time-- -2.1111810207366943 +1.7082650661468506