set of int: input_set = {0,128};
var input_set: i;
var 0..1: o;
constraint i = 0 -> o = 0;
constraint i = 128 -> o = 1;
solve satisfy;
--
You received this message because you are subscribed to the Google Groups "MiniZinc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minizinc+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minizinc/6131354c-e19e-4181-9ae7-bc7282453492n%40googlegroups.com.
Hi,
I think the minizinc tutorial would be a good place to start.
For your given problem, one way to model this problem is to create a model where the input and output are variables and you can start relating between them via using constraints.set of int: input_set = {0,128}; var input_set: i; var 0..1: o; constraint i = 0 -> o = 0; constraint i = 128 -> o = 1; solve satisfy;we'd in this case need to find all solutions for the model to cover the entire search space of potential "test cases" ( needs to be enabled on the minizincIDE ) or use the command ( minizinc -a model.mzn ) in the command line.Maybe also you can check the send more money problem, (https://www.minizinc.org/doc-2.8.1/en/modelling2.html).hope this helps.
On Sun, Dec 10, 2023 at 11:12 PM Olaf wrote:I am investigating if constraint programming can help me finding testcases.I am looking for beginners resources on this topic, it would be great if you have some suggestion.Maybe it is possible to even guide me to a solution of a simple example.a description of the "program" would be:"If the input (uint8) is smaller then 128 then the the output is 0 otherwise 1"I expect one could write a minizinc program that would implement this statement and return two testcases:set input = 0 expected output == 0set input = 128 expected output == 1(more interesting would be the range of numbers in input 0..127 , 128..255, but i want to keep it simple for now)--