| summaryrefslogtreecommitdiff | 
diff options
| -rw-r--r-- | 99_general.txt | 4 | ||||
| -rw-r--r-- | src/hastabel2idp/Parameters.java | 11 | ||||
| -rw-r--r-- | src/hastabel2idp/idp/Project.java | 16 | ||||
| -rw-r--r-- | src/hastabel2idp/idp/Vocabulary.java | 33 | 
4 files changed, 61 insertions, 3 deletions
diff --git a/99_general.txt b/99_general.txt new file mode 100644 index 0000000..9dee3df --- /dev/null +++ b/99_general.txt @@ -0,0 +1,4 @@ +procedure main(){ +	printmodels(allmodels(T,S,Vout)) +} + diff --git a/src/hastabel2idp/Parameters.java b/src/hastabel2idp/Parameters.java index 12f6285..1642fbd 100644 --- a/src/hastabel2idp/Parameters.java +++ b/src/hastabel2idp/Parameters.java @@ -186,17 +186,22 @@ public class Parameters     public String get_theory_filename ()     { -      return output_dir + "/theory.txt"; +      return output_dir + "/03_theory.txt";     }     public String get_vocabulary_filename ()     { -      return output_dir + "/vocabulary.txt"; +      return output_dir + "/00_vocabulary.txt"; +   } + +   public String get_vocabulary_out_filename () +   { +      return output_dir + "/02_vocabulary.txt";     }     public String get_structure_filename ()     { -      return output_dir + "/structure.txt"; +      return output_dir + "/01_structure.txt";     }     public boolean be_verbose () diff --git a/src/hastabel2idp/idp/Project.java b/src/hastabel2idp/idp/Project.java index 9d398c6..0393e3a 100644 --- a/src/hastabel2idp/idp/Project.java +++ b/src/hastabel2idp/idp/Project.java @@ -14,12 +14,14 @@ import java.util.List;  public class Project  { +   private final VocabularyOut vocabulary_out;     private final Vocabulary vocabulary;     private final Structure structure;     private final Theory theory;     public Project (final Parameters params)     { +      vocabulary_out = new VocabularyOut(params.get_vocabulary_out_filename());        vocabulary = new Vocabulary(params.get_vocabulary_filename());        structure = new Structure(params.get_structure_filename());        theory = new Theory(params.get_theory_filename()); @@ -39,6 +41,7 @@ public class Project        predicates = world.get_predicates_manager().get_all();        vocabulary.write_header(); +      vocabulary_out.write_header();        structure.write_header();        theory.write_header(); @@ -85,6 +88,19 @@ public class Project           property        ); +      vocabulary.add_target_predicate +      ( +         property_name, +         world.get_variables_manager().get_all_seeked() +      ); + +      vocabulary_out.add_target_predicate +      ( +         property_name, +         world.get_variables_manager().get_all_seeked() +      ); + +      vocabulary_out.write_footer();        vocabulary.write_footer();        structure.write_footer();        theory.write_footer(); diff --git a/src/hastabel2idp/idp/Vocabulary.java b/src/hastabel2idp/idp/Vocabulary.java index c9c9e44..0794ffd 100644 --- a/src/hastabel2idp/idp/Vocabulary.java +++ b/src/hastabel2idp/idp/Vocabulary.java @@ -5,6 +5,7 @@ import hastabel2idp.OutputFile;  import hastabel.lang.Predicate;  import hastabel.lang.Type;  import hastabel.lang.Element; +import hastabel.lang.Variable;  import java.util.Collection;  import java.util.List; @@ -92,4 +93,36 @@ public class Vocabulary           add_predicate_signature(predicate, signature);        }     } + +   public void add_target_predicate +   ( +      final String name, +      final List<Variable> arguments +   ) +   { +      boolean is_first; + +      is_first = true; + +      out.write("   "); +      out.write(name); +      out.write("("); + +      for (final Variable argument: arguments) +      { +         if (is_first) +         { +            is_first = false; +         } +         else +         { +            out.write(", "); +         } + +         out.write(argument.get_type().get_name()); +      } + +      out.write(")"); +      out.insert_newline(); +   }  }  | 


