Skip to content

Commit

Permalink
latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
uberFoo committed Nov 28, 2023
1 parent 1f96dab commit f6362f8
Show file tree
Hide file tree
Showing 121 changed files with 18,382 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pretty_env_logger = "0.5.0"
[features]
default = ["lu-dog-vec"]
lu-dog-vec = []
lu-dog-vec-tracy = []
lu-dog-rwlock-vec = []
lu-dog-ndrwlock-vec = []
lu-dog-rc = []
Expand Down
2 changes: 1 addition & 1 deletion models/lu_dog.json

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions sarzak.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,29 @@ persist_timestamps = false
uber_store = "Single"
target = "domain"

#
# Lu Dog Vec Tracy
#
[modules."v2/lu_dog_vec_tracy"]
model = "models/lu_dog.json"

[[modules."v2/lu_dog_vec_tracy".compiler]]
always_process = true
compiler = "grace"
derive = ["Clone", "Debug", "Deserialize", "Serialize"]
imported_domains = ["crate/v2/sarzak"]
use_paths = ["serde::{Deserialize, Serialize}"]
tracy = true

[modules."v2/lu_dog_vec_tracy".compiler.target]
optimization_level = "Vec"
is_meta_model = true
is_sarzak = false
persist = true
persist_timestamps = false
uber_store = "Single"
target = "domain"

