Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized variable type #314

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ namespace nil {
case VariableType::column_type::selector:
assignment = assignments.selector(var.index);
break;
default:
BOOST_ASSERT_MSG(false, "Invalid column type");
}

if (var.rotation != 0) {
Expand Down Expand Up @@ -169,6 +171,8 @@ namespace nil {
case VariableType::column_type::selector:
assignment = assignments.selector(var.index);
break;
default:
BOOST_ASSERT_MSG(false, "Invalid column type");
}

if (var.rotation != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ namespace nil {
return witness_columns + public_input_columns + a.index;
case plonk_variable<typename FieldType::value_type>::column_type::selector:
return witness_columns + public_input_columns + constant_columns + a.index;
default:
std::cerr << "Invalid column type";
std::abort();
break;
}
/* unreachable*/
return std::numeric_limits<size_t>::max();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace nil {
using assignment_type = AssignmentType;

enum column_type : std::uint8_t {
witness, public_input, constant, selector
witness, public_input, constant, selector, uninitialized
};

/**
Expand All @@ -80,7 +80,7 @@ namespace nil {
bool relative;
column_type type;

constexpr plonk_variable() : index(0), rotation(0), relative(false), type(column_type::witness) {};
constexpr plonk_variable() : index(0), rotation(0), relative(false), type(column_type::uninitialized) {};

constexpr plonk_variable(const std::size_t index,
std::int32_t rotation,
Expand Down Expand Up @@ -176,7 +176,8 @@ namespace nil {
{plonk_variable<AssignmentType>::column_type::witness, "w"},
{plonk_variable<AssignmentType>::column_type::public_input, "pub"},
{plonk_variable<AssignmentType>::column_type::constant, "c"},
{plonk_variable<AssignmentType>::column_type::selector, "sel"}
{plonk_variable<AssignmentType>::column_type::selector, "sel"},
{plonk_variable<AssignmentType>::column_type::uninitialized,"NaN"}
};
os << type_map[var.type] << "_" << var.index;
if (!var.relative) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ namespace nil {
case polynomial_dfs_variable_type::column_type::selector:
assignment = assignments.selector(var.index);
break;
default:
std::cerr << "Invalid column type";
std::abort();
break;
}

if (var.rotation != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,10 @@ namespace nil {
case DfsVariableType::column_type::selector:
assignment = assignments.selector(var.index);
break;
default:
std::cerr << "Invalid column type";
std::abort();
break;
}

if (var.rotation != 0) {
Expand Down
Loading