fn dload(&mut self, asm: &str) {
    let s = read_to_string(asm).unwrap();

    let wsss = plscan::to_sentences(&s);
//    dbg!(wsss.clone());

    for wss in wsss.iter() {
      let mut refs = TRefs::new();
      let mut cs = IntS::new();
      let mut gs = IntS::new();
      let rss = map_expand(wss);

      let mut k = 0;
      for ws in rss {
        let l = ws.len() as Int;
        gs.push(tag(R, k));
        k += 1;
        cs.push(tag(A, l));
        for w_ in ws {
          let mut w = w_;
          if 1 == w.len() {
            w = format!("c:{}", w)
          }
          let ll = sub_str(&w, 2, None);
          match w.chars().take(1).next() {
            Some('c') => {
              cs.push(self.encode(C, ll));
              k += 1;
            }
            Some('n') => {
              cs.push(self.encode(N, ll));
              k += 1;
            }
            Some('v') => {
              refs.at(ll).push(k as usize);
              cs.push(tag(BAD, k));
              k += 1;
            }
            Some('h') => {
              refs.at(ll).push((k - 1) as usize);
              cs[(k - 1) as usize] = tag(A, l - 1);
              gs.pop();
            }
            _ => {
              panic!("FORGOTTEN={}", w)
            }
          }
        }
      }

      for (_, xis) in &refs {
        let mut leader: Int = -1;
        for j in xis {
          if A == tag_of(cs[*j]) {
            leader = *j as Int;
            break;
          }
        }
        if -1 == leader {
          leader = xis[0] as Int;
          for i in xis {
            if *i == leader as usize {
              cs[*i] = tag(V, *i as Int)
            } else {
              cs[*i] = tag(U, leader)
            }
          }
        } else {
          for i in xis {
            if *i as Int == leader {
              continue;
            }
            cs[*i] = tag(R, leader)
          }
        }
      }

      let neck = if 1 == gs.len() {
        cs.len() as Int
      } else {
        detag(gs[1])
      };
      let mut tgs = gs.clone();
      let clause = self.put_clause(cs, &mut tgs, neck);
      self.clauses.push(clause);
    }
  }
/**
  * loads a program from a .nl file of
  * "natural language" equivalents of Prolog/HiLog statements
  */
loads a program from a .nl file of
"natural language" equivalents of Prolog/HiLog statements
loads a program from a . nl file of " natural language " equivalents of Prolog / HiLog statements
fn dload(&mut self, asm: &str) {
    let s = read_to_string(asm).unwrap();
    let wsss = plscan::to_sentences(&s);
//    dbg!(wsss.clone());
    for wss in wsss.iter() {
      let mut refs = TRefs::new();
      let mut cs = IntS::new();
      let mut gs = IntS::new();
      let rss = map_expand(wss);
      let mut k = 0;
      for ws in rss {
        let l = ws.len() as Int;
        gs.push(tag(R, k));
        k += 1;
        cs.push(tag(A, l));
        for w_ in ws {
          let mut w = w_;
          if 1 == w.len() {
            w = format!("c:{}", w)
          }
          let ll = sub_str(&w, 2, None);
          match w.chars().take(1).next() {
            Some('c') => {
              cs.push(self.encode(C, ll));
              k += 1;
            }
            Some('n') => {
              cs.push(self.encode(N, ll));
              k += 1;
            }
            Some('v') => {
              refs.at(ll).push(k as usize);
              cs.push(tag(BAD, k));
              k += 1;
            }
            Some('h') => {
              refs.at(ll).push((k - 1) as usize);
              cs[(k - 1) as usize] = tag(A, l - 1);
              gs.pop();
            }
            _ => {
              panic!("FORGOTTEN={}", w)
            }
          }
        }
      }
      for (_, xis) in &refs {
        let mut leader: Int = -1;
        for j in xis {
          if A == tag_of(cs[*j]) {
            leader = *j as Int;
            break;
          }
        }
        if -1 == leader {
          leader = xis[0] as Int;
          for i in xis {
            if *i == leader as usize {
              cs[*i] = tag(V, *i as Int)
            } else {
              cs[*i] = tag(U, leader)
            }
          }
        } else {
          for i in xis {
            if *i as Int == leader {
              continue;
            }
            cs[*i] = tag(R, leader)
          }
        }
      }
      let neck = if 1 == gs.len() {
        cs.len() as Int
      } else {
        detag(gs[1])
      };
      let mut tgs = gs.clone();
      let clause = self.put_clause(cs, &mut tgs, neck);
      self.clauses.push(clause);
    }
  }
fn dload ( & mut self , asm : & str ) { let s = read_to_string ( asm ) . unwrap ( ) ; let wsss = plscan :: to_sentences ( & s ) ; //    dbg!(wsss.clone());
 for wss in wsss . iter ( ) { let mut refs = TRefs :: new ( ) ; let mut cs = IntS :: new ( ) ; let mut gs = IntS :: new ( ) ; let rss = map_expand ( wss ) ; let mut k = 0 ; for ws in rss { let l = ws . len ( ) as Int ; gs . push ( tag ( R , k ) ) ; k += 1 ; cs . push ( tag ( A , l ) ) ; for w_ in ws { let mut w = w_ ; if 1 == w . len ( ) { w = format ! ( " " w ) } let ll = sub_str ( & w , 2 , None ) ; match w . chars ( ) . take ( 1 ) . next ( ) { Some ( 'c' ) => { cs . push ( self . encode ( C , ll ) ) ; k += 1 ; } Some ( 'n' ) => { cs . push ( self . encode ( N , ll ) ) ; k += 1 ; } Some ( 'v' ) => { refs . at ( ll ) . push ( k as usize ) ; cs . push ( tag ( BAD , k ) ) ; k += 1 ; } Some ( 'h' ) => { refs . at ( ll ) . push ( ( k - 1 ) as usize ) ; cs [ ( k - 1 ) as usize ] = tag ( A , l - 1 ) ; gs . pop ( ) ; } _ => { panic ! ( " " w ) } } } } for ( _ , xis ) in & refs { let mut leader : Int = - 1 ; for j in xis { if A == tag_of ( cs [ * j ] ) { leader = * j as Int ; break ; } } if - 1 == leader { leader = xis [ 0 ] as Int ; for i in xis { if * i == leader as usize { cs [ * i ] = tag ( V , * i as Int ) } else { cs [ * i ] = tag ( U , leader ) } } } else { for i in xis { if * i as Int == leader { continue ; } cs [ * i ] = tag ( R , leader ) } } } let neck = if 1 == gs . len ( ) { cs . len ( ) as Int } else { detag ( gs [ 1 ] ) } ; let mut tgs = gs . clone ( ) ; let clause = self . put_clause ( cs , & mut tgs , neck ) ; self . clauses . push ( clause ) ; } }
loads a program from a .nl file of
 "natural language" equivalents of Prolog/HiLog statements
loads a program from a . nl file of " natural language " equivalents of Prolog / HiLog statements
&mut self
asm
&str
&mut self
asm
&str