Search in sources :

Example 26 with Term

use of nars.language.Term in project opennars by opennars.

the class Doubt method execute.

/**
 * To activate a concept as if a question has been asked about it
 *
 * @param args Arguments, a Statement followed by an optional tense
 * @param memory The memory in which the operation is executed
 * @return Immediate results as Tasks
 */
@Override
protected ArrayList<Task> execute(Operation operation, Term[] args, Memory memory) {
    Term term = args[1];
    Concept concept = memory.conceptualize(Consider.budgetMentalConcept(operation), term);
    concept.discountConfidence(true);
    return null;
}
Also used : Concept(nars.entity.Concept) Term(nars.language.Term)

Example 27 with Term

use of nars.language.Term in project opennars by opennars.

the class Hesitate method execute.

/**
 * To activate a concept as if a question has been asked about it
 *
 * @param args Arguments, a Statement followed by an optional tense
 * @param memory The memory in which the operation is executed
 * @return Immediate results as Tasks
 */
@Override
protected ArrayList<Task> execute(Operation operation, Term[] args, Memory memory) {
    Term term = args[1];
    Concept concept = memory.conceptualize(Consider.budgetMentalConcept(operation), term);
    concept.discountConfidence(false);
    return null;
}
Also used : Concept(nars.entity.Concept) Term(nars.language.Term)

Example 28 with Term

use of nars.language.Term in project opennars by opennars.

the class Name method execute.

/**
 * To create a judgment with a given statement
 * @param args Arguments, a Statement followed by an optional tense
 * @param memory The memory in which the operation is executed
 * @return Immediate results as Tasks
 */
@Override
protected ArrayList<Task> execute(Operation operation, Term[] args, Memory memory) {
    Term compound = args[1];
    Term atomic = args[2];
    Similarity content = Similarity.make(compound, atomic);
    // a naming convension
    TruthValue truth = new TruthValue(1, 0.9999f);
    Sentence sentence = new Sentence(content, Symbols.JUDGMENT_MARK, truth, new Stamp(memory));
    BudgetValue budget = new BudgetValue(Parameters.DEFAULT_JUDGMENT_PRIORITY, Parameters.DEFAULT_JUDGMENT_DURABILITY, truth);
    return Lists.newArrayList(new Task(sentence, budget, true));
}
Also used : BudgetValue(nars.entity.BudgetValue) Task(nars.entity.Task) Similarity(nars.language.Similarity) Stamp(nars.entity.Stamp) TruthValue(nars.entity.TruthValue) Term(nars.language.Term) Sentence(nars.entity.Sentence)

Example 29 with Term

use of nars.language.Term in project opennars by opennars.

the class InheritanceGraph method add.

@Override
public boolean add(Sentence s, CompoundTerm ct, Item c) {
    if (ct instanceof Statement) {
        Statement st = (Statement) ct;
        Term subject = st.getSubject();
        Term predicate = st.getPredicate();
        addVertex(subject);
        addVertex(predicate);
        System.out.println(subject.toString().trim() + " " + predicate.toString().trim() + " " + s.truth.getExpectation() + s.truth.getFrequency() + " " + s.truth.getConfidence() + " " + " Inheritance");
        addEdge(subject, predicate, s);
        return true;
    }
    return false;
}
Also used : Statement(nars.language.Statement) CompoundTerm(nars.language.CompoundTerm) Term(nars.language.Term)

Example 30 with Term

use of nars.language.Term in project opennars by opennars.

the class SentenceGraph method remove.

protected boolean remove(Sentence s) {
    List<E> componentList = components.get(s);
    if (componentList != null) {
        for (E e : componentList) {
            if (!containsEdge(e))
                continue;
            Term source = getEdgeSource(e);
            Term target = getEdgeTarget(e);
            removeEdge(e);
            ensureTermConnected(source);
            ensureTermConnected(target);
        }
        componentList.clear();
        components.remove(s);
        return true;
    }
    return false;
}
Also used : CompoundTerm(nars.language.CompoundTerm) Term(nars.language.Term)

Aggregations

Term (nars.language.Term)109 CompoundTerm (nars.language.CompoundTerm)66 BudgetValue (nars.entity.BudgetValue)48 TruthValue (nars.entity.TruthValue)46 Sentence (nars.entity.Sentence)40 Task (nars.entity.Task)37 Statement (nars.language.Statement)28 Conjunction (nars.language.Conjunction)20 Inheritance (nars.language.Inheritance)19 Stamp (nars.entity.Stamp)17 Concept (nars.entity.Concept)14 Implication (nars.language.Implication)13 Product (nars.language.Product)11 NAR (nars.main.NAR)9 Interval (nars.language.Interval)8 Test (org.junit.Test)8 HashMap (java.util.HashMap)7 SetExt (nars.language.SetExt)7 SetInt (nars.language.SetInt)7 Variable (nars.language.Variable)7