MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit ec0ddcc7 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[lib] CLUnfolder: Optimization for forward_init_dynamic() & forward_code()

Precompute __var_code_table with the literal names in future format; i.e with a last char '`' at the end.
Thus it is easy to search them directly in the dict (in O(1)), instead of slicing them.
parent 70c909d5
......@@ -129,9 +129,21 @@ class CLUnfolder(object):
base_var_set = list(dynamic_system.base_var_set)
self.__var_list += base_var_set
# keys: are the names of the variables, values: their values
self.__var_code_table = {var_name: var_num for var_num, var_name in enumerate(base_var_set, 1)}
assert len(self.__var_code_table) == self.__shift_step
self.__var_code_table = \
{var_name: var_num for var_num, var_name in enumerate(base_var_set, 1)}
# Optimization: for forward_init_dynamic() and forward_code() (mostly
# implemented in C.
# Precompute __var_code_table with the literal names in "future" format;
# i.e with a last char '`' at the end.
# Thus it is easy to search them directly in the dict (in O(1)),
# instead of slicing them.
# Note: "future" literals are already in self.dynamic_system.list_clauses
# and maybe in self.dynamic_system.aux_list_clauses
temp_var_code_table = \
{var_name + "`": var_num for var_name, var_num in self.__var_code_table.iteritems()}
self.__var_code_table.update(temp_var_code_table)
assert len(self.__var_code_table) == 2 * self.__shift_step
# Include auxiliary clause to eliminate undesirable solutions
# If A->B has clock h, an aux constraint added is h included in h when A
......
......@@ -107,6 +107,17 @@ def feed_forward_code():
'_lit25835': 8,
}
# Optimization: for forward_init_dynamic() and forward_code() (mostly
# implemented in C.
# Precompute __var_code_table with the literal names in "future" format;
# i.e with a last char '`' at the end.
# Thus it is easy to search them directly in the dict (in O(1)),
# instead of slicing them.
# See CLUnfolder constructor.
temp_var_code_table = \
{var_name + "`": var_num for var_name, var_num in var_code_table.iteritems()}
var_code_table.update(temp_var_code_table)
shift_step = 1
return clause, var_code_table, shift_step
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment