dollabs / pamela

Probabalistic Advanced Modeling and Execution Learning Architecture
Apache License 2.0
233 stars 15 forks source link

Pending files should be syntactically correct #143

Closed pmdoll closed 6 years ago

pmdoll commented 6 years ago

Some of the pamela files in test/pamela/pending fail to parse. We should have a test that clearly excludes files that we do not expect to pass but the rest of them should at least pass pamela check action.

Pamela check test/pamela/pending/assert.pamela
Exit code 1 test/pamela/pending/assert.pamela

Pamela check test/pamela/pending/circuit2.pamela
Exit code 1 test/pamela/pending/circuit2.pamela

Pamela check test/pamela/pending/inherit1.pamela
Exit code 1 test/pamela/pending/inherit1.pamela

Pamela check test/pamela/pending/inherit2.pamela
Exit code 1 test/pamela/pending/inherit2.pamela

Pamela check test/pamela/pending/inherit6.pamela
Exit code 1 test/pamela/pending/inherit6.pamela

Pamela check test/pamela/pending/inherit7.pamela
Exit code 1 test/pamela/pending/inherit7.pamela

Pamela check test/pamela/pending/inherit8.pamela
Exit code 1 test/pamela/pending/inherit8.pamela

Pamela check test/pamela/pending/isr-htn2.pamela
Exit code 1 test/pamela/pending/isr-htn2.pamela

Pamela check test/pamela/pending/issue-81-nocolons.pamela
Exit code 1 test/pamela/pending/issue-81-nocolons.pamela

Pamela check test/pamela/pending/issue-81.pamela
Exit code 1 test/pamela/pending/issue-81.pamela

Pamela check test/pamela/pending/issue-84.pamela
Exit code 1 test/pamela/pending/issue-84.pamela

Pamela check test/pamela/pending/quadcopter2.pamela
Exit code 1 test/pamela/pending/quadcopter2.pamela

Bash script to reproduce this issue

#!/usr/bin/env bash

# Assuming CWD is pamela
#set -x
for file in test/pamela/pending/*.pamela
do
  echo "Pamela check $file"
  pamela -v -v -i $file check 2> /dev/null 1> /dev/null
  ret=$?
  echo "Exit code $ret $file"
  echo
done
#set +x
dcerys commented 6 years ago

My expectation of pending is that nothing in that directory is expected to parse, build, or generate a HTN/TPN. It should be used for forward-looking syntax/semantics that aren't yet supported (i.e., pending).
For things we expect to build, they should be in the main test/pamela directory with an associated file in IR.

Q: Is it true that anything that parses (via check) will necessarily generate an IR (via build)? [I expect the answer is no, and we don't have a current mechanism for testing only check for a given Pamela file]

pmdoll commented 6 years ago

check only checks pamela files with respect to ebnf grammar. Unless there is new syntax waiting to be added to the grammar, I think all files should pass the check test. The files with forward looking syntax should be excluded.

This will allow us to keep pending files in sync with grammar changes.

Case in point, I expect all inheritance examples to pass the syntax check because the grammar has support for inheritance. Given that some of them failed, suggests some of those examples need a bit more attention.

The inheritance examples that do pass the check also pass build action and produce IR, albeit not in the form we expect it to be.

tmarble commented 6 years ago

This really defeats the purpose of pending/. The idea of pending/ is specifically to document the syntax and semantics we want to have. Obviously once examples have been promoted they must be both syntactially and semantically correct. Allow me to propose we close this issue.