merges "-ary" tables into "logical_expressions"