Skip to content

Commit

Permalink
working on schema
Browse files Browse the repository at this point in the history
  • Loading branch information
oflatt committed Feb 3, 2024
1 parent 5ae28aa commit 2215bb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions tree_inputs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod ast;
pub mod interpreter;
pub mod schema;

pub type Result = std::result::Result<(), egglog::Error>;
Expand Down
5 changes: 4 additions & 1 deletion tree_inputs/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub enum Type {
TupleT(Vec<Rc<Type>>),
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum BinaryOp {
Add,
Sub,
Expand All @@ -26,6 +27,7 @@ pub enum UnaryOp {
Print,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Constant {
Int(i64),
Bool(bool),
Expand All @@ -43,11 +45,12 @@ pub enum Assumption {
InLoop(RcExpr, RcExpr),
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Expr {
Const(Constant),
Bop(BinaryOp, RcExpr, RcExpr),
Uop(UnaryOp, RcExpr),
Get(RcExpr, i64),
Get(RcExpr, usize),
Read(RcExpr, Type),
Call(String, RcExpr),
All(Order, Vec<RcExpr>),
Expand Down

0 comments on commit 2215bb9

Please sign in to comment.