Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First version of a functional linear checker #138

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
36a8879
linear types example for devloping linear type checker
kenarab May 8, 2024
f010760
Merge remote-tracking branch 'lambda/main' into linear-checker
kenarab May 9, 2024
3e79eab
Merge remote-tracking branch 'lambda/main' into linear-checker
kenarab May 10, 2024
c863194
linearExamples with mutable types
kenarab May 10, 2024
a70127e
linearExamples with mutable types compiles ok
kenarab May 10, 2024
ed2b6bb
Connected a stub for linearityCheck
kenarab May 10, 2024
354840a
Connected a stub for linearityCheck
kenarab May 10, 2024
211fd05
Included linearChecker first testcases
kenarab May 10, 2024
a144cf3
Updated linearityCheck testcases
kenarab May 10, 2024
fa577ca
Implemented check_var_in_expr
kenarab May 10, 2024
53a79f7
LinearityErrors coded
kenarab May 13, 2024
f0596a9
Appareances and count function
kenarab May 13, 2024
d26836a
struct LinearityChecker
kenarab May 13, 2024
8687bd0
Huge refactoring in progress. Does not build yet
kenarab May 14, 2024
9c7f450
linearity_check building with ast
kenarab May 15, 2024
0953bee
Now it runs the linear checker
kenarab May 15, 2024
bc9c8da
Shows the StateTbl for each function call
kenarab May 15, 2024
65e768e
StateTbl::update_state implemented
kenarab May 17, 2024
b70b785
check_var_in_expr: Covered all 13 cases
kenarab May 17, 2024
946ce9d
More info with TODO in Match case
kenarab May 17, 2024
8256951
_Borrowed types because Borrow not covered yet in linearity check
kenarab May 17, 2024
3d6083e
state_tbl is initialized with type
kenarab May 17, 2024
5c97ebe
Only makes linearityChecks for variables of type Linear
kenarab May 17, 2024
869c2ae
New ValueVar struct for trivial expressions building. Does not compile
kenarab May 17, 2024
eeccb0f
New ValueVar struct for trivial expressions building
kenarab May 20, 2024
542cdd0
linearExample01.con xy consumed
kenarab May 20, 2024
036b4eb
Inclued an option for checking types (linearity by now)
kenarab May 20, 2024
e6c6568
flag for checking types included in code
kenarab May 20, 2024
e3f6675
Lintr corrections
kenarab May 20, 2024
c8b395b
Clippy produces no warnings
kenarab May 20, 2024
5779cd6
Ran Cargo fmt
kenarab May 20, 2024
18a0bdb
Removed FIXME from linearExamples
kenarab May 20, 2024
22016ae
cargo fmt
kenarab May 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/concrete_ast/src/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub enum ValueExpr {
ConstFloat(String, Span),
ConstStr(String, Span),
Path(PathOp),
ValueVar(Ident, Span),
}

#[derive(Debug, Clone, PartialEq, Eq)]
Expand Down
4 changes: 4 additions & 0 deletions crates/concrete_check/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ concrete_ir = { version = "0.1.0", path = "../concrete_ir" }
concrete_session = { version = "0.1.0", path = "../concrete_session" }
itertools = "0.12.0"
thiserror = "1.0.56"


[features]
linearity = []
2 changes: 2 additions & 0 deletions crates/concrete_check/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use ariadne::{ColorGenerator, Label, Report, ReportKind};
use concrete_ir::lowering::errors::LoweringError;
use concrete_session::Session;

pub mod linearity_check;

/// Creates a report from a lowering error.
pub fn lowering_error_to_report(
error: LoweringError,
Expand Down
Loading
Loading