Beispiel #1
0
 def test_factory(self):
   """ Test that the factory returns the appropriate PA. """
   self.assertTrue(isinstance(get_prover(path = "/usr/bin/coqtop"), Coq_Local))
   self.assertTrue(isinstance(
             get_prover(url = "http://prover.cs.ru.nl/index.html",
                        group = "nogroup"),
             ProofWeb))
Beispiel #2
0
 def test_factory(self):
     """ Test that the factory returns the appropriate PA. """
     self.assertTrue(
         isinstance(get_prover(path="/usr/bin/coqtop"), Coq_Local))
     self.assertTrue(
         isinstance(
             get_prover(url="http://prover.cs.ru.nl/index.html",
                        group="nogroup"), ProofWeb))
Beispiel #3
0
 def test_factory_which_some(self):
   """ If which returns a path, a Coq_Local instance using that path should be
       created.
   """
   self.assertTrue(isinstance(
                     get_prover(url = None, group = None, path = None),
                     Coq_Local))
Beispiel #4
0
 def test_factory_which_none(self):
   """ Tests that the factory returns a generic Prover instance if "which"
       returns None.
   """
   self.assertTrue(isinstance(
                     get_prover(url = None, group = None, path = None),
                     Prover))
  def test_html_marked_code_real(self):
    """ Extracted code should be readable by the PA. """
    markup = '<div class="code"><span class="id" type="keyword">Goal</span> <span class="id" type="keyword">forall</span> <span class="id" type="var">x</span>, <span class="id" type="var">x</span>-&gt;<span class="id" type="var">x</span>.</div>' 
    self.reader.add_code(self.template.format(body = markup))
    result = self.reader.make_frames(prover = get_prover())
    
    self.assertEquals(result.getFrame(0).getResponse(), """1 subgoal
  
  ============================
   forall x : Type, x -> x
""")
Beispiel #6
0
    def test_html_marked_code_real(self):
        """ Extracted code should be readable by the PA. """
        markup = '<div class="code"><span class="id" type="keyword">Goal</span> <span class="id" type="keyword">forall</span> <span class="id" type="var">x</span>, <span class="id" type="var">x</span>-&gt;<span class="id" type="var">x</span>.</div>'
        self.reader.add_code(self.template.format(body=markup))
        result = self.reader.make_frames(prover=get_prover())

        self.assertEquals(
            result.getFrame(0).getResponse(), """1 subgoal

  ============================
   forall x : Type, x -> x
""")
Beispiel #7
0
def make_film(filename, pwurl=None, group="nogroup", coqtop=None):
    """Main method of the program/script: This creates a flattened 'film' for
   the given file filename.

    Arguments:
    - filename: The filename of the script to read.

    Keyword arguments:
    - pwurl: The URL to the server generating proof states.
    - group: The group used to log in.
  """

    extension = splitext(filename)[1]
    reader = get_reader(extension=extension)
    reader.add_code(open(filename, 'r').read())

    prover = get_prover(path=coqtop, url=pwurl, group=group)

    return reader.make_frames(prover=prover)
Beispiel #8
0
def make_film(filename, pwurl = None, group = "nogroup",
                        coqtop = None):
  """Main method of the program/script: This creates a flattened 'film' for
   the given file filename.

    Arguments:
    - filename: The filename of the script to read.

    Keyword arguments:
    - pwurl: The URL to the server generating proof states.
    - group: The group used to log in.
  """ 

  extension = splitext(filename)[1] 
  reader = get_reader(extension = extension)
  reader.add_code(open(filename, 'r').read())
  
  
  prover = get_prover(path = coqtop, url = pwurl, group = group)

  return reader.make_frames(prover = prover)
Beispiel #9
0
 def test_factory_which_some(self):
     """ If which returns a path, a Coq_Local instance using that path should be
     created.
 """
     self.assertTrue(
         isinstance(get_prover(url=None, group=None, path=None), Coq_Local))
Beispiel #10
0
 def test_factory_which_none(self):
     """ Tests that the factory returns a generic Prover instance if "which"
     returns None.
 """
     self.assertTrue(
         isinstance(get_prover(url=None, group=None, path=None), Prover))