remove vestigial attribute goals struct field and related predicates
This commit is contained in:
@@ -159,8 +159,6 @@ pub(crate) enum SystemClauseType {
|
|||||||
CharCode,
|
CharCode,
|
||||||
CharType,
|
CharType,
|
||||||
CharsToNumber,
|
CharsToNumber,
|
||||||
ClearAttributeGoals,
|
|
||||||
CloneAttributeGoals,
|
|
||||||
CodesToNumber,
|
CodesToNumber,
|
||||||
CopyTermWithoutAttrVars,
|
CopyTermWithoutAttrVars,
|
||||||
CheckCutPoint,
|
CheckCutPoint,
|
||||||
@@ -183,7 +181,6 @@ pub(crate) enum SystemClauseType {
|
|||||||
DeleteAttribute,
|
DeleteAttribute,
|
||||||
DeleteHeadAttribute,
|
DeleteHeadAttribute,
|
||||||
DynamicModuleResolution(usize),
|
DynamicModuleResolution(usize),
|
||||||
EnqueueAttributeGoal,
|
|
||||||
EnqueueAttributedVar,
|
EnqueueAttributedVar,
|
||||||
FetchGlobalVar,
|
FetchGlobalVar,
|
||||||
FirstStream,
|
FirstStream,
|
||||||
@@ -323,8 +320,6 @@ impl SystemClauseType {
|
|||||||
&SystemClauseType::CharType => clause_name!("$char_type"),
|
&SystemClauseType::CharType => clause_name!("$char_type"),
|
||||||
&SystemClauseType::CharsToNumber => clause_name!("$chars_to_number"),
|
&SystemClauseType::CharsToNumber => clause_name!("$chars_to_number"),
|
||||||
&SystemClauseType::CheckCutPoint => clause_name!("$check_cp"),
|
&SystemClauseType::CheckCutPoint => clause_name!("$check_cp"),
|
||||||
&SystemClauseType::ClearAttributeGoals => clause_name!("$clear_attribute_goals"),
|
|
||||||
&SystemClauseType::CloneAttributeGoals => clause_name!("$clone_attribute_goals"),
|
|
||||||
&SystemClauseType::CodesToNumber => clause_name!("$codes_to_number"),
|
&SystemClauseType::CodesToNumber => clause_name!("$codes_to_number"),
|
||||||
&SystemClauseType::CopyTermWithoutAttrVars => {
|
&SystemClauseType::CopyTermWithoutAttrVars => {
|
||||||
clause_name!("$copy_term_without_attr_vars")
|
clause_name!("$copy_term_without_attr_vars")
|
||||||
@@ -436,7 +431,6 @@ impl SystemClauseType {
|
|||||||
&SystemClauseType::DeleteAttribute => clause_name!("$del_attr_non_head"),
|
&SystemClauseType::DeleteAttribute => clause_name!("$del_attr_non_head"),
|
||||||
&SystemClauseType::DeleteHeadAttribute => clause_name!("$del_attr_head"),
|
&SystemClauseType::DeleteHeadAttribute => clause_name!("$del_attr_head"),
|
||||||
&SystemClauseType::DynamicModuleResolution(_) => clause_name!("$module_call"),
|
&SystemClauseType::DynamicModuleResolution(_) => clause_name!("$module_call"),
|
||||||
&SystemClauseType::EnqueueAttributeGoal => clause_name!("$enqueue_attribute_goal"),
|
|
||||||
&SystemClauseType::EnqueueAttributedVar => clause_name!("$enqueue_attr_var"),
|
&SystemClauseType::EnqueueAttributedVar => clause_name!("$enqueue_attr_var"),
|
||||||
&SystemClauseType::FetchGlobalVar => clause_name!("$fetch_global_var"),
|
&SystemClauseType::FetchGlobalVar => clause_name!("$fetch_global_var"),
|
||||||
&SystemClauseType::FirstStream => clause_name!("$first_stream"),
|
&SystemClauseType::FirstStream => clause_name!("$first_stream"),
|
||||||
@@ -627,8 +621,6 @@ impl SystemClauseType {
|
|||||||
("$char_code", 2) => Some(SystemClauseType::CharCode),
|
("$char_code", 2) => Some(SystemClauseType::CharCode),
|
||||||
("$char_type", 2) => Some(SystemClauseType::CharType),
|
("$char_type", 2) => Some(SystemClauseType::CharType),
|
||||||
("$chars_to_number", 2) => Some(SystemClauseType::CharsToNumber),
|
("$chars_to_number", 2) => Some(SystemClauseType::CharsToNumber),
|
||||||
("$clear_attribute_goals", 0) => Some(SystemClauseType::ClearAttributeGoals),
|
|
||||||
("$clone_attribute_goals", 1) => Some(SystemClauseType::CloneAttributeGoals),
|
|
||||||
("$codes_to_number", 2) => Some(SystemClauseType::CodesToNumber),
|
("$codes_to_number", 2) => Some(SystemClauseType::CodesToNumber),
|
||||||
("$copy_term_without_attr_vars", 2) => Some(SystemClauseType::CopyTermWithoutAttrVars),
|
("$copy_term_without_attr_vars", 2) => Some(SystemClauseType::CopyTermWithoutAttrVars),
|
||||||
("$create_partial_string", 3) => Some(SystemClauseType::CreatePartialString),
|
("$create_partial_string", 3) => Some(SystemClauseType::CreatePartialString),
|
||||||
@@ -648,7 +640,6 @@ impl SystemClauseType {
|
|||||||
("$lookup_db_ref", 3) => Some(SystemClauseType::LookupDBRef),
|
("$lookup_db_ref", 3) => Some(SystemClauseType::LookupDBRef),
|
||||||
("$lookup_op_db_ref", 4) => Some(SystemClauseType::LookupOpDBRef),
|
("$lookup_op_db_ref", 4) => Some(SystemClauseType::LookupOpDBRef),
|
||||||
("$module_call", _) => Some(SystemClauseType::DynamicModuleResolution(arity - 2)),
|
("$module_call", _) => Some(SystemClauseType::DynamicModuleResolution(arity - 2)),
|
||||||
("$enqueue_attribute_goal", 1) => Some(SystemClauseType::EnqueueAttributeGoal),
|
|
||||||
("$enqueue_attr_var", 1) => Some(SystemClauseType::EnqueueAttributedVar),
|
("$enqueue_attr_var", 1) => Some(SystemClauseType::EnqueueAttributedVar),
|
||||||
("$partial_string_tail", 2) => Some(SystemClauseType::PartialStringTail),
|
("$partial_string_tail", 2) => Some(SystemClauseType::PartialStringTail),
|
||||||
("$peek_byte", 2) => Some(SystemClauseType::PeekByte),
|
("$peek_byte", 2) => Some(SystemClauseType::PeekByte),
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ pub(super) type Bindings = Vec<(usize, Addr)>;
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(super) struct AttrVarInitializer {
|
pub(super) struct AttrVarInitializer {
|
||||||
pub(super) attribute_goals: Vec<Addr>,
|
|
||||||
pub(super) attr_var_queue: Vec<usize>,
|
pub(super) attr_var_queue: Vec<usize>,
|
||||||
pub(super) bindings: Bindings,
|
pub(super) bindings: Bindings,
|
||||||
pub(super) cp: LocalCodePtr,
|
pub(super) cp: LocalCodePtr,
|
||||||
@@ -22,7 +21,6 @@ pub(super) struct AttrVarInitializer {
|
|||||||
impl AttrVarInitializer {
|
impl AttrVarInitializer {
|
||||||
pub(super) fn new(verify_attrs_loc: usize) -> Self {
|
pub(super) fn new(verify_attrs_loc: usize) -> Self {
|
||||||
AttrVarInitializer {
|
AttrVarInitializer {
|
||||||
attribute_goals: vec![],
|
|
||||||
attr_var_queue: vec![],
|
attr_var_queue: vec![],
|
||||||
bindings: vec![],
|
bindings: vec![],
|
||||||
instigating_p: LocalCodePtr::default(),
|
instigating_p: LocalCodePtr::default(),
|
||||||
@@ -33,7 +31,6 @@ impl AttrVarInitializer {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(super) fn reset(&mut self) {
|
pub(super) fn reset(&mut self) {
|
||||||
self.attribute_goals.clear();
|
|
||||||
self.attr_var_queue.clear();
|
self.attr_var_queue.clear();
|
||||||
self.bindings.clear();
|
self.bindings.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,15 +5,6 @@ project_attributes(QueryVars, AttrVars) :-
|
|||||||
sort(Modules0, Modules),
|
sort(Modules0, Modules),
|
||||||
call_project_attributes(Modules, QueryVars, AttrVars).
|
call_project_attributes(Modules, QueryVars, AttrVars).
|
||||||
|
|
||||||
enqueue_goals(Goals0) :-
|
|
||||||
nonvar(Goals0),
|
|
||||||
Goals0 = [Goal | Goals],
|
|
||||||
nonvar(Goal),
|
|
||||||
!,
|
|
||||||
'$enqueue_attribute_goal'(Goal),
|
|
||||||
enqueue_goals(Goals).
|
|
||||||
enqueue_goals(_).
|
|
||||||
|
|
||||||
'$print_project_attributes_exception'(Module, E) :-
|
'$print_project_attributes_exception'(Module, E) :-
|
||||||
( ( E = error(existence_error(procedure, project_attributes/2), _)
|
( ( E = error(existence_error(procedure, project_attributes/2), _)
|
||||||
; E = error(evaluation_error((Module:project_attributes)/2), _)
|
; E = error(evaluation_error((Module:project_attributes)/2), _)
|
||||||
@@ -38,7 +29,6 @@ call_project_attributes([Module|Modules], QueryVars, AttrVars) :-
|
|||||||
call_attribute_goals([], _, _).
|
call_attribute_goals([], _, _).
|
||||||
call_attribute_goals([Module|Modules], GoalCaller, AttrVars) :-
|
call_attribute_goals([Module|Modules], GoalCaller, AttrVars) :-
|
||||||
call(GoalCaller, AttrVars, Module, Goals),
|
call(GoalCaller, AttrVars, Module, Goals),
|
||||||
enqueue_goals(Goals),
|
|
||||||
call_attribute_goals(Modules, GoalCaller, AttrVars).
|
call_attribute_goals(Modules, GoalCaller, AttrVars).
|
||||||
|
|
||||||
'$print_attribute_goals_exception'(Module, E) :-
|
'$print_attribute_goals_exception'(Module, E) :-
|
||||||
@@ -85,7 +75,6 @@ module_prefixed_goals([G|Gs], Module, [MG|MGs], TailGs) :-
|
|||||||
call_attribute_goals_with_module_prefix([], _, _, []).
|
call_attribute_goals_with_module_prefix([], _, _, []).
|
||||||
call_attribute_goals_with_module_prefix([Module | Modules], GoalCaller, AttrVars, Goals) :-
|
call_attribute_goals_with_module_prefix([Module | Modules], GoalCaller, AttrVars, Goals) :-
|
||||||
call(GoalCaller, AttrVars, Module, Goals0),
|
call(GoalCaller, AttrVars, Module, Goals0),
|
||||||
enqueue_goals(Goals0),
|
|
||||||
module_prefixed_goals(Goals0, Module, Goals, Gs),
|
module_prefixed_goals(Goals0, Module, Goals, Gs),
|
||||||
call_attribute_goals_with_module_prefix(Modules, GoalCaller, AttrVars, Gs).
|
call_attribute_goals_with_module_prefix(Modules, GoalCaller, AttrVars, Gs).
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ use indexmap::IndexSet;
|
|||||||
|
|
||||||
use ref_thread_local::RefThreadLocal;
|
use ref_thread_local::RefThreadLocal;
|
||||||
|
|
||||||
use std::cmp;
|
|
||||||
use std::collections::BTreeSet;
|
use std::collections::BTreeSet;
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::env;
|
use std::env;
|
||||||
@@ -657,20 +656,6 @@ impl MachineState {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fetch_attribute_goals(&mut self, mut attr_goals: Vec<Addr>) {
|
|
||||||
attr_goals.sort_unstable_by(|a1, a2| {
|
|
||||||
self.compare_term_test(a1, a2)
|
|
||||||
.unwrap_or(cmp::Ordering::Less)
|
|
||||||
});
|
|
||||||
|
|
||||||
self.term_dedup(&mut attr_goals);
|
|
||||||
|
|
||||||
let attr_goals = Addr::HeapCell(self.heap.to_list(attr_goals.into_iter()));
|
|
||||||
let target = self[temp_v!(1)];
|
|
||||||
|
|
||||||
(self.unify_fn)(self, attr_goals, target);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn call_continuation_chunk(&mut self, chunk: Addr, return_p: LocalCodePtr) -> LocalCodePtr {
|
fn call_continuation_chunk(&mut self, chunk: Addr, return_p: LocalCodePtr) -> LocalCodePtr {
|
||||||
let chunk = self.store(self.deref(chunk));
|
let chunk = self.store(self.deref(chunk));
|
||||||
|
|
||||||
@@ -2797,10 +2782,6 @@ impl MachineState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&SystemClauseType::EnqueueAttributeGoal => {
|
|
||||||
let addr = self[temp_v!(1)];
|
|
||||||
self.attr_var_init.attribute_goals.push(addr);
|
|
||||||
}
|
|
||||||
&SystemClauseType::EnqueueAttributedVar => {
|
&SystemClauseType::EnqueueAttributedVar => {
|
||||||
let addr = self[temp_v!(1)];
|
let addr = self[temp_v!(1)];
|
||||||
|
|
||||||
@@ -2811,16 +2792,6 @@ impl MachineState {
|
|||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
&SystemClauseType::ExpandGoal => {
|
|
||||||
self.p = CodePtr::Local(LocalCodePtr::UserGoalExpansion(0));
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
&SystemClauseType::ExpandTerm => {
|
|
||||||
self.p = CodePtr::Local(LocalCodePtr::UserTermExpansion(0));
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
&SystemClauseType::GetNextDBRef => {
|
&SystemClauseType::GetNextDBRef => {
|
||||||
let a1 = self[temp_v!(1)];
|
let a1 = self[temp_v!(1)];
|
||||||
|
|
||||||
@@ -3153,13 +3124,6 @@ impl MachineState {
|
|||||||
&SystemClauseType::TruncateIfNoLiftedHeapGrowth => {
|
&SystemClauseType::TruncateIfNoLiftedHeapGrowth => {
|
||||||
self.truncate_if_no_lifted_heap_diff(|_| Addr::EmptyList)
|
self.truncate_if_no_lifted_heap_diff(|_| Addr::EmptyList)
|
||||||
}
|
}
|
||||||
&SystemClauseType::ClearAttributeGoals => {
|
|
||||||
self.attr_var_init.attribute_goals.clear();
|
|
||||||
}
|
|
||||||
&SystemClauseType::CloneAttributeGoals => {
|
|
||||||
let attr_goals = self.attr_var_init.attribute_goals.clone();
|
|
||||||
self.fetch_attribute_goals(attr_goals);
|
|
||||||
}
|
|
||||||
&SystemClauseType::GetAttributedVariableList => {
|
&SystemClauseType::GetAttributedVariableList => {
|
||||||
let attr_var = self.store(self.deref(self[temp_v!(1)]));
|
let attr_var = self.store(self.deref(self[temp_v!(1)]));
|
||||||
let attr_var_list = match attr_var {
|
let attr_var_list = match attr_var {
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ submit_query_and_print_results_(Term, VarList) :-
|
|||||||
submit_query_and_print_results_(_, _) :-
|
submit_query_and_print_results_(_, _) :-
|
||||||
% clear attribute goal lists, which may be populated by
|
% clear attribute goal lists, which may be populated by
|
||||||
% copy_term/3 prior to failure.
|
% copy_term/3 prior to failure.
|
||||||
'$clear_attribute_goals',
|
|
||||||
write('false.'),
|
write('false.'),
|
||||||
nl.
|
nl.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user