Language-independent Transformations

Basics

add(+Pef) is det
Adds +Pef to the factbase.
delete(+Term) is det
Deletes +Term and all its derived predicates from the factbase.
replace(+Old, +New) is det
Replaces the PEF Old with the PEF New.
replace(+New) is det
Replaces the PEF with the same id as New with the PEF New.

Deleting

deepRetract(+PefOrPefList) is det
Deeply retracts Pef or a list of pefs.
delete_subtree(+PefOrPefList) is det
Deeply deletes Pef or list of pefs and all their derived predicates.
replace_subtree(+Parent, +Old, +New) is det
Deletes the tree with root Old and replaces the reference to Old in Parent with a reference to New.

Replace Ids

replaceIdInTerm(+Term, -TranslatedTerm, +OldId, +NewId) is semidet
Replaces OldId with NewId in Term an binds the resulting Term to TranslatedTerm.
replaceIdInList(+List, -TranslatedList, +OldMember, +MewMember) is semidet
Replaces the member OldMember with NewMember in the list List an binds the resulting List to TranslatedList.

Id Creation

new_id(-Id) is det
Binds Id to a unique number.
new_ids(-IDList)
Binds the variables id1, .

Execution

apply_ct(+Name) is det
Apply single ct named Name.
apply_ctlist(+CTHeads:list) is det
Applies the given list of CTs.
enable_ct_logging is det
Enables CT logging.
disable_ct_logging is det
Disables CT logging.

Transaction

rollback is det
Undoes all add/1, delete/1 and replace/2 operations since the last rollback evaluation.
commit is det
Commits all rollback information.
checkpoint_new(+Checkpoint) is det
Defines the new checkpoint Checkpoint for the rollback facility.
checkpoint_commit(+Checkpoint) is det
Commit the rollback check point Checkpoint.
checkpoint_rollback(+Checkpoint) is det
Rollback to the checkpoint Checkpoint.
delete_checkpoint(+Checkpoint) is semidet
Deletes the checkpoint Checkpoint.

add/1

add(+Pef) is det
Adds +Pef to the factbase. Pef must be ground. The addition to the fact base is logged and will be undone in the next rollback.

Be aware: If the Pef already exists the predicate is ignored. The Pef is not added to the factbase, no rollback information is added.


delete/1

delete(+Term) is det
Deletes +Term and all its derived predicates from the factbase. Term be ground. The deletion from the fact base is logged and will be undone in the next rollback/0 operation.

throws error(retract_failed_in_delete(Term)) if retracting of Term fails.


replace/2

replace(+Old, +New) is det
Replaces the PEF Old with the PEF New. Old and New must be a bound PEF terms. The replacement is logged and will be undone in the next rollback.

replace/1

replace(+New) is det
Replaces the PEF with the same id as New with the PEF New. New must be a bound PEF term. The replacement is logged and will be undone in the next rollback.

deepRetract/1

deepRetract(+PefOrPefList) is det
Deeply retracts Pef or a list of pefs. In contrast to deepDelete/1 the pefs are simply retracted from the factbase without logging the operation for future rollback operations.

delete_subtree/1

delete_subtree(+PefOrPefList) is det
Deeply deletes Pef or list of pefs and all their derived predicates. To remove the element retract_and_track_rollback_info/1 is used. Therefore the deletions are logged and will be undone in the next rollback.

replace_subtree/3

replace_subtree(+Parent, +Old, +New) is det
Deletes the tree with root Old and replaces the reference to Old in Parent with a reference to New. Parent is the ID of the parent node of the node with ID Old. To remove the elements retract_and_track_rollback_info/1 is used. Therefore the deletions are logged and will be undone in the next rollback.

replaceIdInTerm/4

replaceIdInTerm(+Term, -TranslatedTerm, +OldId, +NewId) is semidet
Replaces OldId with NewId in Term an binds the resulting Term to TranslatedTerm.

replaceIdInList/4

replaceIdInList(+List, -TranslatedList, +OldMember, +MewMember) is semidet
Replaces the member OldMember with NewMember in the list List an binds the resulting List to TranslatedList. Term to TranslatedTerm.

new_id/1

new_id(-Id) is det
Binds Id to a unique number. @throws already_bound_exception(Msg) if Id is already bound.

new_ids/1

new_ids(-IDList)
Binds the variables id1, ... to new Ids.

apply_ct/1

apply_ct(+Name) is det
Apply single ct named Name.

apply_ctlist/1

apply_ctlist(+CTHeads:list) is det
Applies the given list of CTs.

enable_ct_logging/0

enable_ct_logging is det
Enables CT logging.

disable_ct_logging/0

disable_ct_logging is det
Disables CT logging.

rollback/0

rollback is det
Undoes all add/1, delete/1 and replace/2 operations since the last rollback evaluation.

commit/0

commit is det
Commits all rollback information. This predicate deletes all rollback logging information.

checkpoint_new/1

checkpoint_new(+Checkpoint) is det
Defines the new checkpoint Checkpoint for the rollback facility.

checkpoint_commit/1

checkpoint_commit(+Checkpoint) is det
Commit the rollback check point Checkpoint. This will not commit the facts, it will just remove the check point. use commit/0 to remove all existing rollback information.

checkpoint_rollback/1

checkpoint_rollback(+Checkpoint) is det
Rollback to the checkpoint Checkpoint.

delete_checkpoint/1

delete_checkpoint(+Checkpoint) is semidet
Deletes the checkpoint Checkpoint. Fails if the checkpoint does not exist.