First of all, I wanted to ask if there is an easy method to detect and control errors in the program. Something like an 'if(error){}' command, to display something and then continue, as nothing happened.
polymake extensively uses exceptions for reporting errors. How you catch them depends on the context.
In a C++ client, you enclose the potentially dangerous code in a try { ... } block and catch std::exception after it. All exception types used in polymake are derived from this type.
In a perl script, you enclose the dangerous code in eval { ... } and check the variable $@ after it; it will contain the error message or will be empty if nothing nasty happened. See also topics `die' and `eval' in `man perlfunc'.
I also don't know how to check for two sets if one is subset of the other... I was trying to play with the command 'incl' that seems to work, but gives me funny answers when I'm expecting a simple boolean value.
incl(s1, s2) returns -1 if s1 is included in s2, 0 if both sets are equal, 1 if s2 is included in s1, and, finally, 2 in all other cases. Except for the special last value, its behavior exactly resembles the three-way comparison operator <=> .
I can also do a loop and check if each element belongs to the set, but I also don't know how to check that.
In C++: s.exists(elem)
In perl: exists $s->{$elem} or $s->contains($elem)
Both do the same, first expression looking more "perly".