disprove_double_check(solution(X),NegatedGoal,_Hypotheses,_SelectedHypotheses,_,_,ResultOut,ProofInfos) :-
predicate_identifiers(NegatedGoal,GoalIdentifiers),
findall(binding(Id,Value,PP), get_binding_from_solution(X,GoalIdentifiers,0,Id,Value,PP), FilteredState),
ResultOut = solution(FilteredState),
ProofInfos = ['Counter example to all hypotheses found'].
disprove_double_check(no_solution_found(unfixed_deferred_sets),NegatedGoal,_Hypotheses,SelectedHypotheses,_,_,
no_solution_found(unfixed_deferred_sets),ProofInfos) :-
find_typed_identifier_uses(NegatedGoal,[],GoalIdentifiers),
get_texpr_types(GoalIdentifiers,GoalTypes),
find_typed_identifier_uses_l(SelectedHypotheses,[],HypIdentifiers),
get_texpr_types(HypIdentifiers,HypTypes),
append(GoalTypes,HypTypes,Types),
% exclude all types that are not unfixed
include(contains_unfixed_deferred_set,Types,UnfixedTypes),
% see if an unfixed type is left
UnfixedTypes = [_|_],
!,
ProofInfos = ['Goal or selected hypotheses contain unfixed deferred sets', unfixed(UnfixedTypes)],
!.
disprove_double_check(contradiction_found,NegatedGoal,Hypotheses,SelectedHypotheses,FullPredicate,Opts,
FinalResult,ProofInfos) :-
ProofInfos = ['PO is proven using all hypotheses, no timeout or enumeration warning occured'],
%add_hit(po_discharged,prob_all),
(get_preference(double_evaluation_when_analysing,true)
-> check_negated(NegatedGoal,Hypotheses,SelectedHypotheses,FullPredicate,Opts,FinalResult)
; FinalResult = contradiction_found).
disprove_double_check(Result,_NegatedGoal,Hypotheses,SelectedHypotheses,_,_Opts,ResultOut,ProofInfos) :-
same_conjunction_list(Hypotheses,SelectedHypotheses),!,
ProofInfos = ['Selected hypotheses identical to all hypotheses'],
Result=ResultOut.
disprove_double_check(_OldResult,NegatedGoal,Hypotheses,SelectedHypotheses,_,Opts,ResultOut,ProofInfos) :-
% No proof found with all hypotheses, now try selected ones only
% reset existing enumeration warnings,
% that might have been generated in a previous run
reset_errors,
(debug_mode(on)
-> nl,write('Trying to use only selected hypotheses.\nNegated Goal:'), nl,
translate:nested_print_bexpr_as_classicalb(NegatedGoal),
write_hypothesis(SelectedHypotheses)
; true),
conjunct_predicates([NegatedGoal|SelectedHypotheses],Predicate),
%external_functions:observe_state(State),
solve_disprover_predicate(prob_selected_hyps,Predicate,Opts,Result),
ProofInfos = [disprover_result(prob,selected,Result)],
!,
disprove_triple_check(Result,NegatedGoal,Hypotheses,SelectedHypotheses,Predicate,Opts,ResultOut).