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

[issue1146] Validate SAS file #227

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from

Conversation

tanjaschindler
Copy link

No description provided.

Copy link
Member

@FlorianPommerening FlorianPommerening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look at the code. I don't know the list of things this should check so I didn't verify completeness.

src/search/utils/input_file_parser.h Outdated Show resolved Hide resolved
src/search/utils/input_file_parser.h Outdated Show resolved Hide resolved
src/search/utils/input_file_parser.h Outdated Show resolved Hide resolved
src/search/utils/input_file_parser.h Outdated Show resolved Hide resolved
src/search/utils/input_file_parser.h Outdated Show resolved Hide resolved
int num_facts = file_parser.read_line_int("number of facts in mutex group");
if (num_facts < 1) {
file_parser.error("Number of facts in mutex group is less than 1, should be at least 1.");
}
vector<FactPair> invariant_group;
invariant_group.reserve(num_facts);
for (int j = 0; j < num_facts; ++j) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we already have a function that reads a list of facts? And doesn't it also need the check that there are no duplicate facts?

src/search/tasks/root_task.cc Outdated Show resolved Hide resolved
src/search/tasks/root_task.cc Outdated Show resolved Hide resolved
src/search/tasks/root_task.cc Outdated Show resolved Hide resolved
src/search/tasks/root_task.cc Outdated Show resolved Hide resolved
src/search/tasks/root_task.cc Outdated Show resolved Hide resolved
src/search/tasks/root_task.cc Outdated Show resolved Hide resolved
src/search/tasks/root_task.cc Outdated Show resolved Hide resolved
src/search/tasks/root_task.cc Outdated Show resolved Hide resolved
src/search/utils/input_file_parser.h Outdated Show resolved Hide resolved
src/search/utils/input_file_parser.h Outdated Show resolved Hide resolved
src/search/utils/input_file_parser.h Outdated Show resolved Hide resolved
src/search/utils/input_file_parser.cc Outdated Show resolved Hide resolved
src/search/utils/input_file_parser.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@SimonDold SimonDold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just added renaming suggestions but i am happy as is.

void TaskParser::confirm_end_of_input() {
find_next_line(false);
if(line != "") {
error("Expected end of task, found non-empty line " + line);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename:
task -> task encoding


class InputFileParser {
/*
Parse a task file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename:
task file -> task encoding

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the interface of this class, it doesn't really parse a task (neither a file nor an encoding). It mostly does the scanning/lexing, i.e., breaking the input stream into tokens. The actual parsing then happens in root_task.cc in methods like read_goal, read_actions and so on. Maybe we should either move the parsing functionality here, or rename this class and file.

tanjaschindler and others added 15 commits November 18, 2024 17:09
Almost no code was shared. The patch also makes read_pre_post closer
to read_facts by letting it take a bool read_from_single_line.
This removes an unintuitive dependency on op.is_an_axiom but also
means that the string for parsing the variable no longer mentions
the source (axiom or operator). The string is not used currently and
will be unnecessary once we have errors with a stack trace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants