NAME
Algorithm::SAT::Expression - A class that represent an expression for Algorithm::SAT::Backtracking
SYNOPSIS
use Algorithm::SAT::Expression;
my $exp = Algorithm::SAT::Expression->new;
$exp->or( 'blue', 'green', '-yellow' );
$exp->or( '-blue', '-green', 'yellow' );
$exp->or( 'pink', 'purple', 'green', 'blue', '-yellow' );
my $model = $exp->solve();
# $model now is { 'yellow' => 1, 'green' => 1 }
DESCRIPTION
Algorithm::SAT::Expression is a class that helps to build an expression to solve with Algorithm::SAT::Backtracking.
Look also at the test file for an example of usage.
METHODS
and()
Takes the inputs and build an AND expression for it
or()
Takes the inputs and build an OR expression for it
xor()
Takes the inputs and build an XOR expression for it
solve()
Uses Algorithm::SAT::Backtracking to return a model that satisfies the expression.
LICENSE
Copyright (C) mudler.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
mudler <mudler@dark-lab.net>