parameters: (self, ctl: Control, files: Sequence[str])
docstring: Register the difference constraint propagator, and then ground and
          solve.
docstring_summary: Register the difference constraint propagator, and then ground and
          solve.
docstring_tokens: Register the difference constraint propagator and then ground and solve .
function: def main(self, ctl: Control, files: Sequence[str]):
          '''
          Register the difference constraint propagator, and then ground and
          solve.
          '''
          ctl.register_propagator(self._propagator)
          ctl.add("base", [], THEORY)
  
          if not files:
              files = ["-"]
          self._rewrite(ctl, files)
  
          ctl.ground([("base", [])])
          if self._minimize is None:
              ctl.solve(on_model=self._propagator.on_model)
          else:
              ctl.add("bound", ["b", "v"], "&diff(head) { v-0 } <= b.")
  
              while cast(SolveResult, ctl.solve(on_model=self._on_model)).satisfiable:
                  print("Found new bound: {}".format(self._bound))
                  if self._bound is None:
                      break
                  ctl.ground([("bound", [Number(cast(int, self._bound) - 1), self._minimize])])
  
              if self._bound is not None:
                  print("Optimum found")
function_tokens: def main ( self , ctl : Control , files : Sequence [ str ] ) : ctl . register_propagator ( self . _propagator ) ctl . add ( "base" , [ ] , THEORY ) if not files : files = [ "-" ] self . _rewrite ( ctl , files ) ctl . ground ( [ ( "base" , [ ] ) ] ) if self . _minimize is None : ctl . solve ( on_model = self . _propagator . on_model ) else : ctl . add ( "bound" , [ "b" , "v" ] , "&diff(head) { v-0 } <= b." ) while cast ( SolveResult , ctl . solve ( on_model = self . _on_model ) ) . satisfiable : print ( "Found new bound: {}" . format ( self . _bound ) ) if self . _bound is None : break ctl . ground ( [ ( "bound" , [ Number ( cast ( int , self . _bound ) - 1 ) , self . _minimize ] ) ] ) if self . _bound is not None : print ( "Optimum found" )