amalgame/commit

FIXED: all_mapped returned pairs iso keys ...

authorJacco van Ossenbruggen
Sun Sep 28 23:31:31 2014 +0200
committerJacco van Ossenbruggen
Sun Sep 28 23:31:31 2014 +0200
commit79ed3b3af9695e58fcd96f62cd486e59f6100da5
treef756400ab2444245e70a517a8410112dcb28493d
parent3e6e963cee60d716995fa15f7a9e8827082ad4d8
Diff style: patch stat
diff --git a/lib/amalgame/expand_graph.pl b/lib/amalgame/expand_graph.pl
index efe79e7..4afeb1a 100644
--- a/lib/amalgame/expand_graph.pl
+++ b/lib/amalgame/expand_graph.pl
@@ -74,9 +74,10 @@ all_mapped(Strategy, Type, Mapping, Concepts, Sorted) :-
 	(   cache_mapped_concepts(Strategy, Type, Mapping, Concepts)
 	->  assoc_to_keys(Concepts, Sorted)
 	;   expand_node(Strategy, Mapping, Result),
-	    maplist(my_correspondence_element(Type), Result, Concepts0),
-	    sort(Concepts0, Sorted),
-	    ord_list_to_assoc(Sorted, Concepts),
+	    maplist(my_correspondence_element(Type), Result, ConceptsPairs),
+	    sort(ConceptsPairs, SortedPairs),
+	    ord_list_to_assoc(SortedPairs, Concepts),
+	    assoc_to_keys(Concepts, Sorted),
 	    cache_mapped_concepts(Strategy, Type, Mapping, Concepts)
 	).
 
@@ -86,9 +87,10 @@ all_mapped(Strategy, Type, Mappings, Concepts, Sorted) :-
 	->  assoc_to_keys(Concepts, Sorted)
 	;   maplist(expand_node(Strategy), Mappings, Results),
 	    append(Results, Result),
-	    maplist(my_correspondence_element(Type), Result, Concepts0),
-	    sort(Concepts0, Sorted),
-	    ord_list_to_assoc(Sorted, Concepts),
+	    maplist(my_correspondence_element(Type), Result, ConceptPairs),
+	    sort(ConceptPairs, SortedPairs),
+	    ord_list_to_assoc(SortedPairs, Concepts),
+	    assoc_to_keys(Concepts, Sorted),
 	    cache_mapped_concepts(Strategy, Type, Mappings, Concepts)
 	).