From: Mark Thom Date: Thu, 1 Sep 2022 23:03:00 +0000 (-0600) Subject: begin adapting the techniques of "Compiling Large Disjunctions" X-Git-Tag: v0.9.2~123^2~39 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=46317c3a39a381af89ae3906637244212d800272;p=scryer-prolog.git begin adapting the techniques of "Compiling Large Disjunctions" --- diff --git a/src/iterators.rs b/src/iterators.rs index 62054b04..de091d4a 100644 --- a/src/iterators.rs +++ b/src/iterators.rs @@ -530,3 +530,38 @@ impl<'a> Iterator for ChunkedIterator<'a> { self.iter.next().map(|term| self.take_chunk(term)) } } + +/* +================================================================================ + +This is a disjunction compilation experiment attempting to +adapt the paper "Compiling Large Disjunctions" to Scryer Prolog. + +================================================================================ +*/ + +enum VarInfo { + Perm, + Temp, + Void +} + +pub struct ChunkInfo { + chunk_num: usize, + vars: Vec<(Rc, VarInfo)>, +} + +pub struct BranchInfo { + branch_num: usize, // TODO: Rational?? or own type? + delta: usize, // TODO: Rational?? + chunks: Vec, +} + +pub struct ControlIterator<'a> { + current_branch_num: usize, // TODO: same as above + state_stack: Vec>, + branch_map: IndexMap, Vec>, +} + +impl ControlIterator { +}