]> Repositorios git - scryer-prolog.git/commitdiff
remove cyclic_term/1
authorMark Thom <[email protected]>
Thu, 27 Feb 2020 23:19:48 +0000 (16:19 -0700)
committerMark Thom <[email protected]>
Thu, 27 Feb 2020 23:19:48 +0000 (16:19 -0700)
src/prolog/clause_types.rs
src/prolog/machine/machine_state.rs

index bbb9accc1860ae3fc362ddc59af84112b11c4166..7851ad03b365d0a922b3ed39e216b7f2246f5963 100644 (file)
@@ -117,7 +117,6 @@ ref_thread_local! {
         m.insert(("@>=", 2), ClauseType::BuiltIn(BuiltInClauseType::CompareTerm(CompareTermQT::GreaterThanOrEqual)));
         m.insert(("@=<", 2), ClauseType::BuiltIn(BuiltInClauseType::CompareTerm(CompareTermQT::LessThanOrEqual)));
         m.insert(("copy_term", 2), ClauseType::BuiltIn(BuiltInClauseType::CopyTerm));
-        m.insert(("cyclic_term", 1), ClauseType::BuiltIn(BuiltInClauseType::CyclicTerm));
         m.insert(("==", 2), ClauseType::BuiltIn(BuiltInClauseType::Eq));
         m.insert(("functor", 3), ClauseType::BuiltIn(BuiltInClauseType::Functor));
         m.insert(("ground", 1), ClauseType::BuiltIn(BuiltInClauseType::Ground));
@@ -538,7 +537,6 @@ pub enum BuiltInClauseType {
     Arg,
     Compare,
     CompareTerm(CompareTermQT),
-    CyclicTerm,
     CopyTerm,
     Eq,
     Functor,
@@ -569,7 +567,6 @@ impl BuiltInClauseType {
             &BuiltInClauseType::Arg => clause_name!("arg"),
             &BuiltInClauseType::Compare => clause_name!("compare"),
             &BuiltInClauseType::CompareTerm(qt) => clause_name!(qt.name()),
-            &BuiltInClauseType::CyclicTerm => clause_name!("cyclic_term"),
             &BuiltInClauseType::CopyTerm => clause_name!("copy_term"),
             &BuiltInClauseType::Eq => clause_name!("=="),
             &BuiltInClauseType::Functor => clause_name!("functor"),
@@ -589,7 +586,6 @@ impl BuiltInClauseType {
             &BuiltInClauseType::Arg => 3,
             &BuiltInClauseType::Compare => 2,
             &BuiltInClauseType::CompareTerm(_) => 2,
-            &BuiltInClauseType::CyclicTerm => 1,
             &BuiltInClauseType::CopyTerm => 2,
             &BuiltInClauseType::Eq => 2,
             &BuiltInClauseType::Functor => 3,
index bf4c5c5fd4aca02dcc010196bd63be44ad44a4a2..143379e250fc16f700670439c76417f7d2210b7e 100644 (file)
@@ -711,11 +711,6 @@ pub(crate) trait CallPolicy: Any {
                 machine_st.compare_term(qt);
                 return_from_clause!(machine_st.last_call, machine_st)
             }
-            &BuiltInClauseType::CyclicTerm => {
-                let addr = machine_st[temp_v!(1)].clone();
-                machine_st.fail = !machine_st.is_cyclic_term(addr);
-                return_from_clause!(machine_st.last_call, machine_st)
-            }
             &BuiltInClauseType::Nl => {
                 let mut stdout = stdout();