Algorithm-QuineMcCluskey
view release on metacpan or search on metacpan
lib/Algorithm/QuineMcCluskey.pm view on Meta::CPAN
package Algorithm::QuineMcCluskey;
use strict;
use warnings;
use 5.016001;
use Moose;
use namespace::autoclean;
use Carp;
use Algorithm::QuineMcCluskey::Util qw(:all);
use List::Util qw(uniqnum);
use List::Compare::Functional qw(get_complement is_LequivalentR);
extends 'Logic::Minimizer';
#
# Vaguely consistent Smart-Comment rules:
# 3 pound signs for the code in BUILD() and generate_*() functions.
#
# 4 pound signs for code that manipulates prime/essentials/covers hashes:
# row_dominance().
#
# 5 pound signs for the solve() and recurse_solve() code, and the remels()
# calls.
#
# The ::Format package is only needed for Smart Comments -- comment or uncomment
# in concert with Smart::Comments as needed.
#
#use Algorithm::QuineMcCluskey::Format qw(arrayarray hasharray chart);
#use Smart::Comments ('###', '#####');
#
# Attributes inherited from Logic::Minimizer are width, minterms, maxterms,
# dontcares, columnstring, title, dc, vars, primes, essentials, covers,
# group_symbols, order_by, and minonly.
#
#
# The '_bits' fields are the terms' bitstring fields, and are
# internal attributes. No setting them at object creation.
#
has 'dc_bits' => (
isa => 'ArrayRef[Str]', is => 'rw', required => 0,
init_arg => undef,
predicate => 'has_dc_bits'
);
has 'min_bits' => (
isa => 'ArrayRef[Str]', is => 'rw', required => 0,
init_arg => undef,
predicate => 'has_min_bits'
);
has 'max_bits' => (
isa => 'ArrayRef[Str]', is => 'rw', required => 0,
init_arg => undef,
predicate => 'has_max_bits'
);
our $VERSION = 1.01;
sub BUILD
{
my $self = shift;
my $w = $self->width;
my $last_idx = (1 << $w) - 1;
my @terms;
( run in 0.687 second using v1.01-cache-2.11-cpan-39bf76dae61 )