use super::SyllogismPosition;
use crate::{
control::*,
entity::*,
inference::{rules::utils::*, *},
language::*,
symbols::*,
};
use nar_dev_utils::{f_parallel, unwrap_or_return, RefCount};
use variable_process::VarSubstitution;
use ReasonDirection::*;
use SyllogismPosition::*;
pub fn compose_as_set(
task_content: StatementRef,
belief_content: StatementRef,
shared_term_i: SyllogismPosition,
component_common: &Term,
component_t: &Term,
component_b: &Term,
context: &mut ReasonContextConcept,
) {
debug_assert_eq!(context.reason_direction(), Forward);
let truth_t = TruthValue::from(context.current_task().get_().unwrap_judgement());
let truth_b = context.current_belief().unwrap();
let truth_or = Some(truth_t.union_(truth_b)); let truth_and = Some(truth_t.intersection(truth_b)); let truth_dif;
let [term_or, term_and, term_dif];
let component_t = || component_t.clone();
let component_b = || component_b.clone();
type MakeTermFrom2 = fn(Term, Term) -> Option<Term>;
match task_content.identifier() {
INHERITANCE_RELATION => {
let [make_term_and, make_term_or]: [MakeTermFrom2; 2] =
shared_term_i.select([Term::make_intersection_ext, Term::make_intersection_int]);
term_and = make_term_and(component_t(), component_b());
term_or = make_term_or(component_t(), component_b());
let make_term_dif: MakeTermFrom2 =
shared_term_i.select_one([Term::make_difference_ext, Term::make_difference_int]);
(term_dif, truth_dif) = match [truth_t.is_positive(), truth_b.is_positive()] {
[true, true] | [false, false] => (None, None),
[true, false] => (
make_term_dif(component_t(), component_b()),
Some(truth_t.intersection(&truth_b.negation())),
),
[false, true] => (
make_term_dif(component_b(), component_t()),
Some(truth_b.intersection(&truth_t.negation())),
),
}
}
IMPLICATION_RELATION => {
let [make_term_and, make_term_or]: [MakeTermFrom2; 2] =
shared_term_i.select([Term::make_conjunction, Term::make_disjunction]);
term_and = make_term_and(component_t(), component_b());
term_or = make_term_or(component_t(), component_b());
(term_dif, truth_dif) = (None, None);
}
_ => return,
}
let component_common = || component_common.clone();
let mut term_truths = [
(term_and, truth_and),
(term_or, truth_or),
(term_dif, truth_dif),
]
.into_iter();
while let Some((Some(term), Some(truth))) = term_truths.next() {
let [subject, predicate] = shared_term_i.select([component_common(), term]);
let content = unwrap_or_return!(
?Term::make_statement(&task_content, subject, predicate)
=> continue
);
if content == *task_content || content == *belief_content {
continue;
}
let budget = context.budget_compound_forward(&truth, &content);
context.double_premise_task(content, Some(truth), budget);
}
}
#[doc(alias = "decompose_compound")]
pub fn decompose_as_set(
task_content: StatementRef,
compound: CompoundTermRef,
component: &Term,
component_common: &Term,
side: SyllogismPosition,
compound_from: PremiseSource,
context: &mut ReasonContextConcept,
) {
if compound.instanceof_statement() || compound.instanceof_image() {
return;
}
debug_assert!(context.current_task().get_().is_judgement());
let term2 = unwrap_or_return!(
?compound.reduce_components(component)
);
let [subject, predicate] = side.select([component_common.clone(), term2.clone()]);
let content = unwrap_or_return!(?Term::make_statement(&task_content, subject, predicate));
let belief_truth: TruthValue = context.current_belief().unwrap().into();
let task_truth: TruthValue = context.current_task().get_().unwrap_judgement().into();
let [v1, v2] = compound_from.select([task_truth, belief_truth]);
fn reduce_disjunction_rev(v1: &impl Truth, v2: &impl Truth) -> TruthValue {
v2.reduce_disjunction(v1)
}
let [truth_f_and, truth_f_or]: [TruthFDouble; 2] = side.select([
TruthFunctions::reduce_conjunction,
TruthFunctions::reduce_disjunction,
]);
let truth_f_not = match *compound.component_at(0).unwrap() == *component {
true => reduce_disjunction_rev,
false => TruthFunctions::reduce_conjunction_neg,
};
let task_content_type = task_content.identifier();
let compound_type = compound.identifier();
let truth_f: TruthFDouble = match task_content_type {
INHERITANCE_RELATION => match compound_type {
INTERSECTION_EXT_OPERATOR => truth_f_and,
INTERSECTION_INT_OPERATOR => truth_f_or,
SET_EXT_OPERATOR if component.instanceof_set_ext() => truth_f_or,
SET_INT_OPERATOR if component.instanceof_set_int() => truth_f_and,
DIFFERENCE_EXT_OPERATOR if side == Subject => truth_f_not,
DIFFERENCE_INT_OPERATOR if side == Predicate => truth_f_not,
_ => return,
},
IMPLICATION_RELATION => match compound_type {
CONJUNCTION_OPERATOR => truth_f_and,
DISJUNCTION_OPERATOR => truth_f_or,
_ => return,
},
_ => return,
};
let truth = truth_f(&v1, &v2);
let budget = context.budget_compound_forward(&truth, &content);
context.double_premise_task(content, Some(truth), budget);
}
pub fn decompose_statement(
compound: CompoundTermRef,
component: &Term,
compound_from: PremiseSource,
context: &mut ReasonContextConcept,
) {
let task_truth = context
.current_task()
.get_()
.as_judgement()
.map(TruthValue::from);
let belief_truth = TruthValue::from(context.current_belief().unwrap());
let content = unwrap_or_return!(?compound.reduce_components(component));
let direction = context.reason_direction();
match direction {
Forward => {
let task_truth = task_truth.unwrap();
let [v1, v2] = compound_from.select([&task_truth, &belief_truth]);
let truth_f: TruthFDouble = match compound.identifier() {
CONJUNCTION_OPERATOR => TruthFunctions::reduce_conjunction,
DISJUNCTION_OPERATOR => TruthFunctions::reduce_disjunction,
_ => return,
};
let truth = truth_f(v1, v2);
let budget = context.budget_compound_forward(&truth, &content);
context.double_premise_task(content, Some(truth), budget)
}
Backward => {
if !content.is_zero_complexity() {
let budget = context.budget_compound_backward(&content);
context.double_premise_task(content.clone(), None, budget);
}
let task_rc = context.current_task(); let task_ref = task_rc.get_(); let task = &*task_ref;
if !task.content().contain_var_q() {
return;
}
let content_concept = unwrap_or_return!(?context.term_to_concept(&content));
let content_belief = unwrap_or_return!(
?content_concept.get_belief(task)
);
let new_stamp = Stamp::from_merge_unchecked(
task,
content_belief, context.time(),
context.max_evidence_base_length(),
);
let task_budget = BudgetValue::from(task);
drop(task_ref);
drop(task_rc);
let conjunction = unwrap_or_return!(
?Term::make_conjunction(component.clone(), content)
);
let truth = content_belief.intersection(&belief_truth);
let sentence = content_belief.clone(); let content_task = Task::from_input(
context.reasoner_mut().updated_task_current_serial(),
sentence,
task_budget,
);
let budget = context.budget_compound_forward(&truth, &conjunction);
context.double_premise_task_compositional(
&content_task,
conjunction,
Some(truth),
budget,
new_stamp,
);
}
}
}
pub fn intro_var_same_subject_or_predicate(
original_main_sentence: &impl Judgement,
sub_sentence: &impl Judgement,
component: &Term,
sub_content: CompoundTermRef,
position_sub_in_hi: SyllogismPosition, context: &mut ReasonContextConcept,
) {
let cloned_main = original_main_sentence.sentence_clone();
let cloned_main_t = cloned_main.content();
if !sub_content.instanceof_compound() {
return;
}
let main_statement = unwrap_or_return!(?cloned_main_t.as_statement());
match [component.identifier(), sub_content.identifier()] {
[INHERITANCE_RELATION, INHERITANCE_RELATION]
| [SIMILARITY_RELATION, SIMILARITY_RELATION] => {}
_ => return,
}
let [component, sub_content] = match [component.as_statement(), sub_content.as_statement()] {
[Some(component), Some(sub_content)] => [component, sub_content],
_ => return,
};
if *component == *sub_content {
return;
}
let [com_sub, com_pre] = component.sub_pre();
let [sub_sub, sub_pre] = sub_content.sub_pre();
let var_position = if *com_pre == *sub_pre && !com_pre.instanceof_variable() {
Some(Predicate) } else if *com_sub == *sub_sub && !com_sub.instanceof_variable() {
Some(Subject) } else {
None };
fn replaced_statement_with_term_at(
statement: StatementRef,
at: SyllogismPosition,
new_term: Term,
) -> Option<Term> {
let new_remaining_component = at.opposite().select_one(statement.sub_pre()).clone();
let [sub, pre] = at.select([new_term, new_remaining_component]); Term::make_statement(&statement, sub, pre)
}
let content = match var_position {
Some(var_position) => {
let var_d = || Term::make_var_d([&main_statement, sub_content.statement]);
let sub_component_in_main = unwrap_or_return!( ?position_sub_in_hi.select_one(main_statement.sub_pre()).as_statement()
);
let sub_component_replaced = unwrap_or_return!(
?replaced_statement_with_term_at(sub_component_in_main, var_position, var_d())
);
let new_sub_compound = unwrap_or_return!(
?replaced_statement_with_term_at(sub_content, var_position, var_d())
);
if sub_component_replaced == new_sub_compound {
return;
}
let sub_conjunction = unwrap_or_return!(
?Term::make_conjunction(sub_component_replaced, new_sub_compound)
);
unwrap_or_return!(
?replaced_statement_with_term_at(
main_statement,
position_sub_in_hi,
sub_conjunction,
)
)
}
None => main_statement.statement.clone(),
};
let truth = original_main_sentence.induction(sub_sentence);
let budget = context.budget_compound_forward(&truth, &content);
context.double_premise_task(content, Some(truth), budget);
}
pub fn intro_var_outer(
task_content: StatementRef,
belief_content: StatementRef,
shared_term_i: SyllogismPosition,
context: &mut ReasonContextConcept,
) {
debug_assert!(context.current_task().get_().is_judgement());
let truth_t = TruthValue::from(context.current_task().get_().unwrap_judgement());
let truth_b = TruthValue::from(context.current_belief().unwrap());
let [state_i1, state_i2] = intro_var_states_ind(task_content, belief_content, shared_term_i);
let [state_d1, state_d2] = intro_var_states_dep(task_content, belief_content, shared_term_i);
let (state_i1, state_i2) = (|| state_i1.clone(), || state_i2.clone());
let (state_d1, state_d2) = (|| state_d1.clone(), || state_d2.clone());
enum UsesVar {
I,
D,
}
use UsesVar::*;
type IntroVarOuterParameters = (
UsesVar, fn(Term, Term) -> Option<Term>, fn(&TruthValue, &TruthValue) -> TruthValue, bool, );
const T: bool = true; const F: bool = false; let will_intro_parameters: [IntroVarOuterParameters; 4] = [
(I, Term::make_implication, TruthFunctions::induction, F), (I, Term::make_implication, TruthFunctions::induction, T), (I, Term::make_equivalence, TruthFunctions::comparison, F), (D, Term::make_conjunction, TruthFunctions::intersection, F), ];
for (uses_var, make_content, truth_f, reverse_order) in will_intro_parameters {
let states = match uses_var {
I => [state_i1(), state_i2()],
D => [state_d1(), state_d2()],
};
intro_var_outer_derive(
states,
[&truth_t, &truth_b],
make_content,
truth_f,
reverse_order,
context,
);
}
}
fn intro_var_states_ind(
task_content: StatementRef,
belief_content: StatementRef,
shared_term_i: SyllogismPosition,
) -> [Option<Term>; 2] {
let mut task_content = task_content.to_owned();
let mut belief_content = belief_content.to_owned();
let var_i = Term::make_var_i([&*task_content, &*belief_content]); let [need_common_t, need_common_b] = [
shared_term_i.select_another(task_content.sub_pre_mut()),
shared_term_i.select_another(belief_content.sub_pre_mut()),
];
let second_common_term = second_common_term([need_common_t, need_common_b], shared_term_i);
if let Some(second_common_term) = second_common_term {
let substitute = VarSubstitution::from_pairs([(second_common_term.clone(), var_i)]);
substitute.apply_to_term(need_common_t);
substitute.apply_to_term(need_common_b);
}
let var_i = Term::make_var_i([&*task_content, &*belief_content]);
let other_t = shared_term_i.select_another(task_content.sub_pre());
let other_b = shared_term_i.select_another(belief_content.sub_pre());
let [term11, term12] = shared_term_i.select([&var_i, other_t]);
let [term21, term22] = shared_term_i.select([&var_i, other_b]);
[
Term::make_inheritance(term11.clone(), term12.clone()),
Term::make_inheritance(term21.clone(), term22.clone()),
]
}
fn intro_var_states_dep(
task_content: StatementRef,
belief_content: StatementRef,
shared_term_i: SyllogismPosition,
) -> [Option<Term>; 2] {
let var_d = Term::make_var_d([&*task_content, &*belief_content]);
let other_t = shared_term_i.select_another(task_content.sub_pre());
let other_b = shared_term_i.select_another(belief_content.sub_pre());
let [term11, term12] = shared_term_i.select([&var_d, other_t]);
let [term21, term22] = shared_term_i.select([&var_d, other_b]);
[
Term::make_inheritance(term11.clone(), term12.clone()),
Term::make_inheritance(term21.clone(), term22.clone()),
]
}
fn intro_var_outer_derive(
[state_1, state_2]: [Option<Term>; 2],
[truth_t, truth_b]: [&TruthValue; 2],
make_content: fn(Term, Term) -> Option<Term>,
truth_f: fn(&TruthValue, &TruthValue) -> TruthValue,
reverse_order: bool,
context: &mut ReasonContextConcept,
) {
let state_1 = unwrap_or_return!(?state_1);
let state_2 = unwrap_or_return!(?state_2);
let [state_1, state_2] = reverse_order.select([state_1, state_2]); let content = unwrap_or_return!(?make_content(state_1, state_2));
let [truth_1, truth_2] = reverse_order.select([truth_t, truth_b]);
let truth = truth_f(truth_1, truth_2);
let budget = context.budget_compound_forward(&truth, &content);
context.double_premise_task(content, Some(truth), budget);
}
pub fn intro_var_inner(
premise_1: StatementRef,
premise_2: StatementRef,
old_compound: CompoundTermRef,
context: &mut ReasonContextConcept,
) {
debug_assert!(context.current_task().get_().is_judgement());
let truth_t = TruthValue::from(context.current_task().get_().unwrap_judgement());
let truth_b = TruthValue::from(context.current_belief().unwrap());
if !premise_1.is_same_type(&premise_2) || old_compound.contain_component(&premise_1) {
return;
}
let [common_term_1, common_term_2] = intro_var_commons([premise_1, premise_2]);
let (common_term_1, common_term_2) = (|| common_term_1.cloned(), || common_term_2.cloned());
f_parallel![
intro_var_inner1 intro_var_inner2;
premise_1,
old_compound,
common_term_1(),
common_term_2(),
&truth_t,
&truth_b,
context,
];
}
fn intro_var_commons([premise_1, premise_2]: [StatementRef; 2]) -> [Option<&Term>; 2] {
let [term11, term12] = premise_1.sub_pre();
let [term21, term22] = premise_2.sub_pre();
if *term11 == *term21 {
[Some(term11), second_common_term([term12, term22], Subject)]
} else if *term12 == *term22 {
[Some(term12), second_common_term([term11, term21], Subject)]
} else {
[None, None]
}
}
fn intro_var_inner1(
premise_1: StatementRef,
old_compound: CompoundTermRef,
common_term_1: Option<Term>,
_common_term_2: Option<Term>, truth_t: &impl Truth,
truth_b: &impl Truth,
context: &mut ReasonContextConcept,
) {
let mut content = unwrap_or_return!(
?Term::make_conjunction(premise_1.statement.clone(), old_compound.inner.clone())
);
if let Some(common_term_1) = common_term_1 {
let var_d = Term::make_var_d(&content);
let substitute = VarSubstitution::from_pairs([(common_term_1, var_d)]);
substitute.apply_to_term(&mut content);
}
let truth = truth_t.intersection(truth_b);
let budget = context.budget_forward(&truth);
context.double_premise_task_not_revisable(content, Some(truth), budget);
}
fn intro_var_inner2(
premise_1: StatementRef,
old_compound: CompoundTermRef,
common_term_1: Option<Term>,
common_term_2: Option<Term>,
truth_t: &TruthValue,
truth_b: &TruthValue,
context: &mut ReasonContextConcept,
) {
let mut content = unwrap_or_return!(
?Term::make_implication(premise_1.statement.clone(), old_compound.inner.clone())
);
let var_i = Term::make_var_i(&content);
let var_i_2 = Term::make_var_i([&content, &var_i]); let substitute = VarSubstitution::from_pairs(
[
common_term_1.map(|common_term| (common_term, var_i)),
common_term_2.map(|common_term| (common_term, var_i_2)),
]
.into_iter()
.flatten(),
);
substitute.apply_to_term(&mut content);
let premise1_eq_task = *premise_1 == *context.current_task().get_().content();
let [truth_1, truth_2] = premise1_eq_task.select([truth_t, truth_b]);
let truth = truth_1.induction(truth_2);
let budget = context.budget_forward(&truth);
context.double_premise_task(content, Some(truth), budget);
}
fn second_common_term(
[term1, term2]: [&Term; 2], shared_term_i: SyllogismPosition,
) -> Option<&Term> {
let specific_image_type = shared_term_i.select_one([IMAGE_EXT_OPERATOR, IMAGE_INT_OPERATOR]);
let image1 = term1.as_compound_type(specific_image_type)?;
let image2 = term2.as_compound_type(specific_image_type)?;
match image1.get_the_other_component() {
Some(common_term) if image2.contain_term(common_term) => Some(common_term),
_ => match image2.get_the_other_component() {
Some(common_term) if image1.contain_term(common_term) => Some(common_term),
_ => None,
},
}
}
pub fn eliminate_var_dep(
compound: CompoundTermRef,
component: &Term,
compound_from: PremiseSource,
context: &mut ReasonContextConcept,
) {
let truth_t = context
.current_task()
.get_()
.as_judgement()
.map(TruthValue::from);
let truth_b = TruthValue::from(context.current_belief().unwrap());
let direction = context.reason_direction();
let content = unwrap_or_return!(
?compound.reduce_components(component)
);
if content
.as_statement()
.as_ref()
.is_some_and(StatementRef::invalid)
{
return;
}
let truth = match direction {
Forward => Some({
let [truth_1, truth_2] = compound_from.select([truth_t.unwrap(), truth_b]);
truth_1.anonymous_analogy(&truth_2)
}),
Backward => None,
};
let budget = match direction {
Forward => context.budget_compound_forward(truth.as_ref(), &content),
Backward => match compound_from {
PremiseSource::Task => context.budget_backward(&truth_b),
PremiseSource::Belief => context.budget_backward_weak(&truth_b),
},
};
context.double_premise_task(content, truth, budget);
}
#[cfg(test)]
mod tests {
use crate::expectation_tests;
expectation_tests! {
compose_as_sub_inh_and: {
"
nse <S --> M>.
nse <P --> M>.
cyc 10
"
=> OUT "<(&,S,P) --> M>" in outputs
}
compose_as_sub_inh_or: {
"
nse <S --> M>.
nse <P --> M>.
cyc 10
"
=> OUT "<(|,S,P) --> M>" in outputs
}
compose_as_sub_inh_not_sp: {
"
nse <S --> M>. %1%
nse <P --> M>. %0%
cyc 10
" => OUT "<(~,S,P) --> M>" in outputs
}
compose_as_sub_inh_not_ps: {
"
nse <S --> M>. %0%
nse <P --> M>. %1%
cyc 10
" => OUT "<(~,P,S) --> M>" in outputs
}
compose_as_sub_imp_and: {
"
nse <S ==> M>.
nse <P ==> M>.
cyc 10
"
=> OUT "<(&&,S,P) ==> M>" in outputs
}
compose_as_sub_imp_or: {
"
nse <S ==> M>.
nse <P ==> M>.
cyc 10
"
=> OUT "<(||,S,P) ==> M>" in outputs
}
compose_as_pre_inh_and: {
"
nse <M --> S>.
nse <M --> P>.
cyc 10
"
=> OUT "<M --> (&,S,P)>" in outputs
}
compose_as_pre_inh_or: {
"
nse <M --> S>.
nse <M --> P>.
cyc 10
"
=> OUT "<M --> (|,S,P)>" in outputs
}
compose_as_pre_inh_not_sp: {
"
nse <M --> S>. %1%
nse <M --> P>. %0%
cyc 10
" => OUT "<M --> (-,S,P)>" in outputs
}
compose_as_pre_inh_not_ps: {
"
nse <M --> S>. %0%
nse <M --> P>. %1%
cyc 10
" => OUT "<M --> (-,P,S)>" in outputs
}
compose_as_pre_imp_and: {
"
nse <M ==> S>.
nse <M ==> P>.
cyc 10
"
=> OUT "<M ==> (||,S,P)>" in outputs
}
compose_as_pre_imp_or: {
"
nse <M ==> S>.
nse <M ==> P>.
cyc 10
"
=> OUT "<M ==> (&&,S,P)>" in outputs
}
decompose_as_sub_inh_and: {
"
nse <(&,S,P) --> M>.
nse <S --> M>.
cyc 20
"
=> OUT "<P --> M>" in outputs
}
decompose_as_sub_inh_or: {
"
nse <(|,S,P) --> M>.
nse <S --> M>.
cyc 20
"
=> OUT "<P --> M>" in outputs
}
decompose_as_sub_inh_not_sp: {
"
nse <(~,S,P) --> M>. %1%
nse <S --> M>. %0%
cyc 20
" => OUT "<P --> M>" in outputs
}
decompose_as_sub_inh_not_ps: {
"
nse <(~,P,S) --> M>. %0%
nse <S --> M>. %1%
cyc 20
" => OUT "<P --> M>" in outputs
}
decompose_as_sub_imp_or: {
"
nse <(||,S,P) ==> M>.
nse <S ==> M>.
cyc 20
"
=> OUT "<P ==> M>" in outputs
}
decompose_as_pre_inh_and: {
"
nse <M --> (&,S,P)>.
nse <M --> S>.
cyc 20
"
=> OUT "<M --> P>" in outputs
}
decompose_as_pre_inh_or: {
"
nse <M --> (|,S,P)>.
nse <M --> S>.
cyc 20
"
=> OUT "<M --> P>" in outputs
}
decompose_as_pre_inh_not_sp: {
"
nse <M --> (-,S,P)>. %1%
nse <M --> S>. %0%
cyc 20
" => OUT "<M --> P>" in outputs
}
decompose_as_pre_inh_not_ps: {
"
nse <M --> (-,P,S)>. %0%
nse <M --> S>. %1%
cyc 20
" => OUT "<M --> P>" in outputs
}
decompose_as_pre_imp_and: {
"
nse <M ==> (||,S,P)>.
nse <M ==> S>.
cyc 20
"
=> OUT "<M ==> P>" in outputs
}
decompose_as_pre_imp_or: {
"
nse <M ==> (&&,S,P)>.
nse <M ==> S>.
cyc 20
"
=> OUT "<M ==> P>" in outputs
}
decompose_compound_pre_inh_and: {
"
nse <M --> (&,S,P)>.
nse <M --> S>.
cyc 10
"
=> OUT "<M --> P>" in outputs
}
decompose_statement_conjunction: {
"
nse (&&,S,P).
nse P.
cyc 10
"
=> OUT "S" in outputs
}
decompose_statement_disjunction: {
"
nse (||,S,P).
nse P.
cyc 10
"
=> OUT "S" in outputs
}
decompose_statement_conjunction_backward: {
"
nse (&&,S,P).
nse S?
cyc 10
"
=> ANSWER "S" in outputs
}
decompose_statement_disjunction_backward: {
"
nse (||,S,P).
nse S?
cyc 10
"
=> ANSWER "S" in outputs
}
intro_var_same_subject: {
"
nse <<$1 --> B> ==> <$1 --> A>>.
nse <A --> C>.
cyc 10
"
=> OUT "<<A --> B> ==> (&&,<#1 --> C>,<#1 --> A>)>" in outputs
}
intro_var_same_predicate: {
"
nse <<B --> $1> ==> <A --> $1>>.
nse <C --> A>.
cyc 10
"
=> OUT "<<B --> A> ==> (&&,<C --> #1>,<A --> #1>)>" in outputs
}
intro_var_outer_sub_imp: {
"
nse <M --> A>.
nse <M --> B>.
cyc 5
"
=> OUT "<<$1 --> A> ==> <$1 --> B>>" in outputs
}
intro_var_outer_sub_imp_rev: {
"
nse <M --> A>.
nse <M --> B>.
cyc 5
"
=> OUT "<<$1 --> B> ==> <$1 --> A>>" in outputs
}
intro_var_outer_sub_equ: {
"
nse <M --> A>.
nse <M --> B>.
cyc 5
"
=> OUT "<<$1 --> A> <=> <$1 --> B>>" in outputs
}
intro_var_outer_sub_con: {
"
nse <M --> A>.
nse <M --> B>.
cyc 5
"
=> OUT "(&&,<#1 --> A>,<#1 --> B>)" in outputs
}
intro_var_outer_pre_imp: {
"
nse <A --> M>.
nse <B --> M>.
cyc 5
"
=> OUT "<<A --> $1> ==> <B --> $1>>" in outputs
}
intro_var_outer_pre_imp_rev: {
"
nse <A --> M>.
nse <B --> M>.
cyc 5
"
=> OUT "<<B --> $1> ==> <A --> $1>>" in outputs
}
intro_var_outer_pre_equ: {
"
nse <A --> M>.
nse <B --> M>.
cyc 5
"
=> OUT "<<A --> $1> <=> <B --> $1>>" in outputs
}
intro_var_outer_pre_con: {
"
nse <A --> M>.
nse <B --> M>.
cyc 5
"
=> OUT "(&&,<A --> #1>,<B --> #1>)" in outputs
}
intro_var_inner_con_1: {
"
nse <M --> S>.
nse (&&,C,<M --> P>).
cyc 20
" => OUT "(&&,C,<#1 --> S>,<#1 --> P>)" in outputs
}
intro_var_inner_con_2: {
"
nse <M --> S>.
nse (&&,C,<M --> P>).
cyc 20
" => OUT "<<$1 --> S> ==> (&&,C,<$1 --> P>)>" in outputs
}
eliminate_var_dep: {
"
nse (&&,<#x --> S>,<#x --> P>).
nse <M --> P>.
cyc 10
"
=> OUT "<M --> S>" in outputs
}
eliminate_var_dep_nal_616: {
"
nse $0.80;0.80;0.95$ (&&,<#x --> (/,open,#y,_)>,<#x --> lock>,<#y --> key>). %1.00;0.90%
nse $0.80;0.80;0.95$ <{lock1} --> lock>. %1.00;0.90%
cyc 10
"
=> OUT "(&&,<#1 --> key>,<{lock1} --> (/,open,#1,_)>)" in outputs
}
}
}