| 128 | } |
| 129 | |
| 130 | bool instruction::valid(instruction_ref start, bool check_order) const |
| 131 | { |
| 132 | return valid() and std::all_of(arguments.begin(), arguments.end(), [&](instruction_ref i) { |
| 133 | auto self = std::find(i->outputs().begin(), i->outputs().end(), *this); |
| 134 | bool ret = self != i->outputs().end(); |
| 135 | if(check_order) |
| 136 | { |
| 137 | // check arguments for this instruction before this instruction |
| 138 | ret = ret and (std::distance(start, i) < std::distance(start, *self)); |
| 139 | } |
| 140 | return ret; |
| 141 | }); |
| 142 | } |
| 143 | |
| 144 | bool instruction::valid() const |
| 145 | { |
no test coverage detected