Minerva supports so called term vectors to store and retrieve terms....
Move to
=> <=
Darueber Spitze
Zoom to
tv_add/2
tv_create/1
tv_get/3
tv_list/2
tv_set/3
tv_setsize/2
tv_size/2
See also
Arithmetic comparison
Arithmetic evaluation
Atomic term processing
Text Processing and Regular Expressions
Blackboards
BinaryIO
Character input/output
Constraints
Compilation
Clause creation and destruction
Clause retrieval and information
global variables
Grammar rules
Lists
Logic and control
All Solutions
Communication between distributed Minerva processes.
Stream selection and control
Servlet
Term comparison
Term creation and decomposition
Term input/output
Term unification
Term vector
Term Stream
XML (eXtended Markup Language) terms
Asynchronous timer handling
Type testing
IF Computer > MINERVA > Manual > Reference > Predicates > Term vector

Term vector

Minerva supports so called term vectors to store and retrieve terms.

There exist different types of predicate classes to support the management of global data: the Minerva database (manipulated with assert, retract, clause, etc), global variables (manipulated with set_global, get_global, etc), blackboards (manipulated with bb_put, bb_get, etc) and term vectors.
There exist the following predicates to handle term vectors:

  • tv_create/1
  • tv_add/2
  • tv_size/2
  • tv_setsize/2
  • tv_set/3
  • tv_get/3
  • tv_list/2

A term vector is a kind of dynamically resizable array of terms.
Before you can store/retrieve terms from a term vector, you have to create a term vector. This is done with tv_create/1. The term vector is initially empty, i.e. it's size is 0. You may add terms to the term vector with the predicates tv_add/2 or tv_set/3. You may retrieve all terms of the vector by calling tv_list/2 and you can access a single term with tv_get/3.

Examples:

main(_) :-
    my_findall(I, for(1,I,10), Numbers).

my_findall(Term, Goal, Terms) :- % create a term vector ... tv_create(Vector), % .. . add a bulk of data to it ... retrieve_info(Vector, Term, Goal), % ... and collect all terms. tv_list(Vector, Terms).

retrieve_info(Vector, Term, Goal) :- % call a goal ... call(Goal), % ... store the information ... tv_add(Vector, Term), % ... and backtrack until there are no more results. fail. retrieve_info(_, _, _).

read on...
tv_add/2
Appends a term to a term vector....
tv_create/1
Creates a term vector....
tv_get/3
Retrieves the ith term in a term vector....
tv_list/2
Collects all elements of a term vector in a list....
tv_set/3
Overwrites a term in a term vector....
tv_setsize/2
Sets the size of a term vector....
tv_size/2
Retrieves the current size of a term vector....
MINERVA
ifcomputer logo
f
Expert Services on the Web
Sprache
English
Japanese
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/termvector/home_de.html
published 2008/8/25 update 2003/1/23 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS