Skip to content

Commit

Permalink
Remove unused proofs option
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Fischman committed Oct 5, 2024
1 parent 8ac9cae commit 59030f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
21 changes: 4 additions & 17 deletions src/ast/desugar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ fn desugar_simplify(
},
desugar,
false,
false,
)
.unwrap(),
);
Expand All @@ -198,7 +197,6 @@ pub(crate) fn rewrite_name(rewrite: &Rewrite) -> String {
pub(crate) fn desugar_command(
command: Command,
desugar: &mut Desugar,
get_all_proofs: bool,
seminaive_transform: bool,
) -> Result<Vec<NCommand>, Error> {
let res = match command {
Expand Down Expand Up @@ -232,7 +230,6 @@ pub(crate) fn desugar_command(
return desugar_commands(
desugar.parse_program(Some(file), &s)?,
desugar,
get_all_proofs,
seminaive_transform,
);
}
Expand Down Expand Up @@ -333,15 +330,7 @@ pub(crate) fn desugar_command(
]
}
}
Command::Check(span, facts) => {
let res = vec![NCommand::Check(span, facts)];

if get_all_proofs {
// TODO check proofs
}

res
}
Command::Check(span, facts) => vec![NCommand::Check(span, facts)],
Command::CheckProof => vec![NCommand::CheckProof],
Command::PrintFunction(span, symbol, size) => {
vec![NCommand::PrintTable(span, symbol, size)]
Expand All @@ -355,7 +344,7 @@ pub(crate) fn desugar_command(
vec![NCommand::Pop(span, num)]
}
Command::Fail(span, cmd) => {
let mut desugared = desugar_command(*cmd, desugar, false, seminaive_transform)?;
let mut desugared = desugar_command(*cmd, desugar, seminaive_transform)?;

let last = desugared.pop().unwrap();
desugared.push(NCommand::Fail(span, Box::new(last)));
Expand All @@ -372,12 +361,11 @@ pub(crate) fn desugar_command(
pub(crate) fn desugar_commands(
program: Vec<Command>,
desugar: &mut Desugar,
get_all_proofs: bool,
seminaive_transform: bool,
) -> Result<Vec<NCommand>, Error> {
let mut res = vec![];
for command in program {
let desugared = desugar_command(command, desugar, get_all_proofs, seminaive_transform)?;
let desugared = desugar_command(command, desugar, seminaive_transform)?;
res.extend(desugared);
}
Ok(res)
Expand All @@ -400,10 +388,9 @@ impl Desugar {
pub(crate) fn desugar_program(
&mut self,
program: Vec<Command>,
get_all_proofs: bool,
seminaive_transform: bool,
) -> Result<Vec<NCommand>, Error> {
let res = desugar_commands(program, self, get_all_proofs, seminaive_transform)?;
let res = desugar_commands(program, self, seminaive_transform)?;
Ok(res)
}

Expand Down
8 changes: 3 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ pub struct EGraph {
interactive_mode: bool,
timestamp: u32,
pub run_mode: RunMode,
pub test_proofs: bool,
pub fact_directory: Option<PathBuf>,
pub seminaive: bool,
type_info: TypeInfo,
Expand All @@ -457,7 +456,6 @@ impl Default for EGraph {
timestamp: 0,
run_mode: RunMode::Normal,
interactive_mode: false,
test_proofs: false,
fact_directory: None,
seminaive: true,
extract_report: None,
Expand Down Expand Up @@ -1419,9 +1417,9 @@ impl EGraph {
}

fn process_command(&mut self, command: Command) -> Result<Vec<ResolvedNCommand>, Error> {
let program =
self.desugar
.desugar_program(vec![command], self.test_proofs, self.seminaive)?;
let program = self
.desugar
.desugar_program(vec![command], self.seminaive)?;

let program = self.type_info.typecheck_program(&program)?;

Expand Down

0 comments on commit 59030f4

Please sign in to comment.