(* File: NRules.v  (last edited on 27/10/2000) (c) Klaus Weich  *)
Require Export Cons_Counter_Model.
Require Export NSound.
Inductive nsearch_spec_result_aux (goal : Int) (work : nf_list)
(ds : disjs) (ni : nested_imps) (ai : atomic_imps)
(a : atoms) (context : flist) : Set :=
| NDerivable :
Derivable context (Atom goal) ->
nsearch_spec_result_aux goal work ds ni ai a context
| NRefutable :
forall k : kripke_tree,
Is_Monotone_kripke_tree k ->
forces_ngamma work ds ni ai a k ->
(forces_t k (Atom goal) -> False) ->
nsearch_spec_result_aux goal work ds ni ai a context.
Inductive nsearch_spec_result (goal : Int) (work : nf_list)
(ds : disjs) (ni : nested_imps) (ai : atomic_imps)
(a : atoms) (context : flist) : Set :=
NSearch_Res :
forall ni1 : nested_imps,
le_ni ni1 ni ->
deco_sound work ds ni1 ai a ->
nsearch_spec_result_aux goal work ds ni1 ai a context ->
nsearch_spec_result goal work ds ni ai a context.
Definition nsearch_spec (goal : Int) (work : nf_list)
(ds : disjs) (ni : nested_imps) (ai : atomic_imps)
(a : atoms) (context : flist) :=
deco_sound work ds ni ai a ->
nsound work ds ni ai a context ->
nminimal work ds ni ai a context ->
nsearch_spec_result goal work ds ni ai a context.
(**********************************************************************)
unfold nsearch_spec in |- *.
intros i dni ai a context a_ai_disjunct goal_a_disj complete sound mon.
apply NSearch_Res with (rev_app dni NNil); try assumption.
apply le_ni_refl.
elim (cons_counter_model i dni ai a); try assumption.
intros k k_is_mon k_forces_ngamma k_notforces_goal.
apply NRefutable with k; assumption.
Qed.
(**********************************************************************)

Lemma rule_shift_work_ds :
forall (goal i j : Int) (work : nf_list) (ds : disjs)
(ni : nested_imps) (ai : atomic_imps) (a : atoms)
(context : flist),
nsearch_spec goal work ((i, j) :: ds) ni ai a context ->
nsearch_spec goal (NDisj i j :: work) ds ni ai a context.