| summaryrefslogtreecommitdiff | 
diff options
| -rw-r--r-- | Makefile | 5 | ||||
| -rw-r--r-- | ast-to-instr/Makefile | 2 | ||||
| -rw-r--r-- | ast-to-instr/src/Expressions.java | 63 | ||||
| -rw-r--r-- | data/property/cnes/CNE_01700.pro | 68 | ||||
| -rw-r--r-- | data/property/cnes/CNE_01800.pro | 68 | ||||
| -rw-r--r-- | data/property/cnes/CNE_01900.pro | 68 | ||||
| -rw-r--r-- | data/property/cnes/STD_04800.pro | 88 | ||||
| -rw-r--r-- | data/property/impossible_processes.pro | 8 | ||||
| -rw-r--r-- | data/property/incrementer.pro | 5 | ||||
| -rw-r--r-- | data/property/likely_a_clock.pro | 49 | ||||
| -rw-r--r-- | data/property/simple_flip_flop.pro | 34 | ||||
| -rw-r--r-- | instr-to-kodkod/Makefile | 4 | ||||
| -rw-r--r-- | instr-to-kodkod/cfg-to-paths/Makefile | 2 | ||||
| -rw-r--r-- | instr-to-kodkod/parser/Makefile | 2 | ||||
| -rw-r--r-- | sol-pretty-printer/Makefile | 2 | 
15 files changed, 401 insertions, 67 deletions
| @@ -26,6 +26,11 @@ clean:  	$(MAKE) -C $(SOLVER) clean  	$(MAKE) -C $(PRETTY_PRINTER) clean +build: +	$(MAKE) -C $(AST_TO_INSTR) build +	$(MAKE) -C $(SOLVER) build +	$(MAKE) -C $(PRETTY_PRINTER) build +  $(TMP_DIR):  	mkdir -p $@ diff --git a/ast-to-instr/Makefile b/ast-to-instr/Makefile index bb50219..50a953c 100644 --- a/ast-to-instr/Makefile +++ b/ast-to-instr/Makefile @@ -49,6 +49,8 @@ CLASSES = $(SOURCES:.java=.class)  $(MODEL_DIR)/structural.mod: $(CLASSES) $(AST_FILE)  	$(JAVA) -cp $(CLASSPATH) Main $(AST_FILE) $(MODEL_DIR) +build: $(CLASSES) +  clean:  	rm -f $(CLASSES)  	rm -f $(MODEL_DIR)/*.mod diff --git a/ast-to-instr/src/Expressions.java b/ast-to-instr/src/Expressions.java index 90b0fff..c6037d6 100644 --- a/ast-to-instr/src/Expressions.java +++ b/ast-to-instr/src/Expressions.java @@ -372,22 +372,57 @@ public class Expressions           /*            grep "Kind.*Literal" ./src/vhdl/nodes_meta.adb | sort | uniq -u            points to: -         "character_literal"; -         "enumeration_literal"; -         "floating_point_literal"; -         "integer_literal"; -         "null_literal"; -         "overflow_literal"; -         "physical_fp_literal"; -         "physical_int_literal"; -         "physical_literal"; (unsure if it can happen) -         "string_literal8"; - -         They don't all use the same structure, so we're going to handle them -         latter. +            "character_literal"; +            "enumeration_literal"; +            "floating_point_literal"; +            "integer_literal"; +            "null_literal"; +            "overflow_literal"; +            "physical_fp_literal"; +            "physical_int_literal"; +            "physical_literal"; (unsure if it can happen) +            "string_literal8"; + +          They don't all use the same structure, so we're going to handle them +          later. +            TODO           */ -         structure.append("l"); +         structure.append("?"); +         elements.add +         ( +            Strings.get_id_from_string +            ( +               "l" +            ) +         ); + +      } +      else if (kind.contains("attribute")) +      { +         structure.append("(?"); + +         elements.add +         ( +            Strings.get_id_from_string +            ( +               /* FIXME: Kind of a hacky */ +               kind.replace("_attribute", "") +            ) +         ); + +         process +         ( +            elements, +            structure, +            (Node) XPE_GET_PREFIX.evaluate +            ( +               current_node, +               XPathConstants.NODE +            ) +         ); + +         structure.append(")");        }     }  } diff --git a/data/property/cnes/CNE_01700.pro b/data/property/cnes/CNE_01700.pro index edbb622..db5e676 100644 --- a/data/property/cnes/CNE_01700.pro +++ b/data/property/cnes/CNE_01700.pro @@ -63,12 +63,38 @@                                      (AF                                         (and                                            (kind "if") -                                          (is_read_structure "(??)")                                            (or -                                             (is_read_element "0" "falling_edge") -                                             (is_read_element "0" "rising_edge") +                                             (and +                                                (is_read_structure "(??)") +                                                (or +                                                   (is_read_element "0" "falling_edge") +                                                   (is_read_element "0" "rising_edge") +                                                ) +                                                (is_read_element "1" clk1) +                                             ) +                                             (and +                                                (is_read_structure "(?(??)(???))") +                                                (is_read_element "0" "and") +                                                (is_read_element "1" "event") +                                                (is_read_element "2" clk1) +                                                (is_read_element "3" "=") +                                                (or +                                                   (is_read_element "4" clk1) +                                                   (is_read_element "5" clk1) +                                                ) +                                             ) +                                             (and +                                                (is_read_structure "(?(???)(??))") +                                                (is_read_element "0" "and") +                                                (is_read_element "1" "=") +                                                (or +                                                   (is_read_element "2" clk1) +                                                   (is_read_element "3" clk1) +                                                ) +                                                (is_read_element "4" "event") +                                                (is_read_element "5" clk1) +                                             )                                            ) -                                          (is_read_element "1" clk1)                                            (EX                                               (and                                                  (has_option "cond_was_true") @@ -109,12 +135,38 @@                                                     (and                                                        (not (has_option "cond_was_true"))                                                        (kind "if") -                                                      (is_read_structure "(??)")                                                        (or -                                                         (is_read_element "0" "falling_edge") -                                                         (is_read_element "0" "rising_edge") +                                                         (and +                                                            (is_read_structure "(??)") +                                                            (or +                                                               (is_read_element "0" "falling_edge") +                                                               (is_read_element "0" "rising_edge") +                                                            ) +                                                            (is_read_element "1" clk1) +                                                         ) +                                                         (and +                                                            (is_read_structure "(?(??)(???))") +                                                            (is_read_element "0" "and") +                                                            (is_read_element "1" "event") +                                                            (is_read_element "2" clk1) +                                                            (is_read_element "3" "=") +                                                            (or +                                                               (is_read_element "4" clk1) +                                                               (is_read_element "5" clk1) +                                                            ) +                                                         ) +                                                         (and +                                                            (is_read_structure "(?(???)(??))") +                                                            (is_read_element "0" "and") +                                                            (is_read_element "1" "=") +                                                            (or +                                                               (is_read_element "2" clk1) +                                                               (is_read_element "3" clk1) +                                                            ) +                                                            (is_read_element "4" "event") +                                                            (is_read_element "5" clk1) +                                                         )                                                        ) -                                                      (is_read_element "1" clk1)                                                        (EX                                                           (and                                                              (has_option "cond_was_true") diff --git a/data/property/cnes/CNE_01800.pro b/data/property/cnes/CNE_01800.pro index 521cd8a..fe69841 100644 --- a/data/property/cnes/CNE_01800.pro +++ b/data/property/cnes/CNE_01800.pro @@ -60,12 +60,38 @@                                      (AF                                         (and                                            (kind "if") -                                          (is_read_structure "(??)")                                            (or -                                             (is_read_element "0" "falling_edge") -                                             (is_read_element "0" "rising_edge") +                                             (and +                                                (is_read_structure "(??)") +                                                (or +                                                   (is_read_element "0" "falling_edge") +                                                   (is_read_element "0" "rising_edge") +                                                ) +                                                (is_read_element "1" clk1) +                                             ) +                                             (and +                                                (is_read_structure "(?(??)(???))") +                                                (is_read_element "0" "and") +                                                (is_read_element "1" "event") +                                                (is_read_element "2" clk1) +                                                (is_read_element "3" "=") +                                                (or +                                                   (is_read_element "4" clk1) +                                                   (is_read_element "5" clk1) +                                                ) +                                             ) +                                             (and +                                                (is_read_structure "(?(???)(??))") +                                                (is_read_element "0" "and") +                                                (is_read_element "1" "=") +                                                (or +                                                   (is_read_element "2" clk1) +                                                   (is_read_element "3" clk1) +                                                ) +                                                (is_read_element "4" "event") +                                                (is_read_element "5" clk1) +                                             )                                            ) -                                          (is_read_element "1" clk1)                                            (EX                                               (and                                                  (has_option "cond_was_true") @@ -106,12 +132,38 @@                                                     (and                                                        (not (has_option "cond_was_true"))                                                        (kind "if") -                                                      (is_read_structure "(??)")                                                        (or -                                                         (is_read_element "0" "falling_edge") -                                                         (is_read_element "0" "rising_edge") +                                                         (and +                                                            (is_read_structure "(??)") +                                                            (or +                                                               (is_read_element "0" "falling_edge") +                                                               (is_read_element "0" "rising_edge") +                                                            ) +                                                            (is_read_element "1" clk1) +                                                         ) +                                                         (and +                                                            (is_read_structure "(?(??)(???))") +                                                            (is_read_element "0" "and") +                                                            (is_read_element "1" "event") +                                                            (is_read_element "2" clk1) +                                                            (is_read_element "3" "=") +                                                            (or +                                                               (is_read_element "4" clk1) +                                                               (is_read_element "5" clk1) +                                                            ) +                                                         ) +                                                         (and +                                                            (is_read_structure "(?(???)(??))") +                                                            (is_read_element "0" "and") +                                                            (is_read_element "1" "=") +                                                            (or +                                                               (is_read_element "2" clk1) +                                                               (is_read_element "3" clk1) +                                                            ) +                                                            (is_read_element "4" "event") +                                                            (is_read_element "5" clk1) +                                                         )                                                        ) -                                                      (is_read_element "1" clk1)                                                        (EX                                                           (and                                                              (has_option "cond_was_true") diff --git a/data/property/cnes/CNE_01900.pro b/data/property/cnes/CNE_01900.pro index 6e2beff..51c373f 100644 --- a/data/property/cnes/CNE_01900.pro +++ b/data/property/cnes/CNE_01900.pro @@ -22,12 +22,38 @@                                (AF                                   (and                                      (kind "if") -                                    (is_read_structure "(??)")                                      (or -                                       (is_read_element "0" "falling_edge") -                                       (is_read_element "0" "rising_edge") +                                       (and +                                          (is_read_structure "(??)") +                                          (or +                                             (is_read_element "0" "falling_edge") +                                             (is_read_element "0" "rising_edge") +                                          ) +                                          (is_read_element "1" clk1) +                                       ) +                                       (and +                                          (is_read_structure "(?(??)(???))") +                                          (is_read_element "0" "and") +                                          (is_read_element "1" "event") +                                          (is_read_element "2" clk1) +                                          (is_read_element "3" "=") +                                          (or +                                             (is_read_element "4" clk1) +                                             (is_read_element "5" clk1) +                                          ) +                                       ) +                                       (and +                                          (is_read_structure "(?(???)(??))") +                                          (is_read_element "0" "and") +                                          (is_read_element "1" "=") +                                          (or +                                             (is_read_element "2" clk1) +                                             (is_read_element "3" clk1) +                                          ) +                                          (is_read_element "4" "event") +                                          (is_read_element "5" clk1) +                                       )                                      ) -                                    (is_read_element "1" clk1)                                      (EX                                         (and                                            (has_option "cond_was_true") @@ -67,12 +93,38 @@                                               (and                                                  (not (has_option "cond_was_true"))                                                  (kind "if") -                                                (is_read_structure "(??)")                                                  (or -                                                   (is_read_element "0" "falling_edge") -                                                   (is_read_element "0" "rising_edge") +                                                   (and +                                                      (is_read_structure "(??)") +                                                      (or +                                                         (is_read_element "0" "falling_edge") +                                                         (is_read_element "0" "rising_edge") +                                                      ) +                                                      (is_read_element "1" clk1) +                                                   ) +                                                   (and +                                                      (is_read_structure "(?(??)(???))") +                                                      (is_read_element "0" "and") +                                                      (is_read_element "1" "event") +                                                      (is_read_element "2" clk1) +                                                      (is_read_element "3" "=") +                                                      (or +                                                         (is_read_element "4" clk1) +                                                         (is_read_element "5" clk1) +                                                      ) +                                                   ) +                                                   (and +                                                      (is_read_structure "(?(???)(??))") +                                                      (is_read_element "0" "and") +                                                      (is_read_element "1" "=") +                                                      (or +                                                         (is_read_element "2" clk1) +                                                         (is_read_element "3" clk1) +                                                      ) +                                                      (is_read_element "4" "event") +                                                      (is_read_element "5" clk1) +                                                   )                                                  ) -                                                (is_read_element "1" clk1)                                                  (EX                                                     (and                                                        (has_option "cond_was_true") diff --git a/data/property/cnes/STD_04800.pro b/data/property/cnes/STD_04800.pro index 5f9e817..ae8e4c9 100644 --- a/data/property/cnes/STD_04800.pro +++ b/data/property/cnes/STD_04800.pro @@ -6,10 +6,46 @@        (exists ps_re process           (CTL_verifies ps_re              (EF -               (and -                  (is_read_structure "(??)") -                  (is_read_element "0" "rising_edge") -                  (is_read_element "1" wfm) +               (or +                  (and +                     (is_read_structure "(??)") +                     (is_read_element "0" "rising_edge") +                     (is_read_element "1" wfm) +                  ) +                  (and +                     (is_read_structure "(?(??)(???))") +                     (is_read_element "0" "and") +                     (is_read_element "1" "event") +                     (is_read_element "2" wfm) +                     (is_read_element "3" "=") +                     (or +                        (and +                           (is_read_element "4" wfm) +                           (is_read_element "5" "'1'") +                        ) +                        (and +                           (is_read_element "4" "'1'") +                           (is_read_element "5" wfm) +                        ) +                     ) +                  ) +                  (and +                     (is_read_structure "(?(???)(??))") +                     (is_read_element "0" "and") +                     (is_read_element "1" "=") +                     (or +                        (and +                           (is_read_element "2" wfm) +                           (is_read_element "3" "'1'") +                        ) +                        (and +                           (is_read_element "2" "'1'") +                           (is_read_element "3" wfm) +                        ) +                     ) +                     (is_read_element "4" "event") +                     (is_read_element "5" wfm) +                  )                 )              )           ) @@ -17,10 +53,46 @@        (exists ps_fe process           (CTL_verifies ps_fe              (EF -               (and -                  (is_read_structure "(??)") -                  (is_read_element "0" "falling_edge") -                  (is_read_element "1" wfm) +               (or +                  (and +                     (is_read_structure "(??)") +                     (is_read_element "0" "falling_edge") +                     (is_read_element "1" wfm) +                  ) +                  (and +                     (is_read_structure "(?(??)(???))") +                     (is_read_element "0" "and") +                     (is_read_element "1" "event") +                     (is_read_element "2" wfm) +                     (is_read_element "3" "=") +                     (or +                        (and +                           (is_read_element "4" wfm) +                           (is_read_element "5" "'0'") +                        ) +                        (and +                           (is_read_element "4" "'0'") +                           (is_read_element "5" wfm) +                        ) +                     ) +                  ) +                  (and +                     (is_read_structure "(?(???)(??))") +                     (is_read_element "0" "and") +                     (is_read_element "1" "=") +                     (or +                        (and +                           (is_read_element "2" wfm) +                           (is_read_element "3" "'0'") +                        ) +                        (and +                           (is_read_element "2" "'0'") +                           (is_read_element "3" wfm) +                        ) +                     ) +                     (is_read_element "4" "event") +                     (is_read_element "5" wfm) +                  )                 )              )           ) diff --git a/data/property/impossible_processes.pro b/data/property/impossible_processes.pro index a93e916..5a1bc78 100644 --- a/data/property/impossible_processes.pro +++ b/data/property/impossible_processes.pro @@ -2,11 +2,9 @@     (        (ps process WHAT_ARE_YOU_DOING)     ) -   (forall sl1 waveform -      (CTL_verifies ps -         (not -            (EF (expr_writes sl1)) -         ) +   (CTL_verifies ps +      (not +         (EF (expr_writes _))        )     )  ) diff --git a/data/property/incrementer.pro b/data/property/incrementer.pro index 4bc06ae..f119f99 100644 --- a/data/property/incrementer.pro +++ b/data/property/incrementer.pro @@ -6,9 +6,10 @@     (CTL_verifies ps        (EF           (and -            (is_read_structure "(??L)") +            (is_read_structure "(???)")              (is_read_element "0" "+") -            (is_read_element "1" wf) +            (is_read_element _ wf) +            (is_read_element _ "L")           )        )     ) diff --git a/data/property/likely_a_clock.pro b/data/property/likely_a_clock.pro index 2aae4a4..afe4ed3 100644 --- a/data/property/likely_a_clock.pro +++ b/data/property/likely_a_clock.pro @@ -6,16 +6,47 @@        (and           (is_waveform_of wf clock)           (exists ps process -            (CTL_verifies ps -               (EF -                  (and -                     (kind "if") -                     (is_read_structure "(??)") -                     (or -                        (is_read_element "0" "rising_edge") -                        (is_read_element "0" "falling_edge") +            (and +               (is_accessed_by wf ps) +               (is_in_sensitivity_list wf ps) +               (CTL_verifies ps +                     (EF +                        (and +                           (kind "if") +                           (or +                              (and +                                 (is_read_structure "(??)") +                                 (or +                                    (is_read_element "0" "falling_edge") +                                    (is_read_element "0" "rising_edge") +                                 ) +                                 (is_read_element "1" wf) +                              ) +                              (and +                                 (is_read_structure "(?(??)(???))") +                                 (is_read_element "0" "and") +                                 (is_read_element "1" "event") +                                 (is_read_element "2" wf) +                                 (is_read_element "3" "=") +                                 (or +                                    (is_read_element "4" wf) +                                    (is_read_element "5" wf) +                                 ) +                              ) +                              (and +                                 (is_read_structure "(?(???)(??))") +                                 (is_read_element "0" "and") +                                 (is_read_element "1" "=") +                                 (or +                                    (is_read_element "2" wf) +                                    (is_read_element "3" wf) +                                 ) +                                 (is_read_element "4" "event") +                                 (is_read_element "5" wf) +                              ) +                           ) +                        )                       ) -                     (is_read_element "1" wf)                    )                 )              ) diff --git a/data/property/simple_flip_flop.pro b/data/property/simple_flip_flop.pro index ea67575..e1621c1 100644 --- a/data/property/simple_flip_flop.pro +++ b/data/property/simple_flip_flop.pro @@ -11,12 +11,38 @@           (AF              (and                 (kind "if") -               (is_read_structure "(??)")                 (or -                  (is_read_element "0" "falling_edge") -                  (is_read_element "0" "rising_edge") +                  (and +                     (is_read_structure "(??)") +                     (or +                        (is_read_element "0" "falling_edge") +                        (is_read_element "0" "rising_edge") +                     ) +                     (is_read_element "1" clk) +                  ) +                  (and +                     (is_read_structure "(?(??)(???))") +                     (is_read_element "0" "and") +                     (is_read_element "1" "event") +                     (is_read_element "2" clk) +                     (is_read_element "3" "=") +                     (or +                        (is_read_element "4" clk) +                        (is_read_element "5" clk) +                     ) +                  ) +                  (and +                     (is_read_structure "(?(???)(??))") +                     (is_read_element "0" "and") +                     (is_read_element "1" "=") +                     (or +                        (is_read_element "2" clk) +                        (is_read_element "3" clk) +                     ) +                     (is_read_element "4" "event") +                     (is_read_element "5" clk) +                  )                 ) -               (is_read_element "1" clk)                 (EX                    (and                       (has_option "COND_WAS_TRUE") diff --git a/instr-to-kodkod/Makefile b/instr-to-kodkod/Makefile index 1fe4535..dcdada8 100644 --- a/instr-to-kodkod/Makefile +++ b/instr-to-kodkod/Makefile @@ -94,6 +94,7 @@ SOLUTION_FILES = $(addprefix $(SOL_DIR)/,$(notdir $(PROPERTY_FILES:.pro=.sol)))  MODEL_FILES = \  	$(MODEL_DIR)/structural.mod \  	$(MODEL_DIR)/depths.mod \ +	$(MODEL_DIR)/string_to_instr.map \  	$(filter-out %structural.mod,$(wildcard $(MODEL_DIR)/cfg_*.mod))  PARSER_SOURCES = $(wildcard parser/*.g4)  PARSER_CLASSES = $(PARSER_SOURCES:.g4=.class) @@ -102,6 +103,9 @@ export  ## Makefile Rules ##############################################################  run: cfg-generator $(PARSER_CLASSES) $(CLASSES) $(SOLUTION_FILES) +build: $(PARSER_CLASSES) $(CLASSES) +	$(MAKE) -C cfg-to-paths build +  cfg-generator:  	$(MAKE) -C cfg-to-paths diff --git a/instr-to-kodkod/cfg-to-paths/Makefile b/instr-to-kodkod/cfg-to-paths/Makefile index 3fa5e5c..7971c84 100644 --- a/instr-to-kodkod/cfg-to-paths/Makefile +++ b/instr-to-kodkod/cfg-to-paths/Makefile @@ -51,6 +51,8 @@ PATH_MODEL_FILES = $(addprefix $(PATH_MODEL_DIR)/,$(notdir $(CFG_MODEL_FILES)))  ## Makefile Rules ##############################################################  all: $(PATH_MODEL_DIR) $(PATH_MODEL_FILES) $(CLASSES) +build: $(CLASSES) +  %.class: %.java  	$(JAVAC) -cp $(CLASSPATH) $< diff --git a/instr-to-kodkod/parser/Makefile b/instr-to-kodkod/parser/Makefile index 435a687..d26baf4 100644 --- a/instr-to-kodkod/parser/Makefile +++ b/instr-to-kodkod/parser/Makefile @@ -51,7 +51,7 @@ JAVA_SOURCES = $(ANTLR_SOURCES:.g4=.java)  CLASSES = $(JAVA_SOURCES:.java=.class)  CLASSPATH = ".:$(MAIN_PROGRAM_SRC):$(KODKOD_JAR):$(ANTLR_JAR)" -compile: $(CLASSES) +build: $(CLASSES)  PropertyParser.java: PropertyLexer.g4  PropertyParser.g4 diff --git a/sol-pretty-printer/Makefile b/sol-pretty-printer/Makefile index b983157..592bd84 100644 --- a/sol-pretty-printer/Makefile +++ b/sol-pretty-printer/Makefile @@ -61,6 +61,8 @@ SOLUTION_PP_PAIRS = \  run: $(SOLUTION_PP_PAIRS) $(MODEL_DIR)/structural.mod $(MODEL_DIR)/string_to_instr.map $(CLASSES)  	$(JAVA) -cp $(CLASSPATH) Main $(MODEL_DIR)/structural.mod $(MODEL_DIR)/string_to_instr.map $(SOLUTION_PP_PAIRS) +build: $(CLASSES) +  %.class: %.java  	$(JAVAC) -cp $(CLASSPATH) $< | 


