#[derive(Copy, Clone, PartialEq)]
pub enum SystemClauseType {
CheckCutPoint,
+ ExpandTerm,
GetBValue,
GetSCCCleaner,
InstallSCCCleaner,
pub fn name(&self) -> ClauseName {
match self {
&SystemClauseType::CheckCutPoint => clause_name!("$check_cp"),
+ &SystemClauseType::ExpandTerm => clause_name!("$expand_term"),
&SystemClauseType::GetBValue => clause_name!("$get_b_value"),
&SystemClauseType::GetDoubleQuotes => clause_name!("$get_double_quotes"),
&SystemClauseType::GetSCCCleaner => clause_name!("$get_scc_cleaner"),
pub fn from(name: &str, arity: usize) -> Option<SystemClauseType> {
match (name, arity) {
("$check_cp", 1) => Some(SystemClauseType::CheckCutPoint),
+ ("$expand_term", 2) => Some(SystemClauseType::ExpandTerm),
("$get_b_value", 1) => Some(SystemClauseType::GetBValue),
("$get_double_quotes", 1) => Some(SystemClauseType::GetDoubleQuotes),
("$get_scc_cleaner", 1) => Some(SystemClauseType::GetSCCCleaner),
expand_body(Term0, (ModTerm, ModTerms), N0, N) :-
nonvar(Term0), Term0 = (Term, Terms), !,
+ nonvar(Term),
expand_body_term(Term, ModTerm, N0, N1),
expand_body(Terms, ModTerms, N1, N).
expand_body(Term0, ModTerm, N0, N) :-
pub(super) fn system_call(&mut self, ct: &SystemClauseType,
indices: &IndexStore,
call_policy: &mut Box<CallPolicy>,
- cut_policy: &mut Box<CutPolicy>,)
+ cut_policy: &mut Box<CutPolicy>)
-> CallResult
{
match ct {
_ => self.fail = true
};
},
+ &SystemClauseType::ExpandTerm => {
+ self.p = CodePtr::Local(LocalCodePtr::UserTermExpansion(0));
+ return Ok(());
+ },
&SystemClauseType::GetDoubleQuotes => {
let a1 = self[temp_v!(1)].clone();