This repository was archived by the owner on Jan 28, 2025. It is now read-only.
  
  
  
  
Variable vs Constraint-based solver #34
                  
                    
                      perdasilva
                    
                  
                
                  started this conversation in
                General
              
            Replies: 2 comments 1 reply
-
| 
         Is this a OR b (c depends on)?  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            -
| 
         After an interesting conversation on slack. It seems going the   | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone,
I wanted to ask you what you think about the work I've put together in this PR.
Currently, the solver takes as input a slice of variables.
Variableis an interface that connects an Identifier with a set of Constraints for the purposes of generatingginiliterals when the constraint is applied (e.g. see the dependency constraint).I've refactored the
Solverto take as input a slice ofConstraints, which were themselves refactored to contain thesubjectof the constraint (i.e.). I did this because I think it will make it easier to express arbitrary constraints (inc. conjunctions and disjunctions of arbitrary constraints).For instance, if we have two variables:
A:
B:
It would be hard to express something like
(A OR B), especially given that eachVariablemust only appear once in the input .With a constraint based approach, you could simply add a new constraint, e.g.
Or(Mandatory("a"), Mandatory("b")).Beta Was this translation helpful? Give feedback.
All reactions