From f604df8fec7f3569799a63a37b5bf6096450c4cf Mon Sep 17 00:00:00 2001 From: Paulo Moura Date: Sat, 27 Nov 2010 00:13:00 +0000 Subject: [PATCH 1/2] Commented out the definition of the predicate prolog_to_os_filename/2, now a built-in predicate, in order to fix CHR compilation. --- library/dialect/swi.yap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/dialect/swi.yap b/library/dialect/swi.yap index fea5696be..2214a8cf0 100755 --- a/library/dialect/swi.yap +++ b/library/dialect/swi.yap @@ -224,7 +224,7 @@ goal_expansion(rename_file(A,B),system:swi_rename_file(A,B)) :- swi_io. goal_expansion(is_absolute_file_name(A), is_absolute_file_name(A)) :- swi_io. goal_expansion(file_base_name(A,B),system:swi_file_base_name(A,B)) :- swi_io. goal_expansion(file_directory_name(A,B),system:swi_file_directory_name(A,B)) :- swi_io. -goal_expansion(prolog_to_os_filename(A,B),system:swi_prolog_to_os_filename(A,B)) :- swi_io. +%goal_expansion(prolog_to_os_filename(A,B),system:swi_prolog_to_os_filename(A,B)) :- swi_io. goal_expansion('$mark_executable'(A), system:'swi_is_absolute_file_name'(A)) :- swi_io. goal_expansion('$absolute_file_name'(A,B),system:'swi_$absolute_file_name'(A,B)) :- swi_io. @@ -281,7 +281,7 @@ concat_atom(List, New) :- setenv(X,Y) :- unix(putenv(X,Y)). -prolog_to_os_filename(X,X). +%prolog_to_os_filename(X,X). is_absolute_file_name(X) :- absolute_file_name(X,X). From 359855132a54c8c74261976f46aa803440051849 Mon Sep 17 00:00:00 2001 From: Theofrastos Mantadelis Date: Sat, 27 Nov 2010 16:34:18 +0100 Subject: [PATCH 2/2] Corrected a db trie related bug --- library/tries/core_dbtries.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/library/tries/core_dbtries.c b/library/tries/core_dbtries.c index 822adf24d..071c1b23e 100644 --- a/library/tries/core_dbtries.c +++ b/library/tries/core_dbtries.c @@ -612,8 +612,17 @@ TrNode core_breadth_reduction(TrEngine engine, TrNode node, TrNode breadth_node, } while (bucket != first_bucket); } else { do { - if (TrNode_entry(child) == PairEndTag) - return core_breadth_reduction(engine, child, breadth_node, opt_level, construct_function, destruct_function, copy_function, correct_order_function); + if (TrNode_entry(child) == PairEndTag) { + /* do breadth reduction simplification */ + node = TrNode_parent(child); + DATA_DESTRUCT_FUNCTION = destruct_function; + remove_child_nodes(TrNode_child(node)); + TrNode_child(node) = NULL; + node = trie_node_check_insert(node, PairEndTag); + INCREMENT_ENTRIES(CURRENT_TRIE_ENGINE); + return node; + //return core_breadth_reduction(engine, node, breadth_node, opt_level, construct_function, destruct_function, copy_function, correct_order_function); + } while (IS_FUNCTOR_NODE(child)) { child = TrNode_child(child); if (IS_HASH_NODE(child)) { // gets first child in the hash