.. _section-Knowledge Base Updates: Knowledge Base Updates ---------------------- Flora contains a number of operators that can directly modify the state of the KB. These operators allow you to add and remove fact at runtime, from a rule or a query. They can be used, for example, when **Sunflower** is connected to a database, or a source of knowledge such as a user interface with knowledge entry forms. The insert operator is used to insert facts into the KB, and the delete operator to remove knowledge. .. code-block:: flora insert{Greg : Person [ child -> {Louisa, Kellie} ]}. // composite facts are allowed delete{Greg : Person}. delete{?x : Person}. // variables can be used, all matching facts are removed Flora also has “transactional” versions of these operators, prefixed with t\_, for examples, t\_insert and t\_delete. The difference is that KB updates done by the transactional operators are undone during backtracking, that is, if subsequent updates to the rule fail. The Flora-2 Manual [#Flora2-Manual]_ describes these operators in detail in the section “Updating the Knowledge Base”. .. [#Flora2-Manual] Kifer, Michael, Guizhen Yang, Wan Hui, and Chang Zhao. 2014. *Flora-2: User's Manual*. 1.0. Stony Brook University, Stony Brook: Department of Computer Science.