#
# Lu Dog RwLock Vec
#
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ cfg_if::cfg_if! {
pub use v2::lu_dog;
} else if #[cfg(feature = "lu-dog-vec")] {
pub use v2::lu_dog_vec as lu_dog;
} else if #[cfg(feature = "lu-dog-vec-tracy")] {
pub use v2::lu_dog_vec_tracy as lu_dog;
} else if #[cfg(feature = "lu-dog-async-vec")] {
pub use v2::lu_dog_async as lu_dog;
} else if #[cfg(feature = "lu-dog-rwlock-vec")] {
Expand Down
1 change: 1 addition & 0 deletions src/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod lu_dog_ndrwlock_vec;
pub mod lu_dog_rwlock;
pub mod lu_dog_rwlock_vec;
pub mod lu_dog_vec;
pub mod lu_dog_vec_tracy;
pub mod merlin;
pub mod sarzak;
pub mod woog;
21 changes: 20 additions & 1 deletion src/v2/lu_dog_ndrwlock_vec/types/lambda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pub struct Lambda {
pub id: usize,
/// R73: [`Lambda`] 'contains a' [`Body`]
pub body: Option<usize>,
/// R103: [`Lambda`] 'may have a' [`LambdaParameter`]
pub first_param: Option<usize>,
/// R74: [`Lambda`] 'has a' [`ValueType`]
pub return_type: usize,
}
Expand All @@ -40,13 +42,16 @@ impl Lambda {
/// Inter a new 'Lambda' in the store, and return it's `id`.
pub fn new(
body: Option<&Arc<RwLock<Body>>>,
first_param: Option<&Arc<RwLock<LambdaParameter>>>,
return_type: &Arc<RwLock<ValueType>>,
store: &mut LuDogNdrwlockVecStore,
) -> Arc<RwLock<Lambda>> {
store.inter_lambda(|id| {
Arc::new(RwLock::new(Lambda {
id,
body: body.map(|body| body.read().unwrap().id),
first_param: first_param
.map(|lambda_parameter| lambda_parameter.read().unwrap().id),
return_type: return_type.read().unwrap().id,
}))
})
Expand All @@ -62,6 +67,18 @@ impl Lambda {
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda-struct-impl-nav-forward-cond-to-first_param"}}}
/// Navigate to [`LambdaParameter`] across R103(1-*c)
pub fn r103_lambda_parameter<'a>(
&'a self,
store: &'a LuDogNdrwlockVecStore,
) -> Vec<Arc<RwLock<LambdaParameter>>> {
match self.first_param {
Some(ref first_param) => vec![store.exhume_lambda_parameter(&first_param).unwrap()],
None => Vec::new(),
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda-struct-impl-nav-forward-to-return_type"}}}
/// Navigate to [`ValueType`] across R74(1-*)
pub fn r74_value_type<'a>(
Expand Down Expand Up @@ -124,7 +141,9 @@ impl Lambda {
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda-implementation"}}}
impl PartialEq for Lambda {
fn eq(&self, other: &Self) -> bool {
self.body == other.body && self.return_type == other.return_type
self.body == other.body
&& self.first_param == other.first_param
&& self.return_type == other.return_type
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
Expand Down
9 changes: 9 additions & 0 deletions src/v2/lu_dog_ndrwlock_vec/types/lambda_parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ impl LambdaParameter {
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda_parameter-struct-impl-nav-backward-one-to-lambda"}}}
/// Navigate to [`Lambda`] across R103(1-1)
pub fn r103_lambda<'a>(&'a self, store: &'a LuDogNdrwlockVecStore) -> Vec<Arc<RwLock<Lambda>>> {
vec![store
.iter_lambda()
.find(|lambda| lambda.read().unwrap().first_param == Some(self.id))
.unwrap()]
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda_parameter-struct-impl-nav-backward-one-bi-cond-to-lambda_parameter"}}}
/// Navigate to [`LambdaParameter`] across R75(1c-1c)
pub fn r75c_lambda_parameter<'a>(
Expand Down
2 changes: 2 additions & 0 deletions src/v2/lu_dog_ndrwlock_vec/types/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ impl Parameter {
Some(ref function) => vec![function.clone()],
None => Vec::new(),
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"parameter-struct-impl-nav-backward-one-to-lambda"}}}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"parameter-struct-impl-nav-backward-one-bi-cond-to-parameter"}}}
Expand Down
21 changes: 20 additions & 1 deletion src/v2/lu_dog_rwlock_vec/types/lambda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ pub struct Lambda {
pub id: usize,
/// R73: [`Lambda`] 'contains a' [`Body`]
pub body: Option<usize>,
/// R103: [`Lambda`] 'may have a' [`LambdaParameter`]
pub first_param: Option<usize>,
/// R74: [`Lambda`] 'has a' [`ValueType`]
pub return_type: usize,
}
Expand All @@ -42,13 +44,16 @@ impl Lambda {
/// Inter a new 'Lambda' in the store, and return it's `id`.
pub fn new(
body: Option<&Arc<RwLock<Body>>>,
first_param: Option<&Arc<RwLock<LambdaParameter>>>,
return_type: &Arc<RwLock<ValueType>>,
store: &mut LuDogRwlockVecStore,
) -> Arc<RwLock<Lambda>> {
store.inter_lambda(|id| {
Arc::new(RwLock::new(Lambda {
id,
body: body.map(|body| body.read().unwrap().id),
first_param: first_param
.map(|lambda_parameter| lambda_parameter.read().unwrap().id),
return_type: return_type.read().unwrap().id,
}))
})
Expand All @@ -66,6 +71,18 @@ impl Lambda {
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda-struct-impl-nav-forward-cond-to-first_param"}}}
/// Navigate to [`LambdaParameter`] across R103(1-*c)
pub fn r103_lambda_parameter<'a>(
&'a self,
store: &'a LuDogRwlockVecStore,
) -> Vec<Arc<RwLock<LambdaParameter>>> {
match self.first_param {
Some(ref first_param) => vec![store.exhume_lambda_parameter(&first_param).unwrap()],
None => Vec::new(),
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda-struct-impl-nav-forward-to-return_type"}}}
/// Navigate to [`ValueType`] across R74(1-*)
pub fn r74_value_type<'a>(
Expand Down Expand Up @@ -128,7 +145,9 @@ impl Lambda {
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda-implementation"}}}
impl PartialEq for Lambda {
fn eq(&self, other: &Self) -> bool {
self.body == other.body && self.return_type == other.return_type
self.body == other.body
&& self.first_param == other.first_param
&& self.return_type == other.return_type
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
Expand Down
9 changes: 9 additions & 0 deletions src/v2/lu_dog_rwlock_vec/types/lambda_parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ impl LambdaParameter {
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda_parameter-struct-impl-nav-backward-one-to-lambda"}}}
/// Navigate to [`Lambda`] across R103(1-1)
pub fn r103_lambda<'a>(&'a self, store: &'a LuDogRwlockVecStore) -> Vec<Arc<RwLock<Lambda>>> {
vec![store
.iter_lambda()
.find(|lambda| lambda.read().unwrap().first_param == Some(self.id))
.unwrap()]
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda_parameter-struct-impl-nav-backward-one-bi-cond-to-lambda_parameter"}}}
/// Navigate to [`LambdaParameter`] across R75(1c-1c)
pub fn r75c_lambda_parameter<'a>(
Expand Down
2 changes: 2 additions & 0 deletions src/v2/lu_dog_rwlock_vec/types/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ impl Parameter {
Some(ref function) => vec![function.clone()],
None => Vec::new(),
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"parameter-struct-impl-nav-backward-one-to-lambda"}}}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"parameter-struct-impl-nav-backward-one-bi-cond-to-parameter"}}}
Expand Down
20 changes: 19 additions & 1 deletion src/v2/lu_dog_vec/types/lambda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pub struct Lambda {
pub id: usize,
/// R73: [`Lambda`] 'contains a' [`Body`]
pub body: Option<usize>,
/// R103: [`Lambda`] 'may have a' [`LambdaParameter`]
pub first_param: Option<usize>,
/// R74: [`Lambda`] 'has a' [`ValueType`]
pub return_type: usize,
}
Expand All @@ -40,13 +42,15 @@ impl Lambda {
/// Inter a new 'Lambda' in the store, and return it's `id`.
pub fn new(
body: Option<&Rc<RefCell<Body>>>,
first_param: Option<&Rc<RefCell<LambdaParameter>>>,
return_type: &Rc<RefCell<ValueType>>,
store: &mut LuDogVecStore,
) -> Rc<RefCell<Lambda>> {
store.inter_lambda(|id| {
Rc::new(RefCell::new(Lambda {
id,
body: body.map(|body| body.borrow().id),
first_param: first_param.map(|lambda_parameter| lambda_parameter.borrow().id),
return_type: return_type.borrow().id,
}))
})
Expand All @@ -65,6 +69,18 @@ impl Lambda {
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda-struct-impl-nav-forward-cond-to-first_param"}}}
/// Navigate to [`LambdaParameter`] across R103(1-*c)
pub fn r103_lambda_parameter<'a>(
&'a self,
store: &'a LuDogVecStore,
) -> Vec<Rc<RefCell<LambdaParameter>>> {
match self.first_param {
Some(ref first_param) => vec![store.exhume_lambda_parameter(&first_param).unwrap()],
None => Vec::new(),
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda-struct-impl-nav-forward-to-return_type"}}}
/// Navigate to [`ValueType`] across R74(1-*)
pub fn r74_value_type<'a>(&'a self, store: &'a LuDogVecStore) -> Vec<Rc<RefCell<ValueType>>> {
Expand Down Expand Up @@ -118,7 +134,9 @@ impl Lambda {
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda-implementation"}}}
impl PartialEq for Lambda {
fn eq(&self, other: &Self) -> bool {
self.body == other.body && self.return_type == other.return_type
self.body == other.body
&& self.first_param == other.first_param
&& self.return_type == other.return_type
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
Expand Down
9 changes: 9 additions & 0 deletions src/v2/lu_dog_vec/types/lambda_parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ impl LambdaParameter {
}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda_parameter-struct-impl-nav-backward-one-to-lambda"}}}
/// Navigate to [`Lambda`] across R103(1-1)
pub fn r103_lambda<'a>(&'a self, store: &'a LuDogVecStore) -> Vec<Rc<RefCell<Lambda>>> {
vec![store
.iter_lambda()
.find(|lambda| lambda.borrow().first_param == Some(self.id))
.unwrap()]
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"lambda_parameter-struct-impl-nav-backward-one-bi-cond-to-lambda_parameter"}}}
/// Navigate to [`LambdaParameter`] across R75(1c-1c)
pub fn r75c_lambda_parameter<'a>(
Expand Down
2 changes: 2 additions & 0 deletions src/v2/lu_dog_vec/types/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ impl Parameter {
Some(ref function) => vec![function.clone()],
None => Vec::new(),
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"parameter-struct-impl-nav-backward-one-to-lambda"}}}
}
// {"magic":"","directive":{"End":{"directive":"ignore-orig"}}}
// {"magic":"","directive":{"Start":{"directive":"ignore-orig","tag":"parameter-struct-impl-nav-backward-one-bi-cond-to-parameter"}}}
Expand Down
Loading

0 comments on commit f6362f8

Please sign in to comment.