Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/source/frame/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ FRAME environments define the context in which concepts and conjectures are gene
:maxdepth: 1
:caption: Contents:

environments/ground_truth_entities
environments/ground_truth_types
environments/math_env
environments/name_overrides
7 changes: 7 additions & 0 deletions docs/source/frame/environments/ground_truth_types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Ground Truth Types Environment
==============================

.. automodule:: frame.environments.ground_truth_types
:members:
:undoc-members:
:show-inheritance:
3 changes: 0 additions & 3 deletions docs/source/frame/interestingness.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ FRAME interestingness metrics are used to evaluate the quality and importance of
:maxdepth: 1
:caption: Contents:

interestingness/base
interestingness/comprehensibility
interestingness/parsimony
2 changes: 1 addition & 1 deletion docs/source/frame/policies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ FRAME policies determine how conjectures and concepts are selected during theory

policies/base
policies/concept_biased_random_policy
policies/heuristic_policy
policies/interestingness_guided_policy
policies/rule_balanced_random_policy
1 change: 1 addition & 0 deletions docs/source/frame/productions/conjecture_rules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ Conjecture Production Rules
:caption: Conjecture Production Rules:

conjectures/equivalence
conjectures/exclusivity
conjectures/implication
conjectures/nonexistence
30 changes: 29 additions & 1 deletion frame/knowledge_base/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import typing
from frame.utils.logging import logger
from frame.tools.z3_template import Z3Template

import galois

# Default timeout for example verification (in seconds)
# This can be overridden by the configuration
Expand Down Expand Up @@ -532,6 +532,34 @@ def evaluate(self) -> int:
return self.value


class FiniteFieldOfOrder27(Expression):
"""
Finite field of order 27.
The elements are:

[ 0, 1, 2, α,
α + 1, α + 2, 2α, 2α + 1,
2α + 2, α^2, α^2 + 1, α^2 + 2,
α^2 + α, α^2 + α + 1, α^2 + α + 2, α^2 + 2α,
α^2 + 2α + 1, α^2 + 2α + 2, 2α^2, 2α^2 + 1,
2α^2 + 2, 2α^2 + α, 2α^2 + α + 1, 2α^2 + α + 2,
2α^2 + 2α, 2α^2 + 2α + 1, 2α^2 + 2α + 2]
"""
def __init__(self):
self.field = galois.GF(27)
self.field.repr("poly")


class ElementOfFiniteFieldOfOrder27(Expression):
"""
Represents a finite field element.
"""
def __init__(self, value: int, field: FiniteFieldOfOrder27):
assert 0 <= value < 27, f"Value {value} must be between 0 and 26"
self.value = field.field(value)
self.field = field


class NatDomain(Expression):
"""Represents the domain/type of natural numbers"""

Expand Down
110 changes: 109 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ dependencies = [
"sphinx-rtd-theme (<2.0.0)",
"rich (>=13.7.0,<14.0.0)",
"parglare (>=0.16.1)",
"pebble"
"pebble",
"pyfinite (>=1.9.1,<2.0.0)",
"galois (>=0.4.6,<0.5.0)"
]


Expand Down