- Lua index shifting
This commit is contained in:
parent
fa0ef95e11
commit
0c76214bec
@ -55,12 +55,21 @@ class TruthTableTask extends PicturedTask
|
||||
return $this->lf;
|
||||
}
|
||||
|
||||
public static function sanitizeIndices(array $a): array {
|
||||
$r = [];
|
||||
$i = 0;
|
||||
foreach ($a as $v) {
|
||||
$r[$i++] = $v;
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
|
||||
public function generateRandomFunction(array $input_vars, int $min_depth, int $max_depth): void {
|
||||
$this->lf = LogicFunction::genRandom($input_vars, $min_depth, $max_depth);
|
||||
$this->lf = LogicFunction::genRandom(self::sanitizeIndices($input_vars), $min_depth, $max_depth);
|
||||
}
|
||||
|
||||
public function generateRandomDF(array $input_vars): void {
|
||||
$this->lf = LogicFunction::genRandomDF($input_vars);
|
||||
$this->lf = LogicFunction::genRandomDF(self::sanitizeIndices($input_vars));
|
||||
}
|
||||
|
||||
public function getFunctionAsDNF(): string {
|
||||
@ -72,7 +81,7 @@ class TruthTableTask extends PicturedTask
|
||||
}
|
||||
|
||||
public function setLogicFunctionExpr(string $expr, array $input_vars = []): void {
|
||||
$this->lf = new LogicFunction($expr, $input_vars);
|
||||
$this->lf = new LogicFunction($expr, self::sanitizeIndices($input_vars));
|
||||
}
|
||||
|
||||
public function getLogicFunctionExpr(string $fmt = "verilog_bitwise"): string {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user