Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
Yirmandias committed Nov 28, 2023
1 parent 8566099 commit 0c9dc91
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions acting/apps/src/bin/flow_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ pub async fn __convert(lv: LValue, mut p_env: PLEnv) -> Result<ActingModel, LRun
//debug_println!("annotate =>\n{}", lv_om.format(0));

let pp_lv = lambda_expansion(&lv_om, &p_env).await?;
let pp_lv = pre_processing(&pp_lv, &p_env).await?;
let pp_lv = pre_processing(&pp_lv, &p_env)?;
//debug_println!("pre_processing =>\n{}", pp_lv.format(0));

let chronicle = match _convert(None, &pp_lv, &mut p_env, st).await {
let chronicle = match _convert(None, &pp_lv, &mut p_env, st) {
Ok(ch) => Some(ch),
Err(e) => {
println!("{}", e);
Expand Down
1 change: 1 addition & 0 deletions acting/apps/src/bin/type_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fn test_meet(tn: &TypeLattice, ta: DomainTest, tb: DomainTest) {
println!("{} ^ {} = {}", ta, tb, r2)
}

#[allow(dead_code)]
fn test_union(tn: &TypeLattice, ta: DomainTest, tb: DomainTest) {
let r = tn.union(&ta.into_domain(tn), &tb.into_domain(tn));
let r = DomainTest::from_domain(tn, &r);
Expand Down
12 changes: 7 additions & 5 deletions resources/playground/src/bin/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@ pub async fn main() {
//
let mut command = Command::new("ompas");
command.args(["-d","/home/jeremy/ompas_output/benchmark/gripper/problems/gripper_medium_0_random_satisfactory.lisp"]);
command.env("OMPAS_WORKING_DIR", "/home/jeremy/ompas_output/benchmark/gripper");
command.env(
"OMPAS_WORKING_DIR",
"/home/jeremy/ompas_output/benchmark/gripper",
);

if let Ok(mut c) = command.spawn() {
tokio::select! {
_ = tokio::time::sleep(Duration::from_secs(40)) => {
c.kill().await;
let _ = c.kill().await;
println!("command killed!")
}
r = c.wait() => {
_ = c.wait() => {
println!("command ok!")
}
}
} else {
panic!("panic");
}

}
}
8 changes: 4 additions & 4 deletions scheme/apps/src/bin/bench_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use std::time::SystemTime;
#[tokio::main]
pub async fn main() {
//let env = get_root_env().await;
test_fact(100).await;
test_lisp_integration().await;
let _ = test_fact(100).await;
let _ = test_lisp_integration().await;
}

fn create_list_test() -> Vec<(&'static str, LValue)> {
Expand Down Expand Up @@ -77,11 +77,11 @@ async fn test_fact(n: i64) -> lruntimeerror::Result<()> {
&mut env,
)
.await?;
let r = eval(&lv, &mut env, None).await?;
let _ = eval(&lv, &mut env, None).await?;
let time = SystemTime::now();
let lv = parse(format!("(fact {n})").as_str(), &mut env).await?;
let parse = time.elapsed().unwrap().as_secs_f64();
let r = eval(&lv, &mut env, None).await?;
let _ = eval(&lv, &mut env, None).await?;
let end = time.elapsed().unwrap().as_secs_f64();
println!(
"eval({lv}) took {:.3} µs ({:.1} % to parse)",
Expand Down

0 comments on commit 0c9dc91

Please sign in to comment.