use of com.sri.ai.grinder.api.Context in project aic-expresso by aic-sri-international.
the class SymbolicShell method main.
public static void main(String[] args) {
Theory theory = makeTheory();
Context context = makeContext(theory);
ConsoleIterator consoleIterator = getConsole(args);
help(consoleIterator);
for (String example : EXAMPLES) {
interpretExample(example, consoleIterator, theory, context);
}
while (consoleIterator.hasNext()) {
context = interpretConsoleInput(consoleIterator, theory, context);
}
consoleIterator.getOutputWriter().println("\nGoodbye.");
}
use of com.sri.ai.grinder.api.Context in project aic-expresso by aic-sri-international.
the class AbstractTheoryTestingSupport method extendWithTestingInformation.
@Override
public Context extendWithTestingInformation(Context context) {
// we only need to provide the variables types, and not the known constant types, because the latter will be extracted from the already registered types.
Map<String, String> mapFromSymbolNamesToTypeNames = new LinkedHashMap<String, String>();
for (Map.Entry<String, Type> symbolAndType : getVariableNamesAndTypesForTesting().entrySet()) {
mapFromSymbolNamesToTypeNames.put(symbolAndType.getKey(), symbolAndType.getValue().toString());
}
for (Map.Entry<String, Type> symbolAndType : getExtendedVariableNamesAndTypesForTesting().entrySet()) {
mapFromSymbolNamesToTypeNames.put(symbolAndType.getKey(), symbolAndType.getValue().toString());
}
Context result = (Context) GrinderUtil.extendRegistryWith(mapFromSymbolNamesToTypeNames, getTypesForTesting(), context);
return result;
}
use of com.sri.ai.grinder.api.Context in project aic-expresso by aic-sri-international.
the class MultiVariableContextWithCheckedProperty method setIsUniquelyNamedConstantPredicate.
@Override
public MultiVariableContextWithCheckedProperty setIsUniquelyNamedConstantPredicate(Predicate<Expression> isUniquelyNamedConstantPredicate) {
MultiVariableContextWithCheckedProperty result = clone();
Context newTail = tail.setIsUniquelyNamedConstantPredicate(isUniquelyNamedConstantPredicate);
result.tail = newTail;
return result;
}
use of com.sri.ai.grinder.api.Context in project aic-expresso by aic-sri-international.
the class MultiVariableContextWithCheckedProperty method makeNewContextWithAddedType.
@Override
public MultiVariableContextWithCheckedProperty makeNewContextWithAddedType(Type type) {
MultiVariableContextWithCheckedProperty result = clone();
Context newTail = tail.makeNewContextWithAddedType(type);
result.tail = newTail;
return result;
}
use of com.sri.ai.grinder.api.Context in project aic-expresso by aic-sri-international.
the class MultiVariableContextWithCheckedProperty method putAllGlobalObjects.
@Override
public MultiVariableContextWithCheckedProperty putAllGlobalObjects(Map<Object, Object> objects) {
MultiVariableContextWithCheckedProperty result = clone();
Context newTail = tail.putAllGlobalObjects(objects);
result.tail = newTail;
return result;
}
Aggregations