adds a new clause as first clause of a predicate to the database. ...
Move to
Next Prev
Up Top
See also
abolish/1
asserta/1
assertz/1
collect/3
load/1
unload/1
loaded/1/2
retract/1
retractall/1
IF Computer > MINERVA > Manual > Reference > Predicates > Clause creation and destruction > asserta/1

asserta/1

adds a new clause as first clause of a predicate to the database.

asserta(+Clause)

asserta/1 adds Clause as first clause of the predicate which has the same functor and arity as Clause to the database. If no corresponding predicate exists a new predicate is created.
If Clause is an atom or compound term whose principal functor is different from ':-' then Clause is the head and 'true' is the body of the new clause.
If Clause is a compound term whose principal functor is ':-'/2 then the left side (1st argument) of ':-' is the head and the right side (2nd argument) the body of the new clause.

Arguments

Clause              atom or compound term

Examples

asserta(f(a)). Succeeds and adds the clause 'f(a) :- true' to the database in front of other clauses of the predicate f/1.
asserta((f(X,Z) :- g(X,Y), h(Y,Z))). Succeeds and adds the clause 'f(X,Z) :- g(X,Y), h(Y,Z)' to the database in front of other clauses of the predicate f/2.
asserta(X). instantiation_error.

Standard

This predicate is part of the ISO-Prolog Standard.

See also

assertz/1, abolish/1, collect/3, load/1, unload/1, loaded/1/2, retract/1, retractall/1.

read on...
MINERVA
ifcomputer logo
f
Expert Services on the Web
Language
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/clause_creat_destruct/asserta/home_en.html
published 2008/7/7 update 2003/2/26 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 info@ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS