Encoding Module
Encoding
class lib_satprob.encoding.Encoding()
- get_formula(copy)
- This method returns instance of encoding formula.Input arguments:
copy(Optional[bool]) - a flag to return a copy of pysat formula instance instead of original lazily created instance.
Return type: Any (defined in a specific implementation).
Clause
type lib_satprob.encoding.Clause = List[int]
CNF
class lib_satprob.encoding.CNF(from_file=None: str, from_string=None: str, extract_hard=False: bool, from_clauses=None: List[Clause], comment_lead=['c']: List[str])
from_file(Optional[str]) - a path to the file containing CNF in DIMACS format. This argument involves lazily creation by reading from the given file. Default:None.from_string(Optional[str]) - a string with CNF in DIMACS format. Default:None.extract_hard(Optional[bool]) - a flag to extract hard clauses from the WCNF encoding specified in the given file. Only works with thefrom_fileargument. Default:False.from_clauses(Optional[List[Clause]) - a list of clauses to bootstrap the formula with. Default:None.comment_lead(Optional[List[str]) - a list of characters leading comment lines. Default:['c'].
Important
To create a CNF instance specify only one initialization argument (from_file or from_string or from_clauses).
- get_formula(copy)
- Input arguments:
copy(Optional[bool]) - a flag to return a copy of pysat.formula.CNF instance instead of original lazily created instance.
Return type: pysat.formula.CNF
CNFPlus
class lib_satprob.encoding.CNF(from_file=None: str, from_string=None: str, comment_lead=['c']: List[str])
from_file(Optional[str]) - a path to the file containing CNF+ in DIMACS format. This argument involves lazily creation by reading from the given file. Default:None.from_string(Optional[str]) - a string with CNF+ in DIMACS format. Default:None.comment_lead(Optional[List[str]) - a list of characters leading comment lines. Default:['c'].
Important
To create a CNFPlus instance specify only one initialization argument (from_file or from_string).
- get_formula(copy)
- Input arguments:
copy(Optional[bool]) - a flag to return a copy of pysat.formula.CNFPlus instance instead of original lazily created instance.
Return type: pysat.formula.CNFPlus
WCNF
class lib_satprob.encoding.WCNF(from_file=None: str, from_string=None: str, comment_lead=['c']: List[str])
from_file(Optional[str]) - a path to the file containing WCNF in WDIMACS format. This argument involves lazily creation by reading from the given file. Default:None.from_string(Optional[str]) - a string with WCNF in WDIMACS format. Default:None.comment_lead(Optional[List[str]) - a list of characters leading comment lines. Default:['c'].
Important
To create a WCNF instance specify only one initialization argument (from_file or from_string).
- get_formula(copy)
- Input arguments:
copy(Optional[bool]) - a flag to return a copy of pysat.formula.WCNF instance instead of original lazily created instance.
Return type: pysat.formula.WCNF
WCNFPlus
class lib_satprob.encoding.WCNFPlus(from_file=None: str, from_string=None: str, comment_lead=['c']: List[str])
from_file(Optional[str]) - a path to the file containing WCNFPlus in WDIMACS format. This argument involves lazily creation by reading from the given file. Default:None.from_string(Optional[str]) - a string with WCNFPlus in WDIMACS format. Default:None.comment_lead(Optional[List[str]) - a list of characters leading comment lines. Default:['c'].
Important
To create a WCNFPlus instance specify only one initialization argument (from_file or from_string).
- get_formula(copy)
- Input arguments:
copy(Optional[bool]) - a flag to return a copy of pysat.formula.WCNFPlus instance instead of original lazily created instance.
Return type: pysat.formula.WCNFPlus