pub struct BTSet<T: Clone + Eq + PartialEq + Ord + PartialOrd> { /* private fields */ }Expand description
Une abstraction d’un HashSet realiser avec un BTreeSet
Implementations§
Source§impl<T: Clone + Eq + PartialEq + Ord + PartialOrd + Hash> BTSet<T>
impl<T: Clone + Eq + PartialEq + Ord + PartialOrd + Hash> BTSet<T>
pub fn new() -> Self
pub fn from_vect(&self, v: Vec<T>) -> BTSet<T>
pub fn get(&self) -> &BTreeSet<T>
pub fn insert(&mut self, value: T) -> bool
pub fn contains(&self, value: &T) -> bool
pub fn is_empty(&self) -> bool
pub fn difference<'a>(&self, other: BTSet<T>) -> BTSet<T>
pub fn len(&self) -> usize
pub fn insert_all(&mut self, new: BTSet<T>) -> bool
Trait Implementations§
Source§impl AutomateTrait<BTSet<State>> for NDFA
impl AutomateTrait<BTSet<State>> for NDFA
Source§fn get_starts(&self) -> &BTSet<State>
fn get_starts(&self) -> &BTSet<State>
Retourne les états de départ de l’automate
Source§fn get_delta(&self) -> &HashMap<Transition<State>, BTSet<State>>
fn get_delta(&self) -> &HashMap<Transition<State>, BTSet<State>>
Retourne les transitions de l’automate
Source§fn get_states(&self) -> &BTSet<State>
fn get_states(&self) -> &BTSet<State>
Retournes les differents états de l’automate
Source§fn get_alphabet(&self) -> &BTSet<Symbol>
fn get_alphabet(&self) -> &BTSet<Symbol>
Retourne l’alphabet de l’automate
Source§fn accept(&self, _word: &str) -> bool
fn accept(&self, _word: &str) -> bool
indique si un mot est accepté dans la langue de l’automate
Source§fn to_dfa(&self) -> DFA
fn to_dfa(&self) -> DFA
Convertit le NFA en DFA
use automaters::*;
use std::fs;
use serde_json::{Value, from_str};
fn main() {
let link_file: &str = "src/automates/NFA1.json";
let content_json: Value = {
// Charge le contenu du fichier en tant que String
let content : String = fs::read_to_string(link_file).unwrap();
// Parse le texte en structure Json
from_str::<Value>(&content).unwrap()
};
//creation depuis un lien
let nfa : NDFA = NDFA::from_json_file(link_file);
dbg!(nfa.to_dfa());
}§Return
NDFA- L’automate déterministe à état fini qui correspondante
Source§impl AutomateTrait<BTSet<State>> for NDFAEpsilon
impl AutomateTrait<BTSet<State>> for NDFAEpsilon
Source§fn get_starts(&self) -> &BTSet<State>
fn get_starts(&self) -> &BTSet<State>
Retourne les états de départ de l’automate
Source§fn get_delta(&self) -> &HashMap<Transition<State>, BTSet<State>>
fn get_delta(&self) -> &HashMap<Transition<State>, BTSet<State>>
Retourne les transitions de l’automate
Source§fn get_states(&self) -> &BTSet<State>
fn get_states(&self) -> &BTSet<State>
Retournes les differents états de l’automate
Source§fn get_alphabet(&self) -> &BTSet<Symbol>
fn get_alphabet(&self) -> &BTSet<Symbol>
Retourne l’alphabet de l’automate
Source§fn accept(&self, _word: &str) -> bool
fn accept(&self, _word: &str) -> bool
indique si un mot est accepté dans la langue de l’automate
Source§fn to_dfa(&self) -> DFA
fn to_dfa(&self) -> DFA
Convertit le NFA en DFA
use automaters::*;
use std::fs;
use serde_json::{Value, from_str};
fn main() {
let link_file: &str = "src/automates/NFA1.json";
let content_json: Value = {
// Charge le contenu du fichier en tant que String
let content : String = fs::read_to_string(link_file).unwrap();
// Parse le texte en structure Json
from_str::<Value>(&content).unwrap()
};
//creation depuis un lien
let nfa : NDFA = NDFA::from_json_file(link_file);
dbg!(nfa.to_dfa());
}§Return
NDFA- L’automate déterministe à état fini qui correspondante
Source§impl<T: Ord + Clone + Eq + PartialEq + Ord + PartialOrd> Ord for BTSet<T>
impl<T: Ord + Clone + Eq + PartialEq + Ord + PartialOrd> Ord for BTSet<T>
Source§impl<T: PartialOrd + Clone + Eq + PartialEq + Ord + PartialOrd> PartialOrd for BTSet<T>
impl<T: PartialOrd + Clone + Eq + PartialEq + Ord + PartialOrd> PartialOrd for BTSet<T>
impl<T: Eq + Clone + Eq + PartialEq + Ord + PartialOrd> Eq for BTSet<T>
impl<T: Clone + Eq + PartialEq + Ord + PartialOrd> StructuralPartialEq for BTSet<T>
Auto Trait Implementations§
impl<T> Freeze for BTSet<T>
impl<T> RefUnwindSafe for BTSet<T>where
T: RefUnwindSafe,
impl<T> Send for BTSet<T>where
T: Send,
impl<T> Sync for BTSet<T>where
T: Sync,
impl<T> Unpin for BTSet<T>
impl<T> UnwindSafe for BTSet<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more