summaryrefslogtreecommitdiff
path: root/morphology
diff options
context:
space:
mode:
Diffstat (limited to 'morphology')
-rw-r--r--morphology/Cargo.toml4
-rw-r--r--morphology/examples/demo.rs8
-rw-r--r--morphology/examples/demo_full.rs10
-rw-r--r--morphology/examples/pretty_print_demo.rs2
-rw-r--r--morphology/examples/test_all_sorting_options.rs4
-rw-r--r--morphology/examples/test_length_sorting.rs4
-rw-r--r--morphology/examples/test_sorting_directions.rs4
-rw-r--r--morphology/examples/test_sorting_methods.rs4
-rw-r--r--morphology/src/lib.rs5
-rw-r--r--morphology/src/sequence.rs30
-rw-r--r--morphology/src/set.rs18
-rw-r--r--morphology/src/value.rs14
-rw-r--r--morphology/tests/sequence.rs4
-rw-r--r--morphology/tests/set.rs6
-rw-r--r--morphology/tests/value.rs4
15 files changed, 61 insertions, 60 deletions
diff --git a/morphology/Cargo.toml b/morphology/Cargo.toml
index efe01af..c16cbd5 100644
--- a/morphology/Cargo.toml
+++ b/morphology/Cargo.toml
@@ -1,11 +1,11 @@
[package]
-name = "meta_affine"
+name = "morphology"
version.workspace = true
edition.workspace = true
authors.workspace = true
[lib]
-name = "meta_affine"
+name = "morphology"
path = "src/lib.rs"
[dependencies]
diff --git a/morphology/examples/demo.rs b/morphology/examples/demo.rs
index bdaddf4..5dad367 100644
--- a/morphology/examples/demo.rs
+++ b/morphology/examples/demo.rs
@@ -4,11 +4,11 @@
//! rustc examples/demo.rs -L . --extern meta_affine=libmeta_affine.rlib -o demo
//! ./demo
-extern crate meta_affine;
+extern crate morphology;
-use meta_affine::{Value, ValidSet};
-use meta_affine::value::get_minimum_derivation_path;
-use meta_affine::set::generate_valid_sets;
+use morphology::{Value, ValidSet};
+use morphology::value::get_minimum_derivation_path;
+use morphology::set::generate_valid_sets;
fn main() {
println!("\n{}", "=".repeat(70));
diff --git a/morphology/examples/demo_full.rs b/morphology/examples/demo_full.rs
index aaebef1..01c71f6 100644
--- a/morphology/examples/demo_full.rs
+++ b/morphology/examples/demo_full.rs
@@ -4,11 +4,11 @@
//! rustc examples/demo_full.rs -L . --extern meta_affine=libmeta_affine.rlib -o demo_full
//! ./demo_full
-extern crate meta_affine;
+extern crate morphology;
-use meta_affine::{Value, ValidSet};
-use meta_affine::value::get_minimum_derivation_path;
-use meta_affine::set::generate_valid_sets;
+use morphology::{Value, ValidSet};
+use morphology::value::get_minimum_derivation_path;
+use morphology::set::generate_valid_sets;
fn main() {
println!("\n{}", "=".repeat(70));
@@ -162,7 +162,7 @@ fn main() {
println!("{}", "=".repeat(70));
println!("CONSTRAINT VALIDATION DEMONSTRATION\n");
- use meta_affine::sequence::*;
+ use morphology::sequence::*;
println!("8. Constraint checking examples:");
diff --git a/morphology/examples/pretty_print_demo.rs b/morphology/examples/pretty_print_demo.rs
index 2760962..a25896f 100644
--- a/morphology/examples/pretty_print_demo.rs
+++ b/morphology/examples/pretty_print_demo.rs
@@ -3,7 +3,7 @@
//! Compile and run:
//! cargo run --example pretty_print_demo
-use meta_affine::Value;
+use morphology::Value;
fn main() {
println!("Pretty Print Demonstration\n");
diff --git a/morphology/examples/test_all_sorting_options.rs b/morphology/examples/test_all_sorting_options.rs
index e5e796f..98f454c 100644
--- a/morphology/examples/test_all_sorting_options.rs
+++ b/morphology/examples/test_all_sorting_options.rs
@@ -1,7 +1,7 @@
// Test program demonstrating all sorting options working together
-use meta_affine::{Sequence, Value};
-use meta_affine::sequence::{
+use morphology::{Sequence, Value};
+use morphology::sequence::{
sort_sequences, SequenceOptions,
PrecedenceOrder, SortingMethod, SortingDirection, LengthSorting
};
diff --git a/morphology/examples/test_length_sorting.rs b/morphology/examples/test_length_sorting.rs
index 1dff8f5..5d258cf 100644
--- a/morphology/examples/test_length_sorting.rs
+++ b/morphology/examples/test_length_sorting.rs
@@ -1,7 +1,7 @@
// Test program to demonstrate InterpolateLength vs SegregateLength sorting
-use meta_affine::{Sequence, Value};
-use meta_affine::sequence::{sort_sequences, SequenceOptions, LengthSorting, SortingMethod};
+use morphology::{Sequence, Value};
+use morphology::sequence::{sort_sequences, SequenceOptions, LengthSorting, SortingMethod};
fn print_sequences(label: &str, sequences: &[Sequence]) {
println!("\n{}:", label);
diff --git a/morphology/examples/test_sorting_directions.rs b/morphology/examples/test_sorting_directions.rs
index 30ea280..c348e80 100644
--- a/morphology/examples/test_sorting_directions.rs
+++ b/morphology/examples/test_sorting_directions.rs
@@ -1,7 +1,7 @@
// Test program to demonstrate Forward vs Backward sorting directions
-use meta_affine::{Sequence, Value};
-use meta_affine::sequence::{sort_sequences, SequenceOptions, SortingMethod, SortingDirection};
+use morphology::{Sequence, Value};
+use morphology::sequence::{sort_sequences, SequenceOptions, SortingMethod, SortingDirection};
fn print_sequences(label: &str, sequences: &[Sequence]) {
println!("\n{}:", label);
diff --git a/morphology/examples/test_sorting_methods.rs b/morphology/examples/test_sorting_methods.rs
index b4ad18f..2e1b4f3 100644
--- a/morphology/examples/test_sorting_methods.rs
+++ b/morphology/examples/test_sorting_methods.rs
@@ -1,7 +1,7 @@
// Test program to demonstrate DepthFirst vs BreadthFirst sorting
-use meta_affine::{Sequence, Value};
-use meta_affine::sequence::{sort_sequences, SequenceOptions, SortingMethod};
+use morphology::{Sequence, Value};
+use morphology::sequence::{sort_sequences, SequenceOptions, SortingMethod};
fn print_sequences(label: &str, sequences: &[Sequence]) {
println!("\n{}:", label);
diff --git a/morphology/src/lib.rs b/morphology/src/lib.rs
index de33f70..bfc40f1 100644
--- a/morphology/src/lib.rs
+++ b/morphology/src/lib.rs
@@ -1,6 +1,7 @@
-//! Meta-Affine Sequence Generator
+//! Morphology: Meta-Affine Sequence Generator
//!
-//! A library for generating and validating meta-affine sequences.
+//! A library for generating and validating meta-affine sequences and other
+//! mathematically defined structures.
//!
//! A meta-affine space consists of 2-tuple values (outer, inner) derived from (0,0)
//! using five derivation rules. Valid sets are downward-closed subsets, and valid
diff --git a/morphology/src/sequence.rs b/morphology/src/sequence.rs
index 8f15c7c..88c5942 100644
--- a/morphology/src/sequence.rs
+++ b/morphology/src/sequence.rs
@@ -28,7 +28,7 @@ impl Sequence {
/// # Examples
///
/// ```
- /// use meta_affine::{Sequence, Value};
+ /// use morphology::{Sequence, Value};
///
/// let seq = Sequence::new(vec![Value::new(0,0), Value::new(1,0), Value::new(0,0)]);
/// assert_eq!(seq.length(), 3);
@@ -52,7 +52,7 @@ impl Sequence {
/// # Examples
///
/// ```
- /// use meta_affine::{Sequence, ValidSet, Value};
+ /// use morphology::{Sequence, ValidSet, Value};
///
/// let set = ValidSet::origin_set();
/// let seq = Sequence::new(vec![Value::origin()]);
@@ -76,8 +76,8 @@ impl Sequence {
/// # Examples
///
/// ```
-/// use meta_affine::{Sequence, ValidSet, Value};
-/// use meta_affine::sequence::check_coverage;
+/// use morphology::{Sequence, ValidSet, Value};
+/// use morphology::sequence::check_coverage;
///
/// let set = ValidSet::origin_set();
/// let seq = Sequence::new(vec![Value::origin()]);
@@ -100,8 +100,8 @@ pub fn check_coverage(sequence: &Sequence, set: &ValidSet) -> bool {
/// # Examples
///
/// ```
-/// use meta_affine::{Sequence, Value};
-/// use meta_affine::sequence::check_no_consecutive_duplicates;
+/// use morphology::{Sequence, Value};
+/// use morphology::sequence::check_no_consecutive_duplicates;
///
/// let seq1 = Sequence::new(vec![Value::new(0,0), Value::new(1,0), Value::new(0,0)]);
/// assert!(check_no_consecutive_duplicates(&seq1));
@@ -124,8 +124,8 @@ pub fn check_no_consecutive_duplicates(sequence: &Sequence) -> bool {
/// # Examples
///
/// ```
-/// use meta_affine::{Sequence, Value};
-/// use meta_affine::sequence::check_terminal;
+/// use morphology::{Sequence, Value};
+/// use morphology::sequence::check_terminal;
///
/// let seq1 = Sequence::new(vec![Value::new(1,0), Value::origin()]);
/// assert!(check_terminal(&seq1));
@@ -147,8 +147,8 @@ pub fn check_terminal(sequence: &Sequence) -> bool {
/// # Examples
///
/// ```
-/// use meta_affine::{Sequence, Value};
-/// use meta_affine::sequence::check_outer_value_constraint;
+/// use morphology::{Sequence, Value};
+/// use morphology::sequence::check_outer_value_constraint;
///
/// // Last occurrence of outer=1 is (1,0) ✓
/// let seq1 = Sequence::new(vec![Value::new(1,1), Value::new(1,0), Value::new(0,0)]);
@@ -193,8 +193,8 @@ pub fn check_outer_value_constraint(sequence: &Sequence) -> bool {
/// # Examples
///
/// ```
-/// use meta_affine::{ValidSet, Value};
-/// use meta_affine::sequence::generate_sequences;
+/// use morphology::{ValidSet, Value};
+/// use morphology::sequence::generate_sequences;
///
/// let set = ValidSet::origin_set();
/// let sequences = generate_sequences(&set, 1);
@@ -385,7 +385,7 @@ fn is_outer_constraint_satisfiable(current: &[Value]) -> bool {
/// # Examples
///
/// ```
-/// use meta_affine::sequence::{generate_all_sequences, SequenceOptions, PrecedenceOrder};
+/// use morphology::sequence::{generate_all_sequences, SequenceOptions, PrecedenceOrder};
///
/// // Use defaults
/// let sequences = generate_all_sequences(1, None);
@@ -481,7 +481,7 @@ pub enum LengthSorting {
/// # Examples
///
/// ```
-/// use meta_affine::sequence::{SequenceOptions, PrecedenceOrder};
+/// use morphology::sequence::{SequenceOptions, PrecedenceOrder};
///
/// // All defaults
/// let opts = SequenceOptions::new();
@@ -579,7 +579,7 @@ impl SequenceOptions {
/// # Examples
///
/// ```
-/// use meta_affine::{Sequence, Value, sequence::{sort_sequences, SequenceOptions, PrecedenceOrder}};
+/// use morphology::{Sequence, Value, sequence::{sort_sequences, SequenceOptions, PrecedenceOrder}};
///
/// let mut sequences = vec![
/// Sequence::new(vec![Value::new(1, 0), Value::new(0, 0)]),
diff --git a/morphology/src/set.rs b/morphology/src/set.rs
index cb0d015..06e73b3 100644
--- a/morphology/src/set.rs
+++ b/morphology/src/set.rs
@@ -47,7 +47,7 @@ impl ValidSet {
/// # Examples
///
/// ```
- /// use meta_affine::ValidSet;
+ /// use morphology::ValidSet;
/// let set = ValidSet::new();
/// assert_eq!(set.size(), 0);
/// ```
@@ -64,7 +64,7 @@ impl ValidSet {
/// # Examples
///
/// ```
- /// use meta_affine::{ValidSet, Value};
+ /// use morphology::{ValidSet, Value};
/// let set = ValidSet::origin_set();
/// assert_eq!(set.size(), 1);
/// assert!(set.contains(&Value::origin()));
@@ -83,7 +83,7 @@ impl ValidSet {
/// # Examples
///
/// ```
- /// use meta_affine::{ValidSet, Value};
+ /// use morphology::{ValidSet, Value};
/// use std::collections::HashSet;
///
/// let mut values = HashSet::new();
@@ -115,7 +115,7 @@ impl ValidSet {
/// # Examples
///
/// ```
- /// use meta_affine::{ValidSet, Value};
+ /// use morphology::{ValidSet, Value};
///
/// let set = ValidSet::origin_set();
/// let set2 = set.add_value(Value::new(1, 0)).unwrap();
@@ -135,7 +135,7 @@ impl ValidSet {
/// # Examples
///
/// ```
- /// use meta_affine::{ValidSet, Value};
+ /// use morphology::{ValidSet, Value};
///
/// let set = ValidSet::new();
/// let set2 = set.add_value_with_dependencies(Value::new(2, 3));
@@ -159,7 +159,7 @@ impl ValidSet {
/// # Examples
///
/// ```
- /// use meta_affine::{ValidSet, Value};
+ /// use morphology::{ValidSet, Value};
/// use std::collections::HashSet;
///
/// let mut values = HashSet::new();
@@ -192,7 +192,7 @@ impl ValidSet {
/// # Examples
///
/// ```
- /// use meta_affine::{ValidSet, Value};
+ /// use morphology::{ValidSet, Value};
///
/// let set = ValidSet::origin_set();
/// assert!(set.contains(&Value::origin()));
@@ -207,7 +207,7 @@ impl ValidSet {
/// # Examples
///
/// ```
- /// use meta_affine::ValidSet;
+ /// use morphology::ValidSet;
///
/// let set = ValidSet::origin_set();
/// assert_eq!(set.size(), 1);
@@ -255,7 +255,7 @@ impl Default for ValidSet {
/// # Examples
///
/// ```
-/// use meta_affine::set::generate_valid_sets;
+/// use morphology::set::generate_valid_sets;
///
/// let sets = generate_valid_sets(3);
/// // Will include sets like {(0,0)}, {(0,0), (1,0)}, {(0,0), (0,1)}, etc.
diff --git a/morphology/src/value.rs b/morphology/src/value.rs
index 51e9e40..e3348fb 100644
--- a/morphology/src/value.rs
+++ b/morphology/src/value.rs
@@ -29,7 +29,7 @@ impl Value {
/// # Examples
///
/// ```
- /// use meta_affine::Value;
+ /// use morphology::Value;
/// let v = Value::new(2, 3);
/// assert_eq!(v.outer, 2);
/// assert_eq!(v.inner, 3);
@@ -43,7 +43,7 @@ impl Value {
/// # Examples
///
/// ```
- /// use meta_affine::Value;
+ /// use morphology::Value;
/// let origin = Value::origin();
/// assert_eq!(origin, Value::new(0, 0));
/// ```
@@ -56,7 +56,7 @@ impl Value {
/// # Examples
///
/// ```
- /// use meta_affine::Value;
+ /// use morphology::Value;
/// assert!(Value::new(0, 0).is_origin());
/// assert!(!Value::new(1, 0).is_origin());
/// ```
@@ -79,7 +79,7 @@ impl Value {
/// # Examples
///
/// ```
- /// use meta_affine::Value;
+ /// use morphology::Value;
/// assert_eq!(Value::new(0, 0).pretty_print(), "0");
/// assert_eq!(Value::new(0, 1).pretty_print(), "1");
/// assert_eq!(Value::new(1, 0).pretty_print(), "(0)");
@@ -113,7 +113,7 @@ impl fmt::Display for Value {
/// # Examples
///
/// ```
- /// use meta_affine::Value;
+ /// use morphology::Value;
/// let v = Value::new(2, -3);
/// assert_eq!(format!("{}", v), "(2,-3)");
/// ```
@@ -132,7 +132,7 @@ impl fmt::Display for Value {
/// # Examples
///
/// ```
-/// use meta_affine::{Value, get_minimum_derivation_path};
+/// use morphology::{Value, get_minimum_derivation_path};
/// let path = get_minimum_derivation_path(Value::new(2, 3));
/// assert_eq!(path.len(), 6);
/// assert_eq!(path[0], Value::new(0, 0));
@@ -198,7 +198,7 @@ fn generate_inner_path(m: i32, n: i32) -> Vec<Value> {
/// # Examples
///
/// ```
-/// use meta_affine::{Value, path_length};
+/// use morphology::{Value, path_length};
/// assert_eq!(path_length(Value::new(2, 3)), 6);
/// assert_eq!(path_length(Value::new(-2, -3)), 6);
/// ```
diff --git a/morphology/tests/sequence.rs b/morphology/tests/sequence.rs
index 4b52c57..a4fe6f7 100644
--- a/morphology/tests/sequence.rs
+++ b/morphology/tests/sequence.rs
@@ -2,8 +2,8 @@
use std::collections::HashSet;
-use meta_affine::{Sequence, ValidSet, Value};
-use meta_affine::sequence::*;
+use morphology::{Sequence, ValidSet, Value};
+use morphology::sequence::*;
// ========================================================================
// SEQUENCE CREATION TESTS
diff --git a/morphology/tests/set.rs b/morphology/tests/set.rs
index 54b441a..b2e41de 100644
--- a/morphology/tests/set.rs
+++ b/morphology/tests/set.rs
@@ -2,8 +2,8 @@
use std::collections::HashSet;
-use meta_affine::{ValidSet, Value};
-use meta_affine::set::*;
+use morphology::{ValidSet, Value};
+use morphology::set::*;
// ========================================================================
// VALID SET CREATION TESTS
@@ -342,7 +342,7 @@ fn test_downward_closure_property() {
for set in &sets {
for &value in set.values() {
- let path = meta_affine::value::get_minimum_derivation_path(value);
+ let path = morphology::value::get_minimum_derivation_path(value);
for dep in path {
assert!(
set.contains(&dep),
diff --git a/morphology/tests/value.rs b/morphology/tests/value.rs
index 10c21c5..01c9d40 100644
--- a/morphology/tests/value.rs
+++ b/morphology/tests/value.rs
@@ -3,8 +3,8 @@
use std::collections::HashSet;
// Import from the library crate
-use meta_affine::value::*;
-use meta_affine::Value;
+use morphology::value::*;
+use morphology::Value;
// ========================================================================
// VALUE TESTS