fromList static method
Implementation
static Logic fromList(List<Logic> args) {
final bArgs = <Logic>[];
for (final a in args) {
if (a is True) {
return a;
} else if (a is False) {
continue; // skip this argument
}
bArgs.add(a);
}
final sortedArgs = Or.flatten(bArgs).toSet().toList()
..sort((l1, l2) => l1.hashCode.compareTo(l2.hashCode));
for (final a in sortedArgs) {
if (sortedArgs.contains(Not.create(a))) {
return True();
}
}
if (sortedArgs.length == 1) {
return sortedArgs.first;
} else if (sortedArgs.isEmpty) {
return False();
}
return Or._(sortedArgs);
}