# lhsc
Learning Hard and Soft Constraints

To learn a weighted MaxSat Model from a list of contextual examples call learn_weighted_max_sat in learn.py with the following parameters:

:param m: The number of clauses in the MaxSAT model to learn
:param data: A Boolean s x n (number examples x number Boolean variables) numpy array in which every row is an example and every column a Boolean feature (True = 1 or False = 0)
:param labels: A Boolean numpy array (length s) where the kth entry contains the label (1 or 0) of the kth example
:param contexts: A list of s set-encoded contexts.
:return: A list of weights and clauses. Every entry of the list is a tuple containing as first element None for hard constraints (clauses) or a floating point number for soft constraints, and as second element a set-encoded clause.
    
Some examples are provided for reference in learn.py
