let check_productive (context: context) (producer: literal) (produced: literal) : element option =
if not (Config.productivity context.config) then begin
None
end
else if Term.are_terms_variants producer.Term.atom produced.Term.atom then begin
None
end
else if not (Term_attributes.is_term_parametric producer.Term.atom) then begin
None
end
else begin
let check =
check_productive context producer produced
in
begin
match check with
| None ->
()
| Some _ ->
Statistic.inc_filtered_by_productivity context.statistic;
end;
check
